ResearchMethods
How to Lose a Planet by Choosing the Wrong Integration Method
Simulating gravity is one equation applied over and over: acceleration equals minus times the position vector, divided by the cube of the distance. We integrated a single two-body Kepler orbit (eccentricity 0.6, one hundred steps per orbit, a resolution that looks perfectly reasonable) with three standard stepping rules, forward Euler, velocity Verlet and fourth-order Runge-Kutta (RK4), and checked every trajectory against the exact solution of Kepler's equation rather than against each other. At that resolution, Euler's energy flips sign within the first orbit (from −0.500 to +0.083) and never recovers. Velocity Verlet's energy error oscillates in a bounded band between roughly 0% and 2.99% for the full 300 orbits we ran, with no measurable trend (slope consistent with zero at 0.0 of its own standard error), exactly as symplectic theory predicts, and its angular momentum is conserved to relative error, 107 machine epsilons, indistinguishable from pure floating-point roundoff. RK4 drifts too, just far more slowly and in the opposite direction: it crosses 1% energy loss only after 47.6 orbits and 5% after 234.2 orbits, a real secular trend (21,915 standard errors from zero) that quietly contracts the orbit rather than expanding it. Fitting the measured convergence order across a range of timesteps gives 0.952 for Euler, 1.998 for Verlet and 4.166 for RK4 against textbook values of 1, 2 and 4; repeating the fit across 40 Monte Carlo trials at random eccentricities between 0.10 and 0.60 gives 0.987 ± 0.002, 2.0015 ± 0.0002 and 4.118 ± 0.005, each a small, real, explainable disagreement with the textbook exponent that we report rather than round away. Giving Euler four times the timestep resolution of RK4, so both cost the same number of force evaluations per orbit, does not rescue it: at eccentricity 0.6 it still loses 1% of the orbital energy within about a thousandth of an orbit, a failure of stability, not merely of accuracy, that a bigger budget cannot buy back. We also flag one place our own title oversells the result: at this configuration Euler's planet does not fall into the sun. It gains energy and flies apart, the better-documented and opposite failure mode; the "spiral into the sun" image turns out to describe RK4's slow contraction far better than it describes Euler's fast escape. Master seed 20260901. Total run time 65.0 seconds.
Fall 2026Read 24 minSections 12