Professional Documents
Culture Documents
DEPARTMENT OF MATHEMATICS
JULY, 2021G.C
BONGA; ETHIOPIA
This Project entitled Numerical Solution of ODE Using Euler Method A.Y. 2021 Prepared
and submitted byTeressa Getachew in partial fulfilment of the requirement for the degree of
BACHELOR OF SCIENCE has been examined and here by recommended for approval and
Acceptance.
i
ACKNOWLE DGEMENT
First of all, I would like to express my gratitude to my GOD for his permission to do my daily
activities. Next, I would like to express my deepest gratitude and great appreciation to my
advisor fikire W/G (MSc) for her efforts, and comments during the preparation of this project
and for her guidance and supporting me from starting point to its completeness. Again, I
would like to appreciate all of Bonga University library, staff members who supplied me with
journal books and also Bonga University internet lab. Furthermore, I wish to thank my
closest friends for their help and moral support. Last, my thanks to my family for their
unending support through financial and different materials throughout my project work.
ii
ABSTRACT
In this paper we introduce the notion of numerical solution of ordinary differential equation
by using Euler methods. It informs some materials and methods used to prepare project. The
given ordinary differential equation is analysed on Euler’s method to find the approximated
solution with the given initial conditions. Then, after investigating the numerical solution of
ordinary differential equation by using Euler’s method, we gave advantages and
disadvantages of Euler method. It comparing the approximated solutions or numerical
solutions with analytical solutions.
iii
Contents
ACKNOWLE DGEMENT....................................................................................................................ii
ABSTRACT.............................................................................................................................................iii
CHAPTER ONE........................................................................................................................................1
1. INTRODUCTION.................................................................................................................................1
1.1. Background.................................................................................................................................1
1.2 Statements of the Problem...................................................................................................2
1.3 objectives......................................................................................................................................3
1.3.1 General Objective.............................................................................................................3
1.3.2 Specific Objectives................................................................................................................3
1.2.3. Significance of the Study......................................................................................................3
CHAPTER TWO.......................................................................................................................................4
2. REVIEW OF RELATED LITERATURE.....................................................................................................4
2.1. Ordinary Differential Equations,.............................................................................................4
2.2. Taylor Method............................................................................................................................5
2.3. Types of Errors...........................................................................................................................6
2.4. Single Step and Multi Step Methods...........................................................................................8
2.5 Finite Difference..........................................................................................................................8
CHAPTER THREE..................................................................................................................................10
3.1 Source of the Information..........................................................................................................10
3.2 Mathematical Procedure...........................................................................................................10
CHAPTER FOUR...............................................................................................................................11
4. SOLVING ORDINARY DIFFERENTIAL EQUATION BY EULER METHOD..........................11
4.1 Derivation of Euler’s Method.....................................................................................................11
Figure 1.1.........................................................................................................................................11
4.2. Modified Euler’s Method..........................................................................................................15
Figure 4.1.........................................................................................................................................19
4.3. Error Analysis of Euler’s Method..............................................................................................19
5. CONCLUSION...................................................................................................................................25
REFERENCE..........................................................................................................................................26
iv
CHAPTER ONE
1. INTRODUCTION
1.1. Background
Differential equation is an equation involving independent variable and dependent variable
and the derivatives or differentials of one or more dependent variable with respect to one or
more independent variables. Differential equations are of basic importance in engineering and
mathematics because many physical laws and relations as well as population growth and
decays appear mathematically 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 (John, sons, 1991).
In most real life situations, the differential equation that models the problem is too
complicated to solve exactly, and one of two approaches is taken to approximate the solution.
The first approach is to simplify the differential equations to one that can be solved exactly
and then use the solution of the simplified equation to approximate the solution to the original
equations. The other approach, which we will examine in this project, uses methods for
approximating the solution of the original problem. This is the approach that is most
commonly taken since the approximated methods give more accurate results and realistic
error information (Vilely, 1962).
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 a limited number of differential equations can be solved analytically. There are many
analytical methods for finding the solution of ordinary differential equations. Even if then
there exist a large number of ordinary differential equations whose solutions cannot be
obtained in closed form by 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 condition or conditions. There are many types of practical numerical
methods for solving initial value problems for ordinary differential equations In this project,
we present standard numerical methods, Euler method for solving initial value problems of
ordinary differential equations in the forms:
1
dy
=f ( x , y ) ; y ( 0 )= y 0
dx
Therefore, numerical methods are often very useful for understanding the behaviour of the
solutions (Vilely, 1962).
The problem with this approach is that it’s only really good for getting general trends
in solutions and for long term behavior of solutions. There are times when we will
need something more. For instance, maybe we need to determine how a specific
solution behaves, including some values that the solution will take. There are many
different methods that can be used to approximate solutions to a differential equation
and in fact whole classes can be taught just dealing with the various methods. We are
going to look at one of the oldest and easiest to use here. This method was originally
devised by Euler and is called, oddly enough, Euler’s Method.
However this project where discussed different question that may race numerical solution in
Euler methods. Therefore, this project was attempted to answer the following questions:
2
What do you mean by Euler’s method?
Why do we use Euler’s method?
1.3 objectives
1.3.1 General Objective
The general objective of this project is
To find the numerical solution of ordinary differential equation by using the Euler’s
method.
It also helps the student of mathematics to understand more about several numerical solution
of ordinary differential equation with the Euler methods. It provides a vehicle for you to
reinforce your understanding of mathematics. Because one function of numerical methods is
to reduce higher mathematics to basic arithmetic operations; enhanced understanding and
insight can be result from this alternative perspective. So doing project on the numerical
analysis of differential equation is very important for the development of a country.
3
CHAPTER TWO
It will be useful to review some elementary definitions and concepts from the theory of
differential equations. An equation involving a relation between the values of an unknown
function and one or more of its derivatives is called a differential equation. We shall always
assume that the equation can be solved explicitly for the derivative of highest order. An
ordinary differential equation of order n will then have the form
n ' ( n−n)
y ( x )=f (x , y ( x ) , y ( x ) , … , y ( x ))……………………………………….…… (2.1)
The general solution of (2.1) will normally contain an arbitrary constant, and hence there
' n−1
exists an n-parameter family of solutions. If y ( x 0 ) , y ( x 0 ) , … , y ( x 0 ) are prescribed at one
point x=x 0, we have an initial-value problem. A simple example of a first-order equation is
x
y = y . its general solution is y ( x )=c e , where c is an arbitrary constant. If the initial
'
equations are further classified as linear and nonlinear. An equation is said to be linear if the
function f in (2.1) involves y and its derivatives linearly. Linear differential equations possess
the important property that if
4
Two solutions y 1 , y 2 of a second-order linear differential equation are said to be linearly
independent if the Wronskian of the solution does not vanish, the Wronskian being defined
by
W ( y 1 , y 2) = y 1 y 2− y 2 y 1
The concept of linear independence can be extended to the solutions of equations of higher
order. If y 1 ( x ) , y 2 ( x ) , … , y m ( m ) are n linearly independent solutions of a homogeneous
differential equation of order n, then
Among linear equations, those with constant coefficients are particularly useful since they
lend themselves to a simple treatment. We write the nth -order linear differential equation with
constant coefficients in the form
(n) (n−1) (0 )
L y = y +a n−1 y + …+a0 y =0 …………………………………………. (2.2)
where the a iare assumed to be real. If we seek solutions of (2.2) in the form e β ( x), then direct
substitution shows that β must satisfy the polynomial equation
n n−1
β +an −1 β + …+a0 …………………………………………………………….... (2.3)
This is called the characteristic equation of the nth-order differential equation (2.2). If the
equation (2.3) has n distinct roots β i i=1 , … , n , then it can be shown that
β1 ( x )
β ( x) β (x)
y ( x )=c 1 e +c 2 e + …+c n e
2
Where the c iare arbitrary constants, is the general solution
n
of (2.2). If β 1=α +iβ is a complex root of (2.3), so is its conjugate β 1=α −iβ . Corresponding
to such a pair of conjugate-complex roots are two solutions y 1=eαx cos βx and y 2=eα x sin βx ,
which are linearly independent solutions. When (2.3) have multiple roots, special techniques
are available for obtaining linearly independent solutions. In particular, if β 1 is a double root
of (2.3), then y 1=e βx and y 2=x e βx are linearly independent solutions of (2.2). (John Willy
&sons, 1989)
Definition: If a function has derivatives of all orders at x=c then the series
5
∞ (n ) (n )
f (c ) f (c )
∑ n!
n '
( x−c ) =f ( c ) + f ( c ) ( x−c ) +…+
n!
n
( x−c ) + …
n=0
Is called the Taylor series for f ( x ¿ at c Moreover, if c = 0, then the series is the McLaurin
series for f. (David Kennard, et.al 1991)
Taylor series method is the fundamental numerical method for the solution of the initial value
problem
'
y =f ( x , y ) , y ( x 0 )= y 0
f ( x i , y i ) h f ' (x i , y i)h2
y ( x i+1 )= y ( x i ) + + +…
1! 2!
The error that is produced when a calculator or computer is used to perform real-number
calculations is called round off error. It occurs because the arithmetic performed in a machine
involves numbers with only a finite number of digits, with the result that calculations are
performed with only approximate representations of the actual numbers.
In a typical computer, only a relatively small subset of the real number system is used for the
representation of all the real numbers.
2. Truncation Error
Truncation error is made when a partial sum is used to represent an infinite series. If we
consider the Taylor series
6
2 (n ) n
y ' 'i h yi h
y i+ 1= y i+ y ' i h+ + …+ +…
2! n!
Is exact when all terms are kept. If we truncate this series the remaining terms are the
approximation of the exact series and the terms which are truncated is error terms. Local
truncation error is the error generated in every steps and the error from all the steps is termed
as Global error.
3. Absolute Error
Absolute error is the numerical difference between the true value of a quantity and its
¿
approximate value. Thus if x is the approximate value of quantity x , then ¿ x−¿∨¿ is called
¿
the absolute error and denoted by E a. Therefore, E a=¿ x−x ∨¿. The unit of exact or unit of
approximate values expresses the absolute error.
4. Relative Error
5. Percentage Error
¿
x−x
E p =100 × Er =100×∨ ∨¿
x
Example: Find the absolute, percentage and relative errors if x is rounded off to three
decimal digits. Given x = 0:005998.
Ea Ea 0.000002
Relative Error = Er = = = =0.0033344
True value 0.005998 0.005998
7
Percentage Error= E p =Er ×100=0.33344
Can be classified mainly into two types. They are (i) single step methods, and (ii) multi step
methods. Single step methods: In single step methods, for solving IVP (2.4) are those
methods in which the solution y i+ 1 at the (i +1)th grid point involves only one previous grid
point where the solution is already known. Accordingly, a general one step method may be
written as
y i+ 1= y i+ hϕ (xi , y i ,h)
The increment function ϕ depends on solution y iat previous grid point x i and step size h: If
y i+ 1 can be determined simply by evaluating right hand side then the method is explicit
method.
It may be reasonable to develop methods that use more information about the solution
(functional values and derivatives) at previously known values while computing solution at
the next grid point. Such methods using information at more than one previous grid points are
known as multi-step methods and are expected to give better results than one step methods.
To determine solution y i+ 1, a multi-step method or k-step method uses values of y (x ) and
f (x , y ( x )) at k previous grid points x i−k , k=0, 1, 2… k-1. y iis called the initial point while
y i−k are starting points. The starting points are computed using some suitable one step
method. Thus multi-step methods are not self-starting method. (Delhi$ Iowa, 2009)
Finite differences have had a strong appeal to mathematicians for centuries. Isaac Newton was
an especially a heavy user, and much of the subject originated with him. Given a discrete
function, that is, a finite set of arguments x k each having a mate y k , supposing the arguments
equally spaced , so that x k −x k−1=h , the differences of y k values are denoted
∆ y k = y k+ 1− y k
are called first differences. The difference of these first differences are denoted by
8
2
∆ y k =∆ ( ∆ y k )=∆ y k+1−∆ y k =∆ y k+2−2 y k +1+ y k are called second differences. In general,
n n−1 n−1
∆ y k =∆ y k +1−∆ yk
Defines the nth differences. Suppose f is a differentiable real-valued function on R . Le x ∈ R
and h> 0 .Then we have the following three popular difference approximations:
' f ( x +h )−f (x)
f (x)≈
h
f ( x )−f (x−h)
f ' (x)≈
h
f ( x+ h )−f (x−h)
f ' (x)≈
2h
These differences are called a forward difference, a backward difference and a cantered
difference, respectively. (Gadwall, et.al, 2003)
CHAPTER THREE
3. METHODOLOGY OF THE STUDY
9
Primary source I will get directly from my advisor and secondary source I will get
from internet and reference books.
The source of information for this study would be documentary source or secondary
source like article, internet and reference books.
CHAPTER FOUR
10
problems (IVP) in 1768. It is a first numerical method for solving IVP and serves to illustrate
the concepts involved in the advanced methods. It is important to study because the error
analysis is easier to understand.
y ( x n+1 )= y ( x n ) + hf (x n , y ( x n )) y ( x 0 )= y 0 , n=0 , 1, …
1. A geometric viewpoint
Now since we know the slope of y with respect to x , that is, f (x , y ) then at x=x 0 , the slope
is f (x 0 , y 0 ). Both x 0 and y 0 are known from the initial condition y ( x 0 )= y 0 .
True value
(x 1 , y 1 )
(x0 , y0) Φ Predicted
Value
Step size, h
x
From the graph let y 1 denotes y (x 1) and y 0 denotes y (x 0 ) . So the slope at x=x 0 as shown in
Figure 1 is
11
Rise
Slope =
Run
y ( x 1 )− y (x 0 )
f ( x 0 , y ( x 0 ) )=
x 1−x 0
From here
y ( x 1 )= y ( x 0 ) +f ( x 0 , y ( x 0) ) (x 1−x 0 )
y ( x 1 )= y ( x 0 ) +f ( x 0 , y ( x 0) ) h
One can use the value of y (x i ) (an approximate value of y at x=x i) to calculate y ( x 2 ), that
would be the predicted value at x 2, given by
y ( x 2 )= y ( x 1 )+ hf (x 1 , y 1 )
x 2=x 1+ h
2. Taylor Series
Expands
2
' h ''
y ( x n+1 )= y ( x n ) + h y ( x n ) + y ( ξ n ) where xn ≤ ξ n ≤ x n+1
2
3. Numerical Differentiation
12
y (x ¿¿ n+1)− y (x n) '
= y ( x n )=f (x n , y ( x n ) )¿
h
y ( x n+1 )= y ( x n ) + hf ¿
Example 4.1.1: Use Euler's method on the interval [0, 1] to find the solution to
dy
− y=0 When x=1. (use four steps, i.e., n = 4)
dx
b−a 1−0
Solution: From the given example step size h= = =0.25 .
n 4
y ( x 1 )= y ( x 0 ) +h ¿
y ( x 1 )= y ( 0 ) +0.25( y 0)
y ( x 1 )=1+0.25(1)
y ( x 1 )= y ( 0.25 )=1.25
y ( x 2 )= y ( 0.25 )= y ( x 1 ) +hf ( x1 , y ( x 1 ) )
y ( x 2 )= y ( 0.5 )=1.5625
y ( x 3 )= y ( 0.75 )=1.931
y ( x 4 ) = y ( 1 ) = y ( x 3 ) + hf (x 3 , y ( x 3 ))
13
y ( x 4 ) = y ( 1 ) =1.931+ 0.25 ¿
y ( x 4 ) = y (1) ≈ 2.4414
But from the given equation, by using the method of separation of variables, the exact value
of y ( x 4 ) =e ≈ 2.71828 …
dy
Example 4.1.2: Solve =f ( x , y )=x+ y+ 1 for x = [0, 2] with initial conditions y ( 0 )=0
dx
using the Euler's method: when
a .h=1
b . h=0.2
And compare the result with the exact solution y=2e x −x−2.
y ( x 1 )= y ( x 0 ) +hf ( x 0 , y ( x 0 ) )
y ( x 1 )= y ( x 0 ) +h ( x 0 + y ( x 0 ) +1 )
y ( x 1 )= y ( 0 ) +1 ( 0+0+1 )
y ( x 1 )=0+1=1
y ( x 2 )= y ( x 1 )+ hf (x 1 , y ( x 1 ))
y ( x 2 )= y ( x 1 )+ h( x 1 + y ( x1 ) +1)
Hence y ( x 2 )=¿y(2)¿ 4 .
When h = 0.2;
y ( x 1 )= y ( x 0 ) +h ( x 0 + y ( x 0 ) +1 )
y ( x 2 )= y ( x 1 )+ hf (x 1 , y ( x 1 ))
y ( x 2 )= y ( x 1 )+ h( x 1 + y ( x1 ) +1)
y ( x 3 )= y ( x 2 ) +hf ( x 2 , y ( x 2 ) )
14
y 0.6 ¿=0.48+0.2 ( 0.4+ 0.48+1 )=0.856
y ( x 4 ) = y ( x 3 ) + hf ( x3 , y ( x3 ) )
y ( x 5 )= y ( x 4 ) + hf ( x 4 , y ( x 4 ) )
y ( 2 ) ≈ 8.28
Remark: From the example above as the step size (h) is getting very small, we will have a
better approximation.
Suppose f¿ ¿, y (x o )¿ is the slope of a tangent line through (, x oy( x o)) and f( x 1,y( x 1)) is the slope
of a tangent line through ( x 1,y( x 1)) .Thus the slope
Of another line between the two lines is the average of the two slopes .i.e, the
Slope ¿ f ¿ ¿
Y ( x 1) = y( x o) + hf x o (, y( x o))
By replacing the new slope in the place of the slope at (x0,y(x0)) = f(, x oy() x o).
So we get
15
h
y ( x 1) = y(x o )+ ¿)
m
2
h
y ( x 2) = y( x o) + (f( x 1 ;y( x 1)) + f( x 2; y( x 2)) at x n+1 we will get
m
2
h
y ( x n+1 ) = y ( x n) + (f ( x n; y ( x n)) + f( x n; y( x n)):
m
2
This method is called the modified Euler's method. (Lepidus and G.H., 1971).
st
1 Remark: In the modified formula y( x n) is obtained by applying the
h
y () x 1= y( x o)+ (f(; x o y( x o)) + f( x 1; y( x 1)) n = 0; 1; 2; ::
n +1
2
dy
Example 2.2.1. Solve = f(x; y) = x + y + 1 for x = [0; 2] with initial
dx
a). h=1
b).h=0.2
Solutions.
First consider h = 1
16
Y (x 1 )= y (x o )+ hf x o ¿
Y (x 1 )= y ( x o )+ h(x o + y (x o )+1)
Y (1)= y (0)+1(0+0+1)
Y (x 1 )=0+1=1
Y (x 2 )= y ( x 1)+h (x 1+ y ( x1 )+ 1)
Y (x 2 )= y (2)=1+1(1+1+1)=4
Y (x 1 )= y ( x o )+ hf (x o ; y (x o))
Y (x 1 )= y (x o )+ h(x o + y (x o )+1)
Y (x 2 )= y ( x 1)+h (x 1+ y ( x1 )+ 1)
Y (x 3 )= y ( x 2)+ hf (; x 2 y (x 2 ))
Y (x 5 )= y ( x 4 )+hf ¿
Y (2) ≈ 8:289.
Remark: From the example above and the graph as the step size (h) is getting
17
Very small, we will have a better approximation
dy
Example 2.2.2. Use modified Euler method to solve = f(x, y) = x+y+1
dx
For x = [0, 2] with the initial condition y(x0) = 0. For h = 1 and compare
h
y ( x 1) = y( x o) + (f( x o,y( x o)) + f( x 1,y( x 1)),where y( x 1) = y( x o) + hf(+ x o y( x o))
m
2
h
y ( x 1) = y (0) + (f( x o,y( x o)) + f( x 1,y( x 1))
m
2
1
y ¿) = 0 + ((0 + 0 + 1) + (1 + y( x 1) + 1). But y( x 1) = 0 + 1(0 + 0 + 1) = 1
m
2
y ( x 1) = 0 + 0.5((0 + 0 + 1) + (1 + 1 + 1) = 2
m
h
y ( x 2) = y( x 1) + (f( x 1,y( x 1)) + f( x 2 ,y( x 2)).Where y( x 2) = y( x 1) +hf ( x 1+ y( x 1))
m
2
1
y ( x 2) = 1 + ((1 + 1 + 1) + (2 + y( x 2) + 1).But y( x 2) = 1 + 1(1 + 1 + 1) = 4
m
2
y ( x 2) = 1 + 0.5((1 + 1 + 1) + (2 + 4 + 1) = 6.
m
y (x 1) = x o + hf( x o+ y( x o))
y (x 1) = 0 + 1( x o+ y( x o) + 1)
y (x 1) = 0 + 1(0 + 0 + 1) = 1
y (x 2 ) = x 1 + hf( x 1+ y( x 1))
y (x 2 ) = 1 + 1( x 1+ y( x 1) + 1)
y (x 2 )=¿ 1 + 1(1 + 1 + 1) = 4.
Method.
18
Figure 4.1
2. Round-off errors caused by the limited numbers of significant digits that can be retained by
a computer. The truncation errors are composed of two parts. The first is a local
truncation error that results from an application of the method in question over a single step.
The second is a propagated truncation error that results from the approximations produced
during the previous steps. The sum of the two is the total or global truncation, error.
Insight into the magnitude and properties of the truncation error can be gained by deriving
Euler's method directly from the Taylor series expansion. To do this, realize that the
differential equation being integrated will be of the general form
'
y =f (x , y ) ................................................................................................................... (4.2)
19
' dy
where y = , x and y are the independent and the dependent variables respectively. If the
dx
solution that is, the function describing the behaviour of y has continuous derivatives, it can
be represented by a Taylor series expansion about a starting value ( x , y)
n
y ' 'i 2 yi n
y i+ 1= y i+ y ' i h+ h + …+ h + Rn ………………………………………. (4.3) Where h=
2! n!
( n+1 )
y (ξ) n+1
x i+1−x i and Rn =¿ the remainder term, defined as Rn = h …. (4.4) Where ξ lies
(n+1)!
somewhere in the interval from x i to x i+1. An alternative form can be developed by
substituting Eq. (4.2) into Eq. (4.3) and (4.4) to yield
( n−1)
f ' ' (x i , y i ) 2 f ( xi , yi )
y i+ 1= y i+ f ( x i , y i ) h+ h +…+ h n+ Ο(hn +1)…………… .. (4.5)
2! n!
Where Ο(h n+1 ) specifies that the local truncation error is proportional to the step size raised
to the (n+10)th power.
By comparing Eq. (4.1) and (4.5), it can be seen that Euler's method corresponds to the
Taylor series up to and including the term f ( x i , y i ) h. Additionally, the comparison indicates
that a truncation error occurs because we approximate the true solution using a finite number
of terms from the Taylor series. We thus truncate, or leave out, a part of the true solution. For
example, the truncation error in Euler's method is attributable to the remaining terms in the
Taylor series expansion that were not included in Eq. (4.1). Subtracting Eq.(4.1) from Eq.
(4.5) yields
( n−1)
f ' ' (x i , y i ) 2 f ( xi , yi )
y i+ 1= y i+ f ( x i , y i ) h+ h +…+ h n+ Ο(hn +1)…………… .. (4.5)
2! n!
Where Ο(h n+1 ) specifies that the local truncation error is proportional to the step size raised
to the (n+10)th power.
By comparing Eq. (4.1) and (4.5), it can be seen that Euler's method corresponds to the
Taylor series up to and including the term f ( x i , y i ) h. Additionally, the comparison indicates
20
that a truncation error occurs because we approximate the true solution using a finite number
of terms from the Taylor series. We thus truncate, or leave out, a part of the true solution. For
example, the truncation error in Euler's method is attributable to the remaining terms in the
Taylor series expansion that were not included in Eq. (4.1). Subtracting Eq.(4.1) from Eq.
(4.5) yields
f '( xi , y i) 2 n+1
Et = h + …+Ο(h )……………………………..………………………. (4.6)
2!
Where Et = the true local truncation error. For sufficiently small h, the errors in the terms
in Eq. (6) usually decrease as the order increases and the result is often represented as
f '(x i , yi ) 2 2
E a= h Or E a=Ο(h )
2!
dy 3 2
=−2 x =12 x −20 x +8.5 From x=0 to x=4 with a step size of 0.5. The initial condition
dx
at x = 0 is y = 1.The exact solution is given by y=−0.5 x 4 +4 x 3−10 x 2 +8.5 x+ 1
y ( 0.5 )= y ( 0 )+ f ( 0 , 1 ) 0.5
3 2
f ( 0 ,1 )=−2 ( 0 ) =12 ( 0 ) −20 ( 0 ) + 8.5=8.5
4 3 2
y=−0.5 ( 0.5 ) + 4 ( 0.5 ) −10 ( 0.5 ) +8.5 ( 0.5 ) +1=3.21875
21
Thus, the error is
y ( 1 ) =5.875
The true solution at x = 1.0 is 3.0, and therefore, the percent relative error is -95.8%. The
computation is repeated, and the results are compiled in Table 1. Note that, Comparison of
true and approximate values of the integral of
3 2
y '=−2 x +1 2 x −20 x +8.5,
With the initial condition that y=1 at x=0 . The approximate values were computed using
Euler's method with a step size of 0.5. The local error refers to the error incurred over a single
step. It is calculated with a Taylor series expansion as in Example 25.2. The global error is
the total discrepancy due to past as well as present steps.
Example 4.2.2: Taylor Series Estimate for the Error of Euler's Method
Problem statement: Use Eq. (4.6) to estimate the error of the first step of Example 4.2.1.
Also use it to determine the error due to each higher-order term of the Taylor series
expansion.
Solution: Because, we are dealing with a polynomial, we can use the Taylor series to obtain
enact estimates of the errors in Euler's method. Equation (4.6) can be written as
Where f ' (x i , y i ) = the first derivative of the differential equation (that is, the second
derivative of the solution). For the present case, this is
22
And f ( {x} rsub {i} , {y} rsub {i} is the second derivative of the ODE
''
f ( x i , y i )=−12 x +24
(3 )
And f (x i , y i) is the third derivative of the ODE
(3 )
f ( x i , y i ) =−12
We can omit additional terms (that is, fourth derivatives and higher) because for this
particular case they equal zero. It should be noted that for other functions (for example,
transcendental functions such as sinusoids or exponentials) this would not necessarily be true,
and higher-order terms would have nonzero values. For example, the error due to truncation
of the second-order term can be calculated as
2
−6 ( 0.0 ) +24 ( 0.0 )−20
Et ,2= ( 0.5)2=−2.5
2
−12
Et ,4 = ( 0.5 )4 =−0.03125
24
These three results can be added to yield the total truncation error:
This is exactly the error that was incurred in the initial step of Example 4.2.1.
As illustrated in Example 4.2. 2, the Taylor series provides a means of quantifying the error
in Euler's method. However, there are limitations associated with its use for this purpose:
1. The Taylor series provides only an estimate of the local truncation error that is, the error
created during a single step of the method. It does not provide a measure of the propagated
and, hence, the global truncation error. In Table 1, we have included the local and global
23
truncation errors for Example 1. The local error was computed for each time step using the
true value of y i (the second column of the table) to compute each y i+ 1, rather than the
approximate value (the third column), as is done in the Euler method. As expected, the
average absolute local truncation error (25 per cent) is less than the average global error (90
per cent). The only reason that we can make these exact error calculations is that we know the
true value a priori. Such would not be the case in an actual problem. Consequently, as
discussed below, you must usually apply techniques such as Euler's method using a number
of different step sizes to obtain an indirect estimate of the errors involved ([8]).
2. As mentioned above, in actual problems we usually deal with functions that are more
complicated than simple polynomials. Consequently, the derivatives that are needed to
evaluate the Taylor series expansion would not always be easy to obtain. Although these
limitations preclude exact error analysis for most practical problems, the Taylor series still
provides valuable insight into the behaviour of Euler's method. It can also be demonstrated
that the global truncation error isΟ(h); that is, it is proportional to the step size.
This latter conclusion makes intuitive sense because Euler's method uses straight-line
segments to approximate the solution. Hence, Euler's method is referred to as a first-order
method. It should also be noted that this general pattern holds for the higher-order one-step
methods. That is, an nth-order method will yield perfect results if the underlying solution is
an nth order polynomial. Further, the local truncation error will be Ο(h n+1 )and the global error
n
Ο(h ).
24
5. CONCLUSION
This paper examines one of the most popular numerical methods for solving the differential
equation of the form
'
y =f ( x , y ) , y ( x 0 )= y 0
One of the finite difference methods to solve the above types of initial value
Problems are the Euler's method. The purpose of the paper to investigate
The of derivation of Euler's method and its error analysis. Euler's method is
Defined by
h
y ( x 2) = y( x 1) + (f( x 1; y( x 1)) + f x 2 (; y( x 2)) at x n+1 we will get
m
2
h
y ( x n+1 ) = y ( x n) + (f ( x n; y ( x n)) + f ( x n; y( x n)):
m
2
One of the finite difference methods to solve the above types of initial value problems is the
Euler's method. The purpose of the paper is to investigate the derivation of Euler's method
and its error analysis.
25
This paper also dealt with the error analysis of the Euler's method. And we are able to show
that the stability conditions of the Euler's method and it is found that the stability condition is
REFERENCE
Abhishek K Gupta (1840), Numerical methods using MATLAB.
Douglass, Richard Burden A.L: (2002) Numerical Methods, Brooks Cole, 3rd
Edition,
Francis Shied: Schism’s (1624). Outlines Numerical analysis, M.C. Gadwall, 2nd
Kendal E.Atikson (1989): An Introduction To Numerical Analysis second edition, John Willy
and sons, University of Iowa.
L. Sham pine, , Chapman & Hall, Lepidus, L., and G.H.,( 1971)Numerical Solution of
Ordinary Differential Equations, Chapman & Hall, New York.
Madhumangal Pal( 1660): Numerical Analysis for Scientists and Engineers: Theory and C
Programs, Vidyasagar University, Midnapore 721102
26
Publisher, Delhi, (2009).
27