Mechanical plants (robot arms, pendulums, drones, a motor driving a load) are naturally second-order systems:
A general-purpose integrator treats this as a first-order system and ignores its structure. Over a long run the simulated energy creeps up or down, so a lightly damped plant looks more (or less) stable than it really is. Symplectic integrators advance position and velocity in an interleaved order that respects the geometry of mechanics. For a conservative system the energy error stays bounded forever, at one or two acceleration evaluations per step — fewer than the four of RK4.
Two fixed-step methods are provided: semi-implicit (symplectic) Euler, first order and one evaluation, and velocity Verlet in kick–drift–kick form, second order and two evaluations.
State
The only change from explicit Euler is that the position update uses the new velocity. Local error is
The step is symmetric in time, which cancels the odd error terms: global error
For a position-only force,
For
The conserved modified energies and the resulting error of the true energy
| Method | Conserved quantity ( |
Relative energy error |
|---|---|---|
| Semi-implicit Euler | oscillates, amplitude |
|
| Velocity Verlet | oscillates, amplitude |
With damping or Coriolis terms the system is not Hamiltonian, so neither method is exactly symplectic. Verlet evaluates the second kick at the half-step velocity
| Method | Acceleration evaluations | Order | Arithmetic | Memory |
|---|---|---|---|---|
| Semi-implicit Euler | 1 | 1 | two state copies | |
| Velocity Verlet | 2 | 2 | two state copies |
Here
Unit oscillator
Semi-implicit Euler
| Step | Velocity update | Position update | True |
Modified energy |
|---|---|---|---|---|
| 1 | ||||
| 2 |
The true energy wanders (about
Velocity Verlet, one step: half kick
-
Step size. Both methods require
$h\omega < 2$ for the fastest mode; beyond that the iteration diverges. The step size must be positive, and a non-positive value is rejected at construction. - Not for stiff or dissipative-dominated plants. Both methods are explicit. Strong damping or stiffness needs an implicit method or a much smaller step.
- Conservative forces only for the guarantee. Velocity-dependent forces and discontinuities (contact, saturation, friction) break symplecticity; the energy bound is lost, though the order of accuracy remains.
-
Single-precision floor. Rounding bounds the achievable accuracy. At
$h = 0.01$ the Verlet error ratio between$h$ and$h/2$ departs from the ideal$4$ , while at$h = 0.1$ versus$0.05$ it is$4.00$ . Halving the step below the rounding floor buys nothing. -
Measured energy error. Over
$10^5$ steps at$h = 0.01$ on the unit oscillator, the maximum relative energy error is$0.51%$ for semi-implicit Euler (matching$h\omega/2$ ) and$4\times10^{-5}$ for Verlet, of the same order as$(h\omega)^2/8$ with a single-precision rounding contribution.
| Variant | Key difference |
|---|---|
| Semi-implicit Euler, velocity Verlet (this) | Symplectic, orders 1 and 2; explicit Euler differs only in using the old velocity for the drift and its energy grows |
| Higher-order composition | Chains of Verlet steps with weights (Yoshida, Suzuki) reach orders 4, 6, ... |
| Implicit midpoint / Gauss | Symplectic and implicit; suited to stiff or non-separable systems at the cost of a nonlinear solve |
- Plant simulation — long model-in-the-loop runs of mechanical plants, where numerical energy drift would corrupt stability margins.
- Lightly damped dynamics — pendulums, flexible links, motor plus elastic load, whose true damping must not be masked by numerical damping.
| Algorithm | Relationship |
|---|---|
| Runge–Kutta 4 | Four evaluations per step, fourth order, general first-order systems; energy drifts slowly on conservative problems |
| Dormand–Prince | Adaptive step and error control for first-order systems; higher accuracy per step, no structure preservation |
- Hairer, E., Lubich, C., and Wanner, G., "Geometric numerical integration illustrated by the Störmer–Verlet method," Acta Numerica, 12:399–450, 2003.
- Hairer, E., Lubich, C., and Wanner, G., Geometric Numerical Integration, 2nd ed., Springer, 2006 — Chapters I and VI.
- Verlet, L., "Computer experiments on classical fluids," Physical Review, 159(1):98–103, 1967.