Content uploaded by Abdulrganiyu Abdulrahman
Author content
All content in this area was uploaded by Abdulrganiyu Abdulrahman on Feb 20, 2023
Content may be subject to copyright.
Content uploaded by Abdulrganiyu Abdulrahman
Author content
All content in this area was uploaded by Abdulrganiyu Abdulrahman on Mar 26, 2019
Content may be subject to copyright.
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
Comparison of Euler and Range-Kutta methods in solving ordinary differential
equations of order two and four
David I. LANLEGE1*, Rotimi KEHINDE1, Dolapo A. SOBANKE1, Abdulrahman
ABDULGANIYU2, and Umar M. GARBA2
1Department of Mathematical Science, Federal University Lokoja P.M.B 115 Lokoja Kogi
State, Nigeria.
2 Department of Mathematics/Computer Science, Ibrahim Badamasi Babangida University
Lapai P.M.B 11 Lapai Niger State, Nigeria.
E-mail(s): loislanlege@yahoo.com (DIL); kennyrot2000@yahoo.com (REK);
garbaumar49@yahoo.com (UMG)
* Corresponding author, phone: +2348030528667, +2348131235684
Abstract
The purpose of this to produce efficient numerical methods with the same
order of accuracy as that of the main starting values for exact solutions of
fourth order differential equation without reducing it to a system of first order
differential equations. The methods of the differential systems arising from
the approximate solution to the problem are adopted using the Runge-Kutta
method and stages. The methods were compared and contrasted based on the
results obtained. The comparison shows that Euler method gives accurate
approximate result than Runge-Kutta method. After the derivation of the
formulae of O(h2), the comparison was done in regards to identify the formula
with higher accuracy.
Keywords
Numerical Analysis; Numerical Approximation; Exact Solution; Accuracy;
Runge-Kutta and Euler
10
http://ljs.academicdirect.org/
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
Introduction
Numerical analysis is a branch of mathematics that deals with the study of methods
and procedures used to obtain approximate solutions to mathematical problems. EndreSull
and David Mayer defined the numerical analysis as a branch of mathematics that provides the
theoretical foundation for the numerical algorithm we rely on to solve a multitude of
computational problem in mathematical models or the study of algorithms that use numerical
approximation (as opposed to general symbolic manipulations) for the problems of
mathematical analysis [1]. Numerical analysis naturally finds applications in all fields of
engineering and the physical science, but in this 21st century, the life science and even the arts
have adopted elements of scientific computations [2].
The overall goals of the field of numerical analysis in the design and analysis of
techniques to give approximate but accurate solution are hard to get. It is therefore, important
to be able to estimate the error involved in such approximation. Thus, the aims of this work
was to compare between Euler and Runge-Kutta methods to a rigorous analysis in order to
demonstrate the efficiency of the methods to other similar techniques. It was also examine the
effect of the steps on the accuracy of the techniques.
Euler’s method is more preferable than Runge-Kutta method because it provides
slightly better results. Its major disadvantage is the possibility of having several iterations that
result from a round-error in a successive step.
Secularity band differences in the results of some numerical methods with the standard
Euler’s method of order three and four was examined.
Material and method
Euler method
In mathematics and computational science, the Euler method is a first-order numerical
procedure for solving ordinary differential equation (ODEs) with a given initial value. It is the
most basic explicit method of numerical integration of ordinary differential equation and is
11
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
the simplest Runge-Kutta method. The Euler method is named after Leonhard Euler (1707)
[3].
Two approaches named standard Euler method and modified Euler method are known.
Standard Euler method
The standard Eular method which is the first order Runge-Kutta method was derive by
Leonarhd Euler (1707-1783) [4].
Consider the initial value problem, the first order
() () ()
00
';,, yxyyxfyxy == (1)
where is the first order differential equation;
'
y
(
)
yxf ,
0
x
is the function of x and y; is the
solution to the differential equation in equation (1) at given as ; is the value of y
obtained at and is the point for which y is obtained as
y
0
y0
y
0
x0
x0
y
() ()
()
(
)
!3!2!1
3
0
'''
2
0
''
0
'
0
xxyxxyxxy
yxy −
+
−
+
−
+= (2)
Thus,
() ( )
hxyxy += 01 (3)
()()
()
(
)
(
)
(
)
!
...
!3!2!1
00
'''3
0
''2
0
'
00 N
xyhxyhxyhxhy
xyhxy NN
++++=+ (4)
Let
1=n
() () ()
0
'
01 xhyxyxy += (5)
equation (5) is the same as
(
0001 ,yxhfyy +=
)
)
)
(6)
()
1112 ,yxhfyy += (7)
(
2223 ,yxhfyy += (8a)
(
nnnn yxhfyy ,
1+=
+ (8b)
Equation (8b) is known as standard Euler method.
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
Modified Euler method
This method is a second order Runge-Kutta [5]. The convergence in this method is
higher due to a higher degree of accuracy as compared to the standard Euler.
()( )
[
111 ,
2
1
+++ +++= nnnnnn yxfyxhfyy
]
(9)
DERIVATION:
Considering the Taylors series of
(
)
1+n
xy about h given by
()()
!
...
!3!2!1
'''3''2'
00 N
yhyhyhhy
xyhxy n
n
N
nnn ++++=+ (10)
Truncating when
2=n
()
!2!1
''2' nn
nn
yhhy
yxy ++= (11)
From the definition of derivatives
(
nnn yxfy ,
'=
)
(12)
(
)
()
()()
(
)
∗
∗∗
∗
∗
−++=
−+
≅h
yxf
hxyhxf
h
xyhxhy
ynn
nn
nn
n
,
,
''
'' (13)
Thus,
(
)
(
nnnn yxfhyhxy ,
∗∗ +=+
)
(14)
()()
(
)
∗
∗∗ −++≅ h
yxf
hxyhxfy nn
nnn
,
,
'' (15)
Substitute and into equation (6):
''
n
y y'
n
()
()()
()
⎟
⎠
⎞
⎜
⎝
⎛−++
++=
∗
∗∗
+
h
yxf
hxyhxf
h
yxhfyy
nn
nn
nnnn ,
,2
,2
1 (16)
Let
ahh =
∗ (17)
Then we have
()
(
)
(
)
⎟
⎠
⎞
⎜
⎝
⎛++
++=
+ah
yxahfyahxf
h
yxhfyy nnnn
nnnn
,,
2
,2
1 (18)
() ()()()()
nnnnnnnnnn yxfyxahfyahxf
a
h
yxhfyy ,,,
2
,
1−++++=
+ (19)
13
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
() ()()()
⎟
⎠
⎞
⎜
⎝
⎛−++++=
+nnnnnnnnnn yxf
a
h
yxahfyahxf
a
h
yxhfyy ,
2
,,
2
,
1 (20)
() () ()()()
nnnnnnnnnn yxahfyahxf
a
h
yxf
a
h
yxhfyy ,,
2
,
2
,
1+++−+=
+ (21)
() ()()()
nnnnnnnn yxahfyahxf
a
h
a
h
yxhfyy ,,
22
1,
1+++
⎟
⎠
⎞
⎜
⎝
⎛−+=
+ (22)
Equation (22) can be written as
22111 kckcyy nn
+
+=
+ (23)
where
⎟
⎠
⎞
⎜
⎝
⎛−= a
hc 2
1
1
1 (24)
⎟
⎠
⎞
⎜
⎝
⎛
=a
hc 2
1
2 (25)
(
nn yxfk ,
1=
)
)
(26)
(
12 ,ahkyahxfk nn ++= (27)
Let
2
1
=a (28)
()
011
2
1
2
1
1
1=−=
⎟
⎟
⎟
⎟
⎠
⎞
⎜
⎜
⎜
⎜
⎝
⎛
−= hhc (29)
h
h
c=
⎟
⎟
⎟
⎟
⎠
⎞
⎜
⎜
⎜
⎜
⎝
⎛
⎟
⎠
⎞
⎜
⎝
⎛
=
2
1
2
2 (30)
(
nn yxfk ,
1=
)
(31)
⎟
⎠
⎞
⎜
⎝
⎛++= 12 2
1
,
2
1hkyhxfk nn (32)
Hence,
⎟
⎠
⎞
⎜
⎝
⎛+++=
+11 2
1
,
2
1hkyhxhfyy nnnn (34)
OR
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
()(
[
111 ,
2
1
+++ +++= nnnnnn yxfyxhfyy
)
]
(35)
Runge-Kutta method
The Runge-Kutta method is also a second order Runge-Kutta Method using Taylors
series expansion to derive it, like modified Euler’s method [6].
From equation (22)
() ((()
nnnnnnnn yxahfyahxf
a
h
a
h
yxhfyy ,,
22
1,
1+++
⎟
⎠
⎞
⎜
⎝
⎛−+=
+
))
(36)
Equation (36) can be written as
22111 kckcyy nn
+
+=
+ (37)
where:
⎟
⎠
⎞
⎜
⎝
⎛−= a
hc 2
1
1
1 (38)
⎟
⎠
⎞
⎜
⎝
⎛
=a
h
c2
2 (39)
(
nn yxfk ,
1=
)
)
(40)
(
12 ,ahkyahxfk nn ++= (41)
Let
3
2
=a (42)
hhhhc 4
1
4
1
4
3
1
3
2
2
1
1
1=
⎟
⎠
⎞
⎜
⎝
⎛
=
⎟
⎠
⎞
⎜
⎝
⎛−=
⎟
⎟
⎟
⎟
⎠
⎞
⎜
⎜
⎜
⎜
⎝
⎛
−= (43)
4
3
3
2
2
2
hh
c=
⎟
⎟
⎟
⎟
⎠
⎞
⎜
⎜
⎜
⎜
⎝
⎛
⎟
⎠
⎞
⎜
⎝
⎛
= (44)
(
nn yxfk ,
1=
)
(45)
⎟
⎠
⎞
⎜
⎝
⎛++= 1nn2 hk
3
2
y,h
3
2
xfk (46)
15
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
() ((
1nnnnn1n ahky,ahxf
4
h3
y,xhf
4
1
yy ++++=⇒ +
))
(47)
211 4
3
4
1
:k
h
hkyyie nn ++=
+ (48)
(
211 3
4
:kk
h
yythus nn ++=
+
)
(49)
Third-stage Runge-Kutta method
The third-stage Runge-Kutta method express how formulations of k iterations are
obtained.
(
32101 4
6
1
:kkkyyie +++=
)
)
(50)
where
(
001 ,yxhfk = (51)
()
⎟
⎠
⎞
⎜
⎝
⎛++=++= 2
,
2
,1
0942002
k
y
h
xhfkkyhxhfk (52)
Equation (52) is the third order Runge-Kutta method with error of order h4.
Fourth-stage Runge-Kutta
One of the most frequently used of the Rung-Kutta family is the fourth order Runge-
Kutta method or the classical fourth order Runge-Kutta method [7]. This method is generally
superior to second order, its derivative is algebraically complicated and involves five
equations.
()
43211 22
6
1kkkkhyy nn ++++=
+
)
(53)
where:
(
nn yxhfk ,
1= (54)
⎟
⎠
⎞
⎜
⎝
⎛++= 12 2
1
,
2
1hkyhxhfk nn (55)
(
34 ,hkyhxhfk nn ++=
)
(56)
Other renowned mathematicians that worked on this method are Runge-Kutta-
Fehlberg and Runge-Kutta Nystrom.
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
Fehlberg’s fifth – order Rk methodis:
6655443322111 kkkkkkyy nn
α
α
α
α
α
α
+
+
+
+++=
+ (57)
where:
(
nn yxhfk ,
1=
)
(58)
⎟
⎠
⎞
⎜
⎝
⎛++= 12 4
1
,
4
1hkyhxhfk nn (59)
⎟
⎠
⎞
⎜
⎝
⎛+++= 213 12
9
32
3
,
8
3khkyhxhfk nn (60)
⎟
⎠
⎞
⎜
⎝
⎛+−++= 3214 2197
7296
2197
7200
2197
1932
,
13
12 kkhkyhxhfk nn (61)
⎟
⎠
⎞
⎜
⎝
⎛−+−++= 43215 4104
845
513
3680
8
2197
439
,kkkkyhxhfk nn (62)
⎟
⎠
⎞
⎜
⎝
⎛−+−+++= 543216 40
11
4109
1859
2565
3544
2
27
8
,
2
1kkkkhkyhxhfk nn (63)
A Finnish mathemathecian E.J. Nystron derived his own formular using the Runge-
Kutta method [8].
(
nn yxhfk ,
1=
)
(64)
⎟
⎠
⎞
⎜
⎝
⎛++= 12 4
1
,
4
1hkyhxhfk nn (65)
⎟
⎠
⎞
⎜
⎝
⎛+++= 213 6
25
1
,
3
2khkyhxhfk nn (66)
⎟
⎠
⎞
⎜
⎝
⎛+−++= 3214 1512
4
1
,
8
3kkhkyhxhfk nn (67)
()
⎟
⎠
⎞
⎜
⎝
⎛+−+++= 43215 850906
81
1
,
3
2kkkkhyhxhfk nn (68)
()
⎟
⎠
⎞
⎜
⎝
⎛+−+++= 43215 810366
5
1
,
5
4kkkkhyhxhfk nn (69)
Implementation of Euler method and Runge-Kutta method
The Euler and Runge-Kutta methods as previously deduced was used in this study to
solve differential equations.
17
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
Standard Euler method
From equation (8), we have the formula
(
nnnn yxhfyy ,
1+=
+
)
(70)
Consider the differential equations in equations (71 and 86) of the initial value
problem below:
(
)
3
:,10,1.0,10;3 2' x
eysolutionExactxhyyxy =≤≤=== (71)
Solution:
(
)
nnnn yxhfyy ,
1+=
+ (72)
where
() ()
10,1.0,10;3, 2' ≤≤==== xhyyxyyxf nnnn (73)
when 0=n
() ()()
01033, 2
0
2
900 === yxyxf
(
000 ,yxhfyy +=
)
)
)
)
)
(74)
()()
0000.101.01 =+= (75)
when
0=n
() ()()
03.011.033, 2
1
2
111 === yxyxf
(
1112 ,yxhfyy += (76)
()( )
00300.103.01.01 =+= (77)
when 0
=n
() ()( )
012036.000300.11.033, 2
1
2
222 === yxyxf
(
2223 ,yxhfyy += (78)
()(
12036.01.000300.1 +=
()(
12036.01.000300.1 += (79)
30127.1,17443.1,09249.1,09249.1,04245.1 76654
=
=
=
== yyyyy (80)
78437.2,14182.2,77913.1,49256.1,49256.1 1110988
=
=
=
== yyyyy (81)
Numerical illustration of exact solution for Example 1
The example below in equation (82) illustrates the application of exact solution for the
solution of differential equations
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
10,, 3
3≤≤== xeyey n
x
n
x (82)
If
0=n
1
0
0
3
0=== eey x (83)
when
0=n
() ( )
00100.1
001.01.0
1
3
3
1==== eeey x (84)
when
0=n
() ( )
00803.1
008.02.0
2
3
3
2==== eeey x (85)
⎭
⎬
⎫
===
=====
101098
76543
,71828.2,07301.2,66863.1
,40917.1,24110.1,13315.1,06609.1,02730.1
yyyy
yyyyy (86)
Consider the differential equation of the initial value problem:
(
)
10,1.0,20;
'≤≤==−= xhyxyy (87)
Exact solution
1++= xey x (88)
(
nnnn yxhfyy ,
1+=
+
)
(89)
where
()
2;, 0
'=−== yxyyyxf nnn (90)
when 0
=n
()
00000.202, 0000 =−=
−
=xyyxf
()()
(
)
20000.200000.21.02, 0001
=
+=+= yxhfyy (91)
when 1
=n
()
10000.21.020000.2, 1111
=
−
=
−
=xyyxf
()
(
)
(
)
41000.210000.21.020000.2, 1112
=
+
=+= yxhfyy (92)
when 2
=n
()
21000.22.041000.2, 2222
=
−
=
−
=xyyxf
()
(
)
(
)
61000.221000.21.041000.2, 2222
=
+
=+= yxhfyy (93)
()
(
)
(
)
41000.210000.21.020000.2, 2223
=
+
=+= yxhfyy (94)
64872.3,37156.3,11051.3,86410.2 7654
=
=
== yyyy (95)
19
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
95314.4,59376.4,25796.4,94360.3 111098
=
=
== yyyy (96)
Numerical illustration of exact solution for Example 2
Example 2 below in equation (97) is solved by finding the exact solution for the
solution of differential equations
10,1 ≤≤++= xxey x (97)
1
++= n
xxey n (98)
when
0=n
00000.211101 0
00 =+=++=++= exey n
x (99)
when 1
=n
()
20517.21.110517.111.01 1.0
11 1=+=++=++= exey x (100)
when 2
=n
()
42140.22.122140.12.112.01 2.0
22 2=++=++=++= exey x (101)
42212.3,14872.3,89182.2,64986.2 6543
=
=
== yyyy (102)
71828.4,35960.4,02554.4,371375 7987
=
=
== yyyy (103)
Modified Euler method
This is the second Euler’s method we are considering as deduced in equations (23-35)
and expressed as:
⎟
⎠
⎞
⎜
⎝
⎛+++=
+11 2
1
,
2
1hkyhxhfyy nnnn (104)
where
()
⎟
⎠
⎞
⎜
⎝
⎛++== 121 2
1
,
2
1
,, hkyhxfkyxfk nnnn (105)
21 hkyy nn +=
+ (106)
Let us consider the same differential equations in equations (72 and 87):
(
)
3
:,10,1.0,10;3 2' x
eysolutionExactxhyyxy =≤≤=== (107)
Solution
()
nnnnnn yxyxfhkyy 2
21 3,, =+=
+ (108)
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
0=n when
() ()
(
)
00000.01033, 2
0
2
0001 ==== yxyxfk
()
()( ) ()
1,05.0
00000.01.02
1
.1.0
2
1
0
2
1
,
2
1
1002 ffhkyhxfk =
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛+=
⎟
⎠
⎞
⎜
⎝
⎛++=
()()()
00750.0105.031,05.0 2
2=== fk
()( )
00075.100075.100750.01.01
21 0
=
+
=
+=+=
+hkyy nn (109)
when 1=n
() ()
(
)
03002.000075.11.033, 2
1
2
1111 ==== yxyxfk
2=n when
()( ) ( )
00251.1,15.000075.1,1.0
2
1
1.0
2
1
,
2
1
1112 ffhkyhxfk =
⎟
⎠
⎞
⎜
⎝
⎛+=
⎟
⎠
⎞
⎜
⎝
⎛++=
()()
(
)
06753.000251.115.0300251.1,15.0 2
2=== fk
()
(
)
00750.106753.01.000075.1
212
=
+
=
+= hkyy (110)
when 2
=n
() ()
(
)
12090.000750.12.033, 2
2
2
2221 ==== yxyxfk
()( ) ()( )
()
00251.1,15.0=
=
12090.01.02
1
+075.1,1.0
2
1
+2.0=
=
2
1
+,
2
1
+= 1222
f
f
hkyhxfk
()()
(
)
76016.001255.125.0301355.1,25.0 2
2=== fk
()
(
)
08352.176016.01.000075.1
222
=
+
=
+= hkyy
4766.1,30259.1,19050.1,12076.1 7654
(111)
1
=
== yyyy
88412.3,81384.2,15842.2,74410.1 111098
=
=
== yyyy
Numerical illustration of Exact solution for Example 1
Applyi blem in example 1 ng exact solution technique to show the solution of the pro
3
x
ey = (112)
10,, 3≤≤= xey n
x
n (113)
3
=ey x
21
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
when 0=n, 1
0
0
3
0=== eey x
when 1
=n
() ( )
00100.1
001.01.0
1
3
3
1==== eeey x (114)
(115)
when 1
=n
() ( )
00803.1
008.02.0
1
3
3
2==== eeey x
71828.2,07301.2,66863.1
1,06609.1,02730.1
1098
543
===
=
==
yyy
yyy ,40917.1,24110.1,13315. 76
=
=
yy
Consider the differential equation:
(
)
0,1.0,20;
'≤==−= xhyxyy 1≤ (116)
Solution
(117
1
yn=
+2
hkyn+
()
⎟
⎞
⎜
⎛++=− 12
1
,
1
,hkyhxfkxy nnnn (118)
⎠⎝
==
122
,yxfk nn
when 0
=n
()
202, 00001
=
−=−
=
=xyyxfk
() ()() ()
05.205.01.2
1.2,05.0
21.02
1
2,1.0
2
1
0
2
1
,
2
1
1002
=−=−=
=
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛++=
⎟
⎠
⎞
⎜
⎝
⎛++=
nn xy
ffhkyhxfk (119)
()( )
20500.205.21.02
201
=
+=+=
+hkyyn (120)
when 1=n
()
10500.21.020500, 11111
=
−
=−
=
=xyyxfk (121)
() ()( )
16025.2=15.031025.2==
20500.21.02
1
+20500.2,1.0
2
1
+1.0=
2
1
+,
2
1
+= 1112
nn xy
fhkyhxfk
()
3102.2,15.0=f (122)
()
(
)
42103.216025.21.020500.2
212
=
+
=
+= hkyy (123)
when 2=n
()
22103.22.042103.2, 22221
=
−
=−
=
=xyyxfk (124)
() ()( ) ()
5320
8
.2,25.0=
⎟
⎟
⎞f
28208.225.053208.2
22103.21.02
1
42103.2,1.0
2
1
2.0
2
1
,
2
1
1222
=−=−=
⎠
⎜
⎜
⎝
⎛++=
⎟
⎠
⎞
⎜
⎝
⎛++=
nn xy
fhkyhxfk (125)
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
()( )
62821.228208.21.02
202
=
+
=
+= hkyy (126)
12147.5,37476.4,03960.4
,72671.3,4320.3,15991.3,89091.2
1098
7654
===
=
=
=
yyy
yyyy
Numerical illustration of exact solution for Example 2
Using exact solution approach to show the solution of the problem in example 2.
(127)
(128)
when
(129)
(130)
(131)
10,1 ≤≤+= xxey x+
1++ x
=n
x
ey n
0=n
()
00000.121101 0
00 0+=++=++= exey x
when 1=n
()
20517.21.110517.111.01 1.0
11 1=+=++=++= exey x
when 2=n
()
42140.22.122140.112.01 2.0
22 2=+=++=++= exey x
71828.4,35960.4,02554.4
,71375.3,42212.314872.3,89182.2,64986.2
1098
76543
===
=
=
=
==
yyy
yyyyy
Runge-Kutta method
From equation (49), Heun’s method formula is thus given as:
()
21
4
n13
1kkyyn++=
+ (132)
where:
()
⎟
⎠
⎞
++ 1
3
2
,
3
2hkyh n (133)
⎜
⎝
⎛
== 21 ,, xfkyxfk nnn
onsider the differential equation of the initial value problem
Exact solution
(135)
Solution
(136)
C.
()
10,1.0,10;3 2≤≤=== xhyyxy (134)
3
x
ey =
(
nnnn yxf ,
)
yx2
3=
23
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
0=n when
() ()
(
)
01033 2
0
2
01 === yxfk ,00 =yx (137)
() ()()
⎟
⎠
⎜
⎝
⎟
⎠
⎜
⎛++= 01.0333
2
,
3
2
1002 yhxfk ⎟
⎞
⎜
⎛++=
⎞1
1,1.0
2
0fhk (138)
⎝
()()
(
)
166667.031,66667.0 2
1=== fk 01335.0 (139)
() ()()
0010
0
. (140) 101335.030
4
1.0
133
422101 =++=+++= kkkf
h
yy
when 1=n
() ()
(
)
03003.000100.11.033, 2
1
2
1111 ==== yxyxfk (141)
() ()( )
⎟
⎟
⎠
⎞
2
⎜
⎜
⎝
⎛++=
⎟
⎠
⎞
⎜
⎝
⎛++= 03003.01.03
00100.1,1.0
3
2
1.0
3
2
,
3
2
1112 fhkyhxfk (142)
()()
(
)
00300.116667.0300300.1,16667.0 2
1=== fk 08359.0 (143)
() ()()
08359.03003003.0
4
1.0
00100.13
42112 ++=++= kkf
h
yy
(145)
When
(144)
00802.100702.000100.1
3=+=y
2=n
() ()
(
)
12096.000802.12.033, 2
1
2
2221 ==== yxyxf
k (146)
() ()( )
⎟
⎠
⎜
⎜
⎛
=
⎟
⎞
⎜
⎛++= 12096.01.033
2.0
2
,
2
2fhkyhxfk ⎟
⎞
++ 2
00802.1,1.0
2 (147)
⎝
⎠⎝ 33 122
()()
(
)
001608.126667.0301608.1,26667.0 2
1=== fk 21677. (148)
() ()()
21677.0312096.0
4
1.0
00802.13
42122 ++=++= kkf
h
yy
(150)
(149)
02730.101928.000802.1
3=+=y
58510.3,59376.2,98746.1,60456.1
,35754.1,19691.109345.1,06587.1
111098
7654
====
=
=
==
yyyy
yyyy
Numerical illustration of exact solution for Example 1
(151)
(152)
3
x
ey =
10,, 3
3≤≤== xeyey n
x
n
x
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
when
0=n
1
0
0
3
0=== eey x (153)
1=n when
()
1.0
1
3
3
1== eey x
( )
00100.1
001.0 == e (154)
when 2=n
() ( )
00803.1
008.02.0
1
3
3
2==== eeey x (155)
71828.2,07301.2,66863.1,40917.1
,24110.1,13315.106609.1,02730.1
987
6543
==== 10
=
=
==
yyyy
yyyy
Consider the differential equation of the initial value problem:
(
)
10,1.0,20;
'≤≤==−= xhyxyy (156)
Exact solution
1
3++= xey x (158)
Solution:
(
14
h
yy nn +=
+
)
22 3kk + (159)
()
⎟
⎠⎝ 33
⎞
⎜
⎛++=−== 12
'
1
2
,
2
,, hkyhxfkxyyyxfk nnnnnn (160)
when 0=n
()
202, 00001
=
−=−
=
=xyyxfk (161)
() ()()
⎟
⎟
⎠
⎞
⎜
⎜
⎛
=
⎟
⎞
⎜
⎛++ 2
,
2
100 fhkyhxf ⎝++
⎠⎝
=21.03
2
2,1.0
3
2
0
33
2
k (162)
()
06667.206667.013333.213333.2,06667.0
1
=
−
=
−
== nn xyfk
()
06.013333.213333.2,06667.0
1
(163)
06667.2667
=
−
=
−
== nn xyfk (164)
when 1=n
()
67000.11.077000.1, 11111
=
−
=−
=
=xyyxfk (165)
() ()( )
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛++=
⎟
⎠
⎞
⎜
⎝
⎛++= 7700.11.03
2
77000.1,1.0
3
2
1.0
3
2
,
3
2
1112 fhkyhxfk (166)
()
71466.216667.188133.188133.1,16667.1
1
=
−
=
−
== nn xyfk (167)
25
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
() ()(
9403.171466.1367000.1
4
1.0
77000.13
42111 =++=++= kk
h
yy
)
(168)
when 2=n
()
74035.12.094035.1, 22221
=
−
=−
=
=xyyxfk (169)
() ()( )
⎟
⎟
⎞
2 (170)
⎠
⎜
⎜
⎝
⎛++=
⎟
⎠
⎞
⎜
⎝
⎛++= 74035.11.03
94035.1,1.0
3
2
2.0
3
2
,
3
2
1222 fhkyhxfk
()
78970.226667.005637.205637.2,26667.0
1
=
−
=
−
== nn xyfk (171)
() ()()
1180.271466.1374035.1
4
1.0
94035.13
42122 =++=++= kk
h
yy (172)
92094.3,64567.3,38929.23,14777.3
,91970.2,70380.2,49891.280399.2
111098
7654
====
=
=
==
yyyy
yyyy
Numerical illustration of exact solution for Example 2
(173)
(175)
when
(176)
when
(177)
1++ x
3
=ey x
1 (174) ++= n
xxey n
when 0=n
0000.211101 0
00 0=+=++=++= exey x
1=n
()
20517.21.110517.111.01 1.0
10 1=+=++=++= exey x
1=n
()
42140.22.122140.112.01 2.0
22 2=+=++=++ exey x =
,42212.3,14872.389182.2,64986.2 6543
=
=
== yyyyy ,71375.3
7 (178)
=
71828.4,35960.4,02554.4 1098
=
== yyy
nalysis of Euler and Runge-Kutta methods
The Eu a rigorous analysis in order to
demon
(179)
A
ler and Runge-Kutta methods were compared by
strate the efficiency of the methods to other techniques. The effect of the steps on the
accuracy of the techniques was also examined.
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
The results obtained by solving some differential equations as considered in this paper
were analyzed based on the theory of comparison. This help towards bringing out the result
clearly for easy analysis and understanding of the established concept.
Results and Discussion
Standard Euler method
Table 1 showed that the results improved greatly when the standard Euler’s method
was used. The tables below show the summary of all the results for the methods in
consideration.
In comparing the two methods, we can see clearly that the Euler method is more
preferable than the Runge-Kutta, especially when many values of xn are required. If only a
few values of xn are needed, then the Runge-Kutta techniques is preferred to Euler method
because it gives slightly better results
Table 1. Solution for
(
)
10,1.0,10;3 2' ≤≤=== xhyyxy
N H f(xn, yn) yn+1 Exact solution Error
0 0.1 0 1.00000 1 0
1 0.1 0.03 1.00300 1.00100 0.002
2 0.1 0.12036 1.01504 1.00803 0.00701
3 0.1 0.27406 1.04245 1.02730 0.01515
4 0.1 0.50038 1.09245 1.06609 0.02636
5 0.1 0.81938 1.17443 1.13315 0.04128
6 0.1 1.26838 1.30127 1.24110 0.06017
7 0.1 1.91287 1.49256 1.40917 0.08339
8 0.1 2.86572 1.77913 1.66863 0.1105
9 0.1 3.62692 2.14182 2.07301 0.06881
10 0.1 6.42546 2.78437 2.71828 0.06609
27
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
Figure 1. Graph of Approximate solution of standard Euler compare to exact solution
Table 2. Solution for
(
)
10,1.0,20;
'≤≤==−= xhyxyy
N H f(xn, yn) yn+1 Exact number Error
0 0.1 2.00000 2.20000 2.0000 0.2
1 0.1 2.10000 2.41000 2.20517 0.20483
2 0.1 2.21000 2.61000 2.42140 0.1886
3 0.1 2.33100 2.86410 2.64986 0.21424
4 0.1 2.46410 3.11051 2.89182 0.21869
5 0.1 2.61051 3.37156 3.14872 0.22284
6 0.1 2.77156 3.64872 3.42212 0.2266
7 0.1 2.94872 3.94360 3.71375 0.22985
8 0.1 3.14360 4.25796 4.02554 0.23242
9 0.1 3.35796 4.59376 4.35960 0.23416
10 0.1 3.56376 4.95314 4.71828 0.23486
Figure 2. Graph of Approximate solution of standard Euler compared to exact solution
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
Modified Euler Method
The performance of the modified Euler method is presented in Table 3 and 4 and
graphically depicted in Figure 3 and 4.
Table 3. Solution for
(
)
10,1.0,10;3 2' ≤≤=== xhyyxy
N H f(xn, yn) yn+1 Exact number Error
0 0.1 0.00000 1.00075 2.0000 0.99925
1 0.1 0.03002 1.00750 2.20517 1.19767
2 0.1 0.12090 1.08352 2.42140 1.33788
3 0.1 0.29255 1.12076 2.64986 1.5291
4 0.1 0.53769 1.19050 2.89182 1.70132
5 0.1 0.89288 1.30259 3.14872 1.84613
6 0.1 1.40680 1.47661 3.42212 1.94551
7 0.1 2.17062 1.74410 3.71375 1.96965
8 0.1 3.34867 2.15842 4.02554 1.86712
9 0.1 5.24496 2.81384 4.35960 1.54576
10 0.1 8.44151 3.88412 4.71828 0.83416
Figure 3. Graph of Approximate solution of Modified Euler compared to exact
Table 4. Solution for
(
)
10,1.0,20;
'≤≤==−= xhyxyy
N H f(xn, yn) yn+1 Exact number Error
0 0.1 2 2.20500 1 1.205
1 0.1 2.10500 2.42103 1.00100 1.42003
2 0.1 2.22103 2.62821 1.00803 1.62018
3 0.1 2.34924 2.89091 1.02730 1.86361
4 0.1 2.49091 3.15991 1.06609 2.09382
5 0.1 2.65991 3.43420 1.13315 2.30105
6 0.1 2.83420 3.72671 1.24110 2.48561
7 0.1 3.02679 4.03960 1.40917 2.63043
8 0.1 3.23960 4.37476 1.66863 2.70613
9 0.1 3.47476 4.73461 2.07301 2.6616
10 0.1 3.73461 5.12147 2.71828 2.40319
29
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
Figure 4. Graph of Approximate solution of Modified Euler compared to exact solution
Runge-Kutta method
The performances of the Runge-Kutta method are presented in Table 5 and 6 and
graphically depicted in Figure 5 and 6.
Table 5. Solution for
(
)
10,1.0,10;3 2' ≤≤=== xhyyxy
N H f(xn, yn) yn+1 Exact number Error
0 0.1 0 1.00100 1 0.001
1 0.1 0.3003 1.00802 1.00100 0.00702
2 0.1 0.12096 1.02730 1.00803 0.01927
3 0.1 0.27737 1.06587 1.02730 0.03857
4 0.1 0.55162 1.09345 1.06609 0.02736
5 0.1 0.82009 1.19691 1.13315 0.06376
6 0.1 1.29266 1.35754 1.24110 0.11644
7 0.1 1.99558 1.60456 1.40917 0.19539
8 0.1 3.08076 1.98746 1.66863 0.31883
9 0.1 4.82953 2.59376 2.07301 0.52075
10 0.1 7.78129 3.58510 2.71828 0.86682
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
Figure 5. Graph of Approximate solution of Runge-kutta compared to exact solution
Table 6. Solution for
(
)
10,1.0,20;
'≤≤==−= xhyxyy
N H f(xn, yn) yn+1 Exact number Error
0 0.1 1 1.7700 2.0000 0.23
1 0.1 1.67000 1.94035 2.20517 0.26482
2 0.1 1.74035 2.11809 2.42140 0.30331
3 0.1 1.81809 2.80399 2.64986 0.15413
4 0.1 1.90399 2.49891 2.89182 0.39291
5 0.1 1.99891 2.70380 3.14872 0.44492
6 0.1 2.10380 2.91970 3.42212 0.50242
7 0.1 2.21970 3.14777 3.71375 0.56598
8 0.1 2.34777 3.38929 4.02554 0.63625
9 0.1 2.48929 3.645667 4.35960 0.71393
10 0.1 2.64567 3.92094 4.71828 0.79734
Figure 6. Graph of approximate solution of Runge-kutta compared to exact solution
31
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
Methods comparison
The performances of the methods for specific scenario are presented in Table 7 to 10
and graphically represented in Figure 7 to 10.
Table 7. Solution for
(
)
10,1.0,10;3 2' ≤≤=== xhyyxy
Runge-Kutta Standard Euler Modified Euler Exact Solution
1.001 1 1.00075 1
1.00802 1.003 1.0075 1.001
1.0273 1.01504 1.08352 1.00803
1.06587 1.04245 1.12076 1.0273
1.09345 1.09245 1.1905 1.06609
1.19691 1.17443 1.30259 1.13315
1.35754 1.30127 1.47661 1.2411
1.60456 1.49256 1.7441 1.40917
1.98746 1.77913 2.15842 1.66863
2.59376 2.14182 2.81384 2.07301
3.5851 2.78437 3.88412 2.71828
Figure 7. Comparison of Exact Solution, Standard Euler, Modified Euler and Runge-Kutta
methods
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
Table 6. Solution for
(
)
10,1.0,20;
'≤≤==−= xhyxyy
Runge-Kutta Standard Euler Modified Euler Exact Solution
1.77 2.2 2.205 1
1.94035 2.41 2.42103 1.001
2.11809 2.61 2.62821 1.00803
2.80399 2.8641 2.89091 1.0273
2.49891 3.11051 3.15991 1.06609
2.7038 3.37156 3.4342 1.13315
2.9197 3.64872 3.72671 1.2411
3.14777 3.9436 4.0396 1.40917
3.38929 4.25796 4.37476 1.66863
3.645667 4.59376 4.73461 2.07301
3.92094 4.95314 5.12147 2.71828
Figure 8. Comparison of Exact Solution, Standard Euler, Modified Euler and Runge-Kutta
methods
Table 9. Absolute Errors for
(
)
10,1.0,10;3 2' ≤≤=== xhyyxy
Runge-Kutta Standard Euler Modified Euler
0.001 0 0.99925
0.00702 0.002 1.19767
0.01927 0.00701 1.33788
0.03857 0.01515 1.5291
0.02736 0.02636 1.70132
0.06376 0.04128 1.84613
0.11644 0.06017 1.94551
0.19539 0.08339 1.96965
0.31883 0.1105 1.86712
0.52075 0.06881 1.54576
0.86682 0.06609 0.83416
33
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
Figure 9. Graph of Absolute Errors for Standard Euler, Modified Euler and Runge-Kutta
methods for
(
)
10,1.0,10;3 2' ≤≤=== xhyyxy
Table 10. Absolute error for
(
)
10,1.0,20;
'≤≤==−= xhyxyy
Runge-Kutta Standard Euler Modified Euler
0.23 0.2 1.205
0.26482 0.20483 1.42003
0.30331 0.1886 1.62018
0.15413 0.21424 1.86361
0.39291 0.21869 2.09382
0.44492 0.22284 2.30105
0.50242 0.2266 2.48561
0.56598 0.22985 2.63043
0.63625 0.23242 2.70613
0.71393 0.23416 2.6616
0.79734 0.23486 2.40319
Figure 10. Graph of absolute errors for Standard Euler, Modified Euler and Runge-Kutta
methods for
(
)
10,1.0,20;
'≤≤==−= xhyxyy
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
This research work has been carried out in order to compute direct solution of
numerical method for order four of ordinary differential equations without reducing it to the
system of first order differential equation through the application of both Euler and Runge-
Kutta methods. These methods sufficiently reduce computational efforts as well as provide
the accuracy needed in each result. It was analyzed from figures (1-10) and the percentage
errors as (0.991% and 4.902% from Tables 1 and 2 for standard Euler method), (33.360% and
46.477% from Tables 3 and 4 for Modified Euler method) and (4.322% and 9.948% from
Tables 5 and 6 for Runge-kutta method) which became necessary for a reasonable conclusion
to be made.
Generally, the aim of a good numerical differentiation is that such methods should
give better approximations to the true differentials. By the examples above, it shows that the
two methods produced better degrees of accuracy for ordinary differential equations of all
orders. But comparing the percentage errors, we discovered that Standard Euler method is
more accurate than Modified Euler [3, 10, 11] and Runge-Kutta methods for the examples
illustrated.
The exact solutions for both Euler and Runge-Kutta methods, whose values have the
same order of accuracy with the derived solutions, were not only formulated, also tested for
simplicity, efficiency and accuracy. We can conclude from the derivations above that the
Standard Euler’s method has a higher degree of accuracy than the Modified Euler’s method,
conclusion also supported by other studies [3, 10-15]. It is remarkable therefore to note that
all the examples illustrated are differential equations of order four and orders which are less
than four. This, to a large extent, reduces the effect that global error could have on the
accuracy of the methods as obtained in tables (9 and 10) as well as the corresponding graphs
in figures (9 and 10) respectively.
The methods were also examined to solve both linear and non-linear problems of the
fourth order differential equations. Hence by percentage error, standard Euler method is
ranked more accurate than Runge-kutta method with (0.991% and 4.902%), (4.322% and
9.948%) for the results in tables (1 and 2), (5 and 6) respectively.
35
Comparison of Euler and Range-Kutta methods in solving ordinary differential equations of order two and four
David I. LANLEGE, Rotimi KEHINDE, Dolapo A. SOBANKE, Abdulrahman ABDULGANIYU, Umar M. GARBA
References
1. Endre SMayer D. F., An introduction to Numerical Analysis, Cambridge University Press,
2003.
2. Hussain K., Ismail F., Senua N., Solving Direct Special First-Ordinary Differential
Equations using Runge-Kutta, Journal of Computational and Applied Mathematics, 2016,
p. 179-199.
3. Lanlege D. I., Garba U. M., Aluebho A., Using Modified Euler Method (MEM) for The
solution of some First Order Differential Equations with Initial Value Problems (IVPs),
Pacific Journal of Science and Technology, 2015, p. 63-81.
4. Leonarhd Euler., Standard Euler method: Available at:
http://www.mathe.tufreiberg.de/~ernst/Lehre/Numerik_II/Folien/nadeChapter2.pdf
(accessed 16/05/2017)
5. Bakhalou N. S., Numerical Methods, Mr. Publishing Company Inc., 1977.
6. Dormand J. R., Prince P. J., A reconsideration of some embedded Runge-Kutta Formulae,
Journal of Computational and Applied Mathematics, 1986, 15, p. 203-211.
7. Hamming R. W., Numerical Methods for Scientists and Engineers, 2nd Edition, McGraw
Hills Book, 1973.
8. Nystrom E. J., An Introduction to Numerical Methods, Oxford press Nigeria Plc, 1989.
9. Tracogna S., Jackiewicz, A General Class of Two Step Runge-Kutta Method for ODEs,
Springer Series in Computational Mathematics, Verlang 2010, 10(4), p. 407-427.
10. Gerald C. E., Applied Engineering Mathematics, Addison Wesley Publishing Company
Inc., 1970.
11. Lanlege D. I., Garba U. M., Gana U. M., Adetutu M. O., Application of Modified Euler
Method (MEM) for solution of First Order Differential Equations with Initial Value
Problems. Journal of Nigerian Association of Mathematical Physics, 2015, p 441-450.
12. Rivertz J., Ordinary Differential Equations Solved Exactly by Modified Euler Method,
Archivum Mathematicum (BRNO), 2013, 49, p.29-34.
13. Taiwo O. A., Jimoh A. K., Bello A. K., Comparison of some Numerical Methods for the
Solution of First and Second Orders Linear Integro Differential Equations, American
Journal Of Engineering Research (AJER), 2014, 3(1), p. 245-250.
Leonardo Journal of Sciences
ISSN 1583-0233
Issue 32, January-June 2018
p. 10-37
37
14. Zhang Y. A., Xiong Y., New Runge-Kutta Methods with Improved Internal Order, 2011,
820102. doi: 10.1117/12.904722.
15. Ababneh O. Y., Mossa A. M., Picard Approximation Method for Solving Nonlinear
Quadratic Volterra Integral Equations, Journal of Mathematics Research, 2016, 8(1), p.
79-82.