A Comparative Study on Numerical Solutions of Initial Value Problems (IVP) for Ordinary Differential Equations (ODE) with Euler and Runge Kutta Methods

This paper mainly presents Euler method and fourth‐order Runge Kutta Method (RK4) for solving initial value problems (IVP) for ordinary differential equations (ODE). The two proposed methods are quite efficient and practically well suited for solving these problems. In order to verify the ac‐ curacy, we compare numerical solutions with the exact solutions. The numerical solutions are in good agreement with the exact solutions. Numerical comparisons between Euler method and Runge Kutta method have been presented. Also we compare the performance and the computa‐ tional effort of such methods. In order to achieve higher accuracy in the solution, the step size needs to be very small. Finally we investigate and compute the errors of the two proposed meth‐ ods for different step sizes to examine superiority. Several numerical examples are given to dem‐ onstrate the reliability and efficiency.


Introduction
Differential equations are commonly used for mathematical modeling in science and engineering.Many problems of mathematical physics can be started 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.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 equation to one that can be solved exactly and then use the solution of the simplified equation to approximate the solution to the original equation.The other approach, which we will examine in this paper, uses methods for approximating the solution of original problem.This is the approach that is most commonly taken since the approximation methods give more accurate results and realistic error information.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 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 condition or conditions.There are many types of practical numerical methods for solving initial value problems for ordinary differential equations.In this paper we present two standard numerical methods Euler and Runge Kutta for solving initial value problems of ordinary differential equations.
From the literature review we may realize that several works in numerical solutions of initial value problems using Euler method and Runge Kutta method have been carried out.Many authors have attempted to solve initial value problems (IVP) to obtain high accuracy rapidly by using numerous methods, such as Euler method and Runge Kutta method, and also some other methods.In [1] the author discussed accuracy analysis of numerical solutions of initial value problems (IVP) for ordinary differential equations (ODE), and also in [2] the author discussed accurate solutions of initial value problems for ordinary differential equations with fourth-order Runge kutta method.[3] studied on some numerical methods for solving initial value problems in ordinary differential equations.[4]- [16] also studied numerical solutions of initial value problems for ordinary differential equations using various numerical methods.In this paper Euler method and Runge Kutta method are applied without any discretization, transformation or restrictive assumptions for solving ordinary differential equations in initial value problems.The Euler method is traditionally the first numerical technique.It is very simple to understand and geometrically easy to articulate but not very practical; the method has limited accuracy for more complicated functions.
A more robust and intricate numerical technique is the Runge Kutta method.This method is the most widely used one since it gives reliable starting values and is particularly suitable when the computation of higher derivatives is complicated.The numerical results are very encouraging.Finally, two examples of different kinds of ordinary differential equations are given to verify the proposed formulae.The results of each numerical example indicate that the convergence and error analysis which are discussed illustrate the efficiency of the methods.The use of Euler method to solve the differential equation numerically is less efficient since it requires h to be small for obtaining reasonable accuracy.It is one of the oldest numerical methods used for solving an ordinary initial value differential equation, where the solution will be obtained as a set of tabulated values of variables x and y.It is a simple and single step but a crude numerical method of solving first-order ODE, particularly suitable for quick programming because of their great simplicity, although their accuracy is not high.But in Runge Kutta method, the derivatives of higher order are not required and they are designed to give greater accuracy with the advantage of requiring only the functional values at some selected points on the sub-interval.Runge Kutta method is a more general and improvised method as compared to that of the Euler method.We observe that in the Euler method excessively small step size converges to analytical solution.So, large number of computation is needed.In contrast, Runge Kutta method gives better results and it converges faster to analytical solution and has less iteration to get accuracy solution.This paper is organized as follows: Section 2: problem formulations; Section 3: error analysis; Section 4: numerical examples; Section 5: discussion of results; and the last section: the conclusion of the paper.

Problem Formulation
In this section we consider two numerical methods for finding the approximate solutions of the initial value problem (IVP) of the first-order ordinary differential equation has the form A continuous approximation to the solution   y x will not be obtained; instead, approximations to y will be generated at various values, called mesh points, in the interval   0 , n x x .Numerical methods employ the Equation (1) to obtain approximations to the values of the solution corresponding to various selected values of 0 , 1,2,3, .
The parameter h is called the step size.The numerical solutions of ( 1) is given by a set of points     x y is an approximation to the corresponding point x y x on the solution curve.

Euler Method
Euler's method is the simplest one-step method.It is basic explicit method for numerical integration of ordinary differential equations.Euler proposed his method for initial value problems (IVP) in 1768.It is 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.The general formula for Euler approximation is

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 r h where r is the order of the method.It do not demand prior computational of higher derivatives of   y x 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

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 call Round-off error.Truncation errors in numerical analysis arise when approximations 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 denotes the approximate solution and n y denotes the exact solution.In this paper we consider two initial value problems to verify accuracy of the proposed methods.The Approximated solution is evaluated by using Mathematica software for two proposed numerical methods at different step size.The maximum error is defined by

Numerical Examples
In this section we consider two numerical examples to prove which numerical methods converge faster to analytical solution.Numerical results and errors are computed and the outcomes are represented by graphically.

Discussion of Results
The The approximated solution is calculated with step sizes 0.1, 0.05, 0.025 and 0.0125 and maximum errors also are calculated at specified step size.From the tables for each method we say that a numerical solution converges to the exact solution if the step size leads to decreased errors such that in the limit when the step size to zero the errors go to zero.We see that the Euler approximations using the step size 0.1 and 0.05 does not converge to exact solution but for step size 0.025 and 0.0125 converge slowly to exact   solution.Also we see that the Runge Kutta approximations for same step size converge firstly to exact solution.This shows that the small step size provides the better approximation.The Runge Kutta method of order four requires four evaluations per step, so it should give more accurate results than Euler method with one-fourth the step size if it is to be superior.Finally we observe that the fourth order Runge Kutta method is converging faster than the Euler method and it is the most effective method for solving initial value problems for ordinary differential equations.

Conclusion
In this paper, Euler method and Runge Kutta method are used for solving ordinary differential equation (ODE) in initial value problems (IVP).Finding more accurate results needs the step size smaller for all methods.From the figures 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 results of the two methods under investigation, we observed that the rate of convergence of Euler's method is   O h and the rate of convergence of fourth-order Runge Kutta method is   4 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.
x is a given function and   y x is the solution of the Equation(1).In this paper we determine the solution of this equation on a finite interval   0 , n x x , starting with the initial point 0 x .

Example 1 : 2 y
we consider the initial value problem   exact solution of the given problem is given by   approximate results and maximum errors are obtained and shown in Tables 1(a)-(d) and the graphs of the numerical solutions are displayed in Figures 1-7.

Figure 7 .Example 2 :.
Figure 7. Error for different step size using RK4 method.Example 2: we consider the initial value problem obtained results are shown in Tables 1(a)-(d) and Tables 2(a)-(d) and graphically representations are shown in Figures 1-7 and Figures 8-14.

Table 1 .
(a) Numerical approximations and maximum errors for step size Numerical approximation for step size h = 0.1.Numerical approximation for step size h = 0.05.Numerical approximation for step size h = 0.025.Numerical approximation for step size h = 0.0125.Error for different step size using Euler method.

Table 2 .
(a) Numerical approximations and maximum errors for step; size