Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniilgrbic/solarpy
An accurate Solar system simulation with cool mathematics and a custom 3D engine
https://github.com/daniilgrbic/solarpy
runge-kutta simulation solar-system university-project
Last synced: about 1 month ago
JSON representation
An accurate Solar system simulation with cool mathematics and a custom 3D engine
- Host: GitHub
- URL: https://github.com/daniilgrbic/solarpy
- Owner: daniilgrbic
- Created: 2022-04-26T13:22:01.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-24T14:22:53.000Z (over 2 years ago)
- Last Synced: 2024-11-13T11:53:14.814Z (3 months ago)
- Topics: runge-kutta, simulation, solar-system, university-project
- Language: Python
- Homepage:
- Size: 126 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SolarPy: 3D Solar System Simulation
![]()
![]()
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.## Required modules
* NumPy
* PygameOptional: [astroquery](https://astroquery.readthedocs.io/en/latest/)
& [astropy](https://www.astropy.org/) (to use data from JPL Horizons instead of generating out own)## Running the simulation
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=` Start simulation from date specified in YYYY-MM-DD format. For example:
```
python main.py --start=1500-01-01
```
* `--dt=` 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
```## Controlling the simulation
* 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 the `output` folder## References
* [Approximate Positions of the Planets (ssd.jpl.nasa.gov)](https://ssd.jpl.nasa.gov/planets/approx_pos.html)
* [CHAPTER 8 : Orbital Ephemerides of the Sun , Moon , and Planets.](http://vadimchazov.narod.ru/text_pdf/XSChap8.pdf)
E. Standish, James G. Williams
* [Keplerian Orbit Elements → Cartesian State Vectors.](https://downloads.rene-schwarz.com/download/M001-Keplerian_Orbit_Elements_to_Cartesian_State_Vectors.pdf)
René Schwarz
* [THE EQUATIONS OF PLANETARY MOTION AND THEIR NUMERICAL SOLUTION.](http://www.wiu.edu/cas/mathematics_and_philosophy/graduate/equations-planetary-motion.pdf)
Jonathan Njeunje, Dinuka Sewwandi de Silva
* [opengl-tutorial (www.opengl-tutorial.org)](http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/)
* [Perspective Projection - Graphics Programming.](https://www.mathematik.uni-marburg.de/~thormae/lectures/graphics1/graphics_6_1_eng_web.html#1)
Thorsten Thormählen.