3-Body Problem Simulator
chaotic gravity, twin-run divergence, and numerical stability
why does it look the same on every refresh? 🖖
The three-body problem is chaotic but not random. Chaos means tiny differences in initial conditions grow exponentially โ but refreshing the page changes nothing: same initial positions, same velocities, same dt, same algorithm, same result every time. Deterministic chaos and computational reproducibility are two different things. To actually see the chaos: set perturbation to 0.000001 and watch the dashed twin trajectory. Both trajectories start 10โปโถ apart and eventually diverge into completely different paths. That exponential separation is the chaos โ the Lyapunov exponent at work. The divergence chart below the orbits plots logโโ of that separation over time; a straight rising line means exponential growth.
why three is the hard number 🖖
Two bodies pulling on each other trace simple, endlessly repeating ellipses โ that case Newton solved with pen and paper. Add a third body and the neat formula disappears: there is no general equation for where everyone ends up, so the only way forward is to advance the simulation one tiny dt at a time, exactly as this tool does. Click the figure-8 preset to meet one of the rare exceptions โ three equal masses forever chasing each other along a single looping path.
the solution that exists but is useless 🖖
People often call the three-body problem 'unsolvable', yet in 1912 Karl Sundman proved a convergent power series in t1/3 that yields the bodies' positions for all time (barring triple-collision starts). The catch: it converges so slowly that astronomical accuracy would demand on the order of 108000000 terms โ hopelessly beyond any computer. A formal solution truly exists; stepping the simulation forward, as here, is simply the only usable route.
Example problems
- figure-8 orbit - Figure-8 orbit shows rare near-periodic three-body choreography before divergence grows.
- near collision - Near-collision setup amplifies tiny initial differences into visibly different paths.
- pythagorean - Pythagorean three-body case collapses and slingshots, illustrating strong nonlinear sensitivity.
- butterfly orbit - butterfly orbit
- Euler collinear - Euler collinear
- binary + intruder - binary + intruder