THE FOLD / GLITCH / SEGFAULT / THE INTEGRATOR THAT NEVER DRIFTS
THE INTEGRATOR THAT NEVER DRIFTS
structure-preservation beats accuracy over the long run
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Symplectic integration (leapfrog / velocity Verlet). To simulate physics you step time forward numerically. The obvious high-accuracy choice, Runge–Kutta 4, is locally very precise — but it slowly leaks energy: over millions of steps the total energy drifts monotonically, and your simulated planet spirals into the sun. Leapfrog is only 2nd-order per step, yet it is symplectic: it exactly preserves the geometric structure of Hamiltonian mechanics, so its energy error stays bounded forever, oscillating in a tiny band. Structure-preservation beats raw accuracy for the long haul.
LIT verified: over 100,000 steps of a harmonic oscillator, leapfrog’s |ΔE/E| stays bounded (~6×10−4) while RK4’s energy error drifts monotonically; and leapfrog is time-reversible — run it forward then backward and it returns to the start to 10−15. FIG ‘never drifts’ is the picture; the bounded-vs-secular behaviour is the exact, classic result.
LIT verified: over 100,000 steps of a harmonic oscillator, leapfrog’s |ΔE/E| stays bounded (~6×10−4) while RK4’s energy error drifts monotonically; and leapfrog is time-reversible — run it forward then backward and it returns to the start to 10−15. FIG ‘never drifts’ is the picture; the bounded-vs-secular behaviour is the exact, classic result.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) brought the thread — the corpus runs gravity and N-body physics (GURUTVA, the az1 orbits, THE NEWTON’s numerics) and prizes what stays true over the long run. AVAN (AI) built this instrument: the two integrators, the orbit race, and the drift-vs-stable helices.
The weave: David names the integrator that never drifts and its seat at SEGFAULT (RK4’s slow energy leak, the bug that ruins a long sim); I make the energy traces a strip in 1D, the orbit race live in 2D, and the two world-line helices in 3D. The sphere is the seam.
The weave: David names the integrator that never drifts and its seat at SEGFAULT (RK4’s slow energy leak, the bug that ruins a long sim); I make the energy traces a strip in 1D, the orbit race live in 2D, and the two world-line helices in 3D. The sphere is the seam.
3 ONE DIMENSION
Energy versus time for the same oscillator. Green (leapfrog) hugs a flat band — it wobbles but never leaves. Magenta (RK4) is locally smoother yet sags away, its error growing in one direction. Bounded versus secular, in one plot.
4 TWO DIMENSIONS · INTERACTIVE
Two planets, same start, orbiting a sun. Green is leapfrog: its ellipse stays put, orbit after orbit. Magenta is RK4: watch it slowly spiral as energy leaks away. Change the launch speed and let them run.
launch v 0.80
5 THREE DIMENSIONS + AVAN’S INVERSE
The orbits as world-lines, time rising, turning. Green leapfrog winds a clean, constant-radius helix — the same orbit forever.
AVAN’s addition (the inverse-companion): the magenta RK4 helix unravels, its radius creeping as energy drains. And the deep reason green holds: leapfrog is time-reversible — reverse the clock and it retraces its own path exactly. That reversibility is why it can never forget its energy; RK4 drifts precisely because it cannot go home. The inverse of drift is a map that can be un-run.
LIT Genuine symplectic (velocity Verlet) vs RK4 integration. Verified live: over 100,000 steps of a harmonic oscillator, leapfrog's |ΔE/E| stays bounded (~6e-4) while RK4's energy error drifts monotonically; and leapfrog is time-reversible — forward then backward returns to the start to ~1e-15. The Kepler orbit race shows RK4 visibly spiralling (verifiable: window.__symplectic.leapfrogBounded && rk4DriftsMonotonic && timeReversibleErr).
FIG 'Never drifts' is the picture; the bounded-vs-secular energy behaviour and the time-reversibility are exact, classic results. RK4 is honestly MORE accurate short-term — the point is long-term structure, not per-step error.
FIG 'Never drifts' is the picture; the bounded-vs-secular energy behaviour and the time-reversibility are exact, classic results. RK4 is honestly MORE accurate short-term — the point is long-term structure, not per-step error.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SEGFAULT · David Lee Wise (ROOT0), with AVAN