8.7
Section |
2 Background .1
Cosmology .11 Math |
Section 8.9 |

Section 8 **Runge-Kutta Method**

Consider the **Cauchy problem**
for the differential equation

(8.1)

with the initial condition

(8.2)

Let *y*_{i} denote the approximate value of the required solution at the point *x*_{i}.
By the **Runge-Kutta method** ( [2],[13],[18]),)
the approximate value *y*_{i+1} at the next point *x*_{i+1} =* x*_{i}
+ *h* is given by

(8.3)

where

(8.4)

The corresponding hand computations are best performed by the scheme:

1. Enter *x*_{0}*, y*_{0 }in the first row. 2. Evaluate *K*_{1}^{(0)}*
= hf*(*x*_{0}*,y*_{0}). 3. Enter *x*_{0}* + h*/2*, y*_{0} +
*K*_{1}^{(0)}/2 in the second row.

4. Compute and enter *K*_{2}^{(0)}* = hf*(*x*_{0}* + h*/2,*y*_{0}
+ *K*_{1}^{(0)}/2).etc.Add the numbers in the last column, in order to obtain

Repeat these steps using *x*_{1},_{ }*y*_{1} as initial point, etc. Note
that *h* may be changed when passing from one point to another. A proper choice of *h* can be obtained as follows:

If the quantity

(8.5)

exceeds several hundredths; the value of *h* must be reduced. The **accuracy
of the Runge-Kutta metho**d is *O*(*h*^{4}). Its
error estimate is rather involved. A rough error estimate, which involves repeated computations, is:

where *y*(*x*_{n}) is the value of the exact solution of (8.1) and* y**_{n},
*y*_{n} are the approximate values obtained for *h*/2 and *h*, respectively.

**Example 1****:**
Use the **Runge-Kutta method** to find the solution of
the equation

(8.6)

for the initial condition *y*(0) = -1 with the interval [0,0.5], using *h* = 0.1.

**Solution: **The following table displays the solution of
(8.6):

Note that the last column of this table has been computed using (8.5).

**Example 2****:**
Use the** Runge-Kutta Method**
to find within 5?10^{-6} the solution of the differential equation

(8.7)

for the initial condition *y*(0) = 0 on the interval [0.0.2].

**Solution:** In order to select *h*, compute the
solution for *x *= 0.1 with *h* = 0.1 as well as with *h *= 0.05.

For *h* = 0.1, one finds

Hence

The next table presents the calculation of *y*(0.1) using *h* = 0.05:

Since the obtained result is within the specified accuracy, continue the computations both with *h* = 0.1
and *h* = 0.2. The next two tables present the further computations.

A comparison of the results for *h* =0.1 and *h* = 0.2 shows that y(0.2) ~ 0.014158 is accurate
within 5?10^{-6} and that for further computations the step length *h* can again be doubled.

**Solving (8.7) using ****h ****= 0.1**

**Solving (8.7) using h = 0.2**

**Note:** The **Runge-Kutta
method** can also be used for the solution of systems of differential equations and higher order
differential equations after reduction to systems of first order equations.

**Example 3:** Use the **Runge-Kutta
method** to compute a table of values of the solutions of the system of differential equations

(8.8)

for the initial conditions *x*(0) = 2, *y*(0) = 1, *z*(0) =1 for the interval [0,0.3] with *h*
= 0.1.

**Solution:** The calculations are presented in the next
table, where *f*_{1} = -2*x* + 5*z*, *f*_{2} = -(1 - sin *t*)*x - y + *3*z,
f*_{3} = -*x + *2*z.*

Use the **Runge-Kutta method**
with *h = *0.2 to solve the following differential equations and systems of differential equations for the given intervals
[*a*,*b*].

**1.**