**1. Introduction**

Energy is an essential component of the universe and is considered one of the forms of existence. Energy is divided into two main types (renewable energy and non-renewable energy); non-renewable energy as fossil fuels has a terrible impact on the environment. Therefore, many nations tend to use renewable energy to produce their electricity. Solar energy is one of the primary and available renewable energy sources on the planet that has no pollution and easy installation as well as being inexpensive and noise-free. The

**Citation:** Malki, A.; Mohamed, A.A.; Rashwan, Y.I.; El-Sehiemy, R.A.; Elhosseini, M.A. Parameter Identification of Photovoltaic Cell Model Using Modified Elephant Herding Optimization-Based Algorithms. *Appl. Sci.* **2021**, *11*, 11929. https://doi.org/10.3390/app 112411929

Academic Editor: Edris Pouresmaeil

Received: 10 November 2021 Accepted: 13 December 2021 Published: 15 December 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

need to add renewable energy sources is increased with the dramatic changes in electricity requirements. Therefore, the effective modeling of renewable energy resources is an important issue for efficient energy management [1].

Solar cells are one of the ways to take advantage of solar energy, so significant attention went to model photovoltaic (PV) cells [2–7]. Several parameters define the nonlinear electrical model of a solar cell, which must be studied in depth to design PV systems. It is vital to understand the current–voltage graph (I-V) before using PV cells. In addition to determining PV's parameters, picking a few points from this curve can also help. Based on the number of diodes, different parameter models are presented. Three different types are available: single diode, double diode, and three diode [8–11].

Parameter identification can be accomplished in two ways, using deterministic methods or using metaheuristics. Examples of traditional approaches are Lambert W-functions [12] and the interior-point method [13]. Although traditional models can solve parameter identification, it has some drawbacks facing nonlinear problems such as sensitivity to the initial solution besides sticking in a local optimum solution with heavy computations and taking a long time to reach this optimum. Therefore, metaheuristics algorithms are used to overcome these drawbacks. Examples of these metaheuristics are the Particle Swarm Optimization (PSO) [6], Genetic Algorithm (GA) [14], Differential Evolution (DE) [15], Harmony Search (HS) [16], Artificial Bee Colony (ABC) [17], and Simulated Annealing (SA) [18].

The continuous development in optimization methods has been notable in recent decades. For example, several optimization methods were developed and applied for different power system problems, as presented in [19,20]. Furthermore, in [21–25], an algorithm that mimics the elephant herding behavior called Elephant Herding Algorithm (EHO) was proposed for different applications. Reference [26] proposes three improved variants of EHO that are developed.

The basic architecture of the PV cell guarantees that two differentially doped semiconductor layers form a PN junction. When irradiation is present, the cell absorbs photons from incoming light and produces carriers (or electron–hole pairs). As a result, there may be a discrepancy at the intersection [27]. In an ideal PV cell model, a photocurrent source and a diode are connected in parallel. Model estimation is made easiest by the fact that there are only three unknown parameters: the ideality factor η, the photocurrent *Ipv*, and the reverse saturation current *Is*.

The contact resistance *Rs* between the silicon and electrode surfaces is described by this resistance. A parallel resistance *Rp* is attached to the diode to prepare for leakage current in the PN junction. The single-diode model (SDM) model has five parameters that must be estimated: *Ipv*, *Is*, *Rs*, and *Rp* [28]. The double-diode model (DDM) is a more precise method of modeling PV cells. It takes into account current loss recombination in the depletion area. With the addition of the seventh parallel diode, there are now seven parameters to estimate (*Ipv*, η1, *Id*1, η2, *Id*2, *Rp*, and *Rs*) [8].

These models are of great interest to many researchers. There have been many successful algorithms for adjusting parameters of PV cells in SDM and DDM, but few works in TDM have been published in this area. Reference [29] proposed a solar PV parameter extraction method based on the Flower Pollination Algorithm (FPA). Two diode models are chosen to understand the precision of the computation. The authors experimented with the effectiveness of FPA using RTC France info. Simulated Annealing (SA), Pattern Search (PS), Harmony Search (HS), and Artificial Bee Swarm Optimization (ABSO) techniques are often used to compare the measured root mean square error and relative error for the built model. Researchers [30] proposed a hybridized optimization algorithm (HISA) for accurately estimating the parameters of the PV cells and modules. From the experimental data obtained from five case studies consisting of two cells and three modules for monocrystalline, multi-crystalline, and thin-film PV technologies, single- and double-diode models of PV cells/modules were developed with their respective single I V nonlinear characteristics.

The authors [31] propose two simple metaphor-free algorithms called Rao-2 (R-II) and Rao-3 (R-III) to estimate the parameters of PV cells. Several well-known optimization algorithms are compared to the efficiency of the proposed algorithms. The comparison helps show the merit of the algorithms. Finally, an analysis of statistical data is combined with experimental findings to verify the efficiency of the proposed algorithms. The Grasshopper Optimization Algorithm (GOA) is proposed [32] for parameter extraction of a PV module's three-diode PV model. This GOA-based PV model uses two popular commercial modules: Kyocera KC200GT and Solarex MSX-60.

The single-, double-, and three-diode models have different solar cell parameters. These models have five parameters for the single-diode model and seven parameters for the double- and three-diode models. Each parameter must be obtained accurately based on the objective function to reach the global optimum. In this study, the EHO algorithms have been chosen to solve this problem because they have a few control parameters and smooth implementation. In addition, EHO's simplicity and few parameters made it a suitable choice for achieving such enhancements. Furthermore, by dividing the population into clans, we could avoid becoming trapped in a local optimum and instead converge on reaching a global minimum. Finally, after getting experimental results for this problem, a comparison with other well-known algorithms was presented to prove the result's quality. This comparison is important to ensure that the new variants can solve this problem and compete with other algorithms.

Table 1 reports some of the recent solvers that were applied for PV parameter estimation problems in the recent years


**Table 1.** Recent optimizers for PV parameter estimation.

The RMSE and the relative error are used as the most performance measures developed in the previous methods. The proposed variants of EHO are compared against most of the new well-known algorithms on the parameter identification of different photovoltaics. The performance of these proposed algorithms can be judged according to convergence speed, high estimation of parameters, and low computation time.

The main contributions of this paper can be summarized as follows:


The rest of the paper is organized as follows. The second section focuses on solar cells and mathematical models. In Section 3, an elephant-herding algorithm is proposed, and its different versions are discussed. The results, computer simulations, and comparisons are listed and discussed in Section 4. Finally, we conclude in Section 5 with a wrap-up and conclusion.

### **2. Mathematical Models of Photovoltaic Cell**

Solar cell models describing the I-V characteristics typically contain one diode, two diodes, or three diodes. These detailed models are described as follows:

### *2.1. Single Diode Model (Five-Parameter Model)*

A modified Shockley diode equation can describe a single diode model. It is widely used for modeling solar cells because it is simple to implement with five parameters (*Iph*, *Id*, *n*, *Rsh*, *Rs*). However, at low illuminations, the single diode model is particularly inaccurate in describing cell behavior [48,49]. Figure 1 shows a single diode model consisting of a current source in parallel with a diode, and the module shunt resistance controls the loss of currents at the junction within the cell.

**Figure 1.** Single diode model.

The mathematical model of the single diode model is given by:

$$I\_t = I\_{ph} - I\_{d1} \left[ \exp\left(\frac{q(V\_t + R\_s \cdot I\_l)}{n\_1 \cdot k \cdot T}\right) - 1\right] - \frac{V\_t + R\_s \cdot I\_t}{R\_{sh}}.\tag{1}$$

### *2.2. Double-Diode Model (Seven-Parameter Model)*

Figure 2 shows the double-diode model as an additional diode is added in parallel with the current source. This additional diode can achieve higher accuracy than a single diode model, but with seven parameters, more computation is needed (*Iph*, *Id*1, *Id*2, *n*1, *n*2, *Rsh*, *Rs*).

**Figure 2.** Double-diode model.

The mathematical model of the double-diode model is given below.

$$I\_{l} = I\_{ph} - I\_{d1} \left[ \exp\left(\frac{q(V\_{l} + R\_{\text{s}} \cdot I\_{l})}{n\_{1} \cdot k \cdot T} \right) - 1 \right] - I\_{d2} \left[ \exp\left(\frac{q(V\_{l} + R\_{\text{s}} \cdot I\_{l})}{n\_{2} \cdot k \cdot T} \right) - 1 \right] - \frac{V\_{l} + R\_{\text{s}} \cdot I\_{l}}{R\_{sl}} \tag{2}$$

### *2.3. Three-Diode Model (10-Parameter Model)*

The three-diode model shown in Figure 3 extends the double-diode model by adding the third diode in parallel with the two other diodes. The three-diode model has three more parameters than the double-diode model (*Id*3, *n*2, *K*) [50,51].

**Figure 3.** Three-diode model.

The mathematical formulation of the three-diode model is given by Equation (3) as:

$$I\_{l} = I\_{ph} - I\_{l1} \left[ \exp\left(\frac{q(V\_{l} + R\_{\delta} \cdot I\_{l})}{n\_{1} \cdot k \cdot T}\right) - 1\right] \\ - I\_{l2} \left[ \exp\left(\frac{q(V\_{l} + R\_{\delta} \cdot I\_{l})}{n\_{2} \cdot k \cdot T}\right) - 1\right] \\ - I\_{l3} \left[ \exp\left(\frac{q(V\_{l} + R\_{\delta} \cdot I\_{l})}{n\_{3} \cdot k \cdot T}\right) - 1\right] \\ - \frac{V\_{l} + R\_{\delta} \cdot I\_{l}}{R\_{\mathrm{sl}}}.\tag{3}$$

### *2.4. Parameter Extraction of the Solar Cell*

A set of current–voltage (I–V) experimental data is given to extract the cell parameters. To define an objective function to be used in optimization algorithms, Equations (1)–(3) are reformed as in Equations (4)–(6). Equations (4)–(6) are used to get the error between the experimental and measured currents for the PV models, which are considered as the fitness functions of the three PV models.

$$f\_1(V\_t, I\_l, y) = I\_l - I\_{ph} + I\_{d1} \left[ \exp\left(\frac{q(V\_t + R\_s \cdot I\_l)}{n\_1 \cdot k \cdot T}\right) - 1\right] + \frac{V\_t + R\_s \cdot I\_l}{R\_{sh}} \tag{4}$$

$$f\_2(V\_l, I\_l, y) = l\_l - I\_{pl} + I\_{l1} \left[ \exp\left(\frac{q(V\_l + R\_l \cdot I\_l)}{n\_1 \cdot k \cdot T}\right) - 1\right] + I\_{l2} \left[ \exp\left(\frac{q(V\_l + R\_l \cdot I\_l)}{n\_2 \cdot k \cdot T}\right) - 1\right] + \frac{V\_l + R\_l \cdot I\_l}{R\_{sh}} \tag{5}$$

$$f\_3(V\_l, I\_l, y) = I\_l - I\_{ph} + I\_{d1} \left[ \exp\left(\frac{q(V\_l + R\_l \cdot I\_l)}{n\_1 \cdot k \cdot T}\right) - 1\right] + I\_{d2} \left[ \exp\left(\frac{q(V\_l + R\_l \cdot I\_l)}{n\_2 \cdot k \cdot T}\right) - 1\right] \tag{6}$$

$$+ I\_{d3} \left[ \exp\left(\frac{q(V\_l + R\_l \cdot I\_l)}{n\_3 \cdot k \cdot T}\right) - 1\right] + \frac{V\_l + R\_l \cdot I\_l}{R\_{\text{sh}}} \tag{7}$$

The objective function can be implemented as the root mean square error (RMSE) as:

$$\mathcal{F} = \sqrt{\frac{1}{N} \sum\_{l=1}^{N} f\_l(V\_{l\prime}, I\_{l\prime}, y)^2}. \tag{7}$$

### **3. EHO-Based Optimization Algorithms**

The wild elephant grows in herds. Clans of elephants are organized into groups under the leadership of female leaders. Furthermore, male elephants abandon the herd as they mature. To implement the elephant's behavior to solve nonlinear optimization problems, EHO is summarized into three essential rules:


There are clans within the elephant population, and within each clan, each elephant is ranked based on its fitness, and then each group is updated separately.

Clan updating operator: For each member in clan ci, the best elephant effect on its next position in clan *c*. We can update elephant *j* in clan *c* by:

$$
\lambda \mathbf{x}\_{\mathbf{u}, \mathbf{c}, \mathbf{j}} = \mathbf{x}\_{\mathbf{c}, \mathbf{j}} + \boldsymbol{\mathfrak{a}} \cdot \mathbf{r} \cdot \left(\mathbf{x}\_{\text{best}, \mathbf{c}} - \mathbf{x}\_{\mathbf{c}, \mathbf{j}}\right). \tag{8}
$$

The best elephant in each clan can be updated as:

$$
\lambda x\_{u,c,j} = \beta \cdot x\_{center,c}.\tag{9}
$$

Separating operator: As mentioned, the male elephant will live alone, separately away from the family. This separating process acts as the separating operator, which can be implemented into each generation as the worst fitness. We achieve it as follows:

$$
\lambda \chi\_{\text{Bours}\sharp, \mathcal{L}} = \chi\_{\text{min}} + r \cdot (\chi\_{\text{max}} - \chi\_{\text{min}} + 1). \tag{10}
$$

The elephant optimization procedure has been randomly generated based on the pseudocode in Figure 4 and the flowchart in Figure 5. The EHO algorithm has significant merit of a few control parameters. However, the chances of finding a new good elephant vs. a poor one are low; thus, the new candidate solution is unlikely to be as excellent as or better than the old one. The search operator does not consider the knowledge of the best solution or other solutions that may have a beneficial influence on steering EHO toward more promising areas of search space due to the participation of these random variables. However, a closer look at the flowchart and pseudocode of EHO reveals several gaps and shortcomings. These shortcomings may have a bad impact, affecting EHO's performance.


This paper aims to improve EHO performance, which is under-reported in the scientific literature. Listed below are three potential enhancements to EHO performance:


**Figure 4.** Pseudocode for EHO procedure.

**Figure 5.** Flowchart of EHO.

### *3.1. Alpha Tuning of αEHO*

Careful investigation of EHO parameters recommends setting the scale factor *α* to be adaptive is more promising than being a constant value in the range [0, 1].

Putting it simply, making alpha adaptive and related to the population number is more convenient and matched to the notion of evolution in Equation (11). In the original EHO algorithm, the scale factor-alpha is a constant value. Now, *α* is varying with the generation number by this function:

$$
\kappa\_{\text{new}} = \varkappa + \frac{\varkappa\_{\text{max}} - \varkappa\_{\text{min}}}{n}. \tag{11}
$$

### *3.2. Cultural-Based EHO (CEHO)*

By utilizing the space of the best prior members, the cultural-based algorithm aids in the improvement of the algorithm [26,52,53]. The cultural-based algorithm constructs a better community by considering a belief space comprised of selected population members by acceptance function, as shown in Figure 6. A new member can be generated by using the belief space. A culturalbased algorithm is used to generate new solutions among belief space boundaries in the separating operation.

**Figure 6.** Belief space in cultural-based.
