The integrator-drift generator
The relative error in total energy against revolution number, for three integrators run on the same Kepler orbit at e = 0.5 with the same step of 200 per revolution. The exact energy is a constant, so every curve here is the method rather than the problem. Euler climbs steadily: its energy at the end is 106.5% wrong, and the orbit it draws has spiralled outwards. Runge–Kutta 4 begins 4.7e+2 times more accurate than leapfrog and ends at 2.22e-4, having grown by a factor of 10 across the run: the error is SECULAR. Leapfrog oscillates inside a band and stays there — worst error 2.62e-3, and the second half of the run is no worse than the first, which is measured here rather than claimed. That is the property that decides whether a five-billion-year integration means anything, and it is not accuracy: a symplectic method is the exact solution of a Hamiltonian a step-size away from the intended one, so its energy cannot wander, while a more accurate non-symplectic method has no such constraint and eventually wanders further.
4 essays call
integrator-drift. The drawing above is what it returns with no arguments at all; every
call below passes it something, because a placement that passes nothing draws whichever member
of the family the generator happens to default to rather than the one its essay argues about.
Where it is called
Every figure listed here is the same construction drawn at different numbers, so a correction to one is a correction to all of them.
The singularity that is a change of variable
The Kepler problem blows up at zero separation, and a fixed-step integrator falls apart long before it gets there. Divide time by the radius and the equations become a harmonic oscillator — exactly, for every conic at once.
Wrong about where, and right about how much
Runge–Kutta is the more accurate method and loses energy steadily; leapfrog is cruder and its energy error never leaves a band. Over five billion years only one of those properties survives — and neither method knows where the planet is.
A step that must not be adapted
A symplectic integrator's bounded energy error is a property of a fixed step. It is conserving a Hamiltonian a step-size away from the intended one, and changing the step changes which Hamiltonian — so refining the step at a close encounter, which is the first thing anybody does, destroys the only property the method was chosen for.
An error that grows like a random walk
A long integration accumulates two errors with opposite habits. One falls when the step is made smaller and grows in proportion to the time; the other grows when the step is made smaller and accumulates as a square root. Which of the two dominates decides whether a billion-year integration means anything.