Numerical methods for first order differential equations 475
The percentage error in the Runge-Kutta method
when, say,x= 1 .6is:
(
5. 348811636 − 5. 348817
5. 348811636
)
×100%=− 0 .0001%From Problem 6, page 469, when x=1.6, the per-
centage error for the Euler method was 0.688%, and
for the Euler-Cauchy method−0.048%. Clearly, the
Runge-Kutta method is the mostaccurate of the three
methods.
Now try the following exercise
Exercise 186 Further problemson the
Runge-Kutta method- Apply the Runge-Kutta method to solve the
differential equation:
dy
dx= 3 −y
xfor the range
1.0(0.1)1.5, given that the initial conditions
thatx=1wheny=2.
[see Table 49.19]Table 49.19
n xn yn
0 1.0 2.01 1.1 2.1045452 1.2 2.216667
3 1.3 2.3346154 1.4 2.4571435 1.5 2.533333- Obtain a numerical solution of the differential
equation:
1
xdy
dx+ 2 y=1 using the Runge-
Kuttamethod in the rangex=0(0.2)1.0, given
the initial conditions thatx=0wheny=1.
[see Table 49.20]Table 49.20
n xn yn0 0 1.01 0.2 0.9803952 0.4 0.9260723 0.6 0.848838
4 0.8 0.7636495 1.0 0.6839523.(a) The differential equation:dy
dx+ 1 =−y
x
has the initial conditions that y=1at
x=2. Produce a numerical solution of the
differential equation, correct to 6 decimal
places, using the Runge-Kutta method in
the rangex=2.0(0.1)2.5
(b) If the solution of the differential equa-
tion by an analytical method is given by:y=4
x−x
2determine the percentage error
atx=2.2
[(a) see Table 49.21 (b) no error]Table 49.21
n xn yn
0 2.0 1.01 2.1 0.8547622 2.2 0.718182
3 2.3 0.5891304 2.4 0.4666675 2.5 0.340000