The Physics of the Universe
Home › Simulations › Three-Body Problem Simulator (Symplectic N-Body)

Three-Body Problem Simulator (Symplectic N-Body)

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.

Presets:
Click inside the canvas to nudge the nearest star's velocity and watch how quickly any perturbation breaks a delicate three-body choreography!

Key Equations & Physics Model

Newtonian Three-Body Acceleration: d²rᵢ / dt² = ∑_{j≠i} G mⱼ (rⱼ − rᵢ) / |rⱼ − rᵢ|³
Total Conserved Mechanical Energy: E = ∑ ½ mᵢ |vᵢ|² − ∑_{i<j} G mᵢ mⱼ / |rᵢ − rⱼ|
Symplectic Phase-Space Preservation: 4th-order Yoshida step keeps long-term ΔE bounded

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.

How the Physics Works

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.

Famous Three-Body Regimes & Stability Criteria

System / FamilyMass RatioStability BehaviorCharacteristic Period / Scale
Chenciner–Montgomery Figure-81 : 1 : 1 (Equal)Marginally stable periodic loopT ≈ 6.3259 dimensionless
Lagrange Equilateral Triangle1 : 1 : 1 (Equal)Linearly unstable (violates Routh ratio)Breaks after ~1–2 orbits
Sun–Jupiter–Trojan Asteroids1 : 10⁻³ : ~0Stable L₄ / L₅ librations (Routh μ < 0.0385)11.86-year orbital lock
Sun–Earth–Moon333,000 : 1 : 0.012Hierarchical stability (wide outer body)27.3 days / 365.25 days
Binary + Intruder Encounter~1 : 1 : 0.8Chaotic exchange & slingshot ejectionUnpredictable after close passage

Why can't we solve three orbits with one formula?

A 42-second animation: Figure-8 choreography, Lagrange points, and symplectic orbital chaos.

Experiments to Try

Test Symplectic Figure-8 Stability

Watch the teal, gold, and blue stars weave along identical figure-8 tracks while relative drift |ΔE/E| stays near 10⁻¹³–10⁻¹⁴.

Destroy Choreography with One Click

While Figure-8 runs, click near one star to nudge its velocity slightly and watch the symmetry unravel into chaotic loops.

Compare Lagrange's Triangle

Load Lagrange Triangle: three equal masses stay locked on rotating triangle corners—stable only if mass ratios meet Routh's criterion.

Frequently Asked Questions

Why isn't there a formula like Kepler's laws for three bodies?

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.

Are three-star systems actually unstable in nature?

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.

Why use a Yoshida symplectic integrator instead of RK4?

Standard RK4 introduces secular energy drift over thousands of orbits, causing artificial spirals. Symplectic integrators preserve phase-space area, keeping energy oscillations bounded indefinitely.

Could Earth sit in a Figure-8 orbit in a triple star system?

While mathematically periodic, the Figure-8 stability zone is razor thin; realistic planetary perturbations or unequal stellar masses rapidly break it.

Related Topics & Tools