Numerical Methods for Solving Ordinary Differential Equations
Differential equations are the building blocks in modelling systems in biological, and physical sciences as well as engineering. This study focuses on two numerical methods used in solving the ordinary differential equations. The equations of consideration will be of the form:
such that is the unknown function that needs to be found. Notably, this is a first-order differential equation given that it comprises of a first-order derivative of the unknown function and no higher-order derivative (Atkinson, Han, & Stewart, 2009). Most importantly, the higher-order differential equations can be rearranged to a system of first-order equations.
The first numerical method discussed is the Euler’s method. Essentially, the method is an intuitive approach in highlighting the important ideas in numerical solutions to ordinary differential equations. However, it is not efficient for application in practical use owing to its inaccuracies compared to other methods that run equivalent step size (Gonze, 2013). The second method of interest in this study is the Runge-Kutta method that depicts better numerical stability making it appropriate for use in practical computations.
The Euler’s Method
The majority of the equations arising in applications are complicated enough that it is impractical to have solution formulas. Nonetheless, where the solution formulas are available, the calculations involved can only be possible using numerical quadrature formula. As such, the numerical methods come in handy facilitating viable alternatives for solving the differential equations. The Euler’s method introduces the core ideas pertaining the numerical solutions of differential equations. For the discussion that prevails in this study, it is helpful to identify the notation used first. As such, represents the true solution given an initial value problem having an initial value of .
Solving the above equation using the numerical method entails approximating the solution at discrete set of nodes, . It can be simplified by taking the nodes as evenly spaced, Subsequently, the approximate solutions for the can be represented as, In order to find the approximate solution for the points  some form of interpolation has to be performed.
The Euler’s method is defined as: .
The initial guess is , where at times it is empirically calculated. The formula (1.1) is used in the calculation of values , which is common in numerical methods for solving the ordinary differential equations. Figure 1 illustrate the Euler’s method derivation, whereby the line the tangent to the graph has a slope at the point .
Figure 1 Euler’s method geometric illustration
Solve the equation, whose true solution is
The Euler’s method for the equation is
. Notably, Table 1 illustrates the solution of for three values of l and selected values of x.
Table 1 Results
Obtain the results for the differential equation with the initial condition .
Taking a step of x = 0.2, the solution obtained is illustrated in table 2.
|step||Computed point||Exact point|
The Runge-Kutta Method
Using the Runge-kutta methods facilitates in evaluating at additional points. Importantly, the Runge-Kutta methods can be defined as: . The average slope of the solution at interval is expressed as . However, the expression is constructed by making the Runge-Kutta act as a Taylor method (Atkinson, Han, & Stewart, 2009). Whenever the order is 2 then the equation to obtain the solution should be
. Subsequently, the constants need to be obtained and when the true solution is substituted in the equation the truncation error should satisfy the equation same as the Taylor method for the order 2.
Figure 2 Runge-Kutta methods derivation illustration
Obtain the results when applying the Runge-Kutta method in solving the differential equation:
with the initial condition x(0) = 1.
Table3 illustrated the solutions
|Step||Exact point||Computed point|
|x = 0.1||7.3891||7.3662|
Solve the equation with the solution .
For the step sizes l= 0.25 and 2l = 0.5. The formula evaluates to that leads to the error .
Atkinson, K., Han, W., & Stewart, D. (2009). Numerical Solution of Ordinary Differential Equations. Hoboken: John Wiley and Sons .
Gonze, D. (2013). Numerical Methods for Ordinary Differential Equations. Brussels: University of Brusels.