Read this lesson as text

Classical Fourth-Order RK

Numerical Analysis · Axiom Academy

LESSON Classic Fourth-Order Runge-Kutta Method (RK4) The workhorse of numerical ODE solving: understanding the four-stage method that balances accuracy, stability, and computational efficiency Given an initial value problem y' = f(t, y) with y(t_0) = y_0 , the RK4 method advances the solution using four intermediate slopes (k-values): These four slopes are then combined using a weighted average to compute the next value: Each k-value represents a slope estimate at a different point within the step interval: Here is the step-by-step pseudocode for implementing RK4: The RK4 method is a fourth-order method , meaning its error terms involve powers of h starting at h^5: This means: halving the step size reduces the global error by a factor of 16! RK4 is dramatically more accurate for smooth problems! The classic RK4 method has remained the go-to choice for decades due to its exceptional balance of several key factors: High Accuracy: O(h^4) global error is excellent for most applications Simplicity: Only 4 function evaluations per step, no implicit equations Good Stability: Stable for reasonably stiff problems when h is small enough Self-Starting: No need for special starting procedures (unlike multistep methods) Memory Efficient: Only needs data from the current step Stiff equations (use implicit methods) High precision needs (use RK8 or adaptive) Many steps needed (use multistep methods) Error control needed (use adaptive RK)

This is the written version of the interactive lesson above. See the full Numerical Analysis course.