This project is a fairly accurate simulation of the Solar system in 3D. The initial positions are calculated using desired date and orbital elements of planets. Once ready, the simulation proceeds by using the general second order ordinary differential equation system of planetary motion, which we solve numerically using Runge-Kutta method.
- NumPy
- Pygame
Optional: astroquery & astropy (to use data from JPL Horizons instead of generating out own)
Simply run main.py
to start the simulation with default parameters: the
start date will be set to the current date, and the program won't use
JPL Horizons Queries to determine initial state.
The program can be run with additional command line arguments:
--start=<date>
Start simulation from date specified in YYYY-MM-DD format. For example:python main.py --start=1500-01-01
--dt=<delta>
Set the dt used in simulation in hours (default is 24h)python main.py --start=2000-01-01 --dt=8
--horizons
Use JPL Horizons Queries to calculate initial state (can be combined with--start
).python main.py --horizons
- Press
SPACE
to pause/unpause the simulation - Drag the mouse to move the camera, scroll to zoom
- Scroll while holding the right mouse button to change simulation speed
- Press
p
in order to dump current positions and velocities of planets into a file in theoutput
folder
- Approximate Positions of the Planets (ssd.jpl.nasa.gov)
- CHAPTER 8 : Orbital Ephemerides of the Sun , Moon , and Planets. E. Standish, James G. Williams
- Keplerian Orbit Elements → Cartesian State Vectors. René Schwarz
- THE EQUATIONS OF PLANETARY MOTION AND THEIR NUMERICAL SOLUTION. Jonathan Njeunje, Dinuka Sewwandi de Silva
- opengl-tutorial (www.opengl-tutorial.org)
- Perspective Projection - Graphics Programming. Thorsten Thormählen.