An enhanced Harris Hawk optimization algorithm for parameter estimation of single, double and triple diode photovoltaic models

Due to the rapid development of photovoltaic (PV) system and spreading of its application, the accuracy of modeling of solar cells, as the main and basic element of PV systems, is gaining relevance. In this paper, an Enhanced Harris Hawk Optimization Algorithm (EHHO) is proposed and applied for estimating the required parameters of different PV models in an effective and accurate way. Harris Hawk Algorithm (HHO) is based on Hawks ways in hunting and catching their preys. The HHO utilizes two phases including exploration and exploitation. The main purpose of proposed enhancement is to improve the second phase of HHO. This enhancement is performed on the exploration phase by fluctuating toward or outward the best optimal solution using sine and cosine functions. Both conventional and proposed algorithms are applied for single, double and triple diode PV models. In order to test the applicability and robustness of proposed algorithm, it is applied for estimating the parameters of different real PV systems and compared with other recent optimization algorithms. The results show that the proposed EHHO is more accurate than conventional HHO and other algorithms.


Introduction
Recently, solar energy became an important source of renewable energy in the world as it is used in different applications such as energy generation, self-sustained systems (e.g., water-pumping) as well as smart homes and water heating (Abbassi et al. 2018;Chen et al. 2019a). The increase in solar energy applications leads the need of obtaining accurate and reliable models to be used for the analysis and development of solar modules and its integrations. In this regard, as the characteristic of PV solar cell is similar to P-N junction characteristics so different types of models have been developed based on the number of diodes in the model (single (SD), double (DD) and triple diodes (TD)). In literature, different algorithms have been applied to estimate the parameters of SD and DD models to develop more and more accurate PN model. A comparative study for the most recent algorithms applied to SD and DD models has been presented in Abbassi et al. (2018). The SD model contains only five parameters. These parameters are two currents (photovoltaic current and diode current) and two resistors (series and shunt resistance) and the diffusion diode ideality factor. The SD model is considered a simple model due to it has a small number of parameters (Oliva et al. 2017;Li et al. 2013;Askarzadeh and Rezazadeh 2012). Although the SD model is simple in parameter estimation, some researchers tend to use the Double diode model. DD model has been developed to overcome the problems in the SD model by taking into consideration the recombination losses (Gupta et al. 2012;Jamadi et al. 2016). DD model represents the recombination losses by adding one diode to the SD model and raise the number of the model parameters to seven parameters instead of five parameters in the SD model. These two parameters are (second diode current and recombination factor). The accuracy achieved by the DD model is higher than SD,  which gave the chance for the researchers to develop a triple diode model. The TD model has nine estimated parameters. In the TD model, one diode is added to the DD model to raise the number of diodes in the model to three. The third diode represents leakage current and grain boundaries. Using DD and TD models in estimating the parameters of solar cells is more complex but they give more accurate results than those obtained-based SD model. In the literature, several optimization algorithms have been applied to estimate the parameters of solar cell-based SD, DD and TD models (Qais et al. 2019;Omnia et al. 2018;Elazab et al. 2020;Allam et al. 2016;Abbassi et al. 2019Abbassi et al. , 2017Ramadan et al. 2020). Allam et al. (2016), Moth-Flame Optimization Algorithm has been also used to estimate parameter of SD and DD and TD models. Abbassi et al. (2019), Salp Swarm-inspired algorithm has been adapted for parameter estimation of the DD model. Abbassi et al. (2017), comparative study to improve the SD model using genetic algorithm optimization algorithm has been presented. Ramadan et al. (2020), an enhancement teaching learn optimization algorithm has been developed for estimating the parameter of SD and DD. Many state-of-the-art methods have been developed for PV parameter estimation (Yu et al. 2019;Chen et al. 2019b;Liao et al. 2017;Zhang et al. 2020;Kler et al. 2017). Yu et al. (2019), a performance-guided JAYA (PGJAYA) algorithm has been proposed for extracting parameters of different PV models. Chen et al. (2019b), perturbed stochastic fractal search (PSFS) has been proposed to estimate the PV parameters in an optimization framework. Several hybrid optimization algorithms have been developed for solving the current optimization problem (Chen et al. 2018;Xu and Wang 2017;Ram et al. 2017a;Asaithambi and Rajappa 2018;Baygi et al. 2018;Muhsen et al. 2015;Xiong et al. 2018). Chen et al. (2018), a new hybrid teaching-learning-based artificial bee colony (TLABC) has been proposed for the solar PV parameter estimation problems. However, proposing more accurate algorithms for estimating PV parameters is still a hot research topic which needs more efforts. In general, metaheuristic algorithms are considered intelligent techniques, and they are inspired by observing the phenomena occurring in nature (Oliva et al. 2017(Oliva et al. , 2014Kumar et al. 2017;Alam et al. 2015;Bana and Saini 2017;Qun et al. 2014). Harris hawk optimization algorithm has been considered one of recent and promising metaheuristic algorithms in literature Qais et al. 2020;Chen et al. 2020;Ridha et al. 2020). Its basic idea depends on the Harries Hawk hunting approach for its prey. HHO is a recent and a promising algorithm due to many reasons; the HHO theory is a population-based and doesn't have access to partial derivatives which are too expensive to compute, so it is considered a gradient or derivative-free optimization technique. This advantage allows the application of HHO to any optimization problem subject to a proper formulation.
The performance of the algorithm has been tested on 29 benchmark problems in Heidari et al. (2019). Its performance has been tested for several real engineering problems .
In literature, the HHO has been applied for PV parameter estimation. Qais et al. (2020), some of TD PV model parameters have been estimated using computation, and the rest of parameters have been estimated by HHO. Chen et al. (2020), a diversification-enhanced Harris Hawks Optimization (HHO) has been presented to estimate of SD and DD PV models. Ridha et al. (2020), a Boosted Harris Hawk's Optimization (BHHO) technique has been proposed to estimate the parameters of the SD PV model.
In this paper, an Enhanced Harris Hawk optimization algorithm is proposed. The conventional Harris Hawk algorithm is based on Hawks ways in hunting and catching their preys. The HHO aims for searching locally around promising solutions. The main advantage of the proposed algorithm is the improvement in the exploitation phase of HHO by fluctuating toward or outward the best optimal solution using sine and cosine functions (Mirjalili 2016). EHHO improves the balance between exploration and exploitation phases and increases the chance of escaping from locale optima problem in the original HHO. Unlike the presented references for original or enhanced HHO application on PV model estimation (Qais et al. 2020;Chen et al. 2020;Ridha et al. 2020). Both of EHHO and HHO algorithms have been applied for estimating the PV parameters not only for one or two models but also for three different PV models SD, DD and TD. The accuracy of EHHO has been tested through real PV systems with different characteristics. For a fair comparison, the results of EHHO are compared with the conventional HHO and recent optimization techniques through the same applications and conditions. The main contribution of this paper can be summarized as follows: • EHHO is proposed to enhance the performance of conventional HHO in the exploitation phase by combining between HHO and SCA.

Start
End   • Different types of PV models are discussed, and their parameters estimation are considered the optimization problems. • The performance of EHHO has been tested through three applications; the first application is specialized to test the applicability of EHHO with complex models, and the others two applications are to test the applicability for different systems by applying EHHO to polycrystalline and monocrystalline PV systems. • By comparing obtained results, EHHO results are more accurate than the conventional HHO and other optimization algorithms.
The rest of this paper is arranged as follows. Section 2 describes the PV models, SD, DD and TD. Section 3 discusses the HHO and EHHO. The results and application are discussed in Sect. 4. Section 5 presents the conclusion.

Mathematical PV models
The need for developing accurate solar cell models makes the researchers do their bests in developing different solar cell models providing promising results. Each model has  Tie 0 Lose 13 advantages and drawbacks (Et-torabi et al. 2017;Jordehi 2018). In this section, the most recent models in literature have been discussed. These models are arranged from simple to complex as SD, DD and TD.

SD model
The equivalent circuit of this model consists of one current source to represent the solar cell photo generation current (I ph ), one diode for representing the P-N junction characteristics, equivalent series and shunt resistance are represented by R s and R sh , respectively. The equivalent circuit is shown in Fig. 1. The output current (I t ) is calculated through the following equations:

DD model
The DD model is differentiated from SD model by 2 diodes as shown in Fig. 2. This model is represented by (3) and (4).
An enhanced Harris Hawk optimization algorithm for parameter estimation of... 7239

TD model
The TD equivalent circuit is the same as DD taking into consideration the leakage current which represented by a third diode as shown in Fig. 3.   (5) and (6) describe the mathematical model of TD model 3 Optimization algorithm 3.1 HHO HHO optimization algorithm is inspired from Hawks ways in hunting and catching their preys. The conventional HHO algorithm is divided into two main phases, exploration and exploitation. The exploitation phase is divided into two phases (Hard passage and soft passage) ).

Explorations
In optimization algorithms, exploration is considered as a global search. In this phase, the algorithm explores the search space looking for good solutions. The hawk waits for monitors and looks for a suitable prey through two manners: Exploration in random high trees and exploration depending on the position of rabbit and other hawks, as described in (7), consider q is a chance for each manner: where t is the iteration number, X (t) is the current position of hawk, X (t ? 1) is the position of the hawk in the next iteration, X rabbit (t) is the rabbit current position. X rand (t) is a random position for hawk. X m (t) is average position of hawk current position calculated using (8). LB is the lower limit of variables; UB is the upper limit of variables. r 1 , r 2 , r 3 , r 4 and q are random values.
where N is the number of hawks. The transition between exploration and exploitation depends on the prey escaping energy.
where E is the escaping energy, E 0 is the initial energy, t is the current iteration, and T is the total number of iterations.  Fig. 10 Fitness function for DD model for different optimization algorithms

Exploitation
By comparison with the exploration phase, exploitation is considered a local search. In this phase, the algorithm refines the solution and tries to avoid big jumps in the search space. Exploitation phase starts when |E|B 1, during |E| [ 1, the exploration phase continues. The exploitation phase achieves through 4 inner phases depending on escaping energy (E) and the chance of the prey successfully escaping (r). -

Soft besiege
In this phase, the energy of prey is decreased but it still large enough to escape, |E|C 0.5, |r|C 0.5. At these conditions, the hawk tries to reduce the prey energy though soft circles. This catching manner is presented by (10).
where Dx(t) is the difference between rabbit current position and hawk current position. J is a value changed randomly in each iteration through r 5 which is a random value between (0, 1) as shown in (11) and (12). -

Hard besiege
In this phase, the energy of the prey decreased to a limit that the prey cannot escape |E| \ 0.5, |r|C 0.5, hence the hawk uses hard circles to catch it as presented in (13)    Sometimes when the rabbit still has enough escaping energy for successfully escaping, |E|C 0.5, |r| \ 0.5. The hawk changes its current position to position (Y) through (14). But due to the rabid zigzag escaping movement of the prey, the hawk changes its current position to position (Z) through (15). Where (D) is the problem dimension, (S) is a random vector (1xD), and LF (D) is the levy flight function described by (16). The final position updating at this phase is described by (17).
where t, m are random values between (0, 1), and b is constant.
-Hard besiege with progressive rapid dives In this phase, it is maybe no escaping chance for the prey as its energy is decreased so much |E| \ 0.5, |r| \ 0.5. The hawk decreasing the circle of catching and update its positions by (17). Where positions (Z) and (Y) are described by (15) and (18), respectively.

EHHO
Exploration and exploitation are necessary for metaheuristic optimization algorithms, where they are two conflicting milestones. The EHHO is improved performance of the conventional HHO. The HHO performs in two phases (Exploration phase and exploitation phase), and the enhance-HHO (EHHO) to improve performance of the HHO is performed on the exploitation phase. The exploitation phase aims for searching locally around promising solutions. The sine-cosine method has been applied in the exploitation phase. Where sine-cosine function creates different solutions and fluctuate outward or toward the best possible solution (Ramadan et al. 2020). The sine-cosine function is added to Eqs. (10) and (13). The proposed enhanced equation can be described as follows: where r 1 is constant and r 2 = 2 * pi * rand (0, 1), rand is a random value changed in each iteration. Hard besiege Eq. (13) is updated to Eq. (20)  Fig. 17 The fitness function of TD model for different optimization algorithms   The computational complexity of EHHO is the same as HHO , initialization complexity, fitness evaluation complexity and updating complexity. Assume The overall process of the proposed EHHO can be summarized in the following steps as: Step (1) Input population size, number of decision variables, and Max. Iteration Step (2) Generate an initial population of a hawks Xi (solutions) Step (3) Set current iteration 1 Step (4) Evaluate the fitness function value of hawks Step (5) Set X rabbit as the location of rabbit (best location) Step (6) For each (Xi)Update the E0 and J and the E using (9) Step (7) Update solution of individual Xi using Eq. (16) Step (8) If the current iteration is less than the maximum number of iterations, then continue; else end Exploration phase Step (9) If |E| \ then update its solution using Eq. (9), Step Exploitation phase Step (11) Else |E| \ then go to the next steps Step (12) if (r C 0.5 and |E|C 0.5) then update its solution using Eq. (19), Step Else if (r C 0.5 and |E| \ 0.5) then update its solution using Eq. (20), Step Else if (r \ 0.5 and |E|C 0.5) then update its solution using Eq. (17), Step Else if (r \ 0.5 and |E| \ 0.5) then update its solution using Eq. (18), Step End If  Step (17) End If Step (18) Evaluate the objective function value for each individual Step (19) Update the best solution found for X rabbit Step (20) End If Step

22)
Return X rabbit The SCA enhance the movement of hawk toward its prey as shown in Fig. 4. The flow chart of EHHO is shown in Fig. 5

Simulation results
To discuss the efficiency of the proposed algorithm, EHHO has been applied on 23 different benchmark test functions . Table 1 present the results of EHHO and HHO for all functions, moreover two recent optimization algorithms. The two recent algorithms are social network search (SNS) algorithm (Talatahari et al. 2021) and wild horse optimizer (WHO) (Ramadan et al. 2021). By applying Wilcoxon rank-sum test at the 5% significance level (Chen et al. 2016). The results show that EHHO gives good results with many functions. For the best average (AVG) values of 30 independent runs, EHHO has 30.4%, HHO has 39.1%. For the best standard deviation (STD) values of 30 independent runs, EHHO has 52.1%, HHO has 21.7%, all the best values have been highlighted in bold. Table 2 presents the average time for 30 run (500 iterations in each run). ''?'', ''-'' and ''='' represents that the performance of EHHO is ''better than'', ''worse than'' or ''Equal to'' the performance of HHO.
To discuss the applicability of the proposed algorithm for the different number of estimated parameters, three applications are achieved. In Application 1, the EHHO is applied for the three different PV models (SD, DD and TD). In Application 2 and 3, the proposed algorithm is applied to the polycrystalline and monocrystalline PV system through the complex model (TD model). A comparison between the proposed algorithm, original algorithm and other recent algorithms have been achieved at the same number of search agents (population size(NP)) as shown in Table 3 which presents the parameters setting for each compared algorithm.  Fig. 22 The fitness function of TD model for different optimization algorithms

DD model optimization problem
In DD model, seven estimated parameters are considered [R s , R sh , I ph , I d1 , I d2 , n 1 , n 2 ], and they can be represented in one vector x = [x 1 , x 2 , x 3 , x 4 , x 5, x 6 , x 7 ], hence the optimization problem is described by (22).

TD model optimization problem
In TD model, nine estimated parameters are considered [R s , R sh , I ph , I d1 , I d2, I d3 , n 1 , n 2 , n 3 ], and they can be represented in one vector x = [x 1 , x 2 , x 3 , x 4 , x 5, x 6 , x 7 , x 8 , x 9 ], hence the optimization problem is described by (23).

Application 1
In this application, the EHHO is applied for estimating the parameters of three PV models using real PV system data (Ramadan et al. 2020). In literature, many papers covering RTC France cell in their application, but with conditions differ from this paper, so their results have not covered here (Ć alasan et al. 2019;Gao et al. 2018;Ram et al. 2017b;Yu et al. 2017;Talatahari et al. 2021). A comparison between EHHO, HHO and other algorithms are implemented for SD, DD and TD models. For a comparison between results, the objective function is calculated for each algorithm by the information of the estimated parameters and the real output current. The most accurate objective function is that obtained from the most accurate estimated parameters. The validation process for the results of the proposed algorithm and other compared algorithms depends on different factors:   Table 7 presents the estimated parameters and RMSE for EHHO, HHO and other algorithms. The real and calculated current are presented in Table 8. Figure 9 displays absolute error for EHHO and HHO. The convergence curves are shown in Fig. 10. Table 9 represents the minimum, average, maximum and standard deviation (STD) values for 30 run statistical results. The RMSE values calculated for all run are figured in boxplot for each algorithm as shown in Fig. 11. (?) represents the outliers.

Application 3
In this application, the proposed EHHO is applied to polycrystalline PV panel STM6-120/36 (Ramadan et al. 2020). The panel has open circuit voltage V oc = 19.21, and short circuit current I sc = 7.48A. The measured data from the panel at temperature 55C are listed in Table 16. Also, the calculated output current from the estimated parameter of TD model using EHHO and HHO are presented in Table 16. The estimated parameters and the calculated RMSE values for TD model obtained by EHHO and HHO and other algorithms have been listed in Table 17.  From Tables 15 and 16, it is can be observed that the estimated parameter for TD model obtained by EHHO is more accurate than those obtained by HHO, this also clearer from convergence and current absolute error curves which have been shown in Figs. 22 and 23, respectively. By comparing RMSE of EHHO for TD model with RMSE for different algorithms, the TD model using EHHO gives the same results as TLBO and more accurate model than others. Table 18 represents the minimum, average, maximum and standard deviation (STD) values for 30 run statistical results. The RMSE values calculated for all run are figured in boxplot for each algorithm as shown in Fig. 24. The characteristic and power curves for the polycrystalline PV panel and estimated TD model by the proposed algorithm at different temperatures are displayed in Figs. 25 and 26, respectively.

Conclusion
In this paper, an enhanced version for the Harris Hawk-Based Optimization Algorithm, called EHHO, has been proposed and applied for solving the optimal parameter estimation of different PV models. The proposed algorithm aims to improve the exploitation phase of conventional HHO by fluctuating toward or outward the best optimal solution using sine and cosine functions. The EHHO has been tested through parameter estimation of SD, DD and TD models of the real PV system. In addition, it has been applied for estimating the parameters for Monocrystalline and polycrystalline PV panels through TD model. The results have been compared by several criteria as follows: comparing the best RMSE for the objective function, comparing the Absolute Error of the calculated and the real output current and comparing the statistical results of RMSE in 30 independent runs. The results obtained by EHHO have been compared with the conventional HHO and other recent algorithms including SOA, TLBO, PSO, MRFO, TSA and WCA. In all cases, the results obtained by EHHO are more accurate than those obtained by the conventional HHO and other optimization algorithms. It is observed that the results for TD model are more accurate than SD and DD models. Data Availability Data sharing not applicable to this article as no datasets were generated or analysed during the current study.

Declarations
Conflict of interest Authors declare that they have no conflict of interest.
Ethical approval This article does not contain any studies with human participants or animals performed by any of the authors.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons. org/licenses/by/4.0/.