Crank–Nicolson Integration
📐 Definition
Section titled “📐 Definition”For and timestep , the Crank–Nicolson update solves
implicitly for .
Domain and Codomain
Section titled “Domain and Codomain”Applies to time-dependent states in (or function spaces) with Lipschitz . Output is defined by solving a nonlinear or linear system each step.
⚙️ Key Properties
Section titled “⚙️ Key Properties”Order and Symmetry
Section titled “Order and Symmetry”Crank–Nicolson is second-order accurate in time for smooth . For linear problems it is symmetric (time-reversible) and can preserve qualitative structure better than first-order implicit stepping.
Linear Stability (Test Equation)
Section titled “Linear Stability (Test Equation)”For the linear test equation ,
The method is A-stable but not strongly damping for , so very stiff dissipative modes may decay slowly and can exhibit weak oscillations in some settings.
Implicit Solve Requirement
Section titled “Implicit Solve Requirement”Each step requires a linear or nonlinear solve for ; fixed-point iteration and Newton-type methods are common.
🎯 Special Cases and Limits
Section titled “🎯 Special Cases and Limits”Reduces to the trapezoidal rule for scalar ODEs. For linear , the update solves .
🔗 Related Functions
Section titled “🔗 Related Functions”Compared with explicit Runge–Kutta methods (e.g., RK4), Crank–Nicolson trades nonlinear solves for unconditional stability on diffusion operators.
Usage in Oakfield
Section titled “Usage in Oakfield”Oakfield exposes Crank–Nicolson as an implicit built-in integrator implemented via fixed-point iteration:
- Integrator name:
crank_nicolson(Lua:sim.sim_create_context_integrator(ctx, "crank_nicolson", {...})). - Solve strategy: iterates on the implicit midpoint/trapezoid equation using a Picard-style update until the guess/update residual drops below the integrator tolerance (no Jacobians/Newton).
- Adaptive fallback: when
adaptive = true, Oakfield reducesdtacross a small number of attempts if convergence is not achieved. - Complex + stochastic support: handles complex primary fields and supports optional stochastic increments after the implicit update.
Historical Foundations
Section titled “Historical Foundations”📜 Diffusion Computation
Section titled “📜 Diffusion Computation”Crank–Nicolson arose from mid-20th-century work on numerically solving diffusion equations with finite differences, combining the trapezoidal rule in time with practical linear solves.
🌍 Modern Perspective
Section titled “🌍 Modern Perspective”It remains a standard second-order implicit method in PDE time stepping, especially where reduced numerical damping is desirable.
📚 References
Section titled “📚 References”- Crank, The Mathematics of Diffusion
- Hairer, Nørsett, Wanner, Solving Ordinary Differential Equations II