Skip to content

A simulation for gravitational attraction for N bodies in up to R3 space

Notifications You must be signed in to change notification settings

burtawicz/N-Body-Simulation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-Body-Simulation

A simulation for gravitational attraction for N bodies in up to R3 space.

Details

An N-Body simulation is used to simulate an dynamic system of N number of bodies that have a physical interaction with each other, in this case gravity. The complexity of the current algorithm is O(n^2).

The program will generate N number of bodies and loop for a set number of steps. Each step the list of bodies will be iterated through, and the net force applied to the acceleration of the body, using the following equation:

Formula

Parameters

This acceleration will be applied to the existing velocity of the body. Once the list of bodies has been processed, another iteration will be done. This second iteration will use the new velocity to update the position in space.

Thank you:

josh314151 - For helping me find equation errors when all hope was lost.

About

A simulation for gravitational attraction for N bodies in up to R3 space

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%