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
x
for 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.0
1 1.1 2.104545
2 1.2 2.216667
3 1.3 2.334615
4 1.4 2.457143
5 1.5 2.533333
- Obtain a numerical solution of the differential
equation:
1
x
dy
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 yn
0 0 1.0
1 0.2 0.980395
2 0.4 0.926072
3 0.6 0.848838
4 0.8 0.763649
5 1.0 0.683952
3.(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
2
determine the percentage error
atx=2.2
[(a) see Table 49.21 (b) no error]
Table 49.21
n xn yn
0 2.0 1.0
1 2.1 0.854762
2 2.2 0.718182
3 2.3 0.589130
4 2.4 0.466667
5 2.5 0.340000