The N-Body Problem
All objects are attracted to each other by a gravitational force of magnitude
where G is the universal constant of Gravitation, m and M are the masses of the two objects, and r is the distance between them. Using Newton's 2nd law, F=m⋅a, the corresponding acceleration towards a nearby body of mass M is
The total acceleration a body experiences when there are many other gravitational bodies in the vicinity, of masses Mi and at distances ri , is therefore given by the sum of the individual accelerations towards each other body:
Total acceleration =∑i ai=∑iG⋅Mi⋅riri3,
where we have now used vector notation because the displacements may be in different directions.
Click in the plot window to add bodies to the system. Adjust their velocities and positions by clicking and dragging or editing the textboxes. Adjust their masses using the slider. Flip the switch to start or stop the simulation.
Download Help Document