Numerical integration approximates solutions of ordinary differential equations (ODEs) by advancing the state in finite time steps. In mechanics, the integrator and the step size Δt control not only accuracy but also qualitative behavior such as stability and long-term energy drift.
ODE form
Many dynamical systems can be written as
x˙ = f(x, t)
Let t_n = t0 + nΔt and x_n ≈ x(t_n). A time-stepping method computes x_{n+1} from x_n.
Explicit Euler
x_{n+1} = x_n + Δt f(x_n, t_n)
Euler is simple but can be unstable for oscillations unless Δt is very small, and it can introduce unrealistic energy gain or loss.
Semi-implicit (symplectic) Euler
For mechanical systems in (q, v), updating v first and then q often yields better long-term behavior and can approximately preserve phase-space structure.
Verlet family
Position Verlet and velocity Verlet are time-reversible and commonly show smaller long-term energy drift than naive Euler methods.
Runge-Kutta 4 (RK4)
RK4 improves local accuracy using staged slopes:
x_{n+1} = x_n + (Δt/6)(k1 + 2k2 + 2k3 + k4)
It is often accurate at fixed Δt, but it is not inherently energy-conserving over long times and costs more evaluations per step.
Error, stability, and step size
Key ideas:
- local truncation error vs global error
- stability regions (critical for stiff systems)
- convergence checks by repeating with smaller Δt
A practical check is to halve Δt and confirm that key observables change as expected.
Practical points
- Choose methods based on system type (conservative, dissipative, stiff) and goals (long-term stability vs short-term accuracy).
- Monitoring invariants (energy, momentum) is helpful, but interpret changes in the context of damping and forcing.