Numerical Methods for ODEs

the midpoint method

Here is a different cure for Euler's start-of-step shortsightedness. Instead of averaging the start and end slopes (the way improved Euler does), the midpoint method reasons: the slope that best represents the whole step is probably the slope at its MIDDLE. So it takes a half-step forward to peek at the slope at the midpoint, then goes back and uses that single midpoint slope to make the full step. One well-chosen sample beats one badly-placed one.

Precisely, in two stages: first a half Euler step to the midpoint, y_mid = y_n + (h/2) * f(t_n, y_n), giving an estimate of y at time t_n + h/2. Then evaluate the slope there, k = f(t_n + h/2, y_mid), and use that one midpoint slope for the full step: y_(n+1) = y_n + h * k. The half-step is throwaway scaffolding; the midpoint slope is the real ingredient. Geometrically, you are following a single line whose tilt is read at the centre of the interval, which on a smoothly curving solution is a far better representative slope than the one at the left end.

Like improved Euler, the midpoint method is second order — its global error is of size h^2 — and it also costs two slope evaluations per step. The two are cousins: both are two-stage, second-order Runge-Kutta methods, just built from a different geometric idea (midpoint slope versus averaged endpoint slopes). Neither is dramatically better than the other in general; they are the standard examples used to show that there is a whole family of second-order methods, of which these are two natural members.

For y' = y, y(0) = 1, h = 0.1: half-step y_mid = 1 + 0.05 * 1 = 1.05; midpoint slope k = 1.05; full step y1 = 1 + 0.1 * 1.05 = 1.105. Same as improved Euler here, and again three digits of e^0.1 = 1.10517 — far better than plain Euler's 1.1.

Peek at the midpoint slope, then take the full step with it — second order.

Confusingly, both the midpoint method and improved Euler are sometimes called 'modified Euler' in different textbooks. They are distinct schemes (midpoint slope versus averaged endpoint slopes) that happen to share the same second order and cost.

Also called
modified Euler methodRK2 midpoint改進尤拉中點法二階龍格-庫塔中點法