ISSN 2319-8133 (Online)
(An International Research Journal), www.compmath-journal.org
The Effect of Richardson Extrapolation for Solving IVP on Accuracy Using Matlab Software
Yilekal Yewlu Taddesse
Ambo University Woliso Campus, ETHIOPIA.
email:[email protected]
(Received on: September 27, 2018) ABSTRACT
Initial value problems are frequently occurring in mathematical models that arise in many branches of science, engineering and economics. The study focuses on solving initial value problems with a combination of Richardson extrapolation method with Euler’s, Runge kutta 2 nd , 3 rd and 4 th , order methods using MATLAB program. The amount of error obtained with each numerical methods and their combinational result with Richardson extrapolation was analyzed. The numerical results of each method were expressed using tables and graphs. In order to achieve higher accuracy in the solution of initial value problems it is better to use Runge Kutta 4 th order method together with Richardson extrapolation method.
Keywords: Initial Value Problem (IVP), Euler Method, Higher Order of Runge Kutta Method, Truncation error(TE), MATLAB Software, Richardson Extrapolation.
1. INTRODUCTION
Differential equations are mathematical descriptions of how the variables and their derivatives (rates of change) with respect to one or more independent variable affect each other in a dynamical way. Their solutions show us how the dependent variable(s) will change with the independent variable(s).
Ordinary differential equations are frequently occurring in mathematical models that arise in many branches of science, engineering and economics. Unfortunately it is seldom that these equations have solutions which can be expressed in closed form, so it is common to seek approximate solutions by means of numerical methods. Nowadays this can usually be achieved very inexpensively to high accuracy and with a reliable bound on the error between the analytical solution and its numerical approximation 1 .
Richardson extrapolation is an accelerating method to improve the rate of
convergence of a sequence of solutions. It is named after Lewis Fry Richardson, who
introduced the technique in the early 20th century 2 , which can successfully be used in the efforts to improve the accuracy of the approximate solutions of systems of ordinary differential equations (ODEs) obtained by different numerical methods 3 .
Richardson extrapolation can be used numerical methods such as Runge kutta 2 nd , 3 rd and 4 th , Euler’s forward and backward, method, Adam’s-moulton etc 4 . Richardson extrapolation does not depend too much on the particular numerical method to solve initial value problems 3 .
Due to this the study focuses on solving initial value problems with a combination of Richardson extrapolation method with Euler’s, Runge kutta 2 nd , 3 rd and 4 th , order methods using MATLAB program.
1.1 Euler’s Method
Euler’s method is the simplest numerical method for solving initial value problem in ordinary differential equation. By taking different value of 𝜃 in equation𝑦 𝑛+1 = 𝑦 𝑛 + ℎ[(1 − 𝜃)𝑓(𝑡 𝑛 , 𝑦 𝑛 ] + 𝜃𝑓(𝑡 𝑛+1 , 𝑦 𝑛+1 ), 𝜃 ∈ [0, 1] this method divided in to three, for 0 , 0.5 and 1 are the properties of Euler’s forward method, trapezoidal rule and Euler’s backward method respectively.
In this work we shall only consider forward Euler’s method, it is one of the single step method expressed as y n 1 y n hf t y ( , n n ) , Where h is the step size. According to this equation the slope estimate f is used to extrapolate from an old value y n to a new value y n 1 over a distance h 5 .
1.2 Runge Kutta Methods
The Runge-Kutta’s method is popular in Engineering, especially in the numerical analysis due to its degree of approximation, in which it allows numerical calculus with more accuracy due to having second, third and fourth order formulation, and if we compared Euler’s, Rung kutta 2 nd , Rung kutta 3 rd and Runge kutta 4 th then Runge kutta 4 th is the most accurate and the methods were executed using MATLAB 6 .
a. Runge kutta second order method.
𝑦 𝑛+1 = 𝑦 𝑛 + ℎ
2 (𝑘 1 + 𝑘 2 ), Where 𝑘 1 = 𝑓(𝑥 𝑖 , 𝑦 𝑖 ) and 𝑘 2 = 𝑓(𝑥 𝑖 + ℎ, 𝑦 𝑖 + 𝑘 1 ℎ) b. Runge kutta third order method
𝑦 𝑛+1 = 𝑦 𝑛 + ℎ
6 (𝑘 1 + 4𝑘 2 + 𝑘 3 )
Where 𝑘 1 = 𝑓(𝑥 𝑖 , 𝑦 𝑖 ) , 𝑘 2 = 𝑓 (𝑥 𝑖 + ℎ 2 , 𝑦 𝑖 + ℎ 2 𝑘 1 ) , 𝑘 3 = 𝑓(𝑥 𝑖 + ℎ, 𝑦 𝑖 + (2𝑘 2 − 𝑘 1 )ℎ) c. Runge kutta 4 th order method
𝑦 𝑛+1 = 𝑦 𝑛 + 1
6 (𝑘 1 + 2𝑘 2 + 2𝑘 3 + 𝑘 4 ) Where 𝑘 1 = 𝑓(𝑥 𝑖 , 𝑦 𝑖 ) ,
𝑘 2 = 𝑓 (𝑥 𝑖 + ℎ
2 , 𝑦 𝑖 + ℎ
2 𝑘 1 )
𝑘 3 = 𝑓 (𝑥 𝑖 + ℎ
2 , 𝑦 𝑖 + ℎ 2 𝑘 2 ) 𝑘 4 = 𝑓(𝑥 𝑖 + ℎ, 𝑦 𝑖 + ℎ𝑘 3 ) 1.3 Richardson extrapolation Method
Due to wide application of Richardson extrapolation method different attempts have been made to solve some practical problems in science and engineering. Let us consider the classical initial value problem for systems of s s ( 1) ordinary differential equations.
0
( , ), [ , ], , ( )
dy f t y t a b a b f a y
dt (1) Where, the unknown function y a b :[ , ] s is continuously differentiable, while right- hand-side function f (t, y) is continuous. However, it is often necessary to introduce much more restrictive assumptions when numerical methods of order p such as 2 nd , 3 rd and 4 th Runge kutta methods, Euler’s forward and backward, method, Adam’s-moulton are used in the treatment of (1).
In such cases it is necessary to assume that the function y is continuously differentiable up to order p .
Richardson Extrapolation can be introduced in the following way. Assume that [ , ]
t n a b is a time-point and given that y t ( ) n is the value of the exact solution of (1) at t t n . Assume also that two approximations of y t ( ) n have been obtained by applying the above numerical methods of order p and by using two time-step sizes h and 0.5h . More precisely, starting from a time-point (grid point) t t n 1 where t n 1 t n h , the two approximations are calculated by using first one large time-step and, after that, two small time-steps. Denoting these two approximations with z n and w n respectively, we can write:
( 1)
p p
n n
y t z h k o h
(2)
( ) o 1
2
p
p
n n
y t w h k h
(3) Where k is some quantity depending on the numerical method applied in the calculation of
z n and w n but not on the step size h. solving this gives
2 1
( ) ( )
2 1
p
n n p
n p
w z
y t o h
Define y = 2
2 1
p
n n
n p
w z
(4 )
It is clear that the approximation y n being of order h p 1 , will in general be more accurate than both z n and w n (at least the step size h is sufficiently small) 7 . The value of 𝑝 in (4) is the order of the numerical method.
2. ERROR ANALYSIS
There are two things to consider when applying numerical methods to solve a problem.
The first and most obvious is to obtain the approximation. The equally important second objective is to determine a safety factor for the approximation: some assurance, or at least a sense, of the accuracy of the approximation 8 . There are five types of errors can occur in the numerical solution of differential equations 9 . These are error in the initial data, algebraic errors, Truncation errors, Round of errors and inherited errors, however mostly the first two are nonexistence. Truncation error is the error occurred in a single step caused by truncating the Taylor series approximations for the exact derivatives. Truncation error depends on the step size h and it decreases when the step size decreases. Inherited error is the sum of all accumulated errors from all steps, the presence of inherited error means that the initial condition for the next step is incorrect 9 . 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 8 . For the rest of the paper assume that error in the initial data and algebraic errors are nonexistence. The truncation errors of all the above methods are as follows: TE y t ( ) n y n
Where, 𝑦(𝑡 𝑛 ) is the exact and 𝑦 𝑛 is approximation values.
3. METHODOLOGY 3.1 Materials
For solving initial problems the researcher uses MATLAB software. MATLAB is software that uses an extremely effective and interactive language, which is widely used in several applications in engineering, especially aimed at numerical calculation.
3.2 Methods
The scientific methodology used in the study was based on applied research, in which
the acquired knowledge is used for practical application in the software aiming at solving the
proposed Ordinary Differential Equations. The MATLAB cod of numerical methods like
Euler’s, Runge kutta 2 nd , Runge kutta 3 rd and Runge kutta 4 th was developed and the solution
of some selected initial value problems was solved. Then the researcher developed the
MATLAB code of Richardson extrapolation method together with other methods like Euler’s
method, Runge kutta 2 nd , Runge kutta 3 rd and Runge kutta 4 th methods. The result of the
MATLAB code was described using tables and graphs. Lastly the absolute error of all the above methods was analyzed.
4. NUMERICAL RESULTS
In this section we consider numerical examples to show the effect of Richardson Extrapolation method combined with other the numerical methods (Euler’s method, Runge kutta 2 nd , Runge kutta 3 rd and Runge kutta 4 th methods). [6] Solved the following examples by using Euler’s method, Runge kutta 2 nd , Runge kutta 3 rd and Runge kutta 4 th methods with MATLAB program . However this study focuses on the effect of Richardson extrapolation Using MATLAB program.
Example 1: Consider 𝑦 ′ = 𝑦 − 𝑥 2 + 1 , 0 ≤ 𝑥 ≤ 3.2 , 𝑦(0) = 0.5
With analytical solution 𝑦 = (𝑥 + 1) 2 − 0.5𝑒 𝑥
The graphical representation of the solution of the given IVP using Euler’s, Runge kutta 2 nd , Runge kutta 3 rd and Runge kutta 4 th methods were as follows.
Figure 1: Solution of the given IVP using Euler’s, Runge kutta 2, Runge Kutta3 and Runge kutta order 4
Runge kutta order 4 is more accurate than Eulers, rung kutta order 2 and Rung kutta order 3 methods.
The solution of the given IVP using the combination of Richardson extrapolation together with Euler’s, Runge kutta 2 nd , Runge kutta 3 rd and Runge kutta 4 th order methods were as follows.
0 0.5 1 1.5 2 2.5 3 3.5
0 1 2 3 4 5 6 7
x-value dy/dx=y-x2+1
Euler Rung 2 Rung 3 Rung 4 Exact value
Table 1: The combination of Richardson extrapolation with Euler’s, runge2,3 and 4 methods
X- values Richardson Extrapolation with
Exact Euler Runge kutta 2 Runge kutta 3 Runge kutta 4
0 0.5000000 0.5 0.5 0.5 0.5
0.2 0.82800000 0.829246667 0.82929803 0.829298606 0.829298621 0.4 1.21108000 1.213975128 1.214086429 1.214087619 1.214087651 0.6 1.643726800 1.648757678 1.648938716 1.648940549 1.6489406 0.8 2.119213428 2.126965068 2.12722698 2.127229464 2.127229536 1.0 2.629333048 2.64050052 2.640855872 2.640858993 2.640859086 1.2 3.164074748 3.179474857 3.179937723 3.179941424 3.179941539 1.4 3.711228557 3.731809727 3.732395712 3.732399879 3.732400017 1.6 4.255904288 4.282752981 4.283479185 4.283483629 4.283483788 1.8 4.77994547 4.814286784 4.815171669 4.815176089 4.815176268 2.0 5.261215556 5.30440469 5.305467805 5.305471758 5.305471951 2.2 5.672728668 5.726228697 5.727490205 5.72749305 5.72749325 2.4 5.981591103 6.04693084 6.04841078 6.048411613 6.04841181 2.6 6.147712531 6.226416065 6.228133232 6.228130807 6.228130982 2.8 6.122236919 6.215713539 6.21768387 6.217676484 6.217676614 3.0 5.84563238 5.95501185 5.957246131 5.957231487 5.957231538 3.2 5.245366028 5.371259274 5.373759949 5.373734975 5.373734901
The combination of Richardson extrapolation with Euler’s, runge2,3 and 4 is as follows graphically
Figure 2: Combination of Richardson extrapolation together with Euler’s, Runge 2, Runge 3 and Runge 4
As we see table 1 and figure 2 the solution of the given IVP becomes more accurate if Richardson extrapolation together with Euler’s, Runge 2, Runge 3 and Runge 4 is combined.
In Runge kuta 4 th order method is more accurate if it is compared with Euler’s, Runge 2, and Runge 3 methods. However combination of Richardson extrapolation method with Runge kutta 4 th order method is the most accurate than the other methods and the truncation error of each methods are as follows.
0 0.5 1 1.5 2 2.5 3 3.5
0 1 2 3 4 5 6 7
x-value
dy/dx=y-x2+1
Euler & rich R2 and Rich R3 and Rich R4 and Rich Exact Value