International Journal of Computational Engineering Research(IJCER) is an intentional online Journal in English monthly publishing journal. This Journal publish original research work that contributes significantly to further the scientific knowledge in engineering and Technology
International Journal of Computational Engineering Research (IJCER)
1. International Journal of Computational Engineering Research||Vol, 03||Issue, 7||
||Issn 2250-3005 || ||July||2013|| Page 30
On The Stability and Accuracy of Some Runge-Kutta Methods of
Solving Second Order Ordinary Differential Equations
S.O. Salawu1
, R.A. Kareem2
and O.T. Arowolo3
1
Department of Mathematics, University of Ilorin, Ilorin, Nigeria
2,3
Department of Mathematics, Lagos State Polytechnic, Ikorodu, Nigeria
I. INTRODUCTION.
Solutions to Differential equation have over the years been a focus to Applied Mathematics. The
question then becomes how to find the solutions to those equations. The range of Differential Equations that can
be solved by straight forward analytical method is relatively restricted [12]. Even solution in series may not
always be satisfactory, either because of the slow convergence of the resulting series or because of the involved
manipulation in repeated stages of differentiation [9].Runge-Kutta methods are among the most popular ODE
solvers. They were first studied by Carle Runge and Martin Kutta around 1900. Modern developments are
mostly due to John Butcher in the 1960s [4]. The Runge-Kutta method is not restricted to solving only first-
order differential equations but Runge-Kutta methods are also used to solve higher order ordinary differential
equations or coupled (simultaneous) differential equations [14]. The higher order equations can be solved by
considering an equivalent system of first order equations. However, it is also possible to develop direct single
steps methods to solve higher order equation.
Definition: We define an explicit Runge-Kutta method with n slopes by the following equations [10].
yyxfy ,, bxx ,0
1
n
i
iinnn
kryhyy
1
1
2
j
i
nijnnnj
k
h
c
yqhyhqyhqxf
h
k
1
1
212
22
2
,,
!2
3
Where nij
rrrnjia ........,,,1, 21
are arbitrary.
ABSTRACT.
This paper seeks numerical solutions to second order differential equations of the form
yyxfy ,, with initial value, 00
yxy , 00
yxy using different Runge-Kutta methods
of order two. Two cases of Explicit Runge-Kutta method were derived and their stability was
determined, this is then implemented. The results were compared with the Euler’s method for accuracy.
KEYWORDS. Euler’s Method, Ordinary Differential Equation, Runge-Kutta method, Stability and
Taylor series
2. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 31
II. DERIVATION OF SECOND ORDER RUNGE-KUTTA METHOD.
To derive the Runge-Kutta methods for second order ordinary differential equation of the form
yyxfy ,, with the initial condition, 00
yxy , 00
yxy .
Let us define
nnn
yyxf
h
k ,,
!2
2
1
1.2
1
21
12122
2
2
,,
!2
k
h
c
ykqyhqyhqxf
h
k nnnn
2.2
22111
krkryhyy nnn
3.2
22111
1
krkr
h
yy nn
4.2
Where ,,,,,, 12121212
rrrbqq and 2
r are arbitrary constants to be determined. Using Taylor series expansion
form equation 3.2 and 4.2 gives.
...
!4!3!2
432
1
iv
nnnnnn
y
h
y
h
y
h
yhyy 5.2
...
!3!2
32
1
n
iv
nnnn
y
h
y
h
yhyy 6.2
nnnn
xyxyxfy ,, 7.2
nyyxn
fffyfy 8.2
nyyyxyyxyyxyyyyynxx
iv
n
fffffyffffffyffyfffyfy ]222[
22
9.2
We re-write equations 7.2 , 8.2 and 9.2 as
nn
fy
nn
Dfy
ynnyn
iv
n
ffDfffDy
2
Where
y
f
y
y
x
D nn
So, equations 5.2 and 6.2 becomes
3. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 32
...
!4!3!2
2
432
1
ynnynnnnnn
ffDfffD
h
Df
h
f
h
yhyy 10.2
...
!3!2
2
32
1
ynnynnnnn
ffDfffD
h
Df
h
hfyy 11.2
Simplifying 2
k , we have
3
212
2
2
2
21
22
2
2
2
2
21222
2
2
4
1
!2
2
12
hOffcqfyqfcfyqfq
h
ffcfyqfqhf
h
k
ynxynyyyynxx
ynynxn
3
21
2
2
4
2
32
2
422
hOffqDfq
h
Dfq
h
f
h
k ynnnn
12.2
Where we have used 212
2
1
cq 13.2
The substitution of 1
k and 2
k in equation 3.2 and 4.2 yield
5
212
22
22
4
22
3
21
2
1
422
hOffqrfDqr
h
Dfrq
h
frr
h
yhyy ynnnnnnn
14.2
4
212
22
22
3
22
2
211
422
hOffqrfDqr
h
Dfrq
h
frr
h
yy ynnnnnn
15.2
We compare the coefficient of equations 14.2 and 15.2 with equations 10.2 and 11.2 .to obtain.
121
rr , 221
rr ,
3
1
22
rq , 122
rq 16.2
The coefficient of
4
h in 1n
y and
3
h in 1
n
y of equations 14.2 and 15.2 will not match with the
corresponding coefficients in equation 10.2 and 11.2 for any choice of 2212
,, rqq and 2
r . Thus the local
truncation error is 4
hO in y and 2
hO in y . A solution of equation 12.2 and 16.2 may be
considered for different values of 1
r . Here we consider two cases of 1
r .
Case I:
2
1
1
r
Then, from equation 16.2 , we get
2
1
2
r , 212
3
2
qq ,
3
4
21
b ,
2
1
1
r ,
2
3
2
r
If the function f is independent of y then we can construct a Runge-Kutta method in which the local
truncation error in y and y is 4
hO . Here we obtain,
4. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 33
121
rr , 221
rr ,
3
1
22
rq , 122
rq ,
3
2
2
2
2
rq ,
3
2
221
rq
with the solution
2
1
1
r ,
3
2
2
q ,
2
1
1
q ,
2
1
1
r ,
2
3
2
r
Thus, the Runge-kutta method for the second order initial value problem
yyxfy ,, with initial value, 00
yxy , 00
yxy
Thus from equation 1.2 , 2.2 , 3.2 and 4.2 we have
nnn
yyxf
h
k ,,
!2
2
1
,
11
2
2
3
4
,
9
4
3
2
,
3
2
!2
k
h
ykyhyhxf
h
k nnnn
17.2
)(
2
1
211
kkyhyy nnn
, 211
3
2
1
kk
h
yy nn
18.2
Case II: 01
r
From equation 16.2 , we have
9
1
,
3
2
,1,1,
3
1
,1 21211222
qbrrqr
Therefore,
nnn
yyxf
h
k ,,
!2
2
1
,
11
2
2
3
2
,
9
1
3
1
,
3
1
!2
k
h
ykyhyhxf
h
k nnnn
19.2
21
kyhyy nnn
, 211
1
kk
h
yy nn
20.2
The two methods derived are explicit second order Runge-Kutta.
III. STABILITY ANALYSIS.
While numerically solving an initial value problem for ordinary differential equations, an error is
introduced at each integration step due to the inaccuracy of the formula. Even when the local error at each step
is small, the total error may become large due to accumulation and amplification of these local errors. This
growth phenomenon is called numerical instability [11].
We shall discuss the stability of the Runge-Kutta method in 18.2 and 20.2
Let us consider the differential equation
yy 1.3
Subject to initial condition
00
yxy , 00
yxy , bxx ,0
Where is a real number
5. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 34
We shall consider the case 2
k and 2
k while 0 give a trival solution. Recall that the second
order ordinary differential equation is of the form yyxfy ,,
Then, y
h
k
2
2
1
from equation 1.3
Substitute this 1.3 in equation 17.2 , we have
n
y
h
k
2
2
1
, nn
y
h
y
hh
k
392
3
2
42
2
2.3
Substituting the equation 2.3 into equation 18.2 , we
have nnn
y
h
hy
hh
y
6182
1
3
2
42
1
,
nnn
y
h
y
h
hy
2
1
6
2
2
3
1
3.3
Let us now consider the case when
2
k . The solution in this case is oscillating.
We, therefore consider the eigenvalues of the matrix
2221
1211
qq
qq
which is given by
2
4
2
1
2112
2
22112211
qqqqqq
If 21
, , then
2
4
,
2
1
2112
2
22112211
21
qqqqqq
4.3
To determine the value of ,,, 211211
qqq and 22
q , we consider
n
n
n
n
y
y
qq
qq
y
y
2221
1211
1
1
5.3
We can re-write equation 5.3 as
nnn
yqyqy 12111
nnn
yqyqy 22211
6.3
when
2
k we have
6. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 35
2
2
22
4
3
2
21
2
3
12
4
4
2
2
11
2
1,
6
,
6
,
182
1 k
h
qk
h
hkqk
h
hqk
h
k
h
q 7.3
Substituting equation 7.3 in 4.3 , we have
2
1
224466
244
22
21
129643236
1818
2
2
1
, khkhkh
hkkh
kh
2
1
22224422
244
22
21
244044737.4
1818
2
2
1
, khkhkh
hkkh
kh
Where 779763.15 and 5467418.6
Computing 1
and 2
as functions of
22
kh , we find that the roots have unit modulus .44.40
22
kh
Thus, the stability interval of the Runge-Kutta method 18.2 is .44.40
22
kh which also show that is of
order 2.
For 2
k , the solutions of 1.3 are exponential in nature and can be written in the matrix form as
0
00
y
y
e
xy
xy bxx
n
n
And
0
10
2
k
b for point ,0 n
xnhxx this solution becomes
0
0
442243
2
234422
.....
242
1..........
6
......
6
.....
242
1
y
y
khkhkh
hk
kh
h
khkh
xy
xy
n
n
And then,
4
4
2221
1211
4
0
24
1
0
0
72
1
1
lim
k
k
qq
qq
e
h
bh
h
The relative error for the method under discussion in case of a large number of integration interval (large x,
small h) are to be considered.
The maximum eigenvalue of the matrix.
7. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 36
2
1
6
6182
1
2243
2
234422
khkh
hk
kh
h
khkh
Is obtained as
2
1
2112
2
22112211
4
2
1
qqqqqq
...
36
1
6
1
2
1
1
443322
khkhkhhk
And therefore the relative error is given by
33
72
1
1log
1logloglog
kh
e
hh
e
h
hk
F
hkhk
We shall now consider the stability of the Runge-Kutta method 20.2 using differential equation 1.3 .
Equation 19.2 becomes
n
y
h
k
2
2
1
, nn
y
h
y
hh
k
6362
3
2
42
2
8.3
Substituting the equation 9.3 into equation 21.2 , we have
nnn
y
h
hy
hh
y
6362
1
3
2
42
1
, nnn
y
h
y
h
hy
6
1
36
2
2
3
1
9.3
We now consider the case when
2
k . The eigenvalues is given by
2
1
224466
24422
21
5184115248
36363
2
2
1
, khkhkh
hkkhkh
2
1
22224422
24422
21
2688510232.5
36363
2
2
1
, khkhkh
hkkhkh
Where 15574488.21 and 23461232.26
Computing 1
and 2
as functions of
22
kh , the roots have unit modulus 69.50
22
kh Thus, the stability
interval of the Runge-Kutta method 21.2 is 69.50
22
kh and is of order 2.
For
2
k , the solutions of 1.3 are exponential in nature as above in case I.
8. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 37
The maximum eigenvalue of the matrix.
6
1
36
6362
1
2243
2
234422
khkh
hk
kh
h
khkh
Is obtained as
2
1
2112
2
22112211
4
2
1
qqqqqq
...
72
1
6
1
3
1
1
443322
khkhkhhk
The relative error is given by
33
108
1
1log
1logloglog
kh
e
hh
e
h
hk
F
hkhk
IV. IMPLEMENTATION OF THE METHOD.
Consider the initial value problem [13]
xyy Subjected to initial condition 1.0,20,10 hyy 1.4
The complementary solution is
x
c
BeAy and the particular solution gives xxy p
2
2
1
Using the
initial condition, we have 2A and 3B
The general solution become
xxey
x
2
2
1
32
Numerical solutions are preferred to the derived cases I and case II of explicit second order Runge-Kutta method
of the IVP in 1.4 , obtaining numerical solutions for values of x up to and including 1x with a step size of
0.1 as found in Table 1 and Table 2.
Table1: Solutions of case I second ordered Runge-Kutta methods with 1.0h
X Numerical solution y(x) Analytical solution Y(x) Absolute Error
0 1.000000000 1.000000000 0.000000000
0.1 1.210500000 1.210512754 1.288
5
10
0.2 1.444127500 1.444208274 8.08
5
10
0.3 1.704360888 1.704576424 2.16
4
10
0.4 1.995043782 1.995474094 4.30
4
10
0.5 2.320423378 2.321163813 7.40
4
10
0.6 2.685192833 2.686356400 1.16
3
10
0.7 3.094538080 3.096258121 1.72
3
10
0.8 3.554189578 3.556622784 2.43
3
10
9. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 38
0.9 4.070479483 4.073809330 3.33
3
10
1.0 4.650404829 4.654845484 4.44
3
10
Figure 1:
Table2: Solutions of case II second ordered Runge-Kutta methods with 1.0h
X Numerical solution y(x) Analytical solution Y(x) Absolute Error
0 1.000000000 1.000000000 0.000000000
0.1 1.210500000 1.210512754 1.28 5
10
0.2 1.443075833 1.444208274 1.13 3
10
0.3 1.700988542 1.704576424 3.59 3
10
0.4 1.987830710 1.995474094 7.64 3
10
0.5 2.307560166 2.321163813 1.36 2
10
0.6 2.664537116 2.686356400 2.18 2
10
0.7 3.063565056 3.096258121 3.27
2
10
0.8 3.509935837 3.556622784 4.67
2
10
0.9 4.009479314 4.073809330 6.43 2
10
1.0 4.568618045 4.654845484 8.62
2
10
Figure 2:
Euler’s method
Euler’s method is one of many methods for generating numerical solutions to differential equations.
Besides, most of the other methods that might be discussed are refinements of Euler’s method. This method is
implemented and compared its accuracy and the error with the method in section 4.
The Euler’s method generalized in the form [11].
nnnnn
yyxhfyy
,,1
1.5
nnnnn
yyxhfyy
,,1
2.5 Consider the initial value problem in equation 1.4
xyy
Subjected to initial condition
1.0,20,10 hyy
Table3: Solutions of Euler’s methods with 1.0h
X Numerical solution y(x) Analytical solution Y(x) Absolute Error
0 1.000000000 1.000000000 0.000000000
0.1 1.200000000 1.210512754 1.05
2
10
0.2 1.430000000 1.444208274 1.42
2
10
0.3 1.693000000 1.704576424 1.16
2
10
0.4 1.992300000 1.995474094 7.25
3
10
0.5 2.331530000 2.321163813 1.04
2
10
0.6 2.714680000 2.686356400 2.83
2
10
0.7 3.146145000 3.096258121 4.99
2
10
0.8 3.630756500 3.556622784 7.41
2
10
0.9 4.173829150 4.073809330 1.00
1
10
10. On The Stability And Accuracy Of Some…
||Issn 2250-3005 || ||July||2013|| Page 39
1.0 4.781209065 4.654845484 1.26 1
10
Figure 3:
V. CONCLUSION.
Investigation carried out on some explicit second ordered Runge-Kutta method in this paper has shown
that the stability interval of the Runge-Kutta method in case I is 44.40
22
kh and the stability interval of
the Runge-Kutta method in case II is 69.50
22
kh . It is clear that case I is more stable than case II of the
derived Runge-Kutta methods. The two methods are shown to be accurate, efficient and general in application
for sufficiently solution of xy . The result obtained in the present work demonstrate the effectiveness and
superiority for the solution of second order ordinary differential equation which gave a very high accuracy when
compared with exact solution.
REFERENCE.
[1] Autar Kaw, Runge-Kutta Second Order Method for Ordinary Differential
Equations. University of South Florida; Holistic Numerical methods Institute, 2013.
[2] Buck R.C. and Buch E.F., Introduction to Differential Equation; Honghton Mifflin
Company, 1976
[3] Butcher J.C., Numerical Methods for Ordinary Differential Equations; John Wiley
and sons, New York, 2003.
[4] [Butcher John, Runge-Kutta Methods for Ordinary Differential Equations; COE
Workshop on Numerical Analysis Kyushu University, 2005.
[5] Christopher P. Grant, Theory of Ordinary Differential Equations; Brigham Young
University.
[6] Corliss G. and Kirlinger, On Implicit Taylor Series methods for Stiff Ordinary
Differential Equation; Centre for Research on Parallel Computation, Rice University Houston, 1991.
[7] Curtis F.G. and Patrick O.W., Applied Numerical Analysis; Addison Wesley
Publishing Company, 1989.
[8] Greenspan D., Theory and Solutions of Ordinary Differential Equations; The
MacMillan Company, New York, 1960.
[9] Iserles A., Numerical Analysis for Ordinary Differential Equations; Cambridge
University Press Cambridge, 1996.
[10] Jain M.K., Numerical Solution of Differential Equations, Wiley Eastern Limited.
[11] Joe D. Hoffman, Numerical Methods for Engineers and Scientists; marcel Dekker
Inc, 2001.
[12] Recktenwald G., Numerical Integration of ODEs for Initial Value Problems.
Department of Mechanical engineering, Portland State University. 2006.
[13] Okunnuga S.A. and Akanbi M.A., Computational Mathematics; A First Course.
Wim Publication Lagos Nigeria, 2003.
[14] Patil P.B. and Verma U.P. Numerical Computational Methods, Narosa Publishing House, New Delhi.