← Back to Math 055
9.2 Runge-Kutta Methods: Class Notes
9.2
A generalization of Euler’s formula is , where the quantity in parentheses is a weighted average of slopes.
For example, can be the slope at the current point, and can be the predicted slope from the improved Euler’s method.
Notes: , are recursively defined, and is the order of the method.
Definition
For , we have , , and . Thus Euler’s method is a first-order Runge-Kutta method.
For reference: A second-order Runge-Kutta method has the form , where and . When , , and , the results agree with a Taylor polynomial of degree 2. (Note that this is only one choice for the constants; there are others, though we won’t be exploring that.) If we choose , then , and . The result agrees with the improved Euler’s method, thus making it a second-order Runge-Kutta method.
A fourth-order Runge-Kutta method (RK4)
An RK4 method uses a weighted average of four slopes to approximate -values. The basis of the technique is to find parameters so the formula
agrees with a 4th-degree Taylor polynomial. The resulting system has 11 equations in 13 unknowns, and common choices for the parameters yields
In the general form above, each slope is built from the ones before it: is used in , , and ; in and ; and in .
Local and global truncation errors using RK4 are and , respectively.
For comparison: Euler’s method has error , and the improved Euler’s method has error .
Example
Use the RK4 method to obtain a four-decimal approximation of the indicated value. First use and then use .
Solution
The work is done in a spreadsheet, one row per step:
RK4 method with h = 0.1 | | | | | | |
|---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Answer:
Errors with h = 0.1 | | | | |
|---|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
At the relative error is , compared with for the improved Euler’s method with the same (Section 9.1).
RK4 method with h = 0.05 | | | | | | |
|---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Answer:
Errors with h = 0.05 | | | | |
|---|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
Note that leads to an error about as large: , close to . The error is .