Loading
The second-order Runge-Kutta method solves by sampling the slope twice per step. Heun's version: , with at the start and at the predicted end.
, : by Heun. Use .
| 0 | 0 | 1 | 1 | 1.2 | 1.11 |
| 1 | 0.1 | 1.11 | 1.21 | 1.431 | 1.24205 |
The calculator below opens on this example.
Midpoint: using x + h for k₂.
Heun: forgetting to halve h in the update.
Mixing the two versions in one solution.