Runge–Kutta & Stiff ODEs
Ch 17 — Part III — Series & Numerical Methods
Runge–Kutta (RK) methods raise accuracy by evaluating the RHS at multiple clever points within each step. The classical RK4 is fourth-order accurate and widely used.
RK4 formulas
$$k_1 = f(t_n, y_n),\quad k_2 = f(t_n + h/2, y_n + \tfrac{h}{2} k_1),$$ $$k_3 = f(t_n + h/2, y_n + \tfrac{h}{2} k_2),\quad k_4 = f(t_n + h, y_n + h k_3),$$ $$y_{n+1} = y_n + \tfrac{h}{6}(k_1 + 2 k_2 + 2 k_3 + k_4).$$ Global error \(O(h^4)\).
Stiff ODEs
If \(A\) in \(\mathbf{x}' = A\mathbf{x}\) has eigenvalues with vastly different scales (some very negative), explicit methods need tiny steps. Use implicit methods (e.g. backward Euler \(y_{n+1} = y_n + h f(t_{n+1}, y_{n+1})\)) which have larger stability regions.
Adaptive stepping
Modern solvers (e.g. Dormand–Prince RK45 used in \(\mathtt{scipy.integrate.solve\_ivp}\)) compare two embedded RK methods of different orders to estimate error and adjust \(h\).
Practice Problems
Hint
Solution
RK4 error is about 1000× smaller, at ~4× the function-evaluation cost per step.
Answer: ~10³ ratio.
Hint
Solution
\(y_1 = 1/(1 + 1) = 0.5\).
Answer: \(y_1 = 0.5.\)
Hint
Solution
RK4's \(O(h^4)\) accuracy means you can take far bigger steps for the same error tolerance, easily offsetting the ~4× cost per step.
Answer: Far more efficient at equal accuracy.