Presets
Playback
Parameters
Model checks
The science
The N-body problem
Every body i accelerates towards all others: ai = G Σj mj (rj - ri) / (|rj - ri|² + ε²)3/2. The small softening ε keeps close encounters finite. Time is stepped with the leapfrog (kick-drift-kick) method, which is symplectic, so energy oscillates slightly instead of drifting. Without softening and merging, energy, momentum and angular momentum are exactly conserved, which the graphs show.
Special solutions and the virial theorem
Three equal masses can chase one another along a figure-eight (Chenciner and Montgomery, 2000), period T = 6.3259 for G = m = 1. For a bound, steady system the virial theorem says 2K = |U| on average, so the ratio in the third graph hovers around 1.
Honest simplifications: the 2D map is a plane (the 3D page also lets bodies leave the plane), softened gravity, merging collisions are perfectly inelastic with no debris, no relativity or tides, and the figure-eight is unstable if disturbed.
What to try
- Choose Figure-eight and watch three equal masses share one curve; then throw a small body into it and see it break.
- On Solar system, drag to throw a body past the star; its path is a conic section.
- Set softening to 0 on the Ring preset and look at the energy graph during close approaches.
- Watch the angular momentum graph stay flat while bodies merge.