Ciencias Básicas
Comparative Analysis of Numerical Solutions of ODEs with Initial Value Problems using Improved Euler Methods
Análisis comparativo de las soluciones numéricas de EDOs con problemas de valor inicial mediante los métodos mejorados de Euler
Comparative Analysis of Numerical Solutions of ODEs with Initial Value Problems using Improved Euler Methods
Scientia Et Technica, vol. 26, núm. 3, pp. 391-397, 2021
Universidad Tecnológica de Pereira
Recepción: 10 Mayo 2020
Aprobación: 23 Septiembre 2021
Resumen: Este documento contiene una comparación detallada entre los métodos iniciales de solución numérica de ecuaciones diferenciales ordinarias, que parten del enfoque del método de Euler, que se basa en la solución de ecuaciones diferenciales por el método de Taylor, los otros dos métodos a comparar son mejoras de este. método, el de Euler, y son el método de Heun, y el método del punto medio. Se observará a partir de la solución de ecuaciones diferenciales de prueba su respectivo error con respecto a la solución analítica, obteniendo un índice de error dictado por el error cuadrático medio EMC. A través de este documento conoceremos la mejor aproximación numérica a la solución analítica de los diferentes PVI (problemas de valor inicial) planteados, fijando también un patrón de solución para determinados problemas, es decir, se estipulará el método adecuado para cada tipo de problema.
Palabras clave: Aproximación, función, Hermite, interpolación, Lagrange, polinomio..
Abstract: This document contains a detailed comparison between the initial numerical solution methods of ordinary differential equations, which start from the Euler method approach, which is based on the solution of differential equations by the Taylor method, the others two methods to be compared are improvements of this method, that of Euler, and they are the method of Heun, and the method of the midpoint. It will be observed from the solution of test differential equations its respective error with respect to the analytical solution, obtaining an error index dictated by the mean square error EMC. Through this document we will know the best numerical approximation to the analytical solution of the different PVI (initial value problems) raised, also fixing a solution pattern for certain problems, that is, the appropriate method for each type of problem will be stipulated.
Keywords: Interpolation, approximation, polynomial, function, Lagrange, Hermite.
I. INTRODUCTION
THE first attempts to solve physical problems by differential calculus at the end of the seventeenth century gradually led to the creation of a new branch of mathematics, namely, differential equations. In the mid-eighteenth century differential equations became an independent branch and its resolution an end in itself. [1] Mathematicians of the time often used physical arguments: if y (x) denotes the position at time t of a particle, then
is its velocity. If
, we have that the velocity is zero, that is, the particle does not move and its position, therefore, remains constant. In 1693 Huygens speaks explicitly of differential equations and in the same year, Leibniz says that differential equations are functions of elements of the characteristic triangle (Fig. 1).
![The characteristic triangle. [1]](../84969623014_gf2.png)
At the end of the XXVII century and during the next 100 years’ great characters such as Johann Bernoulli, Jean Le Rond d'Alembert, Joseph-Louis Lagrange, Joseph Fourier concentrated on the problem of constructing structures that could solve the different types of differential equations.
At the beginning of the nineteenth century, more precisely in 1820, Cauchy proved the existence of solutions of the differential equation
under certain conditions. In 1890 Picard established a method of successive approximations that allows to establish with precision the theorem of existence and uniqueness of the differential equations of order n. Poincaré's research on the stability and periodicity of solar system solutions led him to the beginning of the theory of non-linear differential equations. He obtained at the end of the 19th century a series of qualitative results that were improved by Bendixson and by Liapunov [1] [2].
II. CONTENT
A. Ordinary differential equations.
The solution of ordinary differential equations of the form (1) has a wide margin of study in the field of applied mathematics, the functions
represent physical quantities, the derivatives represent their rate of change and the equation defines the relationship between them. Differential equations can then describe physical phenomena and their behavior in certain time intervals, so they play an essential role in various fields such as engineering, economics, physics, chemistry, among others [2].
(1)As mentioned above, one of the major concerns in the subject was the creation of procedures that would allow finding the exact solution to the differential equations, however, in some cases this analytical solution could not be found and that is where the implementation is necessary. of the numerical analysis to obtain a solution with a certain degree of accuracy. [3]
B. Analytical solution
There are different solution techniques for the EDOs depending on the structure they have, you can use methods that contain analytical integration for problems of separable variables, for example. Some equations are more complex to solve and require more cumbersome techniques, however, for non-linear EDOs and for some linear EDOs there are no general methods, ie they have no analytical solution. [4]
C. Numerical solution of initial value problems (PVI)
As mentioned above, it is common for EDOs to appear that have an analytical solution that is too complex or that simply do not have it, for either of these two cases it is necessary to implement techniques that approximate the response to be obtained with a small margin of error. makes the use of numerical methods necessary.
To find an approximate solution to the ODEs, it is necessary to define some concepts:
The PVI (initial value problem), consists of an ordinary differential equation (1). Which is subject to an initial condition


The numerical solution that will be obtained will not be a continuous approximation to the solution y (x), but an approximation discretized in several values called mesh points, this solution will have n points, with abscissas equally spaced by a length of size h over [
]. Therefore, the numerical solution will be determined by the advance of points
y
:
(2)
Where the function φ is called the increment function and behaves like the slope of the local linear approximation in the vicinity of the point
, this function varies depending on the numerical method used, the form of the calculation of the
also varies, while the calculation of the
is equal for all the methods. Therefore the equations seen in (2) generate the set of points {(
,
)} [4] [5]. Once the approximate solution is obtained at the points, the approximate solution at other points in the interval can be found through interpolation [4].
D. Taylor series to solve EDOs
The Taylor series (3) is a tool that allows you to obtain local approximations for a function around a point, in terms of the function and its derivatives of higher order. The PVI provides the first derivative of the function, solution of the differential equation and the coordinate of a point that satisfies the solution. In addition, you can calculate the higher-order derivatives of the solution field, if they exist.
(3)

As mentioned earlier in (2), the extrapolation of points
: is obtained

This value is replaced in the Taylor series:


From this it follows that y (
) =
, therefore the previous result is denoted as:

Then, with
it is possible to obtain
, in the following way:

Generalizing, if
extrapolates to
, then:

We have
of (1), then the derivatives of higher order are given by 




Subsequently, h it is factorized

That finally agrees with the set of points generated
, with
, of (2):

Where:

E. Euler's method
The Euler method is the most basic approach technique for solving initial value problems. Although it is rarely used in practice, the simplicity of its derivation can be used to illustrate techniques related to the construction of some of the most advanced techniques.
It can be seen that the Euler method is really the Taylor series of order 1 to solve ODEs, that is:

Where according (2):

According to this equation, the estimated slope f is used to extrapolate from a previous value
to a new value
over a distance h (Fig. 2). This formula is applied step by step to calculate a subsequent value and, therefore, to plot the path of the solution [6].
![Graphic demonstration of the Euler method. [3]](../84969623014_gf3.png)
A fundamental reason for error in the Euler method is to assume that the derivative at the beginning of the interval is the same throughout the interval. There are two simple modifications to avoid this consideration: the Heun method, and the midpoint method [3].
F. Method of Heun
It is a method that to improve the estimation of the slope uses the determination of two derivatives in the interval (one in the initial point and another in the end). The two derivatives are then averaged in order to obtain a better estimate of the slope over the entire interval. This procedure is presented in graphic form in Fig. 3.
If you remember in the Euler method the slope at the beginning of an interval is given by the (4):
(4)And it is used to linearly extrapolate to 
(5)In Euler's standard method, you should stop here. However, in Heun's method the
calculated in (5) is not the final answer, but an intermediate prediction. Therefore, it is distinguished by a superscript 0. Equation (5) is called a predictor equation or simply a predictor. Give an estimate of
that allows the calculation of an estimate of the slope at the end of the interval given by (6):
(6)
![Graphic demonstration of the Heun´s method [3]](../84969623014_gf4.png)
In this way the two slopes (4) and (6) are combined to obtain an average slope in the interval:

Then the average slope is used to extrapolate linearly from
to
:
(7)This last equation (7) is known as corrective equation or simply corrector, and it is with this that the solutions of the successive points are obtained [3][6].
G. Midpoint method
Fig. 4 illustrates another simple modification of the Euler method. Known as the midpoint method. This technique uses the Euler method to predict a value of y at the midpoint of the interval (Fig. 4-a)
Then, this predicted value is used to calculate a slope at the midpoint:

Where 
The value of
represents a valid approximation of the average slope over the entire interval. This slope is then used to linearly extrapolate from
to
as in Fig. 4-b with:


In this way, the points
and
that approximate the solution of the PVI are obtained [3][7].
![Graphical demonstration of the midpoint method. [3]](../84969623014_gf5.png)
H. Test problems
To guarantee the realization of an effective comparison between Euler's improved methods, these will be implemented to solve different differential equations,[3],[4],[5], in order to do the comparative analysis:
I. PVI 1

With initial condition 
Analytical solution:

J. PVI 2

With initial condition 
Analytical solution:

K. PVI 3

With initial condition 
Analytical solution:

L. Calculation of the error
The truncation error of the series is used in the numerical methods for solving initial value problems. Of Taylor to measure the approximation to the exact response of the differential equation, however, the methods discussed in this paper are derivations of the Euler method, which include some artifacts that distance them from the Taylor series of order 1, reason why it is decided to implement the mean square error (EMC) for each point of the grid of the numerical solution of each method, that is:

Where
is the value of the ordinate obtained from evaluating
in the exact (analytical) solution of the differential equation,
corresponds to the value of the ordinate of the numerical solution of each method obtained according to:

is the increment function, which varies according to the method implemented [8].
III. Results
Below are the results of solving the three problems of initial values presented above, each problem was solved in the interval
, so the points are defined in the same way for each of the solutions
0 0.5 1 1.5 5 2.5 3 3.5
Based on these points, the numerical solutions (Tables I,II and III) and graphically (Fig. 5,6 and 7) will be presented, so that the differences in the methods can be observed.
A. PVI 1

With initial condition 
Analytical solution:

| Euler | Heun | Middle point | Exact Solution |
| 1 | 1 | 1 | 1 |
| 5.25 | 3.4375 | 3.10938 | 3.21875 |
| 5.875 | 3.375 | 2.8125 | 3 |
| 5.125 | 2.6875 | 1.984375 | 2.21875 |
| 4.5 | 2.5 | 1.75 | 2 |
| 4.75 | 3.1875 | 2.48438 | 2.71875 |
| 5.875 | 4.375 | 3.8125 | 4 |
| 7.125 | 4.9375 | 4.60938 | 4.71875 |
| 7 | 3 | 3 | 3 |

B. PVI 2

With initial condition 
Analytical solution:

| Euler | Heun | Middle point | Exact Solution |
| 1 | 1 | 1 | 1 |
| 1.5 | 1.55 | 1.58824 | 1.58986 |
| 2.1 | 2.13125 | 2.19812 | 2.19328 |
| 2.625 | 2.602584 | 2.680631 | 2.67191 |
| 3.02885 | 2.95293 | 3.03593 | 3.02572 |
| 3.33173 | 3.21259 | 3.29884 | 3.28803 |
| 3.56151 | 3.40922 | 3.49811 | 3.48701 |
| 3.73958 | 3.56199 | 3.65317 | 3.64187 |
| 3.8807 | 3.6836 | 3.7767 | 3.7653 |

C. PVI 3

With initial condition 
Analytical solution:

| Euler | Heun | Middle point | Exact Solution |
| 1 | 1 | 1 | 1 |
| 1 | 1.02755 | 1.00757 | 1.01448 |
| 1.0551 | 1.21735 | 1.17152 | 1.19595 |
| 1.369424 | 1.790722 | 1.746698 | 1.814931 |
| 2.049 | 2.73865 | 2.78521 | 2.88288 |
| 2.81925 | 3.45533 | 3.56449 | 3.65615 |
| 3.12141 | 3.64318 | 3.66888 | 3.79329 |
| 3.1258 | 3.60638 | 3.66656 | 3.7787 |
| 3.0503 | 3.1851 | 3.3279 | 3.4117 |

D. Mean square error
The following table IV clearly shows the error calculations.
| PVI 1 | PVI 2 | PVI 3 | |
| Euler | 6.2799 | 0.0055 | 0.2908 |
| Heun | 0.1185 | 0.0045 | 0.0184 |
| Middle point | 0.0296 | 7.84E-05 | 0.0065 |
IV. Conclusions
The development of different numerical methods for the solution of differential equations facilitates the study and application of them. In the comparison made it can be seen that for all the problems raised the method that presents a more approximate solution is the midpoint method, it is possible to conclude that the veracity of the method is due to the fact that it intrinsically takes more mesh points for the solution just as its name says; will take in addition to the normal mesh points, the intermediate points between these.
In spite of the simplicity of the realization of the presented methods, it is shown that the implementation of these, mainly the improvements of the Euler method, give very accurate answers in comparison with the exact answers, besides saving computational effort different from the methods of the Taylor series of higher order. This work and its results leave an open gap to make comparisons in more advanced methods, such as the Runge-Kutta and step-by-step methods, which give closer approximations and are widely used in different types of software.
References
[1]. M. Kline and M. Martínez, “El pensamiento matemático de la Antigüedad a nuestros días”, Alianza Editorial, Madrid, España, 1992.
[2]. J. E. Napoles Valdes, “Un siglo de teoría cualitativa de ecuaciones diferenciales”, Lecturas Matemáticas, Universidad de la Cuenca del Plata, Argentina, 2004.
[3]. S. C. Chapra and R. P. Canale, “Métodos numéricos para ingenieros”, McGraw-Hill, México, 2007.
[4]. J. D. Faires, R. L. Burden and P. J. P. Escolano, “Métodos numéricos”, Thomson-Paraninfo, España, 2007.
[5]. A. Quarteroni, R. Sacco, and F. Saleri, “Numerical mathematics”, Springer Science & Business Media, Berlin, 2010. doi: 10.1007/b98885
[6]. Ledanois, J. M. (2000). Métodos numéricos aplicados en ingeniería (No. 517/M59).
[7]. J. H. Mathews and K. D. Fink, “Métodos numéricos con Matlab”, Pearson, Madrid, 2000.
[8]. K. E. Atkinson, and W. Han, “Elementary numerical analysis”, Wiley, New York, 2005.
Notas de autor

university professor of the Mathematics Department of the Technological University of Pereira, Colombia and director of the applied mathematics and education research group. Master of Science (Msc) in physical instrumentation (2007). Member of the plasma laboratory of the National University of Colombia, located in Manizales, Colombia. Member of the group of non-linear differential equations "GEDNOL" at the Technological University of Pereira, Colombia. Director of the research group in Applied Mathematics and Education "GIMAE" at the Technological University of Pereira, Colombia.

Associated teacher of mathematics and physics at Universidad Tecnologica de Pereira, Colombia. PhD in engineering (2012). Master of Science (Msc) in the faculty of Physics - Cience (2010). Member of plasma laboratory from Universidad Nacional de Colombia located in Manizales, Colombia. Member of nonlinear differential equations group “GEDNOL” at Universidad Tecnológica de Pereira, Colombia. Area of expertise: material processing through assisted plasma techniques, structural characterization mechanical of materials, simulation and modeling of material’s physical properties.

university lecturer of the department of Mathematics at the Universidad Tecnológica de Pereira, Colombia. Master of Science (Msc) in mathematics (2008). Member of nonlinear differential equations group “GEDNOL” at Universidad Tecnologica de Pereira, Colombia. Member of the research group in Applied Mathematics and Education “GIMAE” at the Universidad Tecnológica de Pereira.