Animating Orbital Resonances with Python
I wrote a python script which makes a movie of any orbital resonance you care to request of it. No guarantees are made as to its functionality, usefulness for a given purpose, etc, etc. Use at your own risk. It has the following features:
- Accepts an arbitary system of resonances, e.g. [1, 2, 4] for the inner moons of Jupiter in a 1:2:4 resonance.
- Can space planets/moons at their proper Keplerian orbits or space them evenly (better with large numbers)
- Can draw lines between two orbits where conjunctions occur.
- Can include counters for how many orbits have gone by.
- Arbitrary initial positions.
- Retrograde orbits.
All of the above are set by editing the user parameters at the top of the file. Some familiarity with python may help.
The script requires Gnuplot.py, ffmpeg, and Linux, probably. It could probably be made platform independent by someone who cared enough to try.
Things it cannot do include non-circular orbits, spin-oribt resonances, and simulating gravity (that is, you can give it something completely unstable and/or unphysical but it will happily animate it anyway).
The script is available here: resonate.py.
A simple example movie is here: 1-2-4.mpg.