Thursday, February 27, 2014

Small Angle approximation

Just a note on the small angle approximation!

This approximation is that \(\sin\theta\approx \theta\) when \(\theta\) is in RADIANS.   The angle must be in radians for this to work.  For instance, I cannot say that \(\sin 0.1^{\circ}\approx 0.1\).  If I want the sine of the small angle \(0.1^{\circ}\), I need to first convert it to radians.  There are 57.14 degrees in one radian. Another number to know is that there are 3600 arcseconds in one degree---also, 3600 seconds in one hour.  So I like to remember that degrees are to arcesconds as hours are to seconds.

Finally, a good number to know is that 1 radian  \(=2\times 10^5\) arcseconds.

Thus, if we have an object that has angular size 2 arcseconds, it is \(10^{-5}\) radians.

And, for those of you who haven't seen the small angle approximation before, it just comes from Taylor series.

We have

$$\sin\theta\approx 0+\theta^2+\cdots$$ for small \(\theta\), and
$$\cos\theta\approx 1+\cdots$$ for small \(\theta\)  just by using Taylor's theorem (Taylor series).

Note that this means
$$\tan\theta\approx \sin\theta\approx\theta$$ for small angles (in RADIANS!).

Saturday, February 22, 2014

Celebrating 50 years of modern cosmology at Harvard

In case you missed the announcement last week:
On a bright spring morning 50 years ago, two young astronomers at Bell Laboratories were tuning a 20-foot, horn-shaped antenna pointed toward the sky over New Jersey. Their goal was to measure the Milky Way galaxy, home to planet Earth

To their puzzlement, Robert W. Wilson and Arno A. Penzias heard the insistent hiss of radio signals coming from every direction—and from beyond the Milky Way. It took a full year of testing, experimenting and calculating for them and another group of researchers at Princeton to explain the phenomenon: It was cosmic microwave background radiation, a residue of the primordial explosion of energy and matter that suddenly gave rise to the universe some 13.8 billion years ago. The scientists had found evidence that would confirm the Big Bang theory, first proposed by Georges LemaĆ®tre in 1931.  
You can read more here

And you can follow the Smithsonian Astrophysical Observatory (SAO) @SmithsonianMag on Twitter. The SAO is one component of the Harvard-Smithsonian Center for Astrophysics (CfA) located just off campus at 60 Garden St. and 160 Concord Ave.

Here are the lectures from the event:

Wednesday, February 19, 2014

Mona Lisa in Fourier space: how you can become a frequency artist





After class last Thursday a few people showed some interest in how one might take Fourier transforms of images, along the lines of the Mona Lisa example we did in class.  I looked around and couldn't find a simple Internet interface where one can do this, but if you're still interested it shouldn't be horrible to just do this using python, a free math language that is "the wave of the future" in research.  


This will probably take an hour or two if you still want to do it, but it's worth it if you plan to do more astronomy or do research---I use python daily for mine, for instance. Below are instructions on how to get it all going.


I, Marion, or Luke are glad to help out with any of this in person, and I have an example program I wrote last year that does an FT of an image I could share if there's interest---email astro16.

step 1: get python
go here for installation instructions:
and lots of useful links here:

step 2: load in image from file to python
this will store the image as an array, just a table of numbers basically

step 3: fourier transform image
explained here 
(though your file won't be in fits format, but that doesn't matter---once it's an array you can use the python fft packages this post describes; note fft=fast fourier transform, just an algorithm for doing fts)

step 4: plot it
gives you many ways to plot in python.  you will want a 2-d method since you have an image to plot

Thursday, February 13, 2014

Fourier Transforms! The True Story

In class today, Prof. Johnson went over the math behind Fourier transforms.  Here we'll recap that---with a somewhat math-y idea, one may need more than one pass!

The Fourier transform is just a way to express any function as a sum of cosines and sines with different frequency.  To build up a given function, you need different amounts of each frequency component.  This can be expressed if we use discrete frequencies by writing

$$f(x)=\sum_n \bigg[ia_n \sin(\omega_n x)+b_n \cos(\omega_n x)\bigg].$$

The \(a_n\) and \(b_n\)  are the weight that the sine and cosine with frequency \(\omega_n\) contribute to the total sum building up \(f\).

Now if we let the frequencies take on any value instead of using some discrete set of frequencies
$$\big\{\omega_1, \omega_2,\cdots,\omega_n \big\},$$ we go from a sum over discrete frequencies to an integral over all possible frequencies.

So we write
$$f(x)=\int_{-\infty}^{\infty} F(\omega)\big[i\sin(\omega x)+\cos (\omega x)\big] d\omega.$$

Notice I've added in an \(i=\sqrt{-1}\)  to the sine term.  That's so that we can keep separate track of our sines and cosines---we can recover their coefficients by looking at the imaginary and the real parts of the Fourier transform.  Check out this picture (black dot is F, the F.T. of f(x)):




There's nothing that fundamental about this: it's just a choice we include in the definition of the Fourier transform.  There are things called "Fourier sine transforms" and "Fourier cosine transforms" where you use only sines or cosines, and then you don't need to worry about the i. However, because sine is an odd function (symmetric about x=0), you can only represent other odd functions with a sum of sines.  The opposite holds for cosine: it's even, so you can only represent other even functions with a sum of only cosines.

Anyway, we have the convenient identity that

$$e^{i\omega x}=\cos(\omega x)+i\sin(\omega x).$$

This is actually not too scary to show.  Just write out the Taylor series for each side:
$$\sum_{n=0}^{\infty}\dfrac{(i\omega x)^n}{n!}=\sum_{n\;odd} \dfrac{(\omega x)^n}{n!}(\pm1)+\sum_{n\;even}\dfrac{(\omega x)^n}{n!}.$$

Incidentally, I am lazy: I calculated these Taylor series using wolframalpha.com: go there and type in "Taylor series for e^(iwx)""Taylor series for sine" and "Taylor series for cosine."
It is not a joke that my GPA in college went up about 30% around the time wolframalpha came online! USE it---it's good to do the calculation on paper once, so you know you can, and can have an intuition for when the computer's wrong, but then you should ease up any algebra you can with things like this!

Okay, so using this we can now write our Fourier transform as

$$f(x)=\int_{-\infty}^{\infty} e^{i\omega x}F(\omega)d\omega.$$

Now suppose we wanted to actually FIND \(F(\omega)?\)  It turns out that if we multiply both sides of the above equation by \(e^{-i\omega' x}\) and then integrate both sides with respect to x, we will get

$$\int_{-\infty}^{\infty}f(x)e^{-i\omega' x}dx=\int_{-\infty}^{\infty}dx e^{-i\omega' x}\int_{-\infty}^{\infty} e^{i\omega x}F(\omega)d\omega.$$

It turns out that the righthand side will be zero except when \(\omega=\omega'\).  This is a cool mathematical thing that I'll come back to at the end.  But for now, it means that we MUST HAVE \(\omega=\omega'\), meaning the equation reduces to

$$\int_{-\infty}^{\infty}f(x)e^{-i\omega' x}dx=F(\omega).$$

So now we can go ahead and calculate Fourier transforms!  I should note that usually, there's a factor of \(2\pi\) in front of all of the \(\omega\)s, because they are really angular frequency.  For this reason, usually a factor of \(1/2\pi\)  will show up in front of one or the other side of the equation above for \( F(\omega)\).
to be continued . . .
---
Finally, a point about modulus.  Modulus is the magnitude of a complex number, and it is a little bit more complicated than just taking an absolute value as you'd do to find the magnitude of a real number!  Have a look at the diagram below!



Wednesday, February 12, 2014

Feynman Quote on Waves and Seeing and Astronomy


"If I'm sitting next to a swimming pool, and somebody dives in...I think of the waves and things that have formed in the water. And...when there's lots of people have dived in the pool there's a very great choppiness of all these waves all over the water and to think that it's possible, maybe, that in those waves there's a clue as to what's happening in the pool. That some sort of insect or something with sufficient cleverness could sit in the corner of the pool and just be disturbed by the waves, and by the nature of the irregularities and bumping of the waves have figured out who jumped in where and when and where what's happening all over the pool. And that's what we're doing when we're looking at something. [T]he light that comes out is ... is waves, just like in the swimming pool except in three dimensions instead of the two dimensions of the pool it's they're going in all directions. And we have a eighth of an inch black hole into which these things go ... which...is particularly sensitive to the parts of the waves that are coming in a particular direction it's not particularly sensitive when they're coming in at the wrong angle which we say is from the corner of our eye. And if we want to get more information from the corner of our eye we swivel this ball about so that the hole moves from place to place. Then it's quite wonderful that we can see, to figure [things] out so [easily.]"

From smithlab.net. Transcribed from footage included in the documentary "The Last Journey of a Genius" (1989) by Christopher Sykes, a BBC TV production in association with WGBH Boston and Coronet/MTI Film and Video

Tuesday, February 11, 2014

Double Slit Geometry

Implied, but not stated on the worksheet is the need to derive the geometry that leads to a cosine pattern on the screen behind a double-slit setup. Here's a 10-minute lecture describing this geometry. When he gets to the examples starting at the ~5:00 mark, you should pause the video and try to get the answer for yourself first, and then check against his answer.



Here are two nice demonstrations of diffraction, using water and laser light:



Finally, here's a Minecraft experiment showing the particle-wave nature of chickens

Wednesday, February 5, 2014

Guidelines for worksheet problem writeups on your blog

In order to facilitate efficient reviews and grading of your problem solution writeups, please use the following guidelines for your current and future blog posts.

Title: Worksheet ____, Problem ____ : [Custom name of your choice]

Content: At the top of your post, state the question in bold.

Figures: Be sure to cite your source of any images, diagrams or figures used, except for figures that you create.

Acknowledgements: At the bottom of your document, acknowledge who assisted you with your solution.

Reading, viewing and this week's vocabulary words

Before the next class session, be sure you read Chapter 1, with particular attention to Section 1.3. Reading is Fundamental! Especially for this class with our emphasis on active, collaborative learning over traditional lectures. We're putting off telescopes and optics until Monday to favor depth of learning over breadth of material covered. Blog posts due next Tuesday should focus on problems 1-4 on the Worksheet. Problems 5-7 will be the focus of the following week's blog posts.

You can find supplemental reading on the celestial sphere at Sky & Telescope. Here's another helpful video:



Here's a list of key vocabulary words:

Zenith
Meridian
Elevation
Azimuth
Right ascension
Declination
Hour angle
Latitude (on the Earth, and its relation to declination)
Longitude (on the Earth, and its relation to right ascension)

The goal of this week is for you, the student, to be able to tell me if a star at a given right ascension and declination is observable tonight (irrespective of clouds!). In other words, is a given RA overhead at night at this time of year? Here's a practice problem:
The star HD209458 has a transiting planet. In fact, it was the first transiting planet ever detected by Earthlings, by Harvard's own Prof. David Charbonneau and collaborators way back in 1999 (Charbonneau et al. 2000. See also Henry et al. 2000). If it were clear tonight (not likely, but play along), could we observe this star tonight (Feb 5, 2014) with the Clay telescope on the roof of the Science Center? HD209458 is at RA$ \approx 22$ hours, and a declination of about +19 degrees.


Deriving Kepler's law

For worksheet 1, we used Kepler's law

$$P^2=\frac{4\pi^2a^3}{GM}.$$

P is the period, a the orbital separation (actually the distance to the mutual center of mass (barycenter)), G Newton's constant, M the Earth's mass.  How do you get this?

We can use the test case of a circular orbit to derive it.  While this is not the most general (in general, under gravity closed orbits must be ellipses; a circle is an ellipse with zero eccentricity), a circular orbit must satisfy this law, and so can be used to obtain it.

We balance centrifugal force with gravity (*):

$$\frac{mv^2}{a}=\frac{GMm}{a^2}.$$

m is the mass of the smaller object orbiting; here we approximate that $$m\ll M,$$ so the mutual center of mass is about at the Earth's center and we can just use the Earth's mass as the mass being orbited (the really correct thing to do is to use the reduced mass $$\mu=\frac{Mm}{M+m},$$ which becomes approximately $$M$$ here).

Solving the force balance equation (*) out for v, we get
$$v=\left(\frac{GM}{a}\right)^{1/2}.$$

Now, the orbital period is $$P=2\pi a/v,$$

so substituting in v we find

$$P=\frac{2\pi a^{3/2}}{GM},$$
and finally squaring both sides we get Kepler's law.

In class, Prof. Johnson mentioned that the factor of $$4\pi^2$$ is hard to remember.  It should be easy now: it is actually just coming from the fact that the period is proportional to the circumference, $$2\pi a,$$  and so $$P^2$$ will have a $$4\pi^2$$ in it.

Tuesday, February 4, 2014

Helpful Videos and Apps Illustrating the Celestial Sphere

Many students are struggling with the concept of the celestial sphere right now. It is not an easy concept, but it's key for understanding how observational astronomers locate and study objects in the sky using telescopes. This topic is usually not covered in a physics-oriented astronomy course at the level of Ay16, which I think is a shame since it's so central to the enterprise of astronomy.

Make no mistake about it: this is a tough concept. We live on a moving, tilted platform, which is good for getting a view of the entire universe, but troublesome for devising an intuitive coordinate system. Yesterday in class was our first pass. We'll take more passes at it in TALC, and we'll linger on the topic Thursday. Our next lesson on telescopes and optics can wait a class session until we're comfortable with the sky.

If you're struggling with these concepts, it's okay. It really is! I struggled mightily as a graduate student at UC Berkeley 12 years ago, and I now have the benefit of tons of experience. But when the TFs and I were preparing for this lesson, we struggled again! Embrace the struggle as runners embrace the burn pushing themselves for that extra mile, or weight lifters struggle against 10 extra pounds in the bench press, or a musician struggles against playing the piece just a bit faster.

Here's a short but wonderfully clear video illustrating the Earth in relation to the celestial sphere. Watch it and watch it again. Then watch it again :)



Here's a fun simulator to help you visualize the Earth's relation to the celestial sphere, as viewed from the stars (watching the Earth rotate) and from the Earth (watching the stars rotate across the sky). I found this simulator on the Astronomy Education at the University of Nebraska-Lincoln.

Google is your friend in this class. We live in an age of a plethora of online tools to help you understand key concepts that we won't have time to cover explicitly in class. When you find something helpful, write a blog post and refer your classmates to it. Let's help each other through these tough concepts.




Monday, February 3, 2014

Solved problems from math review worksheet

By popular demand, I am going to solve a few problems from the basic math review worksheet here.

 5. a. The amount an object's speed v changes with time is proportional to its current speed.


$$ \frac{dv}{dt}\propto v(t).$$

Note this is a differential equation that can be solved by rearranging: $$\frac{dv}{v}=dt.$$ Integrating both sides we find $$\ln v=t+C,$$ C a constant of integration, meaning that $$v=v_0\exp(t),$$ where we set the value of C by saying the initial velocity is $$v_0.$$ In more detail, $$v=e^{t+C}=e^te^C=v_0e^t$$ with $$e^C=v_0$$ (we can choose C such that this is true because C was just an arbitrary integration constant!)

b.  A is inversely proportional to the square root of B.

$$A\propto \frac{1}{\sqrt{B}}.$$

c.  An object's speed v varies sinusoidally with a period P and a phase $$\phi.$$

$$v(t)=\sin \bigg(\frac{2\pi}{P}t+\phi \bigg).$$

d.  The flux F of an astronomical source decreases with distance according to the inverse square law.

This law comes from considering the radiation from the source to be emitted isotropically into a sphere of radius d, with surface area $$4\pi d^2.$$  So we have

$$F=\frac{L}{4\pi d^2},$$  where L is the luminosity, which is the energy output per unit time of the source.

e.  The number of stars, N, per unit mass, M, is given by a powerlaw in mass with an index $$-\alpha.$$

This problem was not perfectly worded!  What we meant was the amount of stars dN with masses in the range M, M+dM, where dM is small (really, infinitesimally small!), is given by a powerlaw in mass.  This translates as
$$\frac{dN}{dM}\propto M^{-\alpha}.$$

This is a typical way of specifying the distribution of initial masses with which stars are born.  That is, not all stars are like our Sun, just like babies are born with different weights---some heavier, some lighter.  There is a pattern to the distribution of stars' initial masses, called the IMF, for Initial Mass Function, and it is a subject of intense debate and study.  It turns out that it is set partially by turbulence in the gas from which stars form and partially by the scale on which pressure from the gas is able to balance gravity (called the Jeans length).

f.  The pressure in the atmosphere decreases exponentially from an initial value $$P_0$$ to a value $$P(z)$$ with an e-folding length H.

e-folding means the time a quantity takes to change by one factor of e = 2.818 (note e is also given by the infinite series
$$\sum_{n=0}^{\infty}\frac{x^n}{n!},$$ which I mention to justify the seemingly totally random value of e as having some kind of symmetrical, elegant origin).

We have
$$P(z)=P_0 e^{-z/H},$$ with z one's height above ground and H more conventionally called the "scale height."  You might wonder why this is true?  Fundamentally, it is because the atmosphere is made up of billions of air molecules that are bouncing around. All of these particles are bouncing in a gravitational field that wants them to all end up on the Earth's surface.  The faster ones get to go up higher.  So the density will decrease as you go up from the Earth's surface, because there are fewer particles with high speeds than with low.  That is because for an ideal gas in equilibrium (a reasonable model here), the velocities are "Maxwellian":  the probability of finding a particle with velocity v is proportional to $$v^2e^{-v^2}$$---you'll learn more about that in a statistical mechanics course!  Now, pressure scales with density, and as we've seen, the density is determined by the velocity probability distribution.  Exponential in, exponential out.

7.  Write the ideal gas law in terms of gas pressure P, mass density $$\rho,$$ and temperature T.

It is $$P=\frac{\rho}{\mu m_p}k_{\rm B}T,$$  where $$\mu$$ is the mean particle mass in units of the proton mass $$m_p$$ and $$k_{\rm B}$$ is Boltzmann's constant.

8.  Calculate the derivative of:
a. 1/(1-x)

Rewrite as $$(1-x)^{-1}$$ and then use the Chain Rule: $$-(1-x)^{-2}(-1)=(1-x)^{-2}$$ is the derivative.

b. $$e^{-x}$$.  Derivative: $$-e^{-x}.$$

c.  $$\sin x.$$ Derivative: $$\cos x.$$

d.  $$\cos x.$$ Derivative: $$-\sin x.$$

e.  $$\ln(1-x).$$  Again use Chain Rule.  Derivative: $$\frac{1}{1-x}(-1)=-\frac{1}{1-x}.$$

f.  $$\bigg(e^{-x}-1\bigg)^{-1}.$$  Again use Chain Rule.  $$-\bigg(e^{-x}-1\bigg)^{-2}\bigg(-e^{-x}\bigg),$$ which simplifies to
$$e^{-x}\bigg(e^{-x}-1\bigg)^{-2}.$$

9.  Taylor expansions represent functions as sums of powers of their arguments.  They do this by taking successive approximations to the function: first-order Taylor series models the function as a straight line, second-order as a straight line plus a parabola, etc.  For the second-order series, we need the first and second derivatives.  We have the first derivatives from problem 8.; we differentiate again to get the second derivatives.  Let's do $$e^{-x.}$$  The second derivative is
$$e^{-x}.$$  For a Taylor expansion around x=0, we evaluate the derivatives at zero and then multiply them by respectively, x and $$x^2.$$  We also weight the contributions by 1/n!, where n is the order of the derivative.  Finally, we need a constant term: the value of the function itself at x=0.  Think of that as a vertical offset to the whole curve we are trying to model. Putting it together, we have
$$e^{-x}\approx 1-x + \frac{x^2}{2}.$$  We could easily have gotten this from the series representation of $$e^{x}$$ given earlier by letting x go to -x.

Let's do one more: $$\ln(1-x)$$ about x=0.  We have
$$\ln(1-x)\approx -x+\frac{x^2}{2}.$$

10.  Integrals of the functions in 8. (note: these should be evaluated at $$x_{min}$$ and subtracted from their value at $$x_{max}$$ for the definite integral.)

a.  Use the substitution u=1-x, du=-dx to see that
$$\int \frac{1}{1-x}dx=-\ln (1-x).$$

b.$$\int e^{-x}dx=-e^{-x}.$$

c.  $$\int \sin x dx =-\cos x.$$

d.$$\int \cos x dx=\sin x.$$

e.  $$\int \ln(1-x)dx$$ is tricky.  We should integrate by parts (a very similar example is done in the Basic Math Review page on integration!) to find
$$x\ln(1-x)+\int\frac{x}{1-x}dx,$$ and can then set $$u=1-x$$ to do the remaining integral.

f.  $$\int \frac{1}{e^{-x}-1}dx.$$  This one is also quite hard!  I actually didn't know how to approach it immediately, so still working on a good intuitive explanation!