All four bodies orbit the same point mass under F = -GMm·r̂/r² and start from the identical position and velocity. Each is advanced by a different numerical integrator using the same step size Δt, so any difference you see is caused purely by the integration method:
Explicit Euler: x' = x + v·Δt v' = v + a(x)·Δt
Symplectic Euler: v' = v + a(x)·Δt x' = x + v'·Δt
Velocity Verlet: x' = x + v·Δt + ½a(x)Δt² v' = v + ½[a(x)+a(x')]·Δt
RK4: weighted average of 4 slope evaluations per step
Specific orbital energy E = ½|v|² − GM/r should stay constant on a closed orbit. Explicit Euler is not symplectic: it systematically adds energy every step, so its orbit visibly spirals outward and its drift readout grows without bound. Symplectic (semi-implicit) Euler and Velocity Verlet are symplectic integrators — their energy oscillates but never drifts on average, so the orbit stays closed even at a coarse Δt. RK4 is far more accurate per step than any of the first-order methods but is not symplectic either, so at a large enough Δt its energy drift also creeps up, just much more slowly than plain Euler's.
- Δt slider — the physics step size shared by all four integrators; push it up to exaggerate the divergence.
- GM slider — gravitational parameter of the central mass; higher GM curves orbits faster for a given Δt, which stresses Euler harder.
- Eccentricity slider — sets the initial tangential speed below/above circular, producing an elliptical orbit; the fast perihelion pass is where Euler-family error accumulates fastest.
- Sim speed — how many physics steps are advanced per rendered frame; does not change Δt, only how fast you get there.
- Trail length — how many past positions each body's path keeps on screen before the trail starts fading out.
- Reset orbits — reseeds all four bodies at the same initial state so you can compare a fresh run at the current settings.
- Drag / scroll on the orbit view — pans and zooms the camera; it never affects the physics, only what you're looking at.
This is exactly the trade-off real orbital-mechanics and rigid-body engines face: symplectic integrators (Verlet-family) are the default in long-running N-body and game-physics solvers precisely because they don't leak or gain energy over millions of steps, even though a single RK4 step is more accurate. The lower strip chart tracks each integrator's energy drift over time so the divergence is visible as a trend, not just a snapshot number.