Loading
Calibrating instruments…
Loading
Classical Mechanics · Gravitation
Build a solar system. Break it. Watch conservation laws refuse to.
Energy budget
Angular momentum
Conservation drift (log scale)
The Physics
Every body attracts every other along the line joining them, with a force falling off as one over distance squared. By superposition the acceleration of each body is just the vector sum over all its companions — no two-body approximation is made and no body is held fixed. This coupled set of second-order ODEs is the entire model; everything you see on the stage is its solution.
Two bodies trace exact conic sections — Kepler's ellipses solved once and for all. Add a third and everything changes: Poincaré proved there is no general closed-form solution and that the motion is chaotic, showing sensitive dependence on initial conditions. Nudge a starting position by a hair and the trajectories diverge exponentially. The special orbits below survive only on knife-edge symmetric initial data.
Because the true motion conserves energy exactly, the integrator must respect the geometric (symplectic) structure of Hamiltonian flow or the answer slowly rots. Velocity-Verlet is symplectic and time-reversible, so instead of the energy drifting away secularly it merely oscillates within a bounded band — watch the log-scale drift plot stay flat over many orbits. A naïve Euler or even RK4 step would spiral the orbits open.
Total energy E, total linear momentum, and angular momentum Lz are computed each frame directly from the state — never assumed — and the whole system is evolved in the centre-of-mass frame so it cannot drift off screen. For any bound gravitating system the virial theorem ties the time-averaged kinetic and potential energies, ⟨2T⟩ = −⟨U⟩; it is how astronomers weigh galaxy clusters. The flatness of these plotted invariants is the simulation's own accuracy proof.
Amid the chaos live rare exact periodic solutions. The figure-eight — three equal masses chasing one another along a single ∞-shaped track — was found numerically by Moore (1993) and proven to exist by Chenciner & Montgomery (2000). Lagrange's equilateral triangle and the collinear Euler solutions are others. They are dynamically fragile: they exist, but the tiniest perturbation eventually breaks them, which is exactly why reproducing one to five significant figures is a stringent test of the engine.
Numerically verified
Scientific references