New Modification on Heun’s Method Based on Contraharmonic Mean for Solving Initial Value Problems with High Efficiency

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.


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. ere 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 [4][5][6][7]. 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. e numerical results are very encouraging.
is demonstrates improved performance and better accuracy compared to other well-known methods of second order present in the literature.
In order to solve (1), the most known and simplest method is the explicit Euler's (Forward Euler) method with step length h and is given by y p n+1 � y n + hf x n , y n . (2) is formula comes from approximating the derivative y 0 at x � x n 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 [x i , x i+1 ] 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 [8][9][10], 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) as where K 1 � f(x n , y n ) and K 2 � f(x n+1 , y p n+1 ) � f (x n + h, y n + hf(x n , y n )).

Stability Analysis of the Proposed Method
e 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 f(x, y) per step, while Euler's method requires only one. e local truncation error with the improved Euler method is O(h 3 ), rather than O(h 2 ) as with Euler's method.
If K 1 � f(x n , y n ) and K 2 � f(x n+1 , y p n+1 ), 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 λy n + λ y n + hλy n 2 + λy n 2 + λ y n + hλy n 2 λy n + λ y n + hλy n � y n + h 2 2λy n + hλ 2 y n 2 + λy n + λ(1 + λh) 2 y n 2 + hλ If we let z � hλ, we have e 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.

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 of y n+1 � y n + hϕ x n , y n , h , (11) and will be consistent if lim h⟶0 ϕ(x n , y n , h) � f(x n , y n ).
In our case, in order to check the consistency of the proposed method of equation (7), we have ϕ x n , y n , h � 1 2 From this, erefore, the proposed method is consistent.

Local Truncation Error
e 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.
e Taylor series expansion of y(x n+1 ) is e Taylor series expansions of the slopes K 1 and K 2 of the tangents are And then, the sum of arithmetic mean and contra harmonic mean of K 1 and K 2 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 erefore, the new proposed method has a local truncation error of order O(h 3 ) and hence, the order of the proposed method is of order 2.

Numerical Results and Discussion
In this section, numerical solutions y n of y(x) for the initial value problem (IVP) using Heun's method and the new Proposed method has been discussed in Examples 1-3, and Tables 1-6 show the numerical solutions and errors made, while Figures 2-4 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 h− values, and the results are computed with the help of MATLAB software [12].    Table 1 shows results using Heun's method and the new proposed method with step sizes h � 0.1 and h � 0.05 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 h � 0.1 and h � 0.05 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 h � 0.5 and h � 0.25 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.

Conclusion
is 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). e 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 h � 0.1 and h � 0.05, and the results show that the new proposed method at h � 0.1 is by far better than Heun's method at h � 0.05. 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 h � 0.5 and h � 0.25, and Table 6 shows the absolute errors of the numerical solutions obtained under Table 5.
e new proposed method has been constructed or formed by combining the slopes K 1 and K 2 and using the slope as the average of the arithmetic mean and contraharmonic 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
e data used to support the finding of the study are available within the article.