N-body Orrery and Chaotic Asteroid Pair
What you are seeing: a miniature solar system rendered in 3D under a fourth-order symplectic integrator (Yoshida-4). One sun, five planets at small inclinations, and two ghost asteroids on the same orbit separated by a phase offset of one part in a million. Total energy stays bounded (symplectic invariant) but the asteroid separation grows exponentially (Hamiltonian chaos). Drag to orbit the camera
time step Δt0.006
substeps/frame6
cameradrag to orbit
show ghosts
t:0
|ΔE|/E₀:0
ghost sep:0
WHAT TO TRY
- Watch the energy-drift readout stay near zero: the Yoshida-4 symplectic integrator conserves energy over millions of steps, which is why the orbits do not spiral in or out.
- Raise the time step or substeps: bigger steps run faster but the energy error grows; the ghost planets show how a worse integrator would drift the orbits apart.
- Drag the camera: the five planets trace nested ellipses, a miniature solar system held together by mutual gravity under a long-term-stable scheme.