3-Body Problem Simulator

chaotic gravity, twin-run divergence, and numerical stability

Loading interactive simulation...

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.

Problem solved in full

  1. Energy of the figure-8 choreography for 3 equal masses from initial conditions 7 steps

    The figure-8 choreography sends 3 equal masses around a single closed curve. Work out its energy at t = 0 from the initial conditions alone. This is the figure-8 orbit preset: G = 1, m1 = m2 = m3 = 1, softening Ξ΅ = 0. Positions r1 = (βˆ’0.97000436, 0.24308753), r2 = βˆ’r1, r3 = (0, 0); velocities v1 = v2 = (0.466203685, 0.43236573), and the total momentum is 0.

    Open this problem in the tool

    1. Those long decimals look arbitrary. Square them and add, and they are not: bodies 1 and 2 each sit exactly 1 unit from the origin, which is where body 3 is.

    2. Body 2 is body 1 reflected through the origin, so at this instant all 3 bodies lie on a single straight line with body 3 at its midpoint. Every separation follows from that, with no second square root.

    3. Newton's law now needs nothing but those separations. Body 3 is 1 unit from each of the others, while bodies 1 and 2 are twice as far apart, so the pull between them is weaker by a factor of 4.

    4. Spend the collinearity. Body 3 is pulled equally in opposite directions, so its net force vanishes exactly. Bodies 1 and 2 are pulled the same way by both partners, because body 3 sits between them, so their 2 forces add as plain numbers with no components to resolve.

    5. Zero total momentum, plus bodies 1 and 2 moving identically, pins body 3's velocity at βˆ’2v1. That makes its kinetic energy 4 times theirs, and the sum over all 3 collapses to a single term.

    6. Squaring the 2 components of v1 and tripling is the whole of the kinetic-energy calculation for 3 bodies.

    7. Potential energy needs no vectors either β€” just the reciprocals of the 3 separations, and with Ξ΅ = 0 those reciprocals are exact.

    Answer

    E = βˆ’1.2871, and every row of the panel's t = 0 table β€” separations, pair forces, net forces, both energies and the total β€” came out of those 4 decimals and the vanishing of the total momentum. Watch what happens to the parts: by t = 25.0 the kinetic energy has climbed to 1.305 and the potential has fallen to βˆ’2.592, and the total has not moved. The sign is what carries a consequence. A bound trio can still lose a member, but not for free: if 1 body drifts away with nothing to spare, the pair left behind has to hold the entire βˆ’1.2871, and 2 unit masses with that energy have a semi-major axis of 1/(2 Γ— 1.2871) = 0.3885 β€” under 1/5 of the 2.0000 that separates them now. Ejection and hardening are the same event, and the energy budget is why.

References (1)