ODEs
Improved Euler (Heun's Method)
Improve on Euler's method with a predictor-corrector scheme: predict y* with Euler's slope, then correct using the average of slopes at both endpoints. Example: y'=x+y, y(0)=1, h=1/2; two steps give y(1)≈105/32≈3.28 versus true 2e−2≈3.44.
This achieves second-order accuracy O(h²) globally.
improved-euler-heun
Heun's method uses two slope evaluations per step: Predictor: y* = y_n + h·f(x_n, y_n) Corrector: y_{n+1} = y_n + (h/2)·(f(x_n,y_n) + f(x_{n+1},y*))