Thursday, December 29, 2011

How Long is a Sunset? How Long for the Moon?

Monday night I got to see the lovely sight of Venus and the thin crescent Moon shining close to each other in the dusk after sunset. I was somewhat surprised when I saw them again half an hour later, only a little closer to the western horizon. And then yet again, some fifteen minutes after that. Living in the tropics as I do, I'm used to things setting (and rising) very quickly. If you see something close to the horizon, you'd better look quick, because it'll be gone before too much longer. Here in California, further from the equator, things hang around longer before dropping belong the horizon.

The reason has to do with the fact that the Earth is a sphere (to a good first approximation). If you're in the tropics (between \(\pm\)23.5\(^\circ\)), the Sun appears to set very nearly perpendicularly to the horizon.  Not only that, but your tangential speed \(-\) the speed you travel around the circle you proscribe on the surface of the Earth each day \(-\) is higher than it is further north or south, since you're further from the rotational axis of the Earth. As you travel away from the equator, celestial objects appear to set at more of an angle, and your tangential speed is lower as well, leading to objects taking longer to set (or rise).

Some simple mathematical calculations show that the Sun, about half a degree on the sky, would take about two minutes to set if you were located on the equator and it was either the spring or fall equinox. As you travel further from the equator that time increases until you reach the Arctic or Antarctic circles, where upon the time to set ends up being longer than 24 hours, and the Sun simply travels around the sky. Above the Arctic circle (or below the Antarctic one) you are, in theory, guaranteed at least one, 24-hour period in which the Sun is above the horizon the whole time, and one 24-period in which the Sun is below the horizon the entire time. In theory, these would occur on the summer and winter solstices for the norther hemisphere, vice-versa in the southern. (In practice this depends on other factors such as clarity of the atmosphere, height of the observer above sea level, and the fact that the Sun is a disk on the sky and not a point.)

If you're wondering about similar considerations for the Moon, the picture is fairly similar, albeit modified by two important considerations: one, the Moon's orbit is inclined from the plane of the Earth's equator; and two, the Moon orbits the Earth, and so has a motion of its own that slows down its rising and setting (since it appears to move eastward across the sky, opposite the apparent direction given it by the rotation of the Earth). The Moon is nearly the same size as the Sun on the sky so a naïve calculation would give it about two minutes to set as a minimum time, but in practice the combination of all the factors mentioned above means it will always take longer than that. (Of course, since the full Moon sets at dawn, I doubt too many people are interested in how long it takes to set.)

A hui hou kākou!

Tuesday, December 27, 2011

Adventures in Malware Removal

Yesterday -- Christmas day -- my sister's computer contracted a rather serious case of malware that took me over an hour to neutralize. It's a nasty little program that goes by various names depending on your operating system, usually some combination of "XP/Vista/Win 7 Antispyware/Antivirus/Security 2012". This program is very well designed to look like the official Microsoft Security panel (at least on XP, which my sister has), so much so that when it first appeared even I, naturally suspicious as I am, was almost fooled. Ironically, it was the program's own strenuous self-preservation efforts that alerted me, as it will block any browser you open from accessing the Internet. (At least, it will block Internet Explorer and Firefox, which were the only ones I was able to test, though I suspect it would block others as well.)

Like many malware programs out there, XP Security 2012 (the name that appeared for my sister, and which I'll use for simplicity) poses as a virus scanner, then pretends to scan your computer and locate a bunch of bad stuff, which it promises to remove upon upgrading to the paid version. At best, such programs simply take your money; at worst, they can actually infect you with the very viruses they claim to remove. These programs work by looking very official, and XP Security 2012 takes it up a notch by blocking your Internet access, making it hard for you to check online for a solution.

Luckily, one solution is simply to restore your computer to an earlier backup point. By going to System Restore (found under Start Menu --> Programs --> Accessories), you can restore you computer to an earlier point (after which I would recommend clearing your browser cache of temporary downloads; the file seems to get onto your computer by posing as some sort of legitimate download. In this case I think it may have been a phony Adobe update.). This method may not work if your restore point doesn't go back far enough, although since the program seems to activate immediately on installation (or at least very soon), you would likely need a restore point just a few days ago to work.

I actually found and used a program from the anti-virus group Malwarebytes Anti-malware, although given the rigamarole I had to go through to get it working I wish I'd found the restore point solution earlier (XP Security 2012 can block programs with the .exe extension that it feels are a threat, so you need to change the extension on the Malwarebytes installer to .com, run it to install the anti-virus program, then change its extension to .com in order to run it and remove the malware. Luckily, it works very well)

Here's hoping that your own Christmas was less eventful! Merry Christmas everyone! Mele Kalikimaka kākou!

Thursday, December 22, 2011

Astronomical Perspective

Flying to or from the island of Hawaiʻi is made much more interesting on days with moderate cloud cover by the sight of one or more of the volcanoes that make up the island rearing its massive bulk above the clouds. I've been walking, climbing, and driving on Mauna Kea for over two years now, and I'm still staggered by its gargantuan size every time I see it from the air.

The first time I saw it like that, I gained a measure of insight into Hawaiian culture; I like felt I could better understand the thought processes of people whose ancestors had for centuries lived on and around these voluminous volcanoes. This time, however, I was struck by an entirely different kind of realization.

You see, for all their bulk, Mauna Kea and Mauna Loa are absolutely minuscule when compared to the size of the Earth. If the Earth were the size of a basketball, you wouldn't even be able to feel them with your fingers. In fact, not even the Andes or the Himalayas would protrude enough to be tactile. One concept that astronomers and physicists have to handle, perhaps more than any other people, is a sense of scale for things that are inconceivably beyond our human experience, both incredibly tiny and fantastically large. It's one of the reasons I created my picture showing the relative sizes of the Sun and planets. Seeing those volcanoes provides me an invaluable opportunity to refresh and recalibrate my sense of scale. If you ever have the pleasure of traveling to Hawaiʻi and the ability to see those beautiful mountains, take a moment to reflect on their size in the grand scheme of things. The act of gaining an increased sense of perspective never, in my experience, fails to bring amazement and a heightened sense of wonder at our amazing universe.

Monday, December 19, 2011


Well, as of December 17 I am officially graduated from UH Hilo, and entertain fully the rights, privileges, and responsibilities thereof. I'm now a proud Vulcan alumnus with a bachelor's degree in both astronomy and physics, with a minor in math.

...I'm also extremely tired from a very busy week spent with my family, and I'm flying back to California tomorrow for a few weeks during which time I hope to rest and recover. I've got several blog post ideas just waiting to be set free so you'll probably hear from me soon, but until then, ke Akua pū, a hui hou kākou!

Monday, December 12, 2011

Imaging with Large Telescopes

Last week I posted an image of the Sculptor galaxy taken with the Faulkes 2-meter telescope on Haleakalā while we had some free time as my group was gathering data for our Observational Astronomy final project. Today, I have a picture of our original target, the open cluster Messier 52. It's a moderately rich open cluster located in the constellation Cassiopeia. Unusually, its distance is not well known, with estimates ranging from 3,000 to 7,000 light-years.

Messier 52, in Cassiopeia.

I had to cheat a bit more than usual to get this picture, because it doesn't actually have any red data. All we needed for our project was blue and green data, so I simply duplicated the green data and used it as red to get this picture. I think it came out all right, according to the data we got most of the stars are fairly neutral or white anyway, so the missing red data wasn't really that important for this cluster.

If you're wondering about the ratio of the picture, it's actually two different fields that I combined which we took in order to ensure we got the entire cluster.

Saturday, December 10, 2011

The Power of Calculus

Recently a classmate of mine asked for some help with a physics problem falling under the purview of classical mechanics, and I, not having had a chance to use the ol' calculus for a while, eagerly proffered it.

Start by imagining a jet fighter flying along at a supersonic speed, leaving a hyperbolic shock wave (the famous "sonic boom") behind it.

(Pretend the red dot is a jet fighter.)

Now, the only two pieces of information we have about this problem is that the angle the shock wave makes with the horizontal is 30\(^\circ\), and that the speed of sound in the surrounding air is 330 meters/second. Can we figure out the plane's speed using just this information? You're probably not too surprised to hear that, indeed, we can, through the power of calculus.

Calculus is, at its heart, a study of how things change in relation to each other. And what is speed, but a measure of how position is changing with time? In the language of calculus, we can represent this using differentials, which give rise to differential equations. Differentials themselves are odd mathematical beasts, whose existence has been hotly debated over the centuries since Leibniz first proposed them, but like good physicists we can ignore that aspect of their nature for this post and focus instead on how we can use them.

Let's assume the jet is moving in the positive \(x\) direction, so that we can represent the jet's position by \(x\). This is simply a function of time (we're assuming the jet moves at constant speed), so \(x=f(t)\). We don't know what \(f(t)\) is yet, but if we find it out, we can then differentiate \(x\) to get the speed. I'm going to gloss over how exactly we accomplish that (it's not too difficult, it just takes a while to explain), but it involves taking a differential of the variable on each side of the equation \((dx=f\,'(t)dt)\), then dividing one by the other to get a derivative,
Such a cavalier treatment of differentials is likely to drive any mathematician reading this crazy, but it works well enough for physicists. The prime (\('\)) on the \(f\,'(t)\) simply says that the function it represents (which we also don't know) is simply the first derivative of \(f(t)\). We could continue to take derivatives, but there's no need for this problem (a second derivative would tell us about the jet's acceleration, for example).

Equation \((1)\) can be thought of as the instantaneous change in the jet's position divided by an instantaneous amount of time. Since we can't attack this equation directly with the information we have, let's look at it from another angle. We know information about the shock wave the jet is leaving that could be helpful to us. To see how so, let's briefly review how a sonic boom forms.

When a jet is traveling at sub-sonic speeds, any noise emitted by the jet will be able to expand out from it in a circle. If the jet had a system that emitted brief "pings" several times a second, it might look something like this if you could see the pressure front of the sounds waves:

Note how the sounds waves are closer together in front, and farther apart in back. If you keep increasing the jet's speed, the wave fronts will get closer and closer to each other, until:

BAM! the jet exceeds the speed of sound, meaning that it is now leaving those expanding circles of sound behind as it out-races them. The expanding wave fronts naturally create a hyperbolic shape behind the jet, leading to a huge buildup of sound that all hits at once as the shock wave passes a point, leading to a sonic boom.

Now, from the problem, we know one piece of information about these circles: namely, that they expand at the speed of sound, 330 m/s. In the picture above I've drawn in a radius of the largest circle, call its length \(r\). How fast the length of \(r\) changes can be represented mathematically as
where the units are implicitly recognized to be m/s (although it is important to keep units in mind to make sure the answer we eventually get makes sense). If we want to know the length of \(r\) as a function of time, we can antidifferentiate it in a manner analogous to how we differentiated \(x\) a while ago. Although in more complicated case antidifferentiation is more an art than a science when done by hand, it's fairly simple for this simple equation. First we multiply by \(dt\) on both sides (again, making mathematicians wince), then antidifferentiate (which we denote with the special symbol \(\int\) ). Antidifferentiation "undoes" the action of differentiation in the same way that multiplication "undoes" division, and that fact is so important it's one of the Fundamental Theorems of Calculus.
\int dr&=\int330\,dt\\
\int dr&=330\int dt\\
Now, what this equation tells us is that the length of \(r\) is equal to the time (from some specified starting point) times 330. We could re-write it in a manner equivalent to equation \((1)\), \(r=g(t)\), except that in this case we know that \(g(t)=330t\).

So, we know how fast the shock fronts from the sound waves expand. How does this help us? Well, note that the radius creates a right angle to the shock wave surface (i.e., the circle is tangent to the shock wave where they meet). This means that we have a right triangle, and we know from the information provided that the smaller angle is 30\(^\circ\).

In the figure below I've redrawn this triangle with just the essential information. We have the two known angles (and by extension the third), \(r\), and \(x\). We know how \(r\) is changing with time (\(dr/dt=330\)); can we determine how \(x\) is changing?

We can, if we can figure out a relation between \(r\) and \(x\). From basic trigonometry we know that \(r=x\sin30^\circ\) (Strictly speaking this wouldn't be an actual triangle because the hyperbolic nature of the shock wave would mean that the right corner of the triangle would be rounded instead of pointy, but it's close enough to reality to be useful for this simple problem.). But from equation \((3)\) above, we also know that \(r=330t\). If we combine those two equations, and do a little algebra, we can figure out how \(x\) depends on \(t\), i.e., what \(f(t)\) is in equation \((1)\):
Remembering our discussion from above, we know that we can find the speed of the plane simply by differentiating equation \((4)\). When we do that, we get
(again setting mathematicians' teeth on edge). So the speed of the jet turns out to be \(330/\sin30^\circ=660\) m/s. We can sanity check our work by noting that this is greater than the speed of sound (by twice), as it should be since the plane is supposedly flying supersonically. We could also generalize this into a formula for any angle that the shock wave makes by replacing the 30\(^\circ\) by a variable (say, \(\theta\)). Then we would have
which would allow us to calculate the plane's speed for any (valid) angle we could measure.

Now, you may be looking at that last equation and thinking to yourself that it's putting the cart before the horse, so to speak. After all, the angle of the shock wave is dependent on the speed of the jet, not the other way 'round \(-\) yet that's exactly what the equation seems to be saying. This is part of the beauty and power of calculus, that we can ascertain relationships among variables from unconventional directions. It all depends on what you're solving for. You could invert the equation to find the angle as a function of the speed like so,
and it would be just as valid as equation \((6)\), and would  better reflect what's physically happening to boot, but as we've just seen that doesn't mean that equation \((6)\) can't be useful too.

So the lesson to take home is that calculus is an immensely powerful tool, precisely because it allows us to see the world in a different way, and one that allows us to unleash the full power of mathematics upon it. Calculus is, in my opinion, one of the seminal works of Western civilization, and one, moreover, that richly rewards its studiers. We could all, I think, stand to know a little more calculus.

Thursday, December 8, 2011

Adventures in Image Reduction and Composition

Today I have an image of the Sculptor galaxy, NGC 253 (also known as the Silver Coin or Silver Dollar galaxy for its appearance in small telescopes). This dusty galaxy is fairly nearby by cosmic standards, only about 11 million light years away in the direction of the constellation Sculptor. Unlike most of the images I put up here, this one was not taken at the Vis. Instead, it was taken by the 2-meter Faulkes North telescope on Haleakalā. Last week my group in our Observational Astronomy lab were using the Faulkes telescope to get data for our project, and it wound up that we had a free hour, so on the advice of our teacher we used it to image this galaxy.

The Sculptor galaxy, NGC 253.

This image is by far the hardest one I've ever put together. To begin with, when I got the data from the telescope it had no easy identifying information as to which picture was what, so by trial and error I had to work out which pictures had been taken through the red, green, blue, and H\(\alpha\) channels. Once I'd done that, I had to figure out how to get the images to stack, because Deep Sky Stacker couldn't find enough stars (don't ask me why) for it automatically stack them. Once that was accomplished, I had to figure out how to play with the stretch of the final image to capture a good dynamic range -- no easy feat. All of that meant that I ended up re-reducing the data at least five or six times, and that was before I even began assembling the various pictures into the final image. I put together at least three versions of this picture, playing with the light curves of the different colors to try to get something that captured the beauty of the galaxy without either blowing out the bright parts or losing detail in the darker regions of the arms. This version is fairly close to true color, whatever that means in astronomy. I only took one (conscious) liberty: in addition to the standard RGB filters, we got some images with a hydrogen-alpha (H\(\alpha\)) filter, which is a filter that lets only one particular wavelength of light through (in this case the light emitted when an electron drops from the third to the second orbital in a hydrogen atom, which appears red). But whenever I tried mapping the information from that filter to red, I ended up with a galaxy that looked much too red, so I left it as simple luminance data. It's not "correct", but I think it gives a more aesthetically pleasing picture, so I left it. Perhaps in the future I'll go back and see if I can't get it to look better and at the same time more chromatically correct, but for now I'm moderately satisfied with it.

Sunday, December 4, 2011

Mathematics and MathJax

You know how I'm always saying \(\LaTeX\) makes math look beautiful? Well, yesterday I stumbled upon a way to get that same look in HTML. It's called MathJax, and it's really quite neat. All you have to do is link a JavaScript script in the header of your webpage (accomplished by editing my Blogger template), and the script will go through and convert any \(\LaTeX\) formatting into proper HTML that should be able to be rendered by any browser.

With MathJax, you can have inline equations like \(a^2+b^2=c^2\), or equations displayed with their own focus, like this:
\[ x = {-b\pm\sqrt{b^2-4ac}\over2a}\tag{1}\]
\[e^{i\pi}+1=0 \tag{2}\]
((1) is the quadratic formula; (2) is Euler's Identity)

This happens to be extremely fortuitous, because I was just thinking of writing a post with some calculus in it, and was pondering how to get the equations in. Now with MathJax, I'll be able to write a lot more about math in the future.

Edit (12/4/11): In case anyone would like to use MathJax in their own blog (or other website), here's how to do it. You need to put a line linking to the MathJax script in the header of your site. To accomplish that with Blogger, you need to access your blog's template (the easiest way to do that is to click on the "Design" link at the top right of the screen). Once there, click on the "Edit HTML" button. It'll bring up a dialog reminding you that can seriously mess up your blog if you don't don't know what you're doing. Click "Proceed", whereupon you'll be able to see the code underlying you blog. Once there just paste the following code somewhere in the header of your template; I'd suggest putting right before the line with "<b:skin><![CDATA[/*".
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({ TeX: { extensions: ["autobold.js"] }});
<script type="text/javascript"
Note that by default this script doesn't process AMS (American Mathematical Society) symbols or commands. Since the AMS packages are very helpful, there's an easy way to include them. Simply add the following options to the "extensions" list, right after "autobold.js".
"AMSmath.js", "AMSsymbols.js"
That should be it! Try writing some \(\LaTeX\) expressions enclosed in either
for inline and displayed math, respectively. Check out the MathJax webpage if you need more help or information.

Thursday, December 1, 2011

English, Entropy, and Assignments

Tonight I've been writing a paper for my linguistics class on the historical development of Hawaiian Pidgin English into Hawaiian Creole English as it exists in the present day. This is an important, if subtle, distinction: a pidgin is a simplified language that is used as a second-language lingua franca between two or more groups of people who cannot otherwise communicate with each other, while a creole is an actual language used by a group of people as their primary language. Pidgins can be created between any two (or more) languages, and oftentimes throughout history have developed into full-fledged creole languages. The “Pidgin” spoken in Hawai‘i is a true creole, no longer a pidgin (and hasn't been for quite a few decades). (It draws mainly upon English and Hawaiian, but also upon languages such as Japanese, Chinese, Tagalog, and Portuguese, from the various people groups that were brought in to work on the plantations after the overthrow of the monarchy in 1893.)

The interesting part in this is that, while pidgins are simplified forms of language used only for specific purposes (such as business transactions) and not spoken otherwise, the creoles they develop into are complex languages capable of dealing with all aspects of life that their speakers encounter. This flies in the face of the established linguistic wisdom that languages tend to simplify over time, which is why it got me interested. For instance, in the Middle Ages English used to have special verb forms for present singular verbs, namely -e for first person (“I speake”), -(e)st for second person (“thou speakest”), and -eth for third (“he speaketh”). These have now been dropped completely, and first, second, and third all use the same form of the verb now (the bare verb stem itself, “speak” in this example). Middle English itself is a simplification of Old English, for instance having dropped the nearly one dozen forms of the word “the” that used to exist. Many other examples from other languages could be given as well.

Given this general trend, what are we to make of the fact that a full-fledged creole language seemingly arises from a simplified pidgin? There are several things to keep in mind. First, we must remember where this complexity comes from: it does not arise from nowhere, but rather comes from the languages that originally combined to create the pidgin. Speakers of a pidgin borrow syntax, grammar, and vocabulary from their native tongue and weave it into the collective pidgin language, increasing its complexity. Second, we must remember that there are intelligent agents at work. The observation that languages tend to decrease in complexity is a result of the fact that people like ease and simplicity. If everyone understands you when you take shortcuts in your speech, leave out a conjugation here, a declension there, pretty soon everyone's doing it and shortly thereafter those conjugational and declinational forms no longer exist. However, if people can't understand what you're saying, or you can't figure out a way to say what you want to in the pidgin you're using, you will add (or more likely borrow from your native tongue) ways of speaking that will allow you to express what you want.

In a way, it's similar to the loophole in the Second Law of Thermodynamics that allows life to exist. Technically, it's not quite as iron-clad as that law, because people could, if we chose, increase the complexity of our language; however, it's overwhelmingly unlikely. Also, the decrease of entropy in one portion of a system requires an equal or larger increase in another, while the increase in complexity of a pidgin turning into a creole requires no such corresponding simplification in the parent languages, but the general idea is similar. It's possible to mathematically quantify the entropy of a particular message in information theory, and it would be interesting to see how the entropy of a language changes as it develops from a pidgin into a creole.

(There are slight differences between how languages and physical systems change. Physical systems tend towards states of high entropy, because those are more likely, and thus simpler. Think of the number of ways in which the parts of a clock can be assembled such that the clock will work. Now compare that with the enormous number of ways that you could arrange those same parts without the clock working, and you'll see why over time, without repair, the clock would tend toward one of those numerous simpler states [since a non-working clock is simpler than a working one]. Languages, on the other hand, tend towards states of low entropy, because for languages those are simpler. Think about having 12 different ways to say “the” compared to one. One way is simpler in this case, which is one of the reasons English no longer has 11 other ways. This apparent inversion [physical states tend towards high entropy, languages towards low] comes about because of the way entropy is defined in information theory, but regardless of the semantics, the basic idea is that both physical systems and languages tend to change into less complex forms, even if the way of measuring such complexity is different.)