Abstract

In this paper, small modification on Improved Euler’s method (Heun’s method) is proposed to improve the efficiency so as to solve ordinary differential equations with initial condition by assuming the tangent slope as an average of the arithmetic mean and contra-harmonic mean. In order to validate the conclusion, the stability, consistency, and accuracy of the system were evaluated and numerical results were presented, and it was recognized that the proposed method is more stable, consistent, and accurate with high performance.

1. Introduction

Differential equations, either ordinary derivatives or partial derivatives, are equations which contain derivatives. An ordinary differential equation together with initial condition is an initial value problem (IVP) which specifies the value of the unknown function at a given point in the domain. There are a lot of physical problems in science and engineering which exist in the form of differential equations and are also commonly used in physics, chemistry, biology, and economics [1].

To determine the solution of differential equations, there are different analytical methods available. In certain cases, however, analytical methods are not capable of solving such complicated or complex differential equations. Numerical methods are used to achieve the solution to the complicated differential equations [2, 3]. With the help of computer programming, numerical methods are very valuable tools for solving complex problems very quickly.

Numerous numerical methods for solving ordinary differential equations (ODEs) with initial value problems (IVPs) have been developed by many researchers. Many authors have attempted to solve initial value problems (IVP) to obtain high accuracy rapidly by using a numerous methods, such as Euler’s method and Heun’s method, and some other methods. Euler’s method uses the line tangent to the function at the beginning of the interval as an estimate of the slope of the function over the interval. However, Heun’s method considers the tangent lines to the solution curve at both ends of the interval. And some of them have attempted to enhance these precision methods, where others have improved these methods for better accuracy, stability, and consistency [47]. Some improvements have been made from time to time in numerical methods to get better performance according to our needs.

In this paper, Heun’s method and its modification are applied for solving ordinary differential equation in initial value problems. The numerical results are very encouraging. This demonstrates improved performance and better accuracy compared to other well-known methods of second order present in the literature.

2. Methodology of Research of the Proposed Method

Let us consider the first-order differential equation with initial value problem (IVP):

In order to solve (1), the most known and simplest method is the explicit Euler’s (Forward Euler) method with step length and is given by

This formula comes from approximating the derivative at by a forward difference.

Improved Euler’s method (Heun’s method) has a slope which is the average of the slopes of the tangents to the integral curve at the endpoints of the interval given by

Improved Euler’s method is also known as Heun’s method. In this method, Euler’s method is used as predictor step and a mean slope is used as a corrector step.

In [810], a second stage of the second-order harmonic mean method is given by

Now, the new proposed method assumes the slope as the average of the arithmetic mean and second-order harmonic mean of the slopes of the tangents which is given by equation (5) aswhere .

3. Stability Analysis of the Proposed Method

The stability analysis of the proposed method can be obtained using Dahlquist’s test problem [11]:

Heun’s method and the new proposed (improved Heun’s) method require two evaluations of per step, while Euler’s method requires only one. The local truncation error with the improved Euler method is , rather than as with Euler’s method.

If , then the new proposed (improved Heun’s) method is the average of the artihmetic mean and the second order contra harmonic mean which is given as

In order to check the stability of the proposed method, substitute (6) into (7), and we have

If we let , we have

The stability region is

Here, in Figure 1, the shaded region is the region of unstability of the proposed method. In other words, the proposed method is stable in the unshaded region.

4. Consistency Analysis

In order to check the consistency of the initial value problem (IVP), the numerical formula expressed by [11], equation (1) can be written in the form ofand will be consistent if .

In our case, in order to check the consistency of the proposed method of equation (7), we have

From this,

Therefore, the proposed method is consistent.

5. Local Truncation Error

The local truncation error (LTE) of a numerical method is an estimate of the error introduced in a single iteration of the method, assuming that everything fed into the method was perfectly accurate.

The Taylor series expansion of is

The Taylor series expansions of the slopes and of the tangents are

And then, the sum of arithmetic mean and contra harmonic mean of and is given as

Substituting (17) into the proposed equation (7), we obtain

After comparing equations (15) and (18), the local truncation error (LTE) is given by

Therefore, the new proposed method has a local truncation error of order and hence, the order of the proposed method is of order 2.

6. Numerical Results and Discussion

In this section, numerical solutions of for the initial value problem (IVP) using Heun’s method and the new Proposed method has been discussed in Examples 13, and Tables 16 show the numerical solutions and errors made, while Figures 24 show the graphs of the numerical solutions using Heun’s method for different step lengths and the exact solution. Figures 5 and 6 show the graphs of the numerical solutions using the new proposed method, and Figures 7 and 8 show the errors made using the new proposed method and Heun’s method based on different values, and the results are computed with the help of MATLAB software [12].

Example 1. Solve the initial value problem (IVP) using Heun’s (improved Euler) method and the proposed method with step sizes and and compare the errors.

Example 2. Solve using Heun’s (improved Euler) method and the proposed method for .

Example 3. Solve the IVP for and .
Solution: for Example 1, Table 1 shows results using Heun’s method and the new proposed method with step sizes and and the exact solution, while Table 2 shows the error made using Heun’s method and the new proposed method to find approximate values of the solution of the initial value problem.
For Example 2, Table 3 shows results using Heun’s method and the new proposed method with step sizes and and the exact solution, while Table 4 shows the error made using Heun’s method and the new proposed method to find approximate values of the solution of the initial value problem.
For Example 3, Table 5 shows results using Heun’s method and the new proposed method with step sizes and and the exact solution, while Table 6 shows the error made using Heun’s method and the new proposed method to find approximate values of the solution of the initial value problem.

7. Conclusion

This research paper shows the possibility of constructing a new proposed method on Heun’s method based on second-order contra-harmonic mean to solve ordinary differential equations (ODEs) with initial value problems (IVPs). The result of the new proposed method has been compared with Modified Euler method and Heun’s method (Improved Euler method). Tables 1 and 3 demonstrate the numerical solutions of Heun’s method and the new proposed method with step lengths and , and the results show that the new proposed method at is by far better than Heun’s method at . Tables 2 and 4 show the absolute errors of the numerical solutions obtained under Tables 1 and 3, respectively. Table 5 demonstrates the numerical solution of Heun’s method and the new proposed method with step lengths and , and Table 6 shows the absolute errors of the numerical solutions obtained under Table 5.

The new proposed method has been constructed or formed by combining the slopes and and using the slope as the average of the arithmetic mean and contra-harmonic mean. And also the stability and consistency have been analyzed, and the local truncation error was computed and found that the new proposed method is stable, consistent, and second-order accurate.

Data Availability

The data used to support the finding of the study are available within the article.

Conflicts of Interest

The authors declare that they have no conflicts of interest.