Heun Method
📐 Definition
Section titled “📐 Definition”For and timestep ,
Domain and Codomain
Section titled “Domain and Codomain”Applies to (or function spaces) with locally Lipschitz . Output resides in the same space.
⚙️ Key Properties
Section titled “⚙️ Key Properties”Order and Local Error
Section titled “Order and Local Error”Heun’s method is second-order accurate in time, with local truncation error .
Linear Stability (Test Equation)
Section titled “Linear Stability (Test Equation)”For the linear test equation , the stability function is
Stability requires , so timesteps remain restricted on stiff problems.
Two drift evaluations per step; no linear or nonlinear solves.
🎯 Special Cases and Limits
Section titled “🎯 Special Cases and Limits”As , the method converges to the exact flow under standard smoothness assumptions. Its leading term matches forward Euler, with the second stage acting as an explicit trapezoidal correction.
🔗 Related Functions
Section titled “🔗 Related Functions”Interpolates between forward Euler (predictor) and RK4 in cost-versus-accuracy; shares the trapezoidal averaging idea with Crank–Nicolson but remains explicit.
Usage in Oakfield
Section titled “Usage in Oakfield”Oakfield exposes Heun as a built-in explicit integrator:
- Integrator name:
heun(created viasim.sim_create_context_integrator(ctx, "heun", {...})). - Optional adaptivity: when
adaptive = true, Oakfield uses the difference between the Euler predictor and Heun corrector as an error proxy for step acceptance. - Complex + stochastic support: the implementation handles real and complex fields and can apply stochastic increments after the deterministic update.
Historical Foundations
Section titled “Historical Foundations”📜 Predictor–Corrector Schemes
Section titled “📜 Predictor–Corrector Schemes”Heun popularized this explicit second-order approach in the early 20th century as a practical predictor–corrector alternative to first-order stepping.
🌍 Modern Perspective
Section titled “🌍 Modern Perspective”It is now commonly classified as an explicit Runge–Kutta method of order 2 (explicit trapezoidal / improved Euler) and is frequently used when a small accuracy upgrade over Euler is needed.
📚 References
Section titled “📚 References”- Hairer, Nørsett, Wanner, Solving Ordinary Differential Equations I
- Butcher, Numerical Methods for Ordinary Differential Equations