Three-Body-Problem-Gravitational-System
Three-Body-Problem-Gravitational-System copied to clipboard
A python code to calculate planetary orbits in a three-body gravitational system. The code can demonstrate how one planet affects the orbit of another planet. As an example, Earth, Jupiter, Sun system...
Three-Body-Problem-Gravitational-System
A python code to calculate planetary orbits in a three-body gravitational system. The code can demonstrate how one planet affects the orbit of another planet. As an example, Earth, Jupiter, Sun system is analyzed.
The code is available in Jupyter notebook (or IPython notebook) format and python script format (suitable for running with spyder).
Math and Theory
Requirements
The code uses matplotlib to create the orbital motion animation. The package ffmpeg is required to run the animation. It can be installed using the Anaconda terminal:
conda install -c menpo ffmpeg
The video is embedded in the Jupyter notebook using html5. The vidoe can also exported as mp4.
Earth-Jupiter-Sun system
The effect of Jupiter on Earth's orbit can be visualized using the Earth-Jupiter-Sun system notebook. The mass of Jupiter was taken to be 500 times its original mass. The effect on Earth's orbit due to the presence of this "Super Jupiter" can be easily noticed from the orbital animation.
Sample output
Earth-Jupiter-Sun system.
References
- Earth fact sheet: https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
- Jupiter fact sheet: https://nssdc.gsfc.nasa.gov/planetary/factsheet/jupiterfact.html
- https://www.phas.ubc.ca/~berciu/TEACHING/PHYS349/karla.pdf