Below are some simple animations that I put together for for AST 105: Introduction to the Solar System and AST 203: Astronomy.
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.
You are free to use these codes or animations for teaching purposes
(please credit Michael Zingale).
If you find a mistake or make an improvement, please send it along
to
(Note: some of these movies are quite large, ~ 15-20 MB each.)
Planetary Orbits and Kepler's LawsIntegrate the orbits of two planets around a star, neglecting the gravitational force between the planets themselves. This is useful for demonstrating Kepler's third law. We work in units of AU, years, and solar masses. The semi-major axes are picked such that one planet has an orbital period of 1 year and the other of 2 years. This routine dumps out frames that can be assembled into a movie. source code: orbit2.py Movie of orbits: orbit.avi |
|
Kepler's Second LawShow equal areas in equal times, by shading the area swept out by a planet in equal time intervals. source code: second_law.py second law animation: second_law.avi |
|
Solar System Harmonic Law FigureA simple figure plotting the period of planets (+ pluto) in our solar system vs. semi-major axis on a log-log plot, showing the P2 ~ a3 relation. source code: harmonic_law.py Harmonic law figure: harmonic_law.png |
|
Retrograde MotionIntegrate Earth and Mars in their orbits around the Sun, starting a bit before opposition, and draw a line indicating the line-of-sight to Mars from Earth against some background stars to show the change in apparent motion. Note: the orbits are simplified here -- the semi-major axis and eccentricity are correct, but it is assumed that both ellipses are oriented the same way. For demonstration purposes, this is not all that critical. source code: retrograde.py Movie of retrograde motion: retrograde.avi |
|
Parallax AnimationA simple animation showing how parallax works. source code: parallax.py Parallax animation: parallax.avi |
|
Mercury's rotationIllustrate a 3:2 resonance between the rotation period and orbital period of Mercury. The semi-major axis and eccentricity for the planet drawn match Mercury. The black dot on the surface of the planet represents a person standing initially directly under the Sun at perihelion. source code: mercury_rotation.py Mercury rotation animation: mercury.avi |
|
Orbital EnergyA simple showing the orbit of a planet around the Sun, outputting the kinetic energy / unit mass, the potential energy / unit mass, and the total energy / unit mass along the way. source code: orbitalenergy.py Orbital energy animation: orbitalenergy.avi |
|
Ellipse Geometry FigureA simple figure used to illustrate the geometry of an ellipse source code: ellipse_geom.py Ellipse geometry figure: ellipse_geom.png |
|
Eccentricity of EllipsesA demonstration of how varying the eccentricity of an ellipse changes the shape. source code: eccentricity.py Ellipse eccentricity animation: eccentricity.avi |
|
How to Draw an EllipseA demonstration of how to draw an ellipse. Here we show the distance from each foci to the position on the ellipse, and show that their sum is constant. changes the shape. source code: ellipsedraw.py Drawing and ellipse animation: ellipsedraw.avi |
|
Achieving an OrbitA simple animation that shows a projectile with increasing horizontal velocity, working up to the circular velocity. source code: achievingorbit.py Achieving orbit animation: achieveorbit.avi |
|
Circular vs. Escape Velocity AnimationA simple animation showing how the orbit of a projectile around Earth changes as we increase the change the tangential velocity from less than the circular velocity to greater than the escape velocity. source code: escapevelocity.py Escape velocity animation: escape.avi |
|
Blackbody SpectrumShow 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 |
|
Random WalkA demonstration of a random walk process. source code: random_walk.py Random walk animation: random_walk.avi |
|
Wave PropagationShow 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. source code: waves.py Wave propagation animation: waves.avi |
|
Doppler EffectShow 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 |
|
Doppler Effect 2Show 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 |
|
Binary Star OrbitsAnimation of a binary pair orbiting their common center of mass. The case of e = 0 and e = 0.4 are shown, with a mass ratio of 2. source code: binary_stars.py binary star animation (mass ratio = 1; e = 0.0): binary_mratio=1_e=0.0.avi binary star animation (mass ratio = 1; e = 0.4): binary_mratio=1_e=0.4.avi binary star animation (mass ratio = 2; e = 0.0): binary_mratio=2_e=0.0.avi binary star animation (mass ratio = 2; e = 0.4): binary_mratio=2_e=0.4.avi |
|
Radial Velocity Planet Detection (circular orbit)Illustrate the radial velocity of a star with an unseen planet over the course of a period. Here, the planet's mass was greatly exaggerated to enhance the effect. We also restrict ourselves to being in the plane of the orbits. source code: radial_velocity.py radial velocity animation: radial_velocity.avi |
|
Radial Velocity Planet Detection (elliptical orbit)Illustrate the radial velocity of a star with an unseen planet over the course of a period. Here, the planet's mass was greatly exaggerated to enhance the effect. We use an elliptical orbit but restrict ourselves to being in the plane of the orbits. The semi-major axis is not perpendicular to the observer. source code: radial_velocity_ell.py radial velocity animation: radial_velocity_ell.avi |
|
H-R diagram figureA simple H-R diagram. The main sequence properties are found from Carroll and Ostlie, Appendix G. Lines of constant radius are drawn in, as well as the location of the white dwarfs. source code: HR_radius.py H-R diagram figure: HR_radius_wd.png |
|
Radioactive decay figuresA sequence of figures (each represent 1 half life) illustrating the radioactive decay of a sample. Initially 2500 markers are "parents". Each half life, there is a 50% chance a marker decays. After a number of half lifes, no parents remain. A plot showing the exponential decay follows. source code: radioactive_decay.py radioactive decay figures: |
![]()
|
All movies are in MS MPEG-4v2 format (created with mencoder "mf://*.png" -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=3000:vhq -mf type=png -o orbit.avi). This plays fine in Linux with mplayer, and is said to work with Windows.
Some of the inspiration for these animation topics came from figures in the text The Cosmic Perspective: The Solar System, 5th Ed. by Bennett et al.
updated Dec. 1, 2008