Comparative numerical laboratory
ODE Time Stepping: Euler, Heun, RK4 — Chapter 10
Solve \(y'=-\lambda y,\ y(0)=1\) and compare accuracy and stability.
\[
y(t)=e^{-\lambda t}.
\]
Methods compared
| Method | Convenience | Inconvenience / warning |
|---|---|---|
| Euler | Very simple; useful for explanation. | First order and stability-limited. |
| Heun | Second-order predictor-corrector idea. | More evaluations per step. |
| RK4 | Very accurate for smooth nonstiff problems. | More stages; still not ideal for stiffness. |
| Exact solution | Benchmark for this test. | Not available for general IVPs. |
Illustrative plot / animation
Numerical diagnostics
What the student must compare
- time-history plot
- final error
- stability with \(h\lambda\)
- cost per step