SimpleNBody

  • This python package solves N Body systems by calculating forces due to gravity (as well as drag and wind in the case of the projectile simulation) and iterating the system over a fixed time step, dt.
  • The simulation can accept input either in the form of CSV data or as a list of particle objects
  • This package was designed and tested by Spencer Thompson and Boris Burkov

Contents

  • Multiple solvers in SimpleNBody/simple_nbody/solvers.py offers functionality for simulating projectiles under the influence of the gravity of a single, nearby body (such as the earth), or the behavior under gravity of many independent particles in 3-space. Other factors that may be set to affect the behavior of the projectiles are drag forces and winds.
  • N Body Solver
    • SimpleNBody/bin/ contains scripts to run premade examples, of particular interest is simplenbody which can accept several different arguments from the command line when it is called. To run the script from SimpleNBody, the command is ./bin/SCRIPTNAME
    • The SimpleNBody/bin/tidalrings script simulates the interaction of two extremely massive particles and their companion, massless sattelites. This is an attempt to reproduce the results Alar and Juri Toomre in simulating the collisions of galaxies. (Warning: the algorithm used here is slow (O(n2)) and there is a large number of particles so this particular script is quite computationally expensive)
    • SimpleNBody/examples/ contains example CSV files which can be used as inputs for the N Body Simulation
    • SimpleNBody/simple_nbody/ contains all of the python files which run the simulation (solvers.py, simulation.py, particle.py and init.py)
    • SimpleNBody/tests/ contains all of the unit testing for the simulation to run an individual test from the SimpleNBody directory, the command is python tests/TESTNAME.py

Attachments