Akamaiuniversity.Us/PJST.Htm Volume 13
Total Page:16
File Type:pdf, Size:1020Kb
View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Afe Babalola University Repository Euler’s Method for Solving Initial Value Problems in Ordinary Differential Equations. Sunday Fadugba, M.Sc.1*; Bosede Ogunrinde, Ph.D.2; and Tayo Okunlola, M.Sc.3 1Department of Mathematical and Physical Sciences, Afe Babalola University, Ado Ekiti, Nigeria. 2Department of Mathematical Sciences, Ekiti State University, Ado Ekiti, Nigeria. 3Department of Mathematical and Physical Sciences, Afe Babalola University, Ado Ekiti, Nigieria. E-mail: [email protected]* ABSTRACT conditions of initial value problem are specified at the initial point. There are numerous methods that This work presents Euler’s method for solving produce numerical approximations to solution of initial value problems in ordinary differential initial value problem in ordinary differential equations. This method is presented from the equation such as Euler’s method which was the point of view of Taylor’s algorithm which oldest and simplest such method originated by considerably simplifies the rigorous analysis. We Leonhard Euler in 1768, Improved Euler method, discuss the stability and convergence of the Runge Kutta methods described by Carl Runge method under consideration and the result and Martin Kutta in 1895 and 1905, respectively. obtained is compared to the exact solution. The error incurred is undertaken to determine the There are many excellent and exhaustive texts on accuracy and consistency of Euler’s method. this subject that may be consulted, such as Boyce and DiPrima (2001), Erwin (2003), Stephen (Keywords: differential equation, Euler’s method, error, (1983), Collatz (1960), and Gilat (2004) just to convergence, stability) mention few. In this work we present the practical use and the convergence of Euler method for solving initial value problem in ordinary differential INTRODUCTION equation. Differential equations can describe nearly all systems undergone change. They are ubiquitous NUMERICAL METHOD in science and engineering as well as economics, social science, biology, business, etc. Many The numerical method forms an important part of mathematicians have studied the nature of these solving initial value problem in ordinary differential equations and many complicated systems can be equation, most especially in cases where there is described quite precisely with compact no closed form analytic formula or difficult to mathematical expressions. However, many obtain exact solution. Next, we shall present systems involving differential equations are so Euler’s method for solving initial value problems complex or the systems that they describe are so in ordinary differential equations. large that a purely analytical solution to the equation is not tractable. Euler’s Method It is in these complex systems where computer simulations and numerical approximations are Euler’s method is also called tangent line method useful. The techniques for solving differential and is the simplest numerical method for solving equations based on numerical approximations initial value problem in ordinary differential were developed before programmable computers equation, particularly suitable for quick existed. The problem of solving ordinary programming which was originated by Leonhard differential equations is classified into two namely Euler in 1768. This method subdivided into three initial value problems and boundary value namely: problems, depending on the conditions at the end points of the domain are specified. All the The Pacific Journal of Science and Technology –152– http://www.akamaiuniversity.us/PJST.htm Volume 13. Number 2. November 2012 (Fall) Forward Euler’s method. y(x1 ) y1 (6) Improved Euler’s method. Backward Euler’s method. Repeating the above process, we have at point x as follows: In this work we shall only consider forward Euler’s 1 method. x2 x1 h (7) Derivation of Euler’s Method y y f (x , y )(x x ) 2 1 1 1 2 1 = We present below the derivation of Euler’s y1 hf (x1, y1 ) (8) method for generating, numerically, approximate solutions to the initial value problem: We have: y f (x, y(x)) (1) y(x ) y (9) 2 2 (2) y(x0 ) y0 Then define for n 0,1,2,3,4,5,..., we have Where x0 and y0 are initial values for x and y x x nh , n 0 (10) respectively. Our aim is to determine (approximately) the unknown function Suppose that, for some value of n , we are y(x) for x x0 . We are told explicitly the value already computed an approximate value for . Then the rate of change of for of y(x0 ) , namely , using the given differential yn y(xn ) equation (1), we can also determine exactly the close to instantaneous rate of change of at point xn is f (x, y(x)) f (xn , y(xn )) f (xn , yn ) wh ere y(xn ) yn f (xn , yn )(x xn ) . y(x ) f (x , y(x )) = f (x , y ) 0 0 0 0 0 (3) Thus, If the rate of change of were to remain y(x ) y y hf (x , y ) for all point , then would n1 n1 n n n (11) exactly y0 f (x0 , y0 )(x x0 ) . The rate of Hence, change of does not remain for y y hf (x , y ) all , but it is reasonable to expect that it remains n1 n n n (12) close to for close to . If this is the Equation (12) is called Euler’s method. From (12), case, then the value of will remain close to we have: for close to , for small number , we have: yn1 yn h f (x , y ),n 0,1,2,3,... (13) h n n x x h 1 0 (4) Truncation Errors For Euler’s Method y y f (x , y )(x x ) 1 0 0 0 1 0 y = y hf (x , y ) Numerical stability and errors are discussed in 1 0 0 0 (5) depth in Lambert (1973) and Kockler (1994). There are two types of errors arise in numerical Where h x1 x0 and is called the step size. methods namely truncation error which arises By the above argument: primarily from a discretization process and round The Pacific Journal of Science and Technology –153– http://www.akamaiuniversity.us/PJST.htm Volume 13. Number 2. November 2012 (Fall) off error which arises from the finiteness of Convergence of Euler’s Method number representations in the computer. Refining a mesh to reduce the truncation error often The necessary and sufficient conditions for a causes the round off error to increase. To numerical method to be convergent are stability estimate the truncation error for Euler’s method, and consistency. Stability deals with growth or we first recall Taylor’s theorem with remainder, decay of error as numerical computation which states that a function f (x) can be progresses. Now we state the following theorem expanded in a series about the point x a to discuss the convergence of Euler’s method. f (a)(x a)2 f (x) f (a) f (a)(x a) ... Theorem: If f (x, y) satisfies a Lipschitz 2! condition in and is continuous in for 0 x a and defined a sequence , where f m (a)(x a)m f m1()(x a)m1 n 1,2,...,k and if y y(0) , then m! (m 1)! 0 (14) yn y(x) as n uniformly in where is the solution of the initial value problem (1) The last term of (14) is referred to as the and (2). remainder term. Where x a. x y In (14), let x x and , in which: Proof: we shall start the proof of the above n1 theorem by deriving a bound for the error: y(x) 1 2 eynn yyn(xny)(xn ) (18) y(xn1 ) y(xn ) hy(xn ) h y( n ) 2 (15) Wherex and are called numerical and n exact values respectively. We shall also show Where xn n xn1 . that this bound can be made arbitrarily small. If a bound for the error depends only on the Since satisfies the ordinary differential equation knowledge of the problem but not on its in (1), which can be written as: solution , it is called an a priori bound. If, on the other hand, knowledge of the properties of the y(x ) f (x , y(x )) solution is required, its error bound is referred to n n n (16) as an a posteriori bound. Where is the exact solution at . Hence, To get an a priori bound, let us write: 1 y(x ) y(x ) hf (x , y(x )) h2 y( ) y(x ) y(x ) hf (x , y ) t (19) n1 n n n 2 n n1 n n n n (17) Where t n is called the local truncation error. It is By considering (17) to Euler’s approximation in the amount by which the solution fails to satisfy (12), it is clear that Euler’s method is obtained by the difference method. Subtracting (19) from (12), 1 we get: omitting the remainder term h 2 y( ) in the 2 n e e h[ f (x , y ) f (x , y(x ))] t Taylor expansion of y(x ) at the point . The n1 n n n n n n n1 (20) omitted term accounts for the truncation error in Euler’s method at each step. Let us write: en M n f (xn , yn ) f (xn , y(xn )) (21) The Pacific Journal of Science and Technology –154– http://www.akamaiuniversity.us/PJST.htm Volume 13. Number 2. November 2012 (Fall) Substituting (20) into (21), then: By the Mean value theorem, we get for 0 1, h f (xn h, y(xn )) f (xn , y(xn )) en1 en (1 hM n ) (22) h f (xn h, y(xn h)) f (xn h, y(xn )) This is the difference equation for en .