Skip to content
Symplectic vs Explicit Euler
step 1/5

Reading — step 1 of 5

Read

~2 min readMath & Integration

Why Game Physics Uses Symplectic Euler, Not Explicit Euler

The two one-line integrators

Given position x, velocity v, acceleration a, time step dt:

Explicit (forward) Euler — update position with the OLD velocity, then velocity:

x_new = x + v * dt
v_new = v + a * dt

Semi-implicit / Symplectic Euler — update velocity FIRST, then use the NEW velocity to update position:

v_new = v + a * dt
x_new = x + v_new * dt

That's it. One swap, two different worlds.

Why the swap matters: energy drift

Take a simple harmonic oscillator (a spring): a = -k*x / m. Solve it analytically and the total mechanical energy E = 0.5*m*v^2 + 0.5*k*x^2 is conserved forever.

Run explicit Euler with any dt > 0 and E grows monotonically — the oscillation amplitude inflates frame by frame until your bouncing ball flies into orbit. This is called energy injection or "drift". Explicit Euler is an unstable integrator for oscillatory systems no matter how small you make dt (you just delay the explosion).

Run symplectic Euler at the same dt and E doesn't drift. It oscillates around the true value in a bounded way. The integrator is symplectic: it preserves the symplectic 2-form of Hamiltonian mechanics, which (informally) means it conserves a discrete version of energy.

For game physics, this is the difference between a stack of boxes that sits still and a stack of boxes that vibrates apart on its own.

Why so cheap

Both are O(1) per body and use one acceleration evaluation per step. Symplectic gives you the stability of a much more expensive integrator (RK4 is 4x the cost) essentially for free. Box2D, Bullet, Chipmunk and just about every shipping 2D engine use semi-implicit Euler as their default.

When you DO want something else

  • Verlet integration: x_{n+1} = 2*x_n - x_{n-1} + a*dt^2. Position-based, no velocity stored explicitly. Used in Hitman: Codename 47's cloth (Jakobsen 2001) and position-based dynamics engines. Great for soft bodies and constraint chains.
  • RK4: 4x the cost but high accuracy. Used in scientific simulation. For games it's overkill — symplectic Euler at 60 Hz beats RK4 at 15 Hz for visible quality.
  • Implicit (backward) Euler: solves v_new = v + dt * a(x_new, v_new). Unconditionally stable but damped — kills energy. Used for cloth/rope where you'd rather a stiff system look "wet" than explode.

Exercise

You're given an initial state and a number of steps. Compare both integrators for the same conditions and output their final position + velocity. The free-fall test will show only small differences; the spring test will show explicit Euler diverging.

Discussion

Ask a question, share an insight, or help someone who’s stuck.

Sign in to post a comment or reply.

Loading…