Repository for the development of gravitational N body modelling calculations and visualisations.
This repo can be used to run a web app to explore the orbits of various pre-defined N body configurations (x, y, vx, vy and mass). Orbit paths can also be plotted or animated using the CLI.
The code makes use of scipy.integrate.ode
in order to calculate the change in x, y, vx and vy at each given time step due to the gravitational forces of all other bodies in the system. The integrator used is dopri835
.
Install requirements:
pip install -r requirements.txt
Plot orbits for one of the default orbit configurations:
python run.py --orbit TWO_LIGHT_ONE_MASSIVE
Animate orbits for one of the default orbit configurations:
python run.py --orbit TWO_LIGHT_ONE_MASSIVE --animate
Run the web app using streamlit (https://www.streamlit.io/)
streamlit run app.py
- Update web app to display animations of the orbit path
- Update web app to allow for custom N body configurations
Chaos | 2 Light 1 Massive | Broucke A 2 [1] |
YIN-YANG 2b [1] | BUTTERFLY IV [1] | II.15.A [1] |
[1] Initial starting conditions taken from http://three-body.ipb.ac.rs/. Paper: M. Šuvakov and V. Dmitrašinović, Three Classes of Newtonian Three-Body Planar Periodic Orbits, Phys. Rev. Lett. 110, 114301 (2013). arXiv:1303.0181.