Below are some simple animations that I put together for for ASTR 1040: Accelerated Introductory Astronomy 2.

All of these are coded in python, using the matplotlib library for plotting. The source code is provided in each case. These codes are not meant to be interactive -- they simply dump out frames of the animation that can be assembled into a movie using a program like mencoder. This python script (mkmovie.py) provides an easy interface to mencoder for stringing a bunch of PNGs into movies.

Many of these animations come from Michael Zingale. I have used many of these animations for teaching purposes after having modified them a little bit. You are free to use these codes or animations for teaching purposes (please credit Ryan Orvedahl). If you end up using animations from Michael Zingale's page, please credit him accordingly. If you find a mistake or make an improvement, please send it along to ryan.orvedahl @ colorado.edu.

 

Stellar Motion

Parallax Animation

A simple animation showing how parallax works, illustrating the motion of the Earth around the Sun and the apparent shift seen in the position of a nearby star against the background, more distant stars.

source code: parallax.py

Parallax animation:
parallax.avi [MS MPEG-4v2]
parallax.mp4 [H.264]

parallax

 

Galactic Properties

Spiral Galaxy Geometry

A demonstration of how spiral arms occur from density wave theory.

source code: density-waves.py

Ellipse eccentricity animation:
three_rings.avi [MS MPEG-4v2]
three_rings.mp4 [H.264]
twenty_rings.avi [MS MPEG-4v2]
twenty_rings.mp4 [H.264]

spiral arms

 

Radiation / Thermodynamics

Blackbody Spectrum (frequency)

Show how the Planck function varies as temperature is changed. A "thermometer" on the right keeps track of the temperature. Some reference Planck function curves are plotted every 2 orders-of-magnitude in temperature to illustrate the shift in the location of peak intensity with increasing temperature. Also, the visible frequencies are highlighted with a blue shading.

source code: blackbody.py

Blackbody spectrum animation:
blackbody.avi [MS MPEG-4v2]
blackbody.mp4 [H.264]

blackbody

Blackbody Spectrum (wavelength)

Similar to the animation above, but in terms of wavelenght instead of frequency. Show how the Planck function varies as temperature is changed. A "thermometer" on the right keeps track of the temperature. Some reference Planck function curves are plotted every 2 orders-of-magnitude in temperature to illustrate the shift in the location of peak intensity with increasing temperature. Also, the visible wavelengths are highlighted with a blue shading.

source code: blackbody_wavelength.py

Blackbody spectrum animation:
blackbody_wavelength.avi [MS MPEG-4v2]
blackbody_wavelength.mp4 [H.264]

blackbody wavelength

Random Walk

A demonstration of a random walk process. A number of small hops are taken in random directions, until the overall displacement is equal to the radius of the circle.

If you change the seed used for the random number generator, you will get a different result.

source code: random_walk.py

Random walk animation:
random_walk.avi [MS MPEG-4v2]

random walk

 

Waves

Wave Propagation

Show two waves of different wavelengths to illustrate the difference between wavelength and frequency. The propagation speed of the two waves is the same. The wavelengths are 1 and 1/4 cm, and the velocity is 2.0 cm/s. A point "fixed" to a vertical line moves up and down as the wave passes by, to illustrate the concept of frequency.

source code: waves.py

Wave propagation animation:
waves.avi [MS MPEG-4v2]
waves.mp4 [H.264]

waves

Doppler Effect

Show a moving source emitting waves. The wavefronts are plotted as red circles. The source has a speed of 1 m/s and the waves have a propagation speed of 2 m/s. The wave frequency is 3 Hz.

source code: doppler.py

Doppler effect animation:
doppler.avi [MS MPEG-4v2]
doppler.mp4 [H.264]

doppler effect

Doppler Effect 2

Show two moving sources emitting waves. The top source has a speed of 1 m/s and the bottom source has a speed of 0.5 m/s. The waves have a propagation speed of 2 m/s and frequency of 3 Hz. This version shows how the compression of wave fronts depends on the line of sight velocity.

source code: doppler2.py

Doppler effect 2 animation:
doppler2.avi [MS MPEG-4v2]
doppler2.mp4 [H.264]

doppler effect 2

 

The frames are usually about 600 pixels in dimension, and the movies can be quite large, ~ 15-20 MB each. Most movies are in MS MPEG-4v2 format, created with:

mencoder "mf://*.png" -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=3000:vhq -mf type=png -o movie.avi

This plays fine in Linux with mplayer, and is said to work with Windows. Some movies are also available in H.264 format, created with:

mencoder mf://@list.txt -o movie.mp4 -of lavf -lavfopts format=mp4 -ss 1 -ovc x264 -x264encopts crf=20.0:nocabac:level_idc=30:global_header:threads=2 -fps 15

This plays fine in Linux with mplayer and should work with Windows and Mac.

 

updated