Placeholder (demo). Description only: there is no reference implementation or verification for this entry yet. It belongs to a demonstration set of textbook methods.
What it does
Takes a half step with Euler to estimate the midpoint, then uses the slope there for the full step: , . Second order, two evaluations of per step. Note that "RK2" also refers to other two-stage methods such as Heun's method; this entry is the midpoint variant.
When to use
- Smooth, non-stiff problems over short to moderate times where a simple fixed-step second-order method is enough.
When not to use (and what to use instead)
| Situation | Use instead |
|---|---|
| Long runs of a conservative mechanical system: energy grows | stormer-verlet (same order, one force evaluation per step, bounded energy error) |
| Higher accuracy | rk4, or dormand-prince-rk45 with error control |
| Stiff problem | backward-euler or implicit-midpoint |
Key facts
Order 2, explicit, not symplectic, not time-reversible, conditionally stable, two evaluations per step.
Sources
- E. Hairer, S. P. Nørsett, G. Wanner. Solving Ordinary Differential Equations I, 2nd rev. ed. Springer, 1993. https://doi.org/10.1007/978-3-540-78862-1