Solving nonlinear equation systems for engineering applications is one of the broadest and most essential numerical studies. Several methods and combinations were developed to solve such problems by either finding their roots mathematically or formalizing such problems as an optimization task to obtain the optimal solution using a predetermined objective function. This paper proposes a new algorithm for solving square and nonsquare nonlinear systems combining the genetic algorithm (GA) and the homotopy analysis method (HAM). First, the GA is applied to find out the solution. If it is realized, the algorithm is terminated at this stage as the target solution is determined. Otherwise, the HAM is initiated based on the GA stage’s computed initial guess and linear operator. Moreover, the GA is utilized to calculate the optimum value of the convergence control parameter (

Various applications had to be modeled via a system of ordinary or partial, or even fractional, differential equations [_{o}) introduced by Liao [

Consequently, the convergence region and the convergence rate of the series solutions calculated by HAM depend on the convergence control parameter [

In [

Another way to determine the convergence control parameter’s optimal value is to minimize the squared residual error as in [

Plotting

It hardly converges without being combined with other schemes

The calculations of higher-order derivatives are computationally intensive

The approaches that decrease the symbolic calculations are only suitable for low-dimensional systems

The absence of rules for defining the required terms in the HAM series increases the computational time and slows down the convergence

The other type of modifications depended on combining HAM and other conventional schemes for solving nonlinear systems. These combinations aim to improve the traditional methods’ performance and avoid (if possible) exploring the

In [

There is a need for plotting

The calculations of partial derivatives increase the computational burden

The appearance of the problems in the traditional methods like Jacobian singularity and stiffness hinders the convergence

The undetermined number of the HAM series affects the computation time

Genetic algorithms (GAs) are search-based algorithms based on the concepts of natural selection and genetics. Holland developed them as a subset of evolutionary algorithms [

This work aims to drive an improved algorithm combining the benefits of the previous HAM algorithms’ modifications. It also seeks to use optimization methods in calculating the residual to determine the required number in the series. Finally, it is benefiting from the parallelism and global convergence of the genetic algorithm. For this aim, a hybrid algorithm combining genetic algorithm (GA) and HAM is proposed to solve nonlinear equation systems. The proposed algorithm (GAHAM) tries to determine the target solution through the GA without involving the HAM. If the GA fails to converge to the solution individually, the HAM phase is utilized for this task. Then, the GA enhances the HAM performance by introducing an improved initial guess to the HAM. Moreover, the GA will be used in HAM calculations to determine the optimum value of the convergence control parameter without plotting the

The proposed combination of GA and HAM successfully solved nonlinear equation systems with less computational time and effort

The GA initiates the HAM with an improved initial guess. If it fails to converge by itself, improving the HAM procedure’s performance decreases the required HAM terms

The GA is used in the HAM calculations to determine the convergence parameter, which leads to dispensing the plotting of

As all calculations are done algebraically during this algorithm, they can be easily repeated in high-dimension or slow convergent problems

The main benefits of the proposed algorithm are stated as follows:

If the genetic algorithm succeeded in calculating the solution, the HAM’s symbolic calculations or the gradient calculations using the traditional methods are not needed. As a result, the computational effort and time are reduced.

If the genetic algorithm fails to detect the solution, it will introduce an enhanced initial guess and linear operator to the HAM yielding faster convergence and less symbolic computations.

If the HAM is needed, the genetic algorithm is applied to calculate the convergence control parameter’s optimum value. The genetic algorithm calculates that value without plotting the

The paper is organized as follows. Section

Figure

Flowchart of GAHAM algorithm.

The described computational stages are defined as follows.

The system of nonlinear equations is defined as

For

Assume that the enhanced point is

Figure

(a) Residual decreases with

Because _{1} as

Then, the improved initial point is calculated as

It is noticeable that the number of angles equals the number of unknowns in the nonlinear system.

As illustrated in (

This proposed domain of the angle confirms that the new initial point will have a residual less than the initial random guess. According to the proposed angle domain, it should lie in the third or fourth quarter related to

After constructing the chromosomes based on these intervals, the values of

After completing the calculations in GA stage, the resulting point is examined to be the optimum solution. If the residual is less than the predetermined tolerance, the algorithm stops after the first stage using GA, and the obtained solution is confirmed. Otherwise, the resulting point is entered into the HAM stage as an enhanced initial guess.

Based on the realized initial guess from the GA stage, the HAM is initiated, where it can be represented as

At

Then, (

Consider (

The matrix

Both enhanced

The matrix

Then, (

The differentiation of (

After substitution with

As

From (

The differentiation of (

Because

Because

Because

By repeating the same procedure, the ^{th} order deformation equation is obtained. This can be used to determine the solution series of algebraic equation systems. In general, the series term

According to (

In this stage, the residual function, which is a function of the convergence control parameter (

According to (

At the end of this stage, the convergence control parameter’s optimum value is obtained, and therefore a new solution is calculated. Hence, stages 2 and 3 represent the HAM procedure (stage) based on the enhanced initial guess. If the resulting solution of HAM procedure is optimum, the algorithm terminates, and the solution is displayed. Otherwise, it will be entered to the first stage as a new initial guess, and then the algorithm starts again until the desired tolerance is reached or no more improvement in the residual function is achieved. Then, the final solution of the nonlinear equations is declared.

It is worth mentioning that, according to this sequence of steps, the number of calculated terms using the HAM is identified before starting the HAM stage. In the proposed algorithm, it is selected as five. The reason for this choice is explained in the section of test functions. For more illustration of the algorithm procedure, Algorithm

Initialize:

the size of the population (N)

the maximum number of generations (G)

the initial random guess

(

The angle

The desired tolerance for stopping = Tol

While the stop criterion is not satisfied, do

Stage 1

For It = 1 :

For

Calculate the new individual

Calculate its fitness function

End For

End For

If

Then, display solution =

Else

Stage 2

Stage 3

For It = 1 :

For

End for

End for

If

Then, display solution =

Convergence control parameter optimum value =

Else

Go to stage 1

End while

Four test functions were utilized to investigate the performance of the proposed algorithm. The results are compared to Newton HAM (NHAM) and Newton homotopy differential equation (NHDE). For more generality, square and nonsquare systems are considered test functions. In cases of nonsquare systems, matrices

The proposed algorithm is coded in MATLAB 2020a and implemented on the computer with Intel^{®} Core™ i7 CPU, 3.2 GHz, and 16 GB RAM. For computational studies, a population size equal to 50, and 50 generations are used; crossover fraction is 0.8; migration interval is 20; and migration factor is selected to be 0.2.

As seen in [

The exact solution of this system is

Comparison of results for test function 1 at different cases of the initial guess.

Case 1. Initial guess: 7.0611, 6.0747 | Method | Result | HAM iterations | Other iterations | ||

NHAM | Converging | 1 | Newton | 56 | ||

GAHAM | Converging | 1 | GA | 1 | ||

2 | ||||||

NHDE | Diverging | None | 500 | |||

Case 2. Initial guess: 0.127, 0.9134 | Method | Result | HAM iterations | Other iterations | ||

NHAM | Converging | 1 | Newton | 77 | ||

GAHAM | Converging | None | GA | 1 | ||

NHDE | Converging | None | 22 | |||

Case 3. Initial guess: | Method | Result | HAM iterations | Other iterations | ||

NHAM | Converging | 1 | Newton | 100 | ||

2 | 11 | |||||

GAHAM | Converging | None | GA | 1 | ||

NHDE | Converging | None | 105 |

According to Table _{1} to identify the valid region and, therefore, the convergence parameter optimum value. Figure

For case 2, the NHAM used one HAM iteration, followed by 77 Newton’s iterations. NHDE needed 22 iterations to converge. However, no HAM iterations were required in the GAHAM. Convergence occurred after one iteration of the first stage using the GA stage.

For case 3, NHAM converges after two iterations of HAM and 111 Newton’s iterations. It should be mentioned here that, after the first iteration of HAM, 100 Newton’s iterations were used without convergence which leads to the second iteration of the HAM. After the second iteration of the HAM and 11 Newton’s iterations, the final solution was reached. Furthermore, the calculation of the convergence parameter from curves was time-consuming.

NHAM’s consequence prevented the movement to the Newton method step until completion of convergence control parameter calculations, which affected the speed of convergence and increased the computational burden. Figure

According to [

The exact solution of this test function is

Results of test function 2.

Test function 2 | Method | Result | HAM iterations | Other iterations | |

NHAM | Almost converging | 1 | Newton | 302 | |

NHDE | Converging | None | 495 | ||

GAHAM | Converging | 3 | GA | None |

(a) Residuals of test function 2 during 500 iterations. (b) Results of test function 2 during 5 iterations.

Figure

According to [

The exact solution of this function is

Results of test function 3.

Test function 3 | Method | Result | HAM iterations | Other iterations | |

NHAM | Diverging | 15 | Newton | 100 | |

NHDE | Converging | None | 11 | ||

GAHAM | Converging | 4 | GA | 4 |

(a) Residuals of test function 3 with full scale. (b) Compressed residual scale of test function 3.

Selected test function 4 is represented as

The exact solution of this function is

As shown in Table

Results of test function 4.

Test function 4 | Method | Result | HAM iterations | Other iterations | |

NHAM | Diverging | 5 | Newton | 61 | |

NHDE | Diverging | None | 600 | ||

GAHAM | Converging | 9 | GA | None |

(a) Residuals of test function 4 during 600 iterations. (b) Residuals of test function 4 during 10 iterations.

Comparing the proposed GAHAM's overall results and the considered NHAM and the NHDE methods raises the following remarks.

The proposed algorithm combines the benefits of parallelism, the global ability of search of the GA, and the convergence of the HAM to find the solution of nonlinear equations.

Unlike Newton's method and other local algorithms, the algorithm does not require derivative calculations to improve the initial guess, facilitating the computations and converging even in singular systems (test function 3). Moreover, calculations based on the Jacobian matrix are time-consuming with highly computational burden in large systems unless an approximation is used for the Jacobian, but this may affect the solution's convergence.

In the NHAM and the NHDE method, the residual during the calculations does not continually decrease. It increases during the computations, affecting the speed of convergence and the number of required iterations. However, the GAHAM always offers continuous decrease of residual, ensuring the improved solution’s sustained improvement, and speeds up the convergence.

The main differences of the HAM calculations in the proposed algorithm and other HAM modifications are as follows:

The number of terms can be identified before the calculations, enabling symbolic computations’ control. This number varies according to the system’s complexity and nonlinearity.

The drawing of the

The specified criterion and domain of angles in the GA stage allow converging to the solution. As shown in the test functions, the GA stage could find the system’s solution without involving any HAM stage in some problems.

The proposed algorithm may not contain the additional parameter of step size (

The advantages of this approach can be summarized as follows:

It benefits from the genetic algorithm’s parallelism to realize the solution without derivatives, initial guesses considerations, and symbolic calculations of HAM (if possible).

If the HAM is required, the proposed approach introduces an initial guess that is as close as possible to the optimum solution. As a result, the symbolic calculations using HAM will be reduced, leading to saving of computational burden and time.

The proposed approach calculates the convergence parameter of HAM without plotting the

The ability to repeat the calculations enables the computation of the minimum number of HAM terms required to reach the optimum solution, which accelerates the convergence and reduces its required computational time and burden.

It is known that each algorithm or approach has its own limitations. The limitations of the proposed GAHAM algorithm are as follows:

It depends on defining the number of HAM terms before starting calculations. There is no definite rule to achieve that, so it is determined according to the resulting residual yields from the GA stage. If this residual is not high, the required number is expected to be low. The proposed search found that the required terms are less than or equal to five.

The effect of the GA parameters has not been involved in this search. The effect of these parameters on the convergence of the algorithm should be investigated in future work.

This paper proposes a new algorithm (GAHAM) combining both the HAM and the GA for solving nonlinear equation systems. The algorithm calculates the solution based on three sequential stages. First, the GA is utilized to find either the system's solution or the best initial guess to the HAM. If the first stage failed to reach the target solution, the second stage is performed using the HAM. The HAM calculations were based on a specific number of series terms, and the linear operator matrix resulted from the improved GA stage’s solution. In the third stage, the HAM’s convergence control parameter is calculated using the GA to minimize the residual algebraically based on the predefined search domain without plotting the

All data related to the work are included in the paper and its relevant references. Clarification or data requirements that support the findings of this study are available from the author upon request.

The author declares no conflicts of interest.