Home▸Build & Play▸Game Physics Integrators: Energy Drift of Four Time-Stepping Methods at Frame Rate (2D)

Game Physics Integrators: Energy Drift of Four Time-Stepping Methods at Frame Rate (2D)

Four spring-mass trajectories against the exact oscillation, with live energy-versus-time curves and an error-versus-step-size plot. The same shared model as the 3D scene: explicit and semi-implicit Euler, velocity Verlet and RK4.

Build & Play2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Game Physics Integrators: Energy Drift of Four Time-Stepping Methods at Frame Rate (2D) ↗ Open standalone

Four identical springs are stepped with four different integrators at a chosen frame rate: explicit Euler, semi-implicit (symplectic) Euler, velocity Verlet and fourth-order Runge-Kutta, next to the exact solution. Change the spring frequency, the frame rate and the damping and watch explicit Euler gain energy and blow up while the symplectic methods stay bounded. Growth factors, conserved shadow energy and convergence orders are checked numerically.

⚙ Under the hood

Four spring-mass trajectories against the exact oscillation, with live energy-versus-time curves and an error-versus-step-size plot. The same shared model as the 3D scene: explicit and semi-implicit Euler, velocity Verlet and RK4.

Game PhysicsNumerical IntegrationSymplectic EulerVerletRunge-Kutta

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

What did you find?

Add reproduction steps (optional)