Simulate three mutually gravitating bodies using a 4th-order symplectic Yoshida integrator. Switch seamlessly from delicate periodic choreographies like the Figure-8 into sensitive three-body chaos.
Standard RK4 steadily leaks or gains energy over long simulations. Using a 4th-order symplectic Yoshida composition keeps the Figure-8 choreography repeating smoothly with tiny energy drift.
Isaac Newton solved the two-body gravitational problem completely: two isolated masses always trace clean ellipses, parabolas, or hyperbolas. Adding just a third comparable mass eliminates any general closed-form solution.
In 1993 Cris Moore discovered—and Alain Chenciner and Richard Montgomery proved in 2000—an astonishing periodic solution where three equal masses chase each other forever along the exact same Figure-8 curve, returning cleanly to their starting state every period T ≈ 6.3259.
Notice the relative energy drift metric in the telemetry bar: our 4th-order Yoshida symplectic integrator alternates position and velocity kicks so the Figure-8 repeats loop after loop without artificial energy gain.
Click anywhere in the canvas during Figure-8 or pick Chaotic Binary + Intruder to witness the hallmark of three-body chaos: two bodies frequently pair into a tight binary while flinging the lightest third body far outward into space.
| System / Family | Mass Ratio | Stability Behavior | Characteristic Period / Scale |
|---|---|---|---|
| Chenciner–Montgomery Figure-8 | 1 : 1 : 1 (Equal) | Marginally stable periodic loop | T ≈ 6.3259 dimensionless |
| Lagrange Equilateral Triangle | 1 : 1 : 1 (Equal) | Linearly unstable (violates Routh ratio) | Breaks after ~1–2 orbits |
| Sun–Jupiter–Trojan Asteroids | 1 : 10⁻³ : ~0 | Stable L₄ / L₅ librations (Routh μ < 0.0385) | 11.86-year orbital lock |
| Sun–Earth–Moon | 333,000 : 1 : 0.012 | Hierarchical stability (wide outer body) | 27.3 days / 365.25 days |
| Binary + Intruder Encounter | ~1 : 1 : 0.8 | Chaotic exchange & slingshot ejection | Unpredictable after close passage |
A 42-second animation: Figure-8 choreography, Lagrange points, and symplectic orbital chaos.
Watch the teal, gold, and blue stars weave along identical figure-8 tracks while relative drift |ΔE/E| stays near 10⁻¹³–10⁻¹⁴.
While Figure-8 runs, click near one star to nudge its velocity slightly and watch the symmetry unravel into chaotic loops.
Load Lagrange Triangle: three equal masses stay locked on rotating triangle corners—stable only if mass ratios meet Routh's criterion.
Two bodies have enough conserved quantities (energy, angular momentum, Runge-Lenz vector) to stay integrable. Adding a third interacting body removes integrals of motion, producing genuine deterministic chaos.
Almost all real triple stars avoid chaos by forming hierarchical pairs: two tight binary stars orbited at a huge distance by a third outer star.
Standard RK4 introduces secular energy drift over thousands of orbits, causing artificial spirals. Symplectic integrators preserve phase-space area, keeping energy oscillations bounded indefinitely.
While mathematically periodic, the Figure-8 stability zone is razor thin; realistic planetary perturbations or unequal stellar masses rapidly break it.