Definition
The midpoint method corresponds to the following choice of coefficients:
- a₁ = 0
- a₂ = 1
- a₃ = 1/2
- a₄ = f(tn, yn)/2
By inserting these coefficients into the Runge–Kutta form, we obtain the classical midpoint algorithm.
Midpoint Method Algorithm
Given: a time step h, an initial condition (t₀, y₀), and a maximum number of iterations N.
For 0 ≤ n ≤ N:
k₁ = h f(tₙ, yₙ)
yₙ₊₁ = yₙ + h · f(tₙ + h/2 , yₙ + k₁/2)
tₙ₊₁ = tₙ + h
Write tₙ₊₁ and yₙ₊₁.
Remarks
• Why it is called the midpoint method:
The function f(t, y) is evaluated at the midpoint of the interval [tₙ , tₙ₊₁]. This midpoint evaluation increases accuracy and leads to a second-order method.
• Precision:
The modified Euler method and the midpoint method have the same local truncation order. Therefore, both methods provide comparable accuracy, although their evaluation strategies differ.
• Other choices:
Several other choices of coefficients aᵢ are possible and lead to different second-order Runge–Kutta schemes. In this course, we focus only on these two classical variations.