Tc9, Tc10 - Runge-Kutta methods
Use four-stage Runge–Kutta calculations and implement them in a spreadsheet. You will explain the stage points and weights, adapt the differential equation and step length, and read a supplied variation carefully rather than force every method into the standard pattern.
Four trial gradients make one corrected step
Could four gradient readings land exactly on a curved solution after one large step?
Sometimes they can. For , , the standard four-stage method with gives exactly , matching . That special success is useful to understand, but it is not a promise of exactness for every differential equation.
You already know
Modified Euler samples a starting gradient and a predicted endpoint gradient, then combines their increments. Each increment already contains the step length. A predicted stage point is an aid to the calculation, not a new confirmed point on the solution curve.
The standard fourth-order Runge–Kutta method uses the start, two different midpoint predictions and one endpoint prediction. Each new stage uses information from the preceding stage.
Standard fourth-order Runge–Kutta method
For , starting from ,
All four evaluations must be defined. The are increments; there is no extra multiplication by in the final weighted average.
In the formula booklet.
The two midpoint stages have the same -coordinate but generally different predicted -coordinates. Their doubled weights do not mean that the method takes two actual half steps.
Worked example 1: one four-stage step
Question. For , , calculate one standard Runge–Kutta step with .
Plan. Calculate the increments in order, then combine them with weights .
Why this step? The second midpoint height uses , rather than reusing .
Answer. from this single step.
Check. The analytical solution gives , close to the numerical estimate but not identical.
Change only to , leaving the equation and starting point unchanged.
Worked example 2: halve the one-step interval
Question. Calculate one standard Runge–Kutta step with .
Plan. Recalculate every stage with the new step, rather than halve the earlier increments.
Why this step? A changed step changes both coordinates of the stage points, so the increments are not simply scaled copies.
Answer. . One step now reaches , not .
Check. The exact value is . To compare methods at , take a second step instead of comparing these different endpoints directly.
For the opening equation , the four increments are . Their weighted combination is
so , exactly as claimed. The right side depends only on , so the trial heights do not affect these particular readings. The exact result is a feature of this equation, not a general error rule.
[DIAGRAM: asset_name: Four Runge-Kutta stage points; asset_slug: rk4_stage_points; caption: Two midpoint predictions share x but need not share y; description: A schematic mathematical stage plot for y'=x+y, h=0.2, starting at (0,1), labels stage 1 at (0,1), stage 2 at (0.1,1.1), stage 3 at (0.1,1.12), stage 4 at (0.2,1.244). The final corrected point (0.2,1.2428) is shown separately using a magnified inset or a side table so it is not confused with the predicted endpoint. A note gives weights 1,2,2,1.]

Watch out
Wrong: set because both use the midpoint, or use as the next height. Right: use the distinct predicted heights and combine all four increments with the stated weights.
Apply the standard rule to one new step.
Make each stage a visible spreadsheet column
A spreadsheet makes a long chain of four-stage steps manageable. It must still show enough formulae to reveal the design: the starting conditions, parameter references, each stage and the next-row update.
Consider the family
Store in and in . Set , , and use columns for the increments. Three auxiliary cells in hold the trial heights, keeping the formulae short. These literal entries use repeated multiplication for the square.
| Cell | Formula |
|---|---|
| =\text{\J$1}(\text{A2}-\text{B2}+\text{$J$2}\text{B2}*\text{B2})$ | |
| =\text{\J$1}((\text{A2}+\text{$J$1}/2)-\text{G2}+\text{$J$2}\text{G2}*\text{G2})$ | |
| =\text{\J$1}((\text{A2}+\text{$J$1}/2)-\text{H2}+\text{$J$2}\text{H2}*\text{H2})$ | |
| =\text{\J$1}((\text{A2}+\text{$J$1})-\text{I2}+\text{$J$2}\text{I2}*\text{I2})$ | |
| =\text{A2}+\text{\J$1}$ | |
Copy down, and copy down. Keep full stored precision. The stage formulae are applications of the supplied standard rule, not extra formulae to memorise; this worksheet layout is not printed in the booklet.
Worked example 3: check the spreadsheet against an analytical case
Question. Set , . Use the spreadsheet to estimate .
Plan. Recalculate the four stages at each row, take four complete steps and compare with the analytical solution of .
| Displayed , d.p. | |
|---|---|
Why this step? A known analytical case checks the worksheet before an equation without a convenient exact answer is investigated.
Answer. The estimate is , or to decimal places.
Check. gives , confirming this rounded result.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account