HomePhysics & MechanicsIntegrator Race 2D: Euler vs Verlet vs RK4

Integrator Race 2D: Euler vs Verlet vs RK4

A top-down orbit view and a live energy-drift strip chart, side by side: four numerical integrators — Explicit Euler, Symplectic Euler, Velocity Verlet and RK4 — step the same orbiting body under the same gravity, from the same start, and diverge live as their energy drifts. Drag to pan, scroll to zoom.

Physics & Mechanics2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-physics-simulator ↗ Open standalone

Four identical bodies are launched into the same elliptical orbit around the same central mass, each advanced by a different numerical integrator — Explicit Euler, Symplectic (semi-implicit) Euler, Velocity Verlet and RK4 — using the same shared step size. Because Newton's laws are differential equations with no closed-form solution for most real scenarios, every physics or orbital-mechanics engine has to pick one of these stepping schemes, and the choice matters: explicit Euler visibly spirals outward as it leaks energy every step, the two symplectic methods keep a stable closed ellipse even at a coarse step size, and RK4 trades symplecticity for high per-step accuracy. This 2D edition pairs a pannable/zoomable top-down orbit view with a live energy-drift strip chart underneath, so the divergence is visible both spatially and as a trend over time.

⚙ Under the hood

Four identical bodies orbit the same gravity well, each stepped by a different numerical integrator (Explicit Euler, Symplectic Euler, Velocity Verlet, RK4) from the same starting state. A pannable, zoomable top-down orbit view sits above a live energy-drift strip chart, showing exactly how each method diverges both spatially and over time.

numerical-integrationorbital-mechanicseuler-methodverlet-integrationrk4energy-conservation

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)