Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Predicting the future one small step at a time
If you know where a ball is and how fast it’s moving, you can predict where it’ll be a moment later. Then repeat from there, again and again. That’s how computers simulate everything from planets to robot arms. Take steps too big and small errors pile up, or even blow up. Clever methods peek ahead within each step to stay accurate, and adaptive methods take tiny steps only where things change quickly.
Trajectory propagation, flight simulators, robot dynamics and digital twins are all ODE integrations. Mission analysis tools (GMAT, STK) use high-order adaptive integrators. Physics engines use symplectic or implicit steps for stability. A wrong integrator choice can silently add energy to a simulated satellite or make a stiff controller simulation crash.
- 1. ODE solvers advance the state by…
- 2. Very large steps can make a simulation…
- 3. Adaptive solvers take small steps where…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Explicit Euler
For : . The local error is and the global error : first order.
Classical Runge–Kutta (RK4)
It’s fourth order: halving cuts the error 16×, for 4 evaluations per step.
Systems
Any higher-order ODE becomes a first-order system. For example, becomes .
- 1. Euler's global error is O(…)
- 2. RK4 uses how many f evaluations per step?
- 3. Halving h for RK4 reduces the error by about…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Adaptive step size
An embedded pair computes two solutions of different orders from the same stages. Dormand–Prince 5(4) (ode45, RK45) is the classic. Their difference estimates the local error. Accept the step if (scaled by rtol and atol), then set . Steps shrink automatically where the solution changes fast, such as near periapsis.
Stability and stiffness
For the test equation , explicit Euler gives , which is stable only if . For real that means . A stiff problem has a fast-decaying mode (large ) that forces tiny steps even though the solution is smooth. Backward Euler gives , stable for every (A-stable). Production stiff solvers: BDF (ode15s, CVODE) and Radau IIA.
Long-time behaviour: symplectic integrators
For Hamiltonian systems (orbits, molecular dynamics, rigid bodies), symplectic methods such as symplectic Euler and leapfrog/velocity Verlet preserve phase-space volume. Their energy error stays bounded forever rather than drifting (Hairer, Lubich and Wanner, 2006).
- 1. Explicit Euler on y′ = −1000y is stable for h ≤
- 2. Backward Euler is…
- 3. For long orbital or molecular simulations, prefer…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Euler’s global error
The local truncation error is . With a Lipschitz constant , errors propagate as , so
∎ Errors may grow exponentially in time even for convergent methods.
Stability functions
A Runge–Kutta method applied to gives . For RK4, , a Taylor polynomial; explicit methods always have bounded stability regions. Backward Euler has , with on the whole left half-plane.
Euler on the oscillator gains energy
The step matrix is with determinant . So each step multiplies by exactly . Symplectic Euler’s matrix has determinant 1. ∎
Exercise 3.1: energy after 2000 Euler steps with h = 0.05
, matching the exercise.
- 1. Euler's oscillator step multiplies q² + p² by…
- 2. The stability function of backward Euler is…
- 3. Global error bounds for ODEs can grow like…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Propagating an eccentric orbit
An orbit with e = 0.9 moves slowly at apoapsis and very fast at periapsis. A fixed step small enough for periapsis is wasted everywhere else. Adaptive Dormand–Prince 5(4) completes one orbit in about 230 steps and returns to periapsis within . Fixed-step RK4 with the same number of function evaluations misses by 0.85 (a large fraction of the orbit), and needs about 16 000 steps to match. Real propagators go further: they regularize (Kustaanheimo–Stiefel, Sundman time transformation) or use high-order adaptive methods (RK7(8), Gauss–Jackson).
ODE solvers in AI, robotics and aerospace
- Astrodynamics: adaptive high-order RK and multistep integrators in GMAT, STK, Orekit and JPL’s DPTRAJ/ODP.
- Robotics simulation: semi-implicit Euler in MuJoCo, Bullet and PhysX for stiff contacts; implicit integration for soft bodies.
- Neural ODEs: continuous-depth networks trained through adaptive solvers with adjoint gradients (Chen et al., 2018).
- Estimation: EKF and UKF time updates integrate dynamics and covariance ODEs between measurements.
References
- E. Hairer, S. Nørsett, G. Wanner (1993). Solving Ordinary Differential Equations I: Nonstiff Problems, 2nd ed. Springer.
- E. Hairer, G. Wanner (1996). Solving Ordinary Differential Equations II: Stiff and Differential-Algebraic Problems. Springer.
- J. Dormand, P. Prince (1980). “A family of embedded Runge–Kutta formulae.” J. Computational and Applied Mathematics, 6(1).
- E. Hairer, C. Lubich, G. Wanner (2006). Geometric Numerical Integration, 2nd ed. Springer.
- L. Shampine, M. Reichelt (1997). “The MATLAB ODE suite.” SIAM J. Scientific Computing, 18(1).
- O. Montenbruck, E. Gill (2000). Satellite Orbits: Models, Methods and Applications. Springer. Ch. 4.
- R. T. Q. Chen, Y. Rubanova, J. Bettencourt, D. Duvenaud (2018). “Neural ordinary differential equations.” NeurIPS.
- E. Todorov, T. Erez, Y. Tassa (2012). “MuJoCo: a physics engine for model-based control.” IROS.