Runge-Kutta Methods

Compare Euler, Midpoint (RK2), and RK4 solvers — visualize step error and convergence

Exact
Euler (RK1)
Midpoint (RK2)
RK4
RK4 45 (Adaptive)
Euler error
RK2 error
RK4 error
Steps

Euler's method has global error O(h), RK2 has O(h²), and RK4 has O(h⁴). Halving the step size reduces RK4 error by a factor of 16. For stiff equations, explicit methods require very small h for stability — use implicit methods (e.g., backward Euler) instead.