Differential Equations & Numerical Methods · BE5B01DEN · Topic 5 of 13
Numerical solution of ODEs: Euler and Runge–Kutta
Week 5. Euler is order 1, Heun and the midpoint rule are order 2, RK4 is order 4: more slopes per step buy a higher order.
Key ideas
The Euler method
Follow the slope at the left end of each step. With h=T/n it produces the points (xᵢ,yᵢ); the method has order 1.
Heun and the midpoint method
Both estimate a second slope and use it to correct the step. Heun averages the slopes at both ends; the midpoint method uses the slope at the middle. Both have order 2.
RK4 and error control
RK4 averages four slopes with weights 1,2,2,1 (divided by 6) and has order 4. Adaptive methods such as RKF45 compare two orders and shrink the step when they disagree.
In one line: Order p means halving h divides the final error by about 2^p.
Formulas
- The Euler method
- Heun and the midpoint method
- RK4 and error control
Practice with worked solutions
Question 1
Apply the Euler method with h = 1/2 for two steps and give y₂.
Worked solution
Answer: 5/2
Each step adds h·f(xᵢ,yᵢ).
Question 2
Apply one Heun step with h = 1/2 and give y₁.
Worked solution
Answer: 7/4
Average the slope at the left end and the slope at the Euler predictor.
Question 3
Apply one RK4 step with h = 1/2 and give y₁.
Worked solution
Answer: 211/128
Compute k₁, …, k₄ and combine them with weights 1, 2, 2, 1.
More Differential Equations & Numerical Methods practice in Ucenly
Sources
Written by Ucenly. Based on the BE5B01DEN course materials:
- Course card BE5B01DEN (Bílá kniha), p. 1
- Lecture slides: ODE numerical approach (edens_n3ode.pdf), p. 1, 2, 3, 4
- Habala: Ordinary Differential Equations and Numerical Analysis (dnbook.pdf), p. 118, 129
- Homework 4 (edenhw04.pdf), p. 1