Apex › Storage & databases

Why simulated orbits drift (symplectic integrators)

Simulating a planet means stepping time forward and updating velocity and position from gravity — but the update order decides stability. Forward Euler systematically injects energy every step, so the orbit spirals outward and escapes; velocity-Verlet centers the update, is symplectic, and conserves energy essentially forever, keeping the orbit closed for millions of steps at the same cost. Verified: over a few orbits Euler drifts ~75% in energy (radius nearly quadruples) while Verlet drifts 0%. Race the two integrators from the same start.

More in Storage & databases