Back

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

Figure 1. 3D orrery with two ghost asteroids that start on identical orbits and separate exponentially due to non-integrable N-body dynamics. Method: Yoshida-4 symplectic, Plummer-softened gravity, Canvas2D perspective projection with z-ordered draw.
time step Δt0.006
substeps/frame6
cameradrag to orbit
show ghosts

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.