0% found this document useful (0 votes)
153 views61 pages

Bakare Presentation

This is my M.Sc in Mathematics Research Thesis from Tai Solarin University of Education.

Uploaded by

Bakare Mayowa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
153 views61 pages

Bakare Presentation

This is my M.Sc in Mathematics Research Thesis from Tai Solarin University of Education.

Uploaded by

Bakare Mayowa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 61

COMPUTATIONAL ACCURACY ON NUMERICAL SOLUTION

OF INITIAL VALUE PROBLEMS(IVP) FOR ORDINARY


DIFFERENTIAL EQUATIONS(ODE) WITH EULER AND RUNGE-
KUTTA METHOD

BY

BAKARE MAYOWA BAMIDELE

MATRIC NUMBER: 20175208002

A RESEARCH PROJECT SUBMITTED TO THE DEPARTMENT


OF MATHEMATICS, COLLEGE OF SCIENCE AND
INFORMATION TECHNOLOGY, TAI-SOLARIN UNIVERSITY
OF EDUCATION, IJAGUN, IJEBU-ODE, OGUN STATE.

IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE


AWARD OF MASTER OF SCIENCE AND EDUCATION (MSc.
(Ed) ) IN MATHEMATICS

SEPTEMBER, 2020
CHAPTER ONE: INTRODUCTION
1.1 Background to the study
Euler’s method , which is an explicit method ,can always be used.
However it is a first order method , and the step length j=0,1. . has to be chosen
small in order that the method gives accurate result and is numerical stable.
The first approach is called Euler’s method and serves to illustrate the
concept involved in the advanced it has limited usage because of the
large error that is accumulated as the processes proceeds. However it is
important to study because the error analysis is easier to understand.
Euler’s method accumulates large error as the process proceeds. The
process is known to be very slow and in order to obtain reasonable
accuracy, the value of h needs to be smaller it can be slow that the error
in Euler method is yh( x) y(x) ,the error tends to zero as h , for [ x 0 , b]
fixed . The local truncation error of Euler’s explicitly method is N(h) The

global truncation error is N the total numerical error is the sum of the
global truncation error and the round- off error. The truncation error can
be reduced by using smaller x N ≤b x N +1>b . However, if yn+1=yn+hf(xn,yn) becomes too small
such that round-off errors become significant, the total error might
increase. It
is an essential family of implicit and explicit iterative methods needed for
approximations of solutions of ordinary differential equations which was
developed around 1900 by German Mathematicians C.Runge and M.W.
Kutta. It can used for equations of arbiters order by means of
transformation to a system of first-order equations. The greatest
disadvantage seems to be that it is rather difficult to estimate the error,
and further, the method does not offer any easy checking possibilities.
Using two slopes in the method, we have obtained methods of second
order, which we have as second order Runge-Kutta methods. The method
has one arbitrary parameter, whose value is suitably chosen. The methods
using four evaluations of slopes have two arbitrary parameters. The
values of these parameters are chosen such that the method becomes
simple for computations. One such choice gives the method. All these
methods are of fourth order, that is the truncation error is of order n=0,1,2 ,... .
The method is called the classical Runge-Kutta method of fourth order. If
we use five slopes, we do not get a fifth order method, but only a
fourth order method. It is due to this reason the classical fourth order
Runge-kutta method is preferred for computations . The classical Runge-
Kutta method is of order four uses four points. Runge-Kutta methods give
more accurate solution compare to simpler Euler’s explicitly method. The
accuracy increases with increasing order of Runge-Kutta method. Runge-
Kutta method is one of the most widely used method, and it is particularly
suitable in cases when the computation of higher derivatives is
complicated. It can be used for equations of arbitrary order by means of a
transformation to a system of first-order equations. The greatest
disadvantage seems to be that it is rather difficult to estimate the error,
and further, the method does not offer any easy checking possibilities.
The local truncation error in the Runge-Kutta method of order two is
y 0 =Y 0 . Note that this is smaller by a factor of Δyh than the truncation errors
in Euler’s explicit method . In order word, for the same accuracy, a larger
step size can be used. However, in each step the function Y in the
Runge-Kutta method of order two is computed twice. The local truncation
error in the classical Runge-Kutta method of order four is (x0)=f(x0 ,y0 ) , and the
global truncation error is Y(x1)−Y(x0)=Δy=hY ,this method gives the most accurate
solution compared to the other methods. Is the most accurate formula
available without extending outside the interval ( x 0 ) . While Runge-
Kutta methods give an improvement over Euler’s method in terms of
accuracy, this is achieved by investing additional computation effort;
infact, Runge-Kutta methods require more evaluations of Y(x1)=Y(x0)+hf(x0 ,Y (x0)) than
would seem necessary. The Runge-Kutta method of order four requires
four evaluations per step, where as Euler’s method requires only one
evaluation. Hence if the Runge-Kutta method of order four is to be
superior it should give more accurate answer than Euler’s method with
one-fourth the step size. Similarly, if the Runge-Kutta method of order
four is to be superior to the second-order Runge-Kutta methods which
require two evaluations per step it should give more accuracy with step
y =y+hf(x,y)
size [x1,x2],[x2,x3],. , than a second-order method with step size n+1 n n n .
The most popular one-step method with a constant step size is the fourth
order Runge-Kutta method . This is because the Runge-Kutta method can
achieve the accuracy of a Taylor Series approximation with out the need
for higher derivative calculations. This Runge-Kutta method can be
regarded as the basic form of order one- step methods. However, in terms
of error estimation, the one-step method with an adaptive step size like
the Runge-Kutta Fehlberg method. The Fehlberg Runge-Kutta method is a
method based on the calculation of two Runge-Kutta methods of different
order, by subtracting the results to get an estimate of the error. The one-
step Algorithm method with an adaptive step size automatically adjusts
the step size as a reaction to the calculation truncation errors. Runge-
Kutta Fehiberg method(RKF45) one way to guarantee accuracy in the
solution of an Initial Value Problem is to solve the problem twice using
y =Y
step size n=0,1,2 and 0 0 and compare answer at the mesh point corresponding
to the larger step size. But this requires a significant amount of
computation for the smaller step size and must be repeated if it is
determined that the agreement is not good enough. The Runge-Kutta
Fehlberg method (denoted by RKF45) is one way to try to resolve this
problem. It has a procedure to determine step size Y(xn+1) or x n is being used .
At each step, two different approximations for the solution are made and
compared. If the two answers are in close agreement, the approximation
is accepted. If the two answer do not agree to a specified accuracy, the
step size is reduced. If the answer agree to more significant digits than
required, the step size is increased.
Differential equations are commonly used for mathematical modeling
in science and engineering. Many problems for mathematical physics can
be stated in the form of differential equations. These equations also occur
as reformulations of other mathematical problems such as ordinary
differential equations and partial differential equations.
A differential equation is an equation that relates one or several
functions and its derivatives. Differential equations are used to model
advanced systems, for instance, mechanical and electrical systems from
fields such as biology, social sciences, engineering, economics. Mechanical
systems and electrical systems are two examples of physical system that
change over time. Differential equations are used to describe a continuous
change of physical system mathematically. Partial differential
equations(PDEs) and ordinary differential equations (ODEs) are two
classes of differential equations that are used to model and characterize the
behavior of physical systems. Parabolic PDEs exist in physical problems
such as heat conduction problem for solid bodies. Heat equations describe
how the heat temperature distributes in, for instance, a rode as the time
changes. Wave equations exist to be used to model physical problems such
as physical systems, where wave motions are considered . Numerical
methods are important to use to solve those differential equations whose
exact solutions are not possible to obtain using analytical methods.
Analytical methods such as the method of separation of variables give us
exact solutions of simple PDEs and ODEs, whereas numerical methods
give us approximations of the exact solution
Numerical methods are generally used for solving mathematical
problems that are formulated in science and engineering where it is
difficult or even impossible to obtain exact solutions. Only limited number
of differential equations can be solved analytically. There are many
analytical methods for finding the solution of ordinary differential
equations. Even then there exist a large number of ordinary differential
equations whose solutions cannot be obtained in closed form by using well
known analytical methods, where we have to use the numerical methods to
get the approximate solution of a differential equation under the prescribed
initial conditions. There are many types of practical numerical methods for
solving initial value problems for ordinary differential equations.
Numerical methods are explicit or implicit computed in one step or
multiple steps. An explicit method computes the numerical solution at the
next time point using the previous time point. While an implicit method
evaluates a function using the numerical solution at the next time point
which is solved for.
There are various numerical methods for solving PDEs and ODEs. The
method of lines is an example of a numerical method used to find
numerical solutions of hyperbolic and parabolic PDEs by transforming the
PDEs to a system of first-order ODEs which approximates the original
PDEs. Finite difference methods, finite element method, and finite volume
methods are examples of numerical methods that are used to approximate
the partial derivatives in PDEs. Finite difference methods such as Runge
Kutta methods are essential for finding approximate solutions of initial
value problems of first-order ODEs. High order Runge-Kutta methods are
used to solve ODEs because of their high accuracy and efficiency.
In this thesis, we present two standard numerical methods Euler and
Runge-Kutta for solving initial value problems of ordinary differential
equations.

1.2 Statement of Problem

Euler’s and Runge-Kutta methods has their own advantage and


disadvantages to compare the exact value of the solution of the
differential equation with a numerical approximation of the solution of
differential equation and they have different error analysis and accuracy.
Runge -Kutta methods give an improvement over euler’s method in terms
of accuracy, this is achieved by investing additional effort in fact require
more evaluation . Since , this study is to compare the solution obtained
by Euler’s and Runge-Kutta methods with a numerical approximation of
the solution of the differential equation after completion of the study
the researcher expected to answer the solution of the following
questions:
 To what extent does error enhance initial value problems of
differential equation Euler’s method and Runge-Kutta fourth
method. For f(xn ,yn ) ′= h
from the exact value of the solution y n + 1
 Compare the result of exact value of solution and the numerical
solution of Euler, and Runge-Kutta order four methods.
 Does Euler method and classical Runge-Kutta order four method
can error be estimated with out exact value?

1.3 AIM AND OBJECTIVES


1.3.1 General Objectives

 To compare the computational accuracy of Euler and


Runge-Kutta order four method.
1.3.2 Specific Objectives:

 To show how to derive the second and fourth order runge


kutta method
 To show error estimation in Runge-Kutta method .
 To compare the computational accuracy of exact value of
solution of Euler method, and Runge-Kutta fourth order
method.

1.4 Scope and Limitation of the study

The scope of this study is:


 To know about the numerical method how to
approximate and how to compare the numerical
solution of single step method explicitly with exact
solution of ordinary differential equations.
 Serve to enrich literature on elementary value problem
of differential equation .
 It will give me an experience in doing research on other
title.

1.5 Definition of Terms


The following terms are defined for the purpose of this study.
Initial value problem (IVP): in the field of differential equations an initial
value problem is an ordinary differential equation together with a specified
value, called the initial condition of the unknown function of a given point
in the domain of the solution. An initial value problem is a differential
x n
equation y 4=16 ′ y(x)=e = f (t , y(t )) with f :Ω ⊂ ℜ×ℜ where Ω is an open set of
y together with a point in the domain of =f ( x, y ) y(x 0 )=y 0 ∈ Ω called initial
condition. A solution to an Initial value problem is function f(x,y) that is a
solution to the differential equation and satisfies ( x , y ) Initial value
problem are extended to higher orders by treating the derivative in the
same way of an independent function e.g.
D ′′ xy− plane ′ (x0 , y0 )
Euler Method: Euler numerical method can solve first order first degree
differential equation with a given initial value. It is the most basic explicit
method for numerical integration of ordinary differential equations and is
the simplest Runge-Kutta Method.
Runge-Kutta Method: This method was devised by two German
mathematicians, Runge about 1894 and extended by Kutta a few years
later.
The Runge Kutta Method is most popular because it is quite accurate,
stable and easy to program. This method is distinguished by their order in
the sense that they agree with Taylor’s series solution up to terms of D r
where x<x<x<. <x<. is the order of the method. It do not demand prior computational
012 n

of higher derivatives of x n as in Taylor’s series method. The fourth order


Runge Kutta Method (RK4) is widely used for solving initial value
problems (IVP) for ordinary differential equation (ODE).
The general formula for Runge-Kutta approximation is

y
Where
=f ( x , y )
Error Analysis-:
There are two types of errors in numerical solution of ordinary differential
equations. Round-off errors and truncation errors occur when ordinary
differential equations are solved numerically. Rounding errors originate
from the fact that computers can only represent numbers using a fixed and
limited number of significant figures. Thus, such numbers or cannot be
represented exactly in computer memory. The discrepancy introduced by
this limitation is called round-off error. Truncation errors in numerical
analysis arise when approximation are used to estimate some quantity. The
accuracy of the solution will depend on how small we make the step size, h

. A numerical method is said to be convergent if Y(x) Y | (x)=f (x,Y(x)) |


Y(x0 )=Y 0 where y( x) denotes the approximate solution and y(x0),y(x1),. ,y(xn),. denotes the

exact solution. The maximum error is defined by


y 0 , y 1 ... y n ... |
h>0 |xj=x0+hj
CHAPTER TWO
Literature Review

2.1 Review of Literature


Ogunrinde, Fadugba, and Okunlola(2012) present Euler’s method
for solving initial value problems in ordinary differential equations. They
derived Euler’s method from Taylor’s algorithm which considerably
simplifies the rigorous analysis. In their research they found the stability
and convergence of Euler’s method and the result obtained is compared to
the exact solution. The error incurred is undertaken to determine the
accuracy and consistency of Euler’s method.
Wusu, Akanbi and Okunuga(2013), publish a paper on deriving a
new Runge-Kutta method involving higher derivatives. In their paper, they
derived a three-stage multi derivative explicit Runge-Kutta method with
first-order and second-order derivatives using Taylor series expansion of a
function. They analyzed the multi derivatives explicit Runge- Kutta
method in terms of stability and consistency. They also solved two first-
order ODEs to compare the accuracy of the multi derivatives explicit
Runge-Kutta method with Heun’s method and Goeken’s method. Heun’s
method and Goeken’s method are also three-stage explicit Runge-Kutta
methods but they involve fewer derivatives than the multi derivatives
explicit Runge-Kutta method. The authors computed absolute errors in the
numerical solution of the two first-order ODEs using the multi derivative
explicit Runge-Kutta method, Heun’s method, and Goeken’s method with
different step sizes. An absolute error is the magnitude of the difference
between the numerical solution and the exact solution of an ODE. Their
research has shown that the multi derivative explicit Runge-Kutta method
is stable, it is the most accurate and efficient three-stage explicit Runge-
Kutta method investigated in the paper.
Adesola, Samson, Ayomide and Adekunle (2015),made a study of
standard Runge-Kutta fourth order algorithm by using compiler techniques
to dynamically evaluate the inputs and implement the algorithm for both
first and second order derivatives of the ODE. They have been able to
develop and implement the software that can be used to evaluate inputs and
compute solutions(approximately and analytically) for the ODE using Java
programming language. However, the set of explicit RK methods for
numerically solving IVPs are the most popular because of their speed and
accuracy; in which the simplest and most basic method for solving IVPs is
the Euler’s method also known as Forward Euler (Patterson,2003). Among
the class of RK algorithm is the fourth order method which is the most
popular often referred to as “RK4” and is also used for solving Initial
Value Problems (IVPs).The fourth order Runge-Kutta method is the most
powerful of entire explicit RK methods, so that most computer packages
such as Java and C++ use it to compute solutions numerically for
differential equations. Angelos(2013) formulated using Artificial Neural
Networks in the construction of Runge-Kutta methods by generating the
optimal coefficients of a numerical method. The network was designed to
produce a finite difference algorithm that solves a specific system of
ordinary differential equations numerically. Jorick(2005) presented an
interesting form of flow problem, one that involves multiple fluids of
flows; more particularly, the two-fluid flows where there exists two non-
mixing fluids separated by a sharp fluid interface, occurring in many
applications majorly in both engineering and physics. In his research he
found the improvement of an extremely accurate numerical solver for the
simulation of compressible, unsteady two-fluid flows as portrayed by the
two-dimensional Euler equations of gas dynamics. The two-fluid flow
solver considered was centered on the Level-Set(LS) method. The
uniqueness of the solver developed is the application of an extremely
accurate Runge-Kutta discontinuous Galerkin (RKDG) method for the
temporal and spatial discretization of the governing equations. Adesola et
al(2015) obtained the result by dynamically evaluate the inputs through the
use of compiler techniques to generate a solution of both first and second
order ODE with the use of Java programming language.
Papadopoulos and Simos(2013),have also derived an explicit Runge-
Kutta method, namely the fourth-order modified Runge-Kutta Nystrom
method. The fourth-order modified Runge-Kutta Nystrom method consists
of four additional variable coefficient than the classical fourth-order
Runge-Kutta method. In their research , they have used the fourth-order
modified Runge-Kutta Nystrom method to solve a Schrodinger equation,
which is a second-order ODE. The authors have compared the accuracy
and efficiency of the fourth-order Runge-Kutta Nystrom method with three
additional types of fourth-order Runge-Kutta Nystrom methods for solving
the Schrodinger equation. They verified the efficiency by computing the
error at the final time point. Their research has shown that the fourth-order
modified Runge-Kutta Nystrom method is more accurate and efficient than
the other three types of fourth-order Runge-Kutta Nystrom method.
Another research paper on the accuracy and efficiency of Runge-Kutta
methods is written by (Hassan,2018). In his paper, he has compared the
accuracy and efficiency of the following six Runge-Kutta methods for
solving an initial value problem of a first-order linear ODE: the forward
Euler method, the backward Euler method , Heun’s method, the fourth-
order Runge-Kutta method ,ODE23, and ODE45. He computed the
numerical solution and exact solution of the initial value problem using the
six Runge-Kutta methods with different step sizes. He verified the accuracy
and efficiency of the six Runge-Kutta methods by computing the average
absolute errors and computational time. His research has shown that the
ODE45 is the most accurate Runge-Kutta method.
Moreover, Islam(2015) has also written a research paper on the
forward Euler method and the fourth-order Runge-Kutta method for
finding numerical solutions of the two first-order ODEs with four step
sizes. He has compared the accuracy of the two explicit Runge-Kutta
methods by computing the maximum errors. Another comparison he did
was to compare the efficiency of the two explicit Runge-Kutta methods by
verifying how fast the numerical solution converges to the exact solution .
His research has shown that the fourth-order Runge-Kutta method is more
accurate and the numerical solution obtained by this method converges
faster in comparison with forward Euler method. Also, the fourth-order
Runge-Kutta method computed the numerical solution of the two first-
order ODEs more efficiently than the forward Euler method.
Akanbi(2010)made a study of error bound of a numerical algorithm
for use in computation of numerical values of Initial Value Problems. In his
study he found out the computation of error bounds for new Euler Scheme
proposed by (Abraham, 2008).
Faranak and Fudziah (2011) made a study of explicit third-order
improved Runge-Kutta(IRK) methods. The method used in two and three
stage which indicated as the required number of function evaluations per
step. The third order IRK method in two-stage has a lower number of
function evaluations than the classical third-order RK method while
maintaining the same order of local accuracy. In three-stages, the new
method is more accurate compared to the classical third-order RK method.
In their study they found out that IRK3 has a lower number of function
evaluation than RK3 method while maintaining the same order of local
accuracy and IRK3-3 is more accurate compared with the classical RK3
method.
Furthermore, according to Ketcheson and Ahmadia(2013) it is
significant to find stability polynomials of optimal explicit Runge-Kutta
methods for solving first-order ODEs. In their research , they have for
instance introduced an approach for how to construct stability polynomials
of first-order ODEs. The authors have plotted the stability regions of
optimal explicit Runge-Kutta methods such as Runge-Kutta methods.
Another research paper on stability regions is written by Seka and
Assui(2019), where they have proved that the evolution of stability regions
does not depend on the order of Runge-Kutta methods. They did this proof
by analyzing the stability of the first-order, the second-order, the third-
order, and the fourth-order Runge-Kutta method with an eight-order
Runge-Kutta with eleven stages. Afterwards, they compared the stability
regions of the first-order, the second-order, the third-order, and the fourth-
order Runge-Kutta method with an eight-order Runge-Kutta method with
eleven stages which they have introduced. Their research has shown that
the size of the stability regions of the second-order, the third-order, and the
fourth-order Runge-Kutta methods are larger than the stability region of the
eighth-order Runge-Kutta method.
Heath(2002) emphasizes that numerical methods are viewed as a
significant tool to use to solve problems for example in engineering and
industry. Also Omale et al(2014) describe that numerical methods have
been used to solve differential equations of weather and climate forecasts.
Bazuaye and Etin(2019) made a study of a new 4th order Hybrid Runge-
Kutta method based on linear combination of Arithmetic mean, Geometric
mean and the Harmonic mean to solve first order initial value
problems(IVP) in ordinary differential equations. In their study they found
out with the aid of a MATLAB by drawing the curve of stability
polynomial. It is revealed that the stability region of the new method is the
set of complex values of hλ for which all solutions of y ′ =λy will
remain bounded as n→ ∞ . Several practically applicable problems
have been considered to test the suitability, adoptability and accuracy
of the proposed method. To achieve this ,three test problems were
considered and the results indicate that the New method is stable and
of high degree of accuracy in comparison with the other existing
methods.
Ashiribo, Moses and Solomon (2013) presented a new class of three
stage Runge-Kutta method with first and second derivatives. The
consistency and stability of the method is analysed. They obtained the
absolute error associated with the schemes for the test problems with
variation of the step length. The standard Heun’s(third order) method
grows faster in error than the method of Goeken and the newly derived
scheme. They concluded that the 3sMERK method proposed is
reliable,stable and with high accuracy.
Jahangir, Shah and Babul(2017) made a study of fourth order Runge-
Kutta(RK4) and Butcher’s fifth order Runge-Kutta(RK5) methods for
solving second order initial value problems (IVP) for ordinary differential
equations. In their study they found out that RK5 method gives more
accurate results than RK4 method.
In this thesis, we derive the computational accuracy for the
following: the Euler method, Improved Euler method(Euler- Cauchy
method),Runge-Kutta method(RK4) for first-order differential equation,
Runge-Kutta method(RK4) for second-order diferential equation.
CHAPTER THREE
METHODOLOGY
3.1 RESEARCH METHODS
In this study, We have used Microsoft Excel software in order to
achieve a high accuracy of numerical solution of initial value
problem. Researcher has use the following procedure.
1. First proof Euler’s method, Improved Euler’s method, second
order Runge-Kutta method and classical Runge-Kutta order four
method.
2. Compare the accuracy of Euler’s method, Improved Euler’s
method, and classical Runge-Kutta order four method.
3.2 METHOD OF ANALYSIS
Based on the indication numerical approximation values and the
exact solution of the differential equations, different tables the
researcher has given an explanation and conclusion especially, by
using
 Euler Method
 Improved Euler Method
 Runge-Kutta Method

3.3 Theory of Euler Method

In mathematics and computation science , the Euler method (also called


forward Euler method) is a first-order numerical procedure for solving
ordinary differential equations(ODEs) with a given initial value . It is the
most basic explicit method for numerical integration of ordinary equation
and is the simplest Runge-Kutta method. The Euler method is named after
Leonhard Euler, who treated it in his book Institutionum Calculi integralis
(published 1768 – 1870). The Euler method is a first-order method, which
means that the local error (error per step) is proportional to the square of
the step size, and the global error(error at a given time) is proportional to
the step size.

Example
2
h
Given the initial value problem Y(xn+1)=Y(xn)+h ′ Y , (x n )+
2 ,We would like to use the
Euler method to approximate Y ,using step size equal to xn≤ ¿ x n+1 , the
h2
euler method is So the first we must compute T n=
2

In this simple differential equation, the function Y is defined by


Y ( x n+1 )−Y ( x n )
x n +1 ′.We have h
=Y
= ( x n ) = 1. The next step is to multiply the
above value by the step size =f(xn,Y(xn) , which we take equal to one here:
Y(xn+1 )=Y(xn )+hf (xn ,Y(xn )) ,this value is then added to the initial Y value to obtain the

next value to be used for computations.


( t ) ′)f(t,Y(t) [ x n , x n + 1 ]

The above steps would be repeated to find Y(xn+1) , Y(xn ) and +∫ f(t,Y (t)dt .
xn+1
xn

hg ( a ) ′Y(xn+1)=Y(xn)+hf(xn,Y(xn) x

yh ( x ) ′ Y(x) Y ( x )− yh ( x )
h=0 .1 ′)h=0.2 h=0 .05

Table 2.1

y
=y y(0 )=1 Y ( x) h yh(xn )
0 1 0 1 1 2
1 2 1 2 1 4
2 4 2 4 1 8
3 8 3 8 1 16
The conclusion of this computation is that x . The exact solution of
differential equation is h , so = Y ( x )− y ( x )

Figure 2.1

Y-Values
60

50

40
Y-Values
30

20

10

0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

The step size is


Using other step sizes

As suggested in the introduction, the Euler method is more accurate if the


step size h is smaller. The table below shows the result with different step
sizes. The top row corresponds to the example in the previous section
and the second row is illustrated in the figure below.

Table 2.2

Step size Result of Euler’s Error


method
1 16.00 38.60
0.25 35.53 19.07
0.1 45.26 9.34
0.05 49.56 5.04
0.025 51.98 2.62
0.0125 53.26 1.34

Differential equations are one of the most important mathematical tools


used in modeling problems in physical sciences. The main form of problem
that we study is the initial value problem:
′ y ( x 0 )= y 0 f ( x , y ) ……………….equation 1
dy
=f(x,y)
dx

The function f is to be continuous for all x=x 0 in some domain xn+1−xn=h of

the x n+1 =x n +h , and yn+1=y n+f n h is a point in f n=f(xn ,yn) . The results obtained for
equation 1, will generalize in a straight forward way to both systems of
differential equations and higher order equations, provided appropriate
vector and matrix notation is used. The most popular numerical methods
for solving equation 1 are called finite difference methods. Approximate
values are obtained for the solution at a set of grid points
( t f −t 0 )
;
N

and the approximate value at each x0=x(t0 ) is obtained by using some of the
values obtained in the previous steps.
tn
(t f −
N
);
will denote the true solution of equation 1
k1
2 ′
k 2
2
y n + 1 …………..equation 2

The approximate solution will be denoted by y n , and the values

f 2
will often be denoted by O ( h ) An equal grid size
5
O(h ) will be used to define the node points,
f f
When we are comparing numerical solutions for various values of f(x,y, , we
will also use the notation y to refer to ) with step size y .
The problem of equation 1 will be solved on a fixed finite interval, which

will always be denoted by =f (x, y) . The notation y will denote the


longest index =f(x, y),y(x0)=0 for which
x0 y0

Derivation of Euler’s method

Euler’s method is defined by a < x <b x 0

………..equation 3 With y ( x ) according to Akinson, kendell A(1989) pg


330.
1. A geometric viewpoint .

using the curve x0


≤ x≤ x = + h , x = x +2 h , x = + 3 h
x1 Then 1 0 2 0 3 0 = y(x+h)=y(x)+h ′ y
h2
+
2
y
′ ( x)
h
By repeating this argument on h2 , h3 . we obtain the
general formula:
h y(x+h)~ y(x)+h y with ( x )
2.Taylor Series

Expand y(x+h)=hf(x,y) about yn+1=hf(xn, yn) ,

( n=0,1,2. .. .) dn+1 ′
y( x n ) x n ′′(ξ
n )
1
en=y(x −y ) d +1=y(x +h)−y(x )−hf (x ,y (x ) = h2 y
n n ξn n n n n n 2 (xn,y(yn+1) ………equation 4
By dropping the error term , we obtain the Euler method of
equation 1.

The term
y(yn+h) = x ′′(ξ ) ………………equation 5 n n

is called the truncation error or discretization error at p=1,

3.Numerical Differentiation

From the definition of a derivative ,


y(xn+h)= y(x)+hf(xn ,y(xn) +dn+1 ′ y +1=y +hf(x ,y ) e +1=e +h(f(x ,y(x ) −f(x ,y ) +d +1=(1+hf (x ,u)e +d +1
n n nn n n n n nn n yn nn
y ( xn )

4. Numerical Integration

Integrate y n ′ ( x n , y ( x n ) −f ( x n , y n ) . = d (n+ 1 ) over u :

f y =
1
2
y …………equation 6
Consider the simple numerical integration method
a +h

∫ g ( t ) dt = ¿ D …………..equation 7
a

is Called the left-hand rectangular rule.


From equation 6, we obtain
x as before of the three analytical
derivatives of equation 2 to 4, both equation 2 and 4 are the
simplest cases of a set of increasingly accurate methods. Approach
of equation 2 leads to the single-step methods, particularly the
Runge-Kutta formulas. Approach to equation 4 leads to multistep
methods, especially the predictor -corrector methods.

Table 2.3 Euler’s method Example

[x0,xend ] f y ¿L [ x 0 , x end ]
y 0.40 1.46410 1.49182 0.2772
0.80 2.14359 2.22554 0.8195
1.20 3.13843 3.32012 0.18169
1.60 4.59497 4.95303 0.358806
2.00 6.72750 7.38906 0.66156
e n+ 1 0.40 1.44000 1.49182 1.5182
0.80 2.07360 2.22554 0.15194
1.20 2.98598 3.32012 0.33413
1.60 4.29982 4.95303 0.65321
2.00 6.19174 7.38906 1.19732
( 1+ hl ) 0.40 1.47746 1.49182 0.01437
0.80 2.18287 2.22554 0.04267
1.20 3.22510 3.32012 0.09502
1.60 4.76494 4.95303 0.18809
2.00 7.03999 7.38906 0.34907

Considering the equation e n ′ Dh2 , e 0 , Its true solution is e 1 = e x


2
Numerical results are given in Table 2.3 for several values of ¿Dh . The

answer e 2 are given at only a few points, rather than at all points
at which they were calculated. Note that the error at each point ¿(1+hL)Dh2+Dh2

Nstep−1
eN Nstep−1 (1+hL)
decreases by about half when steep is halved. The total error ¿∑i=0 (1+hL)i Dh2=
1+hL−1
Dh2

is called the global error, and the last columns of Table 2.3 are
example of global error.

Derivation of Euler’s Method Numerical methods for solving


Differential Equations
Starting with a general first order Initial Value Problem
hL
hL≤e h.Nstep=xend −x0 ……..equation 8

e Nstep is a known function and the values in the initial condition


Where
( xend−x0 )−1
hL Nstep−1

are also known numbers. If is continuous functions then there is a


(e ) Dh eL D.h
¿ = =C.h
L L

unique solution to the Initial Value Problem in some interval surrounding


C

We want to approximate the solution to equation 8, near x=x 0


1. Point( x 0, y 0) an exact value, know to lie on the solution curve
tangent line to the ghost (unknown) solution y = f ( x) at x = x 0: y = y
0 + f ′( x 0 , y 0)( x → x 0)
If x 1 is close enough to x 0 then the point y 1 on the tangent line
should be fairly close to the actual value of the solution at x 1 or y ( x
1 ).
2. Point ( x 1, y 1) y 1 = y 0 + f ( x 0, y 0) ( x 1 → x 0) an approximate value of f (
x 1), lying on tangent line through ( x 0, y 0).

3. Point ( x 2 , y 2)
y 2 = y 1 + f ( x 1, y 1) ( x 2 – x 1)

4. Point ( x 3, y 3) y 3 = y 2 + f ( x 2, y 2)( x 3 – x 2)

Assuming that the step sizes are of uniform size:


D
=( e hL−1 )
L

Recursive formula for approximate point is:


y( x end )− y Nstep
→0 h→ 0( or
Example
Solve the initial value problem:
y ′ = x + 2 y , y (0) = 0 numerically (Euler), finding a value for the
solution at x = 1, and using steps of size h = 0.25
Solution
x n + 1= x n + h
y n + 1 = y n + hf ( x n , y n)
1. Point (0 ,0)
2. Point(0.25 , 0)
x 1 = x 0 + h = 0.25
y 1 = y 0 + hf ( x 0, y 0)
= y 0 + h ( x 0 + 2 y 0)
1 + 0.25(0 +2 × 0) = y 1 = 0 + 0.25(0) = 0
3. Point (0.5, 0.0625)
x 2 = x 1 + h = 0.5
y 2 = y 1 + hf ( x 1 , y 1) =
= y 1 + h ( x 1 + 2 y 1)
y 2=0 + 0.25(0.25 + 2 ×0) = 0.0625
4. Point(0.75, 0.21875)
x 3= x 2 + h = 0.75
y 3= y 2 + hf ( x 2, y 2)
y 2 + h ( x 2 + 2 y 2)
=0.0625 + 0.25(0.5 + 2 ×0.0625)
y 3 = 0.21875
5. Point (1, 0.515625)
x4 = x3 + h = 1
y 4 = y 3 + hf ( x 3, y 3)
= y 3 + h ( x 3 + 2 y 3)
0.21875 + 0.25(0.75 + 2 × 0.21875)
=0.515625
Euler’s Algorithm
Select N

Set =
h N step→
For K = 0: (n – 1)
x k + 1 = x k + hf (t k, x k);
x k + 1 = t k + h;
END FOR

Matlab
Function[ t , x ] =myEuler(@ f , x0,t 0,t f, N )
h
=
)
t = [t 0: h : tf ]; % discrete time points between, and including,
x (1) = x 0;
for k = 2 : N
x (k )= x (k −1) + h ¿ feval( f , t (k −1) ,
x (k −1 ¿¿ ;
end ;

Advantages /Disadvantage of Euler’s Method


Advantages:
 Euler’s method is simple and direct
 Can be use for nonlinear Initial Value Problems
Disadvantages:
 It is less accurate and numerically unstable.
 Approximation error is proportional to the step size h.
Hence, good approximation is obtained with a very small
h . This requires a large number of time discretization
leading to a larger computation time .
 Usually applicable to explicit differential equations.
Runge – Kutta methods
In numerical analysis, the Runge-Kutta are a family of implicit and explicit
iterative methods, which include the well known routine called the
Euler method , used in temporal discretization for the approximate
solutions of ordinary differential equations.
The most widely known member of the Runge-Kutta family is generally
referred to as “RK4”,the “classic Runge – Kutta method” or simply as “the
Runge – Kutta method “.
Let an initial an initial value problem be specified as follows:
y = f (t , y ), y (t 0¿= y 0

Step – Size h > 0


1
y n + 1 = y n + (k 1 + 2k 2 + 2k 3 + k 4)
6
t n + 1= t n +h

forn = 0,1,2,3 using Suji & Mayers(2003),p328


k 1 = hf (t n, y n)

k hf t
h
y
ci ,ai
2 = ( n + 2, n + j )

k
=
hf t
h
y
( n + 2, n +
b j ),
3

k 4 = hf (t n +h , y n +k 3)

The above equation have different but equivalent definition in different


texts Atkinson (1989, p.423).
yn + 1 is the RK4 approximation of y (t n + 1), and the next value ( y n + 1) is
determined by the present value ( y n)plus the weighted average of four
increment, where each increment is the product of the size of the interval
h , and an estimated slope specified by function f on the right-hand side of

the differential equation.


s
c i=∑ j ai
 j is the increment based on the slope at the beginning of the
interval, using y (Euler’s method).

 k i is the increment based on the slope at the midpoint of the

interval, using y and k 1

 k1=hf (xn, yn) is again the increment based on the slope at the midpoint, but
now using y and k 2

 k2=hf(xn+c2h, yn+a21k1) is the increment based on the slope at the end of the interval,
using y and k 3
The RK4 method is a fourth order method, meaning that the local
truncation error is on the order of O (h5),while the total accumulated
error is on the order of O (h4).

Runge-Kutta ‘s Method

1. Second Order
1
y n + 1 = y n + (k 1 + k 2)
2
where k 1 = hf ( x n , y n)

k 2 = hf ( x n + h , y n+k 1)
2. Fourth order
1
y n +1 = y n + (k + 2 K 2 + 2 K 3 + K 4)
6 1
where k 1 = hf ( x n , y n)

k
2 =
hf x
h
y
( n + 2, n + y)
+ =1+ xy )
h
k hf x y
3= ( n + 2, n

k 4 = hf ( x n + h , y n + k 3)
Example
dy
Given dx = x + y , with initial conditions y (0) = 1. Choose h = 0.1 and find y

(0.1), y (0.2) and y (0.3) using Runge – Kutta’s method of fourth order.
Solution
Putting n = 0 in Runge-kutta’s formular for fourth order we get
1
y1 = y0 + (k + 2k 2 + 2k 3 + k 4)
6 1
where k 1 = hf ( x 0 , y 0) = (0.1)(0 + 1) = 0.1

k
2 =
hf x
( 0
h
y
+ 2, 0 +
x =0 ( . 1 ) 0 . 5 )
=(0.1)(0.05 + 1.05) = 0.11
y 1= y0 +h ( y 1 )0
y 1=1 +0 . 1( 1 )
y 1=1 . 1
( y 1)1=1+ x 1 y 1
¿1 +0 . 1×1 .1

h
¿1 . 11
y 2= y1 +h ( y 1 )1
¿1 . 1+ 0. 1( 1. 11 )
¿1 . 211
1
( y )2=1+ x 2 y 2
¿1 +0 . 2×1 .211
¿1 . 2422

k hf x y
y 3= y2 +h ( y 1 )2
1 . 211+ 0. 1 ( 1. 2422)
¿1 . 33522
( y 1)3=1+ x 3 y 3
¿1 +0 . 3×1 . 33522

= ( + 2, 0 + )
¿1 . 400566
y 4=y 3+ h( y1 )3
¿1 . 33522 +0 . 1( 1 . 400566 )
¿1 . 4752766
( y 1)4 =1+ x 4 y 4
1+( 0 . 4 )×( 1 . 4752766 )

3 0
¿1 . 59011064
y 5= y 4+ h( y1 ) 4
¿1 . 4752766 +( 0. 1 )×( 1 . 59011064 )
¿1 . 634287664

(0.1)(0.05 + 1.055) = 0.1105


k 4 = hf ( x 0 + h , y 0 + k 3)

(0.1)(0.1 + 1.1105) = 0.12105


(y1)5=1+x5 y5
y y ¿1+(0.5)×(1.6342876 4)
(0.1) = 1 = 1 + ( )(0.1 + 0.22 + 0.221 + 0.12105) = 1.110341667
¿1.817143832

1
putting n = 1 in Runge-Kutta’s formula for fourth order, we get y 2 = y 1 + 6 (

k 1 + 2k 2 + 2k 3 + k 4)

where k1 = hf ( x 1, y 1) = (0.1)(0.1 + 1.110341667) = 0.1210341667


k
=
hf x
h
y
( 1 + 2, 1 +
x0 ) = (0.1)(0.15+1.17085875)=0.132085875
2

k
=
hf x
h
y
( 1 + 2, 1 +
y0 ) =(0.1)(0.15+1.176384604)= 0.1326384604
3

k 4 =hf ( x 1 + h , y 1 + k 3) =(0.1)(0.2+1.242980127)= 0.1442980127

1
y (0.2) = y 2 = y 1 + (k 1 + 2k 2 + 2k 3 +k 4)
6
1
=1.110341667 +( 6 )(0.1210341667 + 2(0.132085875) + 2(0.1326384604) +
0.1442980127)
1
= 1.110341667 + ( 6 )(0.7947808502)
=1.110341667 + 0.132463475
y (0.2) = y 2 = 1.242805142
n = 2 will give y (0.3) = 1.399711
k 1 = 0.14428, k 2 = 0.156494, k 3 = 0.157105, k 4 = 0.169990

Advantages and Disadvantages of Runge Kutta methods


Advantages
 They are easy to implement
 They are stable
Disadvantages
 They require relatively large computer time
 Error estimation are not easily to be done

Comparison of Euler method and Runge-Kutta method with advantages


and disadvantages

1. Euler Method
Advantages:
Euler’s method is the simplest of all linear multi-step method to
obtain the approximated solution of the specified initial value
problem. It has the one-step techniques, and it can be easily
programmed. Most of the ordinary differential equations can be
solved conjecturally with numerical method and approximated

solution ( y can be obtained from )0 . The derivation of Euler’s


method can be revealed by constructing Taylor Series.
Approximated solution can be acquired at each step before
progressing to the next step. In addition, it has purely single
y 1 ( x)=x 2 +xy , y (0 )=1
x 0 =0 , y0 =1

computation of function in each time (step-size). The error


h=0 . 1
x1=x 0+h
x1=0+0 . 1
x1=0 .1
( y ' ) 0 =0 2 +0×1
¿0 +0=0
ByEuler ' smethod
y 1= y 0 +h( y 1 )0
y 1=1 +0 . 1 ( 0)
y 1=1 .0

analysis, which involve local and global truncation error, and


remainder term can be obtained smoothly. Consequently, Euler’s
method has the practical solution’ techniques in order solve
complicated differential equations.
Disadvantages:
In spite of the simplicity, it is restricted to use. The reason is ; it
generate large error in each successive step during the
computation which is the accumulated error. In order to avoid the
formulation of large error, step-size should be taken excessively
small. Therefore, it needs high computation of time. Additively,
approximated solution converge slower to analytical solution. This
means that the order of method is 1 and the error is observable
( y 1 )1 = x 1
2
+ x1 y1
¿ 0 . 1 2 +( 0 . 1 )(1 . 0 )
¿ 0 . 11
y2 = y1 + h ( y 1 )1

. It is a slow rate of convergence.


¿ 1 . 0 +0 . 1 ( 0 . 11 )
¿ 1 . 01 1
y 3 = y 2 + h ( y 1 )2
( y 1 )2 = x 2
2
+ x2 y 2
¿ 0 . 2 2 +( 0 . 2 )×(1 . 011 )
( y 1 )2 =0 . 242 2
y 3 =1 . 011 + ( 0 . 1 )×( 0. 24 22 )
y 3 =1 . 035 221 1 .

2. RUNGE – KUTTA METHOD


Advantages:
The idea of families of Runge-Kutta method is too complicated, but
higher order provides much better approximated solutions than
Euler method. The most popular Runge-Kutta method is the
method of order four. It is a good choice to get more accurate and
more efficient solutions for solving the specified ordinary
differential equations. The approximated solution converge faster
to exact solution and the order of RK4 is 4 and the truncation error
y 1 ( x )= xy− y 2 , y ( 0 )=1
x 0 =0 , y 0 =1
h= 0 . 1

is
x 1 = x 0 +h
x 1 =0 +0 . 1
x 1 =0 . 1
( y 1 ) 0= 0×1−1 2
¿− 1

Disadvantages: y 1=y 0 +h( y1 ) 0


y 1=1+0. 1(−1 )
y 1=0 .9

Method is re-evaluating the function at each time to obtain the


( y 1)1=x1 y1 −y 12
¿ {( 0. 1)( 0. 9)−(0 .9)2 }
¿ −0. 72
y 2=y 1+h( y1 )1
¿ 0 .9+( 0 .1)(−0 .72)
¿ 0 .828
y 3=y 2 +h( y1 )2
( y 1)2=x2 y2 −y 22
¿ ( 0 .2 )( 0.828 )−(0. 828 )2
1
( y )2=−0. 519984
y 3=0 .828 +( 0. 1) (−0 .519984 )
¿ 0 .7760016

predictable solution. It requires four evaluation per step. So, the


computation of function may take long time. The derivation of
Runge-Kutta method is obtained from Taylor Series, but it is tedious
to calculate higher derivatives. To avoid this, the function is
evaluated at more points.

CHAPTER FOUR
DISCUSSION AND RESULTS
4.1 NUMERICAL METHODS FOR DIFFERENTIAL EQUATIONS

Differential equation describe nearly all systems undergoing changes


often systems describe by differential equation are so complex, or the
systems that they describe are so large, that purely analytically solution
to the equation is not tractable. It is in this complex systems where
computer simulations and numerical methods are useful. The techniques
for solving differential equation based on numerical approximations were
developed before programmable computer existed.

4.1.1 EULER’S METHOD

The derivation of Euler use Taylor’s formula from calculus to


approximate the solution to a first order ODE at points that are a
distance h apart. We know that an ODE of the first order is of
the form ′ and can often be written in the explicit form
′ an initial value problem for this equation is of the
x2=x1 +h=0.1+0.1
¿0.2
y(x)=x 2+xy,y(0)=1
x 0 =0,y 0 =1,h=0.1

form ′ …………equation 1
k 1 =hf (x0 , y 0 )=h (y1 ) 0
¿ 0. 1×( x0 2 +x0 ×y0 )
¿ 0. 1×(02 +0×1 )
¿ 0=h(y 1 )0
k2 =hf (x 0 +1 h , y0 +1 k1 )
2 2
¿ h{(x0 +1 h )2 +x0+1 h×y 0+1 k 1 }
2 2 2
¿ 0. 1{(0+0 .5×0 .1 )2 +(0 +0. 5×0. 1 )×(1 +0. 5×0)}
¿ 0. 1{1
400 +0 . 05 ×1}
¿ 0. 00525
k3 =hf (x0 +1 h , y0 +1 k 2 )
2 2
¿ 0. 1{(0+0 .5×0 .1 )2 +(0 +0. 5×0. 1 )×(1 +0. 5×0. 00525 )}
¿ 0. 1{(1
400 )+(0. 05 )×(1 . 002625 )}
¿ 0. 005263125
k 4=hf(x0 +h , y0 +k3 )
¿ h{(x0 +h )2 +(x0 +h)×(y 0+k3 )}
¿ 0. 1{(0+0 .1 )2 +(0 +0 . 1)×(1+0 .005263 )}
k 4=0. 011053
y1 =y 0+(1
6 ){k1+2 k2 +2 k3 +k 4}
y1 =1+(1 )×{0+2×0 .00525+2×0 .00526312 5 +0 .0110526 }
6
¿ 1. 005346
and y are given and we assume that the problem has
x 1= x 0 + h, x 1 =0 +0 . 1= 0. 1
x 2= x 1 + h
0 .1 +0 . 1
x 2= 0. 2
y 1( x) = xy− y 2 , y( 0 )= 1
x 0= 0, y 0= 1, h =0 .1
n =0
k 1 =hf ( x 0 , y 0 ) = h( y 1) 0
¿ h( x 0 × y 0 − y 02 )

Where
¿ 0. 1×( 0 ×1− 1 2 )
1
¿− 0. 1= h( y )0
1 1
k 2 =hf ( x 0 + h , y 0 + k 1)
2 2
1 1
¿ h{ ( x 0 + h) ×( y 0 +1 k 1 )− ( y 0+ k 1 )2 }
2 2 2
¿ 0. 1× {( 0+ 0 .5 ×0 . 1)× ( 1+ 0. 5 ×−0 . 1) −( 1+ 0 .5 ×− 0. 1) 2}
¿− 0. 085 5
1 1
k =hf ( x + h , y + k )
3 0 2 0 2 2
1 2
¿ h{ ( x 0 +1 h )( y 0 +1 k 2 )− ( y 0 + k 2 ) }
2 2 2
¿ 0. 1{ ( 0+ 0 .5× 0 .1 )( 1 +0 . 5×− 0 .085 5 )−( 1 +0 . 5×− 0. 085 5) 2}
¿− 0. 086846506 2 5
k 4= hf ( x 0 + h , y 0 + k 3 )
2
¿ 0. 1× {( x 0 + h) ×( y 0 +k 3) −( y 0 + k 3 ) }
¿ 0. 1× {( 0+ 0 .1 )× (1 −0 . 086846506 2 5) −( 1− 0. 086846506 2 5) 2}
k =− 0 .0742533953 8
4
1
y 1= y 0+ ( ){ k 1 +2 k 2+ 2 k 3+ k 4 }
6
1
y 1= 1+ ( ) ×{ −0 .1 +2 ( −0 .085 5 )+ 2( − 0. 086846506 2 5) +( −0 . 074253395 3 8 ) }
6
y 1= 0 .91350893 20

a unique solution on some open interval =2 x− y containing y=1


computing approximate numeric values of the solution x=0 of
equation 1 at the equidistant points on the x-axis.
x =0 ( 0 . 2 ) 1 . 0 … step size h is a fixed number.
Those methods are step-by-step methods using formula each
step, such formulas are suggested by the Taylor series, 1 1
k3 =hf (x 0 + h), y 0 + k 2 )
2 2
1 1
k3 =h((2( x0 + h )− y 0 + k 2 )
2 2
k3 =0. 2(2(0+0 . 5×0. 2)−( 1+0 .5×−0 . 14 )
y1
=2 x − y
k3 =−0.146
k 4 =hf ( x 0 +h, y0 +k 3 )
1
x 0= 0 , y 0= 1 , h = 0 . 2

′ ′′y =y +(6 ){k +2k +2k +k } ………..equation 2


k 1 =hf ( x 0 , y 0 )= h ( y 1
) 1 1
¿ 0 . 2 ×( 2 x 0− y 0 )
0
k 2 =hf (x 0 + h, y 0 + k 1 ) ¿h(2( x 0 +h )−y 0 +k 3 )
2 2
¿0 .2(2(0+0. 2 )−( 1−0.146 ))
1 0 1 2 34
¿ 0 . 2 ( 2 ( 0 )− 1
1 1
¿ 0 . 2 ( 0 −1 ) ¿h(2(x 0 + h)−y 0 + k 1 )
¿ ( 0 . 2 )( −1 ) 2 2 ¿−0. 0908
k 1 =− 0 . 2= h ( y 1 ) 0 ¿−0.14

1
This formula is develop by Euler’s method for small =1+(6){−0.2+×−0.14+2×−0.146−0.908}, the
higher powers y1=0.8562 In equation 2, k1=hf(x1,y1)=h(y )1 are very small dropping all
1

of them gives the crude approximation


=h ( 2 x 1 − y 1 ) =0.2(2×0.2−0.8562)

=−0. 09124
and the corresponding Euler method y 11=( x+2) y−2 y 1
1
x=0, y=1, y =0 ………….equation 3
Since the local truncation error x=0(0.2)1.0 is the error done in one
11 1
step when starting at the exact solution y =(x+2)y−2y . The global error is
the difference between the exact and the numerical solution at
point x0=0,y0=1,h=0.2 thus ( y ) 0= 0 .
1

The local truncation error of Euler’s method is


1
k 1= h2 ( y 11 )0 ∈
2 ′′(ξ),where ξ
11 1
( y )0=(x0+2)y 0−2( y )0
the Taylor expansion of around (0+2)1−2(0) ,with
This is given from
(2)1−2(0) to see how the global error propagates from one step to the
next, the trick is ,we have 2−0 =2
11
( y )0 =2
Take the difference of these two and get
1
k 1 = ( 0 . 2 )2 ( 2 )
2

…………..equation 4
Where u is somewhere between k 1=0.04 and k=2hf(x+2h,y+2h(y)+4k,(y)+h). We have here
1111 k 2 1 11
2 0 0 010

1 1 1 1 k
= h2 {( x 0 + h+2)( y 0 + h( y 1 )0 + k 1 )−2(( y 1 )0 + 1 )}
2 2 2 4 h

used the mean value theorem for Thus is


1 0 . 04
¿ ( 0 .2 )2 {( 0+( 0. 5 )( 0. 2)+2 )( 1+(0 .5 )(0 .2 )(0 )+( 0 .25 )( 0 . 04 ))−2( (0)+ )}
2 0.2
¿ 0 .03442

1 1 1 1 k
k3 = h2 f {x0+ h,y0 + h(y1 )0 + k1 ,( y1 )0 + 2 }
2 2 2 4 h

about as far we get with exact calculations, if error ξ in as


k2 12 0.34 2
1 1 1 1
k3 = h2 {( x0 + h+2)(y0+ h(y1 )0+ k1 −2((y1 )0+ )} (0.2){(0+(0.5)(0.2)+ (1+(0.5)(0.2)(0 +(0.25)(0.4)−2(0)+ )}
2 2 2 4 h 2 0.2

in 0.035 36 are unknown, and will also change from one step to the
next. So we will look for an upper bound of global error. We will
first assume upper bounds for our unknown, that is we assume
1
P0=( ){0. 4+0. 34 2+0. 35 6}
there exist positive constant D and L so that 3 |P0=0.036 52 ′′| y1=y0+h(y1)+P0 for all
1
| 0.031349184 for all x ∈ Q =3{0.04+2(0.03442)+2(0.035536)+0.031349184} and for all 0.07042039467 . Take the
∈ and |
1+(0. 2)(0)+ 0.036652
0
y1=1. 0367

absolute value of both sides of equation 4 and using the triangle


0. 07042039467
(y1)1=0+
inequality | 0. 2 |≤| |+
Since =0(there is no error at the initial point). We can use this
formula recursively to get an upper bound for the error at the
end point;
| |
1
y (x) =y n ( x )+ (k 1 +2k 2 +2k 3 +k 4 ),n=0,1,2,3
| | n+1 6

hk hk
k1=hf (x, y),k2=hf (x+ , y+ 1),k3=hf (x+ , y+ 2),k4=hf(x+h,y+k3)
| | 22 22 using the fact that
1+ y and f (x , y ), y (x 0 )=x 0 we finally reach the conclusion

| y=f(x) |
y the constant (t)

F(t ,y(t)) Depends only on the problem and we have proved


convergence
n
| f :Ω ⊂×ℜ | ℜ×ℜ
n

f (t0 ,y 0) y ∞
Where

4.12 Improved Euler’s method

Assume that x n , y n is known. The exact solution y( x n+1 ) with x n+1 =x n +h


y ′= f (x , y) passing through this point is given by
xn x n+1
y ( x n +h ) = y n+∫xn y ′ (τ )dτ = y n +∫xn f (τ , y (τ )dτ
the idea is to find approximation to the last integral. The simplest idea is
to use f (τ , y (t )) ≃ in which case we get the Euler’s method again
y n+1= y n +hf ( x n , y n ) . The integral can also be approximated by the
x h
∫xnn+1 f (τ , y (τ ))= 2 (f ( x n , y n )+ f ( x n+1 + y ( x n+1 )))
trapezoidal rule. by replacing
the unknown solution y( x n+1 ) by y n+1 we get the trapezoidal method.
h
y n+1= (f (x n , y n )+f ( x n+1 , y n +hf ( xn , yn )))
2 . Hence
is available by y(n+1)
solving a usually non linear system of equations. Such methods are called
implicitly to avoid this extra difficulty we could replace y(n+1 ) on the right
hand side by the approximation from Euler’s method, thus
y n+1 = yn+hf ( x n , y n )
h
y n+1= (f (x n , y n )+f ( x n+1 , y n+1 )
2 ………..equation 5
This method is called the improved Euler’ method.
3
Error of the improved Euler method. The local error is of order O(h ) , so
that the method is a second-order method.
Proof;
If we substitute y ′= y( x, y( x)) in equation 2 we have
1 1
y ( x+ h)= y ( x )+ hf + h2 f + h 3 f
2 ′ 6 ′′+……equation 6
Setting f n =f ( x n , y ( x n )) and using equation 6
1 1
y ( x n +h )− y ( x n )=h f n + h2 f n + h 3 f n
2 ′ 6 ′′+…….equation 7
Approximating the expression in the brackets in equation 5 by f n +f n+1
and again using the Taylor expansion, we obtain from equation 5 y n+1− y n
1 1 1 1 3
≃ h[ f n ( f n +h f n + h2 f h f n + h2 f n h fn
=2 ′ 2 n ′′ + ……..)] 2 ′+ 4 ′′ +
……..equation 8
Subtraction of equation 8 from equation 7 gives local error
3 3
h 3 h
f − f
6 n 4 n ′′……..
3
h
− fn
= 12 ′′ + ……… since the number of steps over a fixed x interval is
3
1 h
=h 2
proportional to h the global error is of order 3 , so that the
method is of second order.
4.1.2 Runge- Kutta Methods

Runge-Kutta Methods are techniques for solving a first-order ordinary


differential equation. Various types of Runge-Kutta methods are
classified according to their order. The order identifies the number of
points within the subinterval that are utilized for finding the value of the
slope. For instance second order Runge-Kutta methods used the slope at
two points; third-order methods use three points, and so on. The classical
Runge-Kutta methods is of order four and uses four points. A general
frame work for explicit Runge-Kutta schemes are given by
k 1 =f ( x n , y n )
k 2=f ( x n +c 2 h , y n + ha21 k 1 )
k 3=f ( x n +c 3 h , y n +h(a 31 k 1 +a32 k 2 ))
s−1
k s=f ( x n + c s h , y n + h ∑ a sj k j )
j=1 ……..equation 9
s
y n+1= y n +h ∑ b i k i
i=1 ………equation10
where y , and (t)=f(t,y(t),y are coefficient defining the methods .We always
require
( t )) . here, s is the number of stage, or the number of function
evolution ended for each step. The vector h are called stage derivatives.

RUNGE-KUTTA METHOD OF SECOND ORDER

consider a Runge-Kutta Methods with two slopes. Define r


y ( x )
y n+1= y n +w 1 k 1 +w2 k 2 .. . .. . …………equation 11
where the value of the parameters c 2 , a21 , w1 , w 2 are chosen such that the
method is of highest possible order. Now Taylor expansion about x=x n
gives
2
h
y ( x n+1 )= y (x n )+hy ′ ( x n ) + 2 y ′′ ( x n )+.. .... . ……
2 3
h h
= y ( x n )+hf ( x n , y ( x n ))+ (f x + ff y ) x n + [ f xx +2 ff xy +f 2 f yy + f y (f x + ff y )x n ]
2 6 …
….equation 12
We also have
k 1 =hf n
2
h 2
k 2 =hf ( x n +c 2 h , y n + a21 hf n )h [ f n +h (c 2 f x +a 21 ff y ) xi + (c f +2 c 2 a21 ff xy +a 221 f 2 f yy ) x n +. .. . ]
2 2 xx
Substituting the value of k 1 and k 2 in equation 11 gives
h3
y n+1= y n +( w1 +w2 )hf n +h [ w 2 c 2 f x +w 2 a21 ff y )x n + w2 (c 22 f xx +2 c 2 a21 ff xy +a 212 f 2 f yy )x n +. . .]
2
2

………..equation 13
2
Comparing the coefficients on h and h in equation 12 and equation 13
1 1
w +w =1 c 2 w 2= , a 21 w 21=
we obtain 1 2 , 2 2 solving these equations, we
1 1
w 2= w 1=1−
obtain a21=c 2 , 2 c2 , 2 c 2 , where c 2 is arbitrary, if is not possible
3
to compare the coefficients of h as there are five terms in equation 12
and three terms in equation 13. Therefore the Runge-Kutta methods using
two slope(the evaluation of f ) is given by
1 1
y n+1= y n +(1− )k 1 + k
2 c2 2 c 2 2 …….equation 14

We note that the method has one arbitrary parameter c 2 .We may choose
any value for c 2 such that 0≤c 2≤1 . Therefore we have an infinite family
of these methods.
If we choose c 2=1 , we obtained the method
1
y n+1= y n + ( k 1 +k 2 )
2 ……equation 15
k 1 =hf ( x n , y n )
k 2 =hf ( x n +h , y n +k 1 ) which is the Huen’s method
1
c2= w 1=0
If we choose 2 , we get the method is given by
y n+1= y n +k 2 …….equation 16
k 1 =hf ( x n , y n )
h 1
k 2 =hf ( x n + , y n + k 1 )
2 2 which is the modified Euler method
Error of the Runge-Kutta method
Subtracting equation 13 from equation 12 we get the truncation error in
the method as
1 c 1
h3 [( − 2 )f xx+2 ff xy +f 2 f yy+ f y (f x + ff y )+. .. . .. ]
T . E= y (x n+1 )− y n+1 = 6 4 6
….equ
ation 17
3
Since the truncation error is of order O(h ) , the method is of the second
order for all values of c 2 . Therefore , equation 14 gives an infinite family
2
,
of second order methods. We may note that for c 2 = 3 the first term inside
the bracket in equation 17 vanishes and we get a method of minimum
truncation error. The method is given by
1
y n+1= y n + ( k 1 +3 k 2 )
4 …….equation 18
k 1 =hf ( x n , y n )
2h 2
k 2 =hf ( x n + , y n + k 1 )
3 3
Therefore, the method of equation 18 is a second order method with a
minimum of a truncation error.

Fourth-Order Runge-Kutta method


The fourth-Runge-Kutta method (RK4) simulates the accuracy of the
Taylor series method of order N=4. The method on computing y n+1 is as
follows;
y n+1= y n +w 1 k 1 +w2 k 2 +w3 k 3 +w 4 k 4 …….equation 19 where k 1 ,k 2 ,k 3 ,k 4 has the
form
k 1 =hf ( x n , y n )
k 2 =hf ( x n +a1 h , y n +b1 k 1 )
k 3 =hf (x n +a2 h , y n +b2 k 1 +b 3 k 2 )
k 4 =hf ( x n + a3 h , y n + b4 k 1 +b 5 k 2 +b6 k 3 )
By matching coefficients with those of the Taylor series method of order
5
N=4 so that the local truncation error is of order O(h ) ,Runge and Kutta
were able to obtain the following system of equation
b1 =a 1
b2 +b3 =a 2
b 4 +b 5 +b 6 =a 3
w 1 +w 2 +w 3 +w4 =1
1
w 2 a1 +w3 a2 +w4 a3 =
2
1
w 2 a 31 +w 3 a 22 +w 4 a 33 =
3
1
w 2 a31 +w3 a32 +w 4 a 33 =
4
1
w 3 a1 b 3 +w 4 (a1 b 5 +a2 b6 )=
6
1
w 3 a1 a 2 b3 +w 4 a 3 (a 1 b5 +a2 b6 )=
6
1
w 3 a 21 b3 +w4 (a 21 b5 +a 22 b 6 )=
2
1
w 4 a1 b3 b 6 =
24
The system involves 11 equations in 13 unknowns. Two additional
conditions must be supplied to solve the system .The most useful choice
to proof classical Runge-Kutta order four method is
1
a1 =
2 and b2 =0 …….equation 20
Then the solution for the remaining variable is
1 1 1 1 1 1 1
a2 = , w 1= , a3 =1 , w2 = , b1 = , b3 = , w3 = , w 4 = , b4 =0 , b 5=0 ,b 6 =1
2 6 3 2 2 3 6 …….
equation 21
The value in equation 20 and equation 21 are substitute into equation 19
to obtain the formula for the standard Runge-Kutta method of order N=4
which is
1
y n+1= y n + (k 1 +2 k 2 +2 k 3 +k 4 )
6 ………equation 22
k 1 =hf ( x n , y n )
h 1
k 2 =hf ( x n + , y n + k 1 )
2 2
h 1
k 3 =hf ( x n + , y n + k 2 )
2 2
k 4 =hf ( x n +h , y n +k 3 )
This is called a fourth order method because it reproduces the term in the
4
Taylor series up to and including the one involving h h . The error is
5 5
therefore O(h ) . The exact expressions for h error are available by( David
Kincard and Ward Chenes,1991).

Example 1, Euler Method


2
Given the initial value problem y ′ ( x )=x +xy , y (0 )=1 on the interval
0≤x≤1. The exact solution of the given problem is given by


y( x )=
π x2 x x2
2 e erf ( √2 ) +e 2 −x .
2

Solution

h
h
, Euler Method

Example 2
2
Given the initial value problem y ′ ( x)=xy− y , y (0)=1 on the interval
0≤x≤1. The exact solution of the given problem is given by
x2
2
2e
y ( x )=

√ 2 π erf (

Solution
x
√2
)+2

O(h)
By Euler ‘s Method
i.e
Euler Method Example 3
Apply Euler’s method to solve the equation y ′ =1+xy for x=0(0. 1)0 .5
given that x=0 , y=1 . The exact solution of the given problem is given by
1
1 x2
y ( x )=( √ π √ 2 erf ( 1 √ 2 x )+1)e 2
2 2
Solution

By Euler Method
yn
0
=0
y ( xn )
er =

1.0
max
1≤n≤steps
( y(xn )− yn ′ )
1.0
0.1 1.1 1.11
0.2 1.211 1.2422
0.3 1.33522 1.400566
0.4 1.4752766 1.59011064
0.5 1.634287664 1.817143832

Euler Cauchy or Improved Euler Method Example


2
The equation y ′= x −2 x+ y is subjected to the initial condition
x=0 , y=0 .5 use Euler Cauchy or the Improved Euler Method to obtain
function values for x=0(0 .1)0.5 , the exact solution of the given problem is
1
y ( x )=−x 2 + e x
given by 2

Solution
x 1=x 0 + h
x 1=0+0 .1
x 1=0 . 1
2
y′= x −2 x+ y
x 0=0 , y 0=0. 5 , h=0. 1
( y ′ )0 =f ( x 0 , y 0 )
2
( y ′ )0 = x 0 −2 x 0 + y 0
= 0−0+0 .5
( y ′ )0 =0 .5
2
f (x 1 , y 1 )=x 1 −2x 1 + y 1
2
= x 1 −2 x 1 + y 0 +h( y ′ )0
from
1
y 1 = y 0 + h ¿ ¿ ) +f ( x , y )¿¿
2 ′ 0 1 1
1
y 1= y 0 + h ¿ ¿ 2
2 ′ )0 +x 1 −2 x 1 + y 0 +h( y ′ )0 ¿¿
1
y 1= y 0+ h ¿ ¿ ) ¿¿
2 ′0
2
= 0.5+(0 .5 )×0.1 {0 . 1 −2(0 .1)+0 . 5+(1+0 . 1)×0.5}
y 1 =0 .543
(y ′ )1=x 21 −2 x 1 + y 1
2
=0 . 1 −2(0. 1)+0. 543
=0 .353
1
y 2= y 1+ h¿¿
2 ′ )1 ¿¿
2
y 2 =0 .543+(0 .5 )×0 . 1×{0 .2 −2(0 . 2)+0 .543+(1+0 .1 )×0 . 353}
y 2 =0 .5716
2
( y ′ )2 =x 2 −2 x 2 + y 2
2
=0 . 2 −2(0 .2 )+0. 5716
= 0.2116

1
y 3= y 2+ h¿¿
2 ′ )2 ¿¿
2
= 0 .5716+(0 .5 )×0. 1 {0 . 3 −2(0 .3 )+0 .5716+(1+0 .1 )×0 . 2116}
=0 . 586318=0 . 5863
2
( y ′ )3 =x 3 −2 x 3 + y 3
2
=0 . 3 −2(0 .3 )+0 .5863
=0 . 0763
1
y 4= y 3 + h¿¿
2 ′ )3 ¿¿
=0. 5863+(0 . 5)×0.1 {0. 4 2 −2(0. 4 )+0 .5863+(1+0 .1)×0 . 0763}
=0. 5878
2
( y ′ )4 =x 4 −2 x 4 + y 4
2
= 0 . 4 −2(0. 4 )+0 . 5878
−0. 0522
1
y 5= y 4 + h¿¿
2 ′ )4 ¿¿
=0 . 5878+(0 . 5)×0 .1 {0. 52 −2(0 .5 )+0 . 5878+(1+0 .1)×(−0 . 0522)}
= 0.5768
2
( y ′ )5 =x 5 −2 x 5 + y 5
2
=0 . 5 −2(0 .5 )+0 .5768
=−0. 1732
Runge Kutta Method Example 1
2
Given the initial value problem y ′ ( x )=x +xy , y (0 )=1 on the interval
0≤x≤1. The exact solution of the given problem is given by

y( x )=
π x2
√x x2
2 e erf ( √2 ) +e 2 −x .
2

Solution

h→0 x=xn (h2 ) O(h)


n =0
h(step
size )
h
Example 2, Runge Kutta Method
2
5
O(h )

Given the initial value problem y ′ ( x)=xy− y , y (0)=1 on the interval


0≤x≤1. The exact solution of the given problem is given by

y ( x )=
2e
x2
2

√ 2 π erf (
x
√2
)+2
3
Solution

O(h )
Runge-Kutta First Order Method Example 3
Using Runge-Kutta method, solve the equation h ′ f (x , y ) given that
y = 1 when x=0(0. 2)1.0 , the exact solution of the problem is given by
y( x)=−2+2 x +3 e−x
SOLUTION

f(xn ,yn)
h
h
2
h
h
2
h
n=1,
qh
y
= y
y ( 0 )=1

Runge-Kutta Second Order Method Example


Using Runge-kutta method, solve the equation, y ″ =(x +2 ) y −2 y ′
given that when x=0, y=1, y ′ 0 for x=0(0. 2)1. 0 , the exact solution of the
−x −2 x
given problem is given by e (3+x)(1+e )
SOLUTION
y ″ =(x +2 ) y −2 y ′
f ( xn , y0 )
n=0
f
f (x , y)= y
f ( x0 , y0 )
f(0,1) h
hf ( y 0 )=1×1=1
y
y 1=y 0+hf ( y

0
=y1=1+1×1=2

y 2

y3
y4
y 2 = y 1 + hf ( y
)1

=2+1×2=4
y 3 = y 2 +hf ( y
)2

=4+1×4=8
y 4 = y 3 +hf ( y
3
=8+1×8=16

n
yn

xn
f ( xn , yn )

CHAPTER FIVE
5.1 SUMMARY,CONCLUSION AND RECOMMENDATIONS
This chapter is the final chapter of this study. It comprises
summary of the study,conclusion,recommendations for the study
and suggestion for further studies.

5.2 SUMMARY
In this thesis, Euler method and Runge-Kutta method are used
for solving ordinary differential (ODE) in initial problems(IVP) . Finding
more accurate results needs the step size smaller for all methods. From
the figures and the tables we can see the accuracy of the methods for
decreasing the step size h and the graph of the approximate solution
approaches to the graph of the exact solution. The numerical solutions
obtained by the two proposed methods are in good agreement with exact
solutions. Comparing the two methods under investigation, we observed
that the rate of convergence of Euler’s method is O(h) and the rate of
4
convergence of fourth-order Runge-Kutta method is O(h ) . The Euler
method was found to be less accurate due to the inaccurate numerical
results that were obtained from the approximate solution in comparison
to the exact solution.
5.3 CONCLUSION AND RECOMMENDATION
The conclusion drawn from the results of this thesis are follows:
1. The accuracy of improved Euler method is better than the accuracy
of Euler method and the accuracy of Runge-Kutta fourth order
method is better than the Improved Euler method.
2. We have compared to the Runge –Kutta order four method, to the
Runge-Kutta second order four method, the Runge-Kutta second
order four method is a computational time very similar,slightly more
accurate results with a much lower number of discretization steps, but
the additional computational cost per step.
3. Runge-Kutta fourth order method have been developed for numerical
integration of first order ordinary differential equations, they are
almost four-step in nature and they are computationally more
efficient and produced small errors.
4. When we use the Runge-Kutta order four method, by minimizing the
step-size h then the error become decrease and the accuracy
although increase.
5. We use the exact solution in Runge-Kutta methods to compute the
errors.
6. This study shows that Euler’s method, Improved Euler method and
Runge-Kutta fourth order method can generate a solution of second
order ODE.

5.4 Suggestion for further Studies


Based on this thesis there are some suggestions for further study.
1. To compare the accuracy of Runge-Kutta Fehlberg method, Dormard
prince method and Runge-Kutta verner method with different
algorithm.
2. To compare the accuracy of Runge-Kutta Fehlberg method and
Runge-Kutta fourth order method to a second order differential
equation.
REFERENCES
Abraham, O., and Leonardo, J. (2008). Sci, 12(2008) 57-66.
Adesola, O.A. Samson, A. A., Ayomide O.A., and Adekunle O.A.(2015). Dynamic
Computational of Runge-Kutta’s Fourth-Order Algorithm for First and
Second Ordinary Differential Equation Using Java. International Journal of Computer
Science Issues, Volume 12,Issues 3, 1694-0784.
Akanbi, M.A.(2010).Propagation of Errors in Euler Methods, Scholars Research
Library. Archives of Applied Science Research,2(2):457-469.
http://scholarsresearchlibrary.com/archive.html
Angelos, A.A. (2003). Constructing Runge-Kutta Methods with the use of Artificial
Neural Networks, doi:10.1007/2Fs005210131476x. Retrieved from
http://link.springer.com/2003
Ashiribo, S.W. Moses, A.A., and Solomon, A.O.(2013).A Three-Stage Multiderivative
Explicit Runge-Kutta Method. American Journal of Computational
Mathematics,2013,3,121-126 http://dx.doi.org/10.4236/ajcm.2013.32020
Atkinson, Kendall,A.(1989)An introduction to Numerical Analysis(2 nd end).New York
John Wiley & sons ISBN 978-0-471-50023-0.
Balagurusamy.E.(2006)Numerical Methods.Tata McGraw-Hill,New Delhi.
Bazuaye, Frank., and Etin, Osa.(2019). A New 4th Order Hybrid Runge-Kutta Methods
for Solving Initial Value Problems(IVPs). Pure and Applied Mathematics Journal. Vol.
7, No.6,2018,pp 78-87. Doi:10.11648/j.pamj.20180706.11
ISSN:2326-9812(online).
Bulirsch, R., and Store J.(1993)Introduction to Numerical analysis second edition.
Springer veriag new York Inc.
Burden, R.L.,and Faires,J.D.(2002)Numerical Analysis. Bangalore,India.
Carl-Eric,Froberg(1969)Introduction to Numerical analysis second edition by Addison
Wesles publishing Company.
David Kincaid, and Ward Chenes(1991). Numerical Analysis of Scientific Computing by
WardsWorth Ink.
Erinle, L.M. (2019).Tai Solarin University of Education Second Semester
Examination on Numerical Analysis.
Faranak, R., and Fudziah, I. (2011). Third-Order Improved Runge-Kutta Method for
Solving Ordinary Differential Equation. International Journal of Applied
Physics and Mathematics, Vol. 1, No,3.
Gear, C.W.(1971)Numerical Initial Value Problems in Ordinary differential Equations.
Prentice-Hall, Upper Saddle river.
Gerald, C.F., and Wheatley,P.O,(2002)Applied Numerical Analysis Pearson Education,
India.
Hall, G., and Watt, J.M.(1976)Modern Numerical Methods for Ordinary Differential
Equations Oxford University Press,Oxford.
Heath, M.T. (2002). Scientific computing: an introductory survey. McGraw-Hill.
Hossain, Md.S., Bhattacharjee, P.K., and Hossain,Md.E.(2013)Numerical Analysis Titas
Publications, Dhaka.
Islam, Md.A. (2015)Accuracy Analysis of Numerical Solutions of Initial Value Problems
(IVP),for Ordinary Differential Equations(ODE).IOSR Journal of Mathematics
11,18-23.
Islam, Md.A.(2015)Accurate Solutions of Initial Value Problems for Ordinary
Differential Equations with Fourth Order Runge-Kutta Method. Journal
Of Mathematics Research,7,41-45.
http://dx.doi.org/10.5539/jmr.v7n3p41
Islam, Md.A. (2015). A comparative study on numerical solutions of initial value
problems (IVP) for ordinary differential equations (ODE) with Euler and
Runge-Kutta methods. American Journal of Computational
Mathematics, 5(3):393-404.
Jahangir, Md. H. Shah,Md.A., and Babul,Md.H.(2017).A study on Numerical Solutions
of Second Order Initial Value Problems(IVP) for Ordinary Differential
Equations with Fourth Order and Butcher’s Fifth Order Runge-Kutta Methods.
American Journal of Computational and Applied Mathematics,7(5):129-137
DOI:10.5923/j.ajcam.20170705.02
Jain, M.K., Iyengar, S.R.K., and Jain, R.K.(2012)Numerical Methods for Scientific and
Engineering Computation 6th Edition ISBN:978-81-224-3323-4
www.newagepublishers.com
John, H. Mathews., and Kurtis, D. Fink. (1999).Numerical Method using MATLAB
Third edition prentice hall.
Jorick, N. (2005).”A Runge-Kutta Discontinuous-Galerkin Level-Set Method for
Unsteady Compressible Two-Fluid Flow”, Masters thesis, Delft University of
Technology, Netherlands.
Ketcheson, D., and Ahmadia, A. (2013). Optimal stability polynomials for numerical
Integration of initial value problems. Communications in Applied
Mathematics and Computational Science, 7(2):247-271.
Kockler, N.(1994)Numerical Method for Ordinary System of Initial Value Problems.
John Wiley and sons, New York.
Mathews, J.H. (2005)Numerical Methods for Mathematics, Science and
Engineering.Prentice-Hall,India.
Ogunrinde,R.B., Fadugba,S.E., and Okunlola,J.T.(2012).On some Numerical Methods for
Solving Initial Value Problems in Ordinary Differential Equations. IOSR Journal of
Mathematics,1,25-31
http://dx.doi.org/109790/5728-0132531
Omale, D. Ojih, P.B., and Ogwo, M.O.(2014). Mathematical analysis of stiff andn non-
stiff initial value problems of ordinary differential equation using
matlab. International Journal of scientific and engineering research,
5(9):49-59.
Papadopoulos, D.F., and Simos, T.E. (2013). The use of phase lag and amplification
error derivatives for the construction of a modified Runge-Kutta Nystrom method. In
Abstract and Applied Mathematics Hindawi.

Patterson, M.D. (2003). “Implementing Runge-Kutta solvers in Java”,B.Sc. thesis


AcadiaUniversity.

Pual, L., DeVries, and Javier,E.H.(2011)2nd Edition,Jones and Barlett Publishers.


A first course in Computational Physics.
Richard, B., and Gabriel,B.C.(2006).Third Edition Schaum’s Outline of Differential
Equations McGraw Hill-ISBN 978-007-161162-6
Sastry, S.S.(2000)Introductory Methods of Numerical Analysis. Prentice-Hall, India.
Sé ka, H., and Assui, K.R. (2019). Order of the Runge-Kutta method and evolution of
the stability region. Ural Mathematical Journal, 5(2):64-71.
Shampine, L.F., and Watts, H.A. (1971) Computing Error Estimators forRunge-Kutta
Methods. Mathematics of Computation,25,445-455
http://dx.doi.org/10.1090/S0025-5718-1971-0297138-9
Suli, E., and Mayers , D.(2003)An Introduction to Numerical Analysis, Cambridge
University Press, ISBN 0-521-00794-1
Stoer, J., and Bulirsch, R. (2002)Introduction to Numerical Analysis(3 rd ed),Berlin,
New York:Springer-Verlag,ISBN 978-0-387-95452-3
Stroud, K.A., and Dexter, J.B. (2011) Advanced Engineering Mathematics 5 th Edition,
Palgrave® and Macmillian ISBN 978-0-230-27548-5
Wusu, A.S. Akanbi, M.A. , and Okunuga, S.A.(2013). A three-stage multi derivative
explicit Runge-Kutta method. American Journal of Computational
Mathematics, 3(2):121-126,2013.
APPENDIX

Table 2.4 Euler’s Method Example 1


n x y y' Exact h= 0.1 Error(%)
0 0 1.0000000000 0.0000000000 1.0000000000 0.000000000000E+00
1 0.1 1.0000000000 0.1100000000 1.0053465218 5.346521805272E-03
2 0.2 1.0110000000 0.2422000000 1.0228894625 1.188946246017E-02
3 0.3 1.0352200000 0.4005660000 1.0551919636 1.997196357437E-02
4 0.4 1.0752766000 0.5901106400 1.1053189529 3.004235289309E-02
5 0.5 1.1342876640 0.8171438320 1.1769749716 4.268730756509E-02
6 0.6 1.2160020472 1.0896012283 1.2746789917 5.867694449676E-02
7 0.7 1.3249621700 1.4174735190 1.4039883159 7.902614590374E-02
8 0.8 1.4667095219 1.8133676175 1.5717877689 1.050782470007E-01
9 0.9 1.6480462837 2.2932416553 1.7866658485 1.386195647988E-01
10 1 1.8773704492 2.8773704492 2.0594074036 1.820369544267E-01

Exact Values
2.5

2.0

1.5
Exact Values
1.0

0.5

0.0
0 0.2 0.4 0.6 0.8 1 1.2

Figure 2.2 Euler’s Method Example 1 Graph

h yn+1 y 4=16 y(x)=ex


y(4)=e ≈54.598 h=1.0
4
Table 2.5 Euler’s Method Example 2

n X y y' 0.1 Exact Error


̵1.0000000000000000
0 0 1.0000000000000000 1.0000000000 0.00000000E+00
1 0.1 0.9000000000000000 ̵0.7200000000000000 0.9137859912 1.37859912E-02
2 0.2 0.8280000000000000 ̵0.5199840000000000 0.8511078116 2.31078116E-02
3 0.3 0.7760016000000000 ̵0.3693780032025600 0.8073943125 3.13927125E-02
4 0.4 0.7390637996797440 ̵0.2505897801251630 0.7795762278 4.05124282E-02
5 0.5 0.7140048216672280 ̵0.1528004745304360 0.7656795352 5.16747135E-02
6 0.6 0.6987247742141840 ̵0.0689814455721522 0.7645732528 6.58484785E-02
7 0.7 0.6918266296569690 0.0056545552573574 0.7758200022 8.39933726E-02
8 0.8 0.6923920851827050 0.0745068685225099 0.7995997383 1.07207653E-01
9 0.9 0.6998427720349560 0.1400785892618890 0.8366905724 1.36847800E-01
10 1 0.7138506309611450 0.2042679076375200 0.8884994608 1.74648830E-01

Exact Values
1.2

1.0

0.8

0.6 Exact Values

0.4

0.2

0.0
0 0.2 0.4 0.6 0.8 1 1.2

Figure 2.3 Euler’s Method Example 2 Graph

Table 2.6 Euler’s Method Example 3


n x y y' Exact Error h=0.1
0 0 1 1 1.055901 5.294151
1 0.1 1.1 1.11 1.180341 6.806568
2 0.2 1.211 1.2422 1.226293 1.247131
3 0.3 1.33522 1.400566 1.27317 -4.87366
4 0.4 1.475277 1.590111 1.3289 -11.0149
5 0.5 1.634288 1.817144 1.397441 -16.9486
6 0.6 1.816002 2.089601 1.481981 -22.5389
7 0.7 2.024962 2.417474 1.585819 -27.6919
8 0.8 2.26671 2.813368 1.712799 -32.3395
9 0.9 2.548046 3.293242 1.867623 -36.4326
10 1 2.87737 3.87737 2.056178 -39.9378
Euler method Example 3
2.50

2.00

1.50

1.00

0.50

0.00
0 0.2 0.4 0.6 0.8 1 1.2

Figure 2.4

Table 2.7 Euler’s Cauchy Method Example


n x y y' Exact Error 0.1
0 0 0.5 0.5 0.5 0
1 0.1 0.543 0.353 0.562585 3.48133
2 0.2 0.571565 0.211565 0.650701 12.1617
3 0.3 0.586279 0.076279 0.764929 23.35511
4 0.4 0.587789 -0.05221 0.905912 35.11639
5 0.5 0.576806 -0.17319 1.074361 46.31165
6 0.6 0.554121 -0.28588 1.271059 56.40478
7 0.7 0.520604 -0.3894 1.496876 65.22065
8 0.8 0.477217 -0.48278 1.75277 72.77354
9 0.9 0.425025 -0.56497 2.039802 79.16341
10 1 0.365203 -0.6348 2.359141 84.51967
Euler Cauchy method Example
2.50

2.00

1.50

1.00

0.50

0.00
0 0.2 0.4 0.6 0.8 1 1.2

Figure 2.5

Table 2.8 Runge-Kutta Method First order Example 1


n x k1 k2 k3 k4 y y' Exact Error(%) h
0 0 -0.2 -0.14 -0.146 -0.0908 1.0000000 -1 1 0.0000000000 0.2
1 0.2 -0.09124 -0.04212 -0.04703 -0.00183 0.8562000 -0.4562 0.856192 ̵0.0009040920
2 0.4 -0.00219 0.038025 0.034003 0.071005 0.8109728 -0.01097 0.81096 ̵0.0015629901
3 0.6 0.07071 0.103639 0.100346 0.130641 0.8464505 0.35355 0.846435 ̵0.0018390571
4 0.8 0.130399 0.157359 0.154663 0.179467 0.9480039 0.651996 0.947987 ̵0.0017925322
5 1 0.179269 0.201342 0.199135 0.219442 1.1036557 0.896344 1.103638 ̵0.0015757754
6 1.2 0.21928 0.237352 0.235545 0.252171 1.3035997 1.0964 1.303583 ̵0.0013107068
7 1.4 0.252039 0.266835 0.265355 0.278968 1.5398072 1.260193 1.539791 ̵0.0010599148
8 1.6 0.278859 0.290973 0.289762 0.300907 1.8057048 1.394295 1.80569 ̵0.0008457137
9 1.8 0.300818 0.310736 0.309744 0.318869 2.0959107 1.504089 2.095897 ̵0.0006711056
10 2 0.318796 0.326917 0.326105 0.333575 2.4060186 1.593981 2.406006 ̵0.0005318184
Runge Kutta Method first order
3.00

2.50

2.00

1.50

1.00

0.50

0.00
0 0.5 1 1.5 2 2.5

Figure 2.6

Table 2.9 Runge-Kutta Method first order Example 2


n x k1 k2 k3 k4 y
0 0.0 0.0000000000 0.0052500000 0.0052631250 0.0110526313
1 0.1 0.0110534648 0.0174130982 0.0174607954 0.0244561455
2 0.2 0.0244577876 0.0321279568 0.0322238340 0.0406533964
3 0.3 0.0406557552 0.0498931901 0.0500548453 0.0602098674
4 0.4 0.0602127516 0.0713441324 0.0715945885 0.0838456689
5 0.5 0.0838487383 0.0972894525 0.0976590721 0.1124780303
6 0.6 0.1124807242 0.1287597414 0.1292888095 0.1472777282
7 0.7 0.1472791597 0.1670720681 0.1678143022 0.1897441838
8 0.8 0.1897429874 0.2139160011 0.2149433542 0.2418057627
9 0.9 0.2417998728 0.2714686930 0.2728779619 0.3059543215
10 1.0 0.3059406504 0.3425495670 0.3444715351 0.3854265843

h=0.1 Exact Errors(%)


1.0000000 0.000000000000E+00
1.0053211 2.539415844804E-05
1.0228381 5.130097676820E-05
1.0551136 7.825360979541E-05
1.1052120 1.068264043156E-04
1.1768371 1.376610588861E-04
1.2745072 1.714885137740E-04
1.4037788 2.091724162270E-04
1.5715356 2.517308781156E-04
1.7863648 3.004138247988E-04
2.0590498 3.567240854720E-04
2.50
Runge Kutta method first order

2.00

1.50

1.00

0.50

0.00
0 0.2 0.4 0.6 0.8 1 1.2

Figure 2.7

Table 2.10 Runge-Kutta Method Example 3


n x k1 k2 k3 k4 y
0 0 ̵ .1000000000000000
0 ̵ .0855000000000000
0 ̵ .0868465062500000
0 ̵ .0742533953772831 1.00000000000
0
0.
1 1 ̵ .0743147675679103
0 ̵ .0636539303861032
0 ̵ .0645110795604524
0 ̵ .0550997782989693 0.91350893202
0
0.
2 2 ̵ .0551327867847172
0 ̵ .0469698699328118
0 ̵ .0475402068166837
0 ̵ .0402184169080905 0.84921817106
0
0.
3 3 ̵ .0402373151448337
0 ̵ .0337465092215344
0 ̵ .0341413624637357
0 ̵ .0282262378993994 0.80182294486
0
0.
4 4 ̵ .0282377605637206
0 ̵ .0228860817164961
0 ̵ .0231697218200842
0 ̵ .0182142356408601 0.76778306212
0
0.
5 5 ̵ .0182217333605185
0 ̵ .0136507335027290
0 ̵ .0138617861705335
0 ̵ .0095612198680158 0.74468912824
0
0.
6 6 ̵ .0095664292871486
0 ̵ .0055259885305893
0 ̵ .0056884605895034
0 ̵ .0018274541405458 0.73088779615
0
0.
7 7 ̵ .0018313062237814
0 0.0018590048859490 0.0017297489381860 0.0053083808330180 0.72525066587
0.
8 8 0.0053053714354742 0.0087795636700070 0.0086734105380750 0.0120875601355270 0.72702642958
0.
9 9 0.0120850989624742 0.0154450518833472 0.0153551309930145 0.0186949774020381 0.73574290958
1
0 1 0.0186928876231582 0.0220171299652968 0.0219385724162370 0.0252736106713550 0.75113964993

y y' h=0.1 Exact Error


1.0000000000000000 ̵1.0000000000000000 1.0000000000 0.000000000000E+00
0.9135089320204530 ̵0.7431476756791030 0.9137859912 2.770592128982E-04
0.8492181710604540 ̵0.5513278678471720 0.8511078116 1.889640514372E-03
0.8018229448618210 ̵0.4023731514483370 0.8073943125 5.571367615713E-03
0.7677830621260260 ̵0.2823776056372060 0.7795762278 1.179316571355E-02
0.7446891282464020 ̵0.1822173336051850 0.7656795352 2.099040690455E-02
0.7308877961505590 ̵0.0956642928714856 0.7645732528 3.368545660833E-02
0.7252506658725790 ̵0.0183130622378139 0.7758200022 5.056933635467E-02
0.7270264295821630 0.0530537143547423 0.7995997383 7.257330870157E-02
0.7357429095800240 0.1208509896247420 0.8366905724 1.009476628415E-01
0.7511396499328970 0.1869288762315820 0.8884994608 1.373598108509E-01

Example 3 runge kutta graph


1.2

1.0

0.8

0.6

0.4

0.2

0.0
0 0.2 0.4 0.6 0.8 1 1.2

Figure 2.8

Table 2.11 Runge-Kutta Method Second Order


N x k1 k2 k3 k4 P Q y
0 0.0 0.0400000 0.0344200 0.0355360 0.0313492 0.0366520 0.0704204 1.0000000
1 0.2 0.0315286 0.0292784 0.0297285 0.0285910 0.0301785 0.0593778 1.0366520
2 0.4 0.0286284 0.0287800 0.0287497 0.0299220 0.0287194 0.0578700 1.1372509
3 0.6 0.0298463 0.0319386 0.0315201 0.0346959 0.0311017 0.0638199 1.2957685
4 0.8 0.0345165 0.0384360 0.0376521 0.0428623 0.0368682 0.0765183 1.5145383
5 1.0 0.0425724 0.0484918 0.0473079 0.0548809 0.0461240 0.0963509 1.8028945
6 1.2 0.0544581 0.0628229 0.0611500 0.0717208 0.0594770 0.1247082 2.1770249
7 1.4 0.0711253 0.0826840 0.0803722 0.0949394 0.0780605 0.1640590 2.6608591
8 1.6 0.0941100 0.1099906 0.1068145 0.1268515 0.1036384 0.2181906 3.2879851
9 1.8 0.1256978 0.1475402 0.1431717 0.1708071 0.1388032 0.2926429 4.1047479
10 2.0 0.1691977 0.1993587 0.1933265 0.2316185 0.1872943 0.3953956 5.1748663

y' y'' h= 0.2 Exact Error(%)


0.0000000 2.0000000 6.0000000 83.33
0.3521020 1.5764305 4.3761356 76.31
0.6489910 1.4314202 3.3031485 65.57
0.9383408 1.4923164 2.5707979 49.60
1.2574401 1.7258270 2.0521783 26.20
1.6400316 2.1286205 1.6706660 -7.91
2.1217861 2.7229074 1.3797753 -57.78
2.7453272 3.5562666 1.1510072 -131.18
3.5656224 4.7055014 0.9665808 -240.17
4.6565755 6.2848912 0.8151143 -403.58
6.1197898 8.4598855 0.6890702 -650.99

Runge Kutta Method Second Order


7.00

6.00

5.00

4.00

3.00

2.00

1.00

0.00
0.0 0.5 1.0 1.5 2.0 2.5

Figure 2.8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy