Numerical Integrator (Semi-implicit Euler / RK4)
积分器AdvancedThe numerical method a physics engine uses each step to advance velocity and position forward in time given the current forces.
At every simulation step, a physics engine first computes acceleration from the forces acting on a body, then hands off to an integrator to advance velocity and position to the next instant. The most naive method, explicit Euler, updates position using the old velocity; in spring-like systems this steadily manufactures energy out of nowhere until the simulation diverges. Semi-implicit (or symplectic) Euler just swaps the order — update velocity first, then use the new velocity to update position — which is still only first-order accurate but far more stable, and is what most game physics engines use. RK4 (fourth-order Runge-Kutta) evaluates the derivative four times per step for higher accuracy, at roughly four times the cost. Implicit integration folds velocity-dependent forces like damping into the equations being solved, letting it tolerate much larger timesteps. MuJoCo defaults to semi-implicit Euler with implicit joint damping, though its documentation recommends switching most models to implicitfast. The integrator, together with the simulation timestep, determines whether a simulation stays stable or “blows up.”
ExampleSetting integrator to implicitfast in a MuJoCo model's option element, while keeping the default 0.002-second timestep, is usually more stable than the default Euler integrator at a similar computational cost.
- Also called
- Semi-implicit Euler, Symplectic Euler, RK4, Fourth-order Runge-Kutta, Implicit Integration
- Related
- Physics Engine · Simulation Timestep · Substeps · Simulation Instability · MuJoCo (Multi-Joint dynamics with Contact) · Constraint Solver
- Sources
- MuJoCo Documentation: Computation - Numerical Integration
Gaffer On Games: Integration Basics - As of
- 2026-09