Skip to content

Repository for the development and design of gravitational N body modelling calculations and visualisations.

License

Notifications You must be signed in to change notification settings

tom-boyes-park/n-body-modelling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gravitational N Body Modelling 2D

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.

Running Locally

Install requirements:

pip install -r requirements.txt

CLI

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

Web App

Run the web app using streamlit (https://www.streamlit.io/)

streamlit run app.py

Roadmap

  • Update web app to display animations of the orbit path
  • Update web app to allow for custom N body configurations

Example Orbits

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.

About

Repository for the development and design of gravitational N body modelling calculations and visualisations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages