**Parameters Extraction of Photovoltaic Models Using an Improved Moth-Flame Optimization**

#### **Huawen Sheng, Chunquan Li \*, Hanming Wang, Zeyuan Yan, Yin Xiong, Zhenting Cao and Qianying Kuang**

School of Information Engineering, Nanchang University, Nanchang 330029, China; huawensheng@outlook.com (H.S.); wanghanmingcsw@outlook.com (H.W.); yzyilia@outlook.com (Z.Y.); xiongyin@ncu.edu.cn (Y.X.); zhentingcao125@gmail.com (Z.C.); QianYingKuangK@outlook.com (Q.K.) **\*** Correspondence: lichunquan@ncu.edu.cn

Received: 1 August 2019; Accepted: 6 September 2019; Published: 13 September 2019

**Abstract:** Photovoltaic (PV) models' parameter extraction with the tested current-voltage values is vital for the optimization, control, and evaluation of the PV systems. To reliably and accurately extract their parameters, this paper presents one improved moths-flames optimization (IMFO) method. In the IMFO, a double flames generation (DFG) strategy is proposed to generate two different types of target flames for guiding the flying of moths. Furthermore, two different update strategies are developed for updating the positions of moths. To greatly balance the exploitation and exploration, we adopt a probability to rationally select one of the two update strategies for each moth at each iteration. The proposed IMFO is used to distinguish the parameter of three test PV models including single diode model (SDM), double diode model (DDM), and PV module model (PMM). The results indicate that, compared with other well-established methods, the proposed IMFO can obtain an extremely promising performance.

**Keywords:** moth-flame optimization; parameter extraction; photovoltaic model; double flames generation (DFG) strategy

#### **1. Introduction**

Owing to fuel depletion, global warming, and environmental pollution, the renewable energy sources such as wave, tidal, wind, geothermal, and biomass have received more attention in recent years [1–4]. Solar energy is considered as an extremely promising renewable energy source owing to its usability and cleanliness [5–7]. Furthermore, solar energy is also widely adopted to generate power via photovoltaic (PV) systems [8]. However, PV systems are susceptible to external environmental factors such as temperature and global irradiance, affecting the use efficiency of solar energy [9]. Therefore, it is crucial to accurately establish current-voltage models for optimizing and controlling PV systems [10]. The current-voltage models mainly include single diode model (SDM) and double diode model (DDM) [11], which are widely utilized to indicate the connection between current and voltage. The accuracy and reliability of the PV models are primarily determined by their parameters. However, because of unstable operating cases such as faults and aging, the PV models' parameters are generally not available and vary. Thus, developing an effective method to accurately extract these parameters becomes especially critical.

Recently, a large number of algorithms have been proposed for identifying the parameters of PV models. They are mainly divided into the following three categories: analytical [12], deterministic [13], and heuristic methods [14]. The first category methods identify the PV models' parameters via analyzing a set of mathematical formulas [15,16], which accelerates and simplifies the calculation. However, the reliability and accuracy of the solution are poor due to some postulations that need to be made before the analysis [17,18]. The second category methods are greatly susceptible to initial assumptions

and tend to fall into local optimum. In addition, they depend on the model's differentiability or convexity. However, the PV models are usually non-linear and multimodal, resulting in a set of poor solutions when using the second category methods. The third category methods are heuristic methods and can properly overcome the defects of analytical and deterministic methods. Therefore, they have become potential alternatives to PV models' parameters extraction.

Until now, various heuristic algorithms have been proposed for the parameter extraction of the PV models. Reference [14] presents a genetic algorithm (GA) for identifying the SDM parameters of a photovoltaic panel. Reference [19] proposes a new method adopting particle swarm optimization (PSO) with inverse barrier constraint to determine the uncertain parameters of a PV model. Reference [20] applies the artificial bee colony (ABC) to identify the optimal parameters of a silicon solar cell. Reference [21] presents an improved adaptive differential evolution (IADE) algorithm, which utilizes a simple structure based on the feedback of fitness value in the evolutionary process. Reference [22] uses the bird mating optimizer (BMO) to estimate the optimal parameters of silicon solar cell. Reference [23] proposes the chaotic whale optimization algorithm (CWOA), which adopts the chaotic maps to calculate and automatically adapt the internal parameters of the optimization algorithm. Reference [24] presents an improved ant lion optimizer (IALO), which arranges the initial positions of individuals by chaotic sequence to improve the uniformity and ergodicity of population. Reference [25] adopts the bacterial foraging algorithm (BFA) to predict the solar PV characteristics accurately. Reference [26] proposes an improved JAYA (IJAYA) algorithm, in which a self-adaptive weight is proposed to regulate the trend of moving towards the best result, getting out of the worst result at distinct search stages. Reference [27] uses a teaching learning–based optimization (TLBO) algorithm to extract all five parameters of a solar cell. Reference [28] proposes flower pollination algorithm (FPA) to extract the optimal parameters of different PV models.

Furthermore, as a population-based heuristic algorithm, MFO [29] is inspired by moths' behaviors and acquires great performance when solving non-convex and multimodal optimization problems. In MFO, each of the moths represents a solution for problems. Specifically, the algorithm's most striking feature is that each moth has its own flame and flies toward the flame in a spiral curve. Consequently, the flight curves of the moths are always oriented at a fixed angle to the remote target flames, known as the transverse orientation. In MFO, the flames' number is gradually decreased with the iterations' number raising, which allows MFO to obtain fast convergence speed. Note that reference [29] demonstrates MFO's excellent optimization performance in relation to other well-known methods such as GA [18], FPA [28], and PSO [19]. Besides, MFO has been commonly applied to various PV-related practical problems. In reference [30], MFO is utilized to estimate parameters of the three diode models for multi-crystalline solar cells/modules. In reference [31], MFO is used for PV MPPT and partial shading problem. In reference [32], MFO is applied for AI-based MPPT that is used for partial-shaded grid-connected PV plant.

Nevertheless, in MFO, the fast information exchanges among moths are produced owing to all the moths flying toward their best target flames. Once the global optimal value is close to the local optimum, the moths can easily fall into the local optimum of the search area. To overcome the shortcoming of MFO, various MFO variants have been proposed. Reference [33] presents a novel opposition-based moths-flames optimization (OMFO) that uses an opposition-based learning strategy in MFO to improve convergence speed. Reference [34] proposes an efficient hybrid algorithm based on water cycle and MFO algorithms (WCMFO), which combines the Levy-flight operator and spiral movement of MFO into the Water Cycle (WC) method to enhance the WC's ability of exploration and exploitation, respectively. Reference [35] presents a moth-flame optimization algorithm based on chaotic crisscross operator (CCMFO) that uses the chaotic operator and crisscross strategy in MFO to enhance the convergence of premature. However, the above MFO variants have no attempts for solving the PV models' parameters extraction problems.

This paper proposes an improved MFO (IMFO) for accurately estimating the parameters of the PV models. In IMFO, a double-flames generation (DFG) strategy is presented to generate two different kinds of target flames for effectively guiding the flying of moths. By adopting corresponding local best moths, a type of flames called local flame (LF) is produced. Another type of flames is called global flame (GF) and is generated by combining all the moths' current personal best positions (pbests). Furthermore, two different update strategies are created for updating the positions of moths, and each moth only adopts one of the two different evolution update strategies at each iteration. To ensure the effective compromise between global exploration and local exploitation, a probability is utilized to rationally select the two different update strategies for each moth. To demonstrate the superior performance of IMFO, we compare the proposed method with eight well-established algorithms on extracting the parameters of three different PV models, i.e., SDM, DDM, and PMM. The experimental results show that IMFO can achieve a highly competitive performance as well as can reliably and accurately extract the parameters of the three different PV models.

The main contributions of our work are as follows:


#### **2. Formulation of PV Models**

The single diode model (SDM), double diode model (DDM), and PV module model (PMM) are generally adopted to indicate the relationship between current and voltage of solar cells and PV systems. In this section, the SDM, the DDM, and the PMM are given as follows. Furthermore, the objective function for extracting the parameters of the three models is described as follows.

#### *2.1. Single Diode Model*

The SDM has been commonly used to illustrate the static characteristics of solar cells owing to its simple structure and accuracy. As shown in Figure 1a, the SDM is composed of a diode, a current source, a shunt resistor, and a series resistor. Note that the shunt resistor and series resistor are used for indicating leakage current and denoting load current loss, respectively. The output current *I*<sup>o</sup> of this diode model can be computed as follows:

$$I\_{\rm o} = I\_{\rm ph} - I\_{\rm d} - I\_{\rm sh} \tag{1}$$

where *I*sh, *I*d, and *I*ph represent the shunt resistor current, the diode current, and the photo produced current, respectively; *I*<sup>o</sup> denotes the calculated output current. The calculation formulas of *I*<sup>d</sup> and *I*sh are shown as follows:

$$I\_{\rm d} = I\_{\rm sd} \left[ \exp\left(\frac{q\left(V\_{\rm t} + I\_{\rm t}R\_{\rm s}\right)}{mkT}\right) - 1\right] \tag{2}$$

$$I\_{\rm sh} = \frac{I\_{\rm t} R\_{\rm s} + V\_{\rm t}}{R\_{\rm sh}} \tag{3}$$

where *I*sd indicates the saturation current of the diode; *I*<sup>t</sup> and *V*<sup>t</sup> respectively represent the tested output current and voltage; *<sup>R</sup>*<sup>s</sup> means the series resistance; *<sup>q</sup>* and *<sup>k</sup>* are the electron charge (1.60217646 <sup>×</sup> <sup>10</sup><sup>−</sup>19C) and Boltzmann constant (1.3806503 <sup>×</sup> <sup>10</sup>−<sup>23</sup> <sup>J</sup>/K), respectively; *<sup>m</sup>* is the ideal factor of diode; *<sup>T</sup>* is the cell temperature (K); *R*sh denotes the shunt resistance. Consequently, we can rewrite Formula (1) as follows:

$$I\_{\rm o} = I\_{\rm ph} - I\_{\rm sd} \left[ \exp\left(\frac{q\left(V\_{\rm t} + I\_{\rm t}R\_{\rm s}\right)}{mkT}\right) - 1\right] - \frac{I\_{\rm l}R\_{\rm s} + V\_{\rm t}}{R\_{\rm sh}} \tag{4}$$

**Figure 1.** Equivalent circuit diagram of the (**a**) SDM, (**b**) DDM, and (**c**) PMM.

Note that Formula (4) has five undetermined parameters (*I*ph, *I*sd, *R*s, *R*sh, and *m*). Accurate and reliable extraction of the five parameters is important for solar cells, which can be realized by the proposed IMFO algorithms.

#### *2.2. Double Diode Model*

The DDM has been developed [36,37] due to this fact that the SDM has not considered the influence of composite current loss of the depletion area. As shown in Figure 1b, the DDM contains a current source, two diodes in parallel with a shunt resistance and a resistance in series with the current source. One of the diodes is applied to simulate the charge-recombination current with the non-ideal factors, and the other one is set as the rectifier. The output current *I*o of this model can be acquired as follows:

$$I\_{\rm o} = I\_{\rm ph} - I\_{\rm d1} - I\_{\rm d2} - I\_{\rm sh}$$

$$I\_{\rm e} = I\_{\rm ph} - I\_{\rm sd1} \left[ \exp\left(\frac{q(V\_{\rm t} + I\_{\rm t} \mathbf{R}\_{\rm s})}{m\_1 kT}\right) - 1\right] - I\_{\rm sd2} \left[ \exp\left(\frac{q(V\_{\rm t} + I\_{\rm t} \mathbf{R}\_{\rm s})}{m\_2 kT}\right) - 1\right] - \frac{I\_{\rm t} \mathbf{R}\_{\rm s} + V\_{\rm t}}{R\_{\rm sh}} \tag{5}$$

where *I*d1 and *m*<sup>1</sup> denote the current of diffusion and the ideality factor, respectively; *m*<sup>2</sup> and *I*d2 indicate the composite diode ideality factor and saturation current, respectively. Different from the SDM, the DDM includes seven undetermined parameters (*I*ph, *I*sd1, *I*sd2, *R*s, *R*sh, *m*1, and *m*2) that need to be accurately extracted.

#### *2.3. PV Module Model*

The PMM typically embodies multiple solar cells connected in parallel and/or in series. The equivalent circuit diagram of the single diode PMM is presented in Figure 1c. The output current of this model can be calculated by the following Formula (6):

$$I\_{\rm o} = N\_{\rm P} \left\{ I\_{\rm ph} - I\_{\rm sd} \left[ \exp \left( \frac{q \left( V\_{\rm t} / N\_{\rm s} + I\_{\rm t} \text{R}\_{\rm s} / N\_{\rm P} \right)}{mkT} \right) - 1 \right] - \frac{I\_{\rm t} \text{R}\_{\rm s} / N\_{\rm P} + V\_{\rm t} / N\_{\rm s}}{R\_{\rm sh}} \right\} \tag{6}$$

where *N*<sup>s</sup> and *N*<sup>p</sup> represent the number of solar cells in series and parallel, respectively. Same as the SDM, PMM also has five undetermined parameters (*I*ph, *I*sd, *R*s, *R*sh, and *m*) to be accurately extracted.

#### *2.4. Objective Function*

For the extraction problem of the undetermined parameters in PV models, the main task is to explore the undetermined parameter optimal value for narrowing the difference between the calculated and tested current values. The errors on each set of calculated and tested current values of the SDM and DDM can be obtained by the following Formulas (7) and (8), respectively.

$$\begin{cases} \begin{array}{c} f\_{\mathbf{x}}(V\_{\mathbf{t}\prime}I\_{\mathbf{t}\prime}X) = I\_{\mathbf{p}\mathbf{h}} - I\_{\mathbf{s}\mathbf{d}} \Big[ \exp\Big(\frac{q(V\_{\mathbf{t}\prime} + I\_{\mathbf{t}}R\_{\mathbf{s}})}{mkT}\Big) - 1 \Big] - \frac{I\_{\mathbf{f}}R\_{\mathbf{s}} + V\_{\mathbf{t}}}{R\_{\mathbf{s}\mathbf{h}}} - I\_{\mathbf{t}}\\ \mathbf{X} = \begin{Bmatrix} I\_{\mathbf{p}\mathbf{h}\prime} \ I\_{\mathbf{s}\mathbf{d}\prime} \ R\_{\mathbf{s}\mathbf{s}} \ R\_{\mathbf{s}\mathbf{h}\prime} \ m \end{Bmatrix} \end{array} \tag{7}$$

$$\begin{cases} f\_{\mathbf{x}}(V\_{\mathbf{t}\prime}I\_{\mathbf{t}\prime}X) = I\_{\mathbf{p}\rm h} - I\_{\mathbf{s}\rm d1} \Big[ \exp\Big(\frac{q(V\_{\mathbf{t}\prime} + I\_{\mathbf{t}\prime}R\_{\mathbf{s}})}{m\_{\mathbf{1}}kT} \Big) - 1 \Big] - I\_{\mathbf{s}\rm d2} \Big[ \exp\Big(\frac{q(V\_{\mathbf{t}\prime} + I\_{\mathbf{t}\prime}R\_{\mathbf{s}})}{m\_{\mathbf{2}}kT} \Big) - 1 \Big] - \frac{I\_{\mathbf{t}\prime}R\_{\mathbf{s}} + V\_{\mathbf{t}}}{R\_{\mathbf{s}\rm h}} - I\_{\mathbf{t}}\\ \qquad \qquad X = \left\{ I\_{\mathbf{p}\rm h}, \ I\_{\mathbf{s}\rm d1}, \ I\_{\mathbf{s}\rm d2}, \ R\_{\mathbf{s}\rm s}, R\_{\mathbf{s}\rm h}, m\_{\mathbf{1}}, m\_{\mathbf{2}} \right\} \end{cases} \tag{8}$$

In this work, to evaluate the entire difference between the calculated and tested current values, the root mean square error (RMSE) is utilized as objective functions as shown in Formula (9), which has been commonly adopted in literature [24,26,27]. Particularly, the smaller the RMSE(X) value, the more accurate the extraction of PV models' parameters.

$$\text{RMSE}(\mathbf{X}) = \sqrt{\frac{\sum\_{x=1}^{N} f\_{\mathbf{x}}(V\_{\mathbf{t}\nu}I\_{\mathbf{t}\nu}X)^2}{N}} \tag{9}$$

where *N*. denotes the number of tested current values, X is the decision vector that contains the undetermined parameters to be estimated.

#### **3. Moth-Flame Optimization Algorithm**

As a novel population-based heuristic algorithm, MFO is proposed by Mirjalili in 2015 [29]. The algorithm mainly contains two mechanisms: flame generation mechanism and the spiral flight search mechanism.

#### *3.1. Flame Generation Mechanism*

In MFO, the whole moth swarm' population size and the individual dimensional size are set as *N* and *D*, respectively. The whole moth swarm can be expressed as the following matrix *AM*:

$$\mathbf{AM} = \begin{bmatrix} AM\_1 \\ AM\_2 \\ \vdots \\ AM\_N \end{bmatrix} = \begin{bmatrix} am\_{11} & am\_{12} & \cdots & \cdots & am\_{1D} \\ am\_{21} & am\_{22} & \cdots & \cdots & am\_{2D} \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ am\_{N1} & am\_{N2} & \cdots & \cdots & am\_{ND} \end{bmatrix} \tag{10}$$

where *AMi* = [*ami*1, *ami*2, ··· , *amiD*] represents the state of the *i*-th moth, *i* ∈ {1, 2, ··· , *N*}, and *amid* indicates the d-th dimensional position of *i*-th moth, *d* ∈ {1, 2, ··· , *D*}. When MFO is applied for the estimating a PV model's parameters, each dimension of *AMi* = [*ami*1, *ami*2, ··· , *amiD*] corresponds to a set of extracted parameters of the PV model; *D* stands for the number of the estimated parameters. For example, for the SDM with its five estimated parameters, each *AMi*, *i* ∈ {1, 2, ··· , *N*} has five dimensions, written as *AMi* = [*ami*1, *ami*2, ··· , *ami*5]; *ami*1, *ami*2, *ami*3, *ami*4, *and ami*<sup>5</sup> represent five estimated parameters *I*ph, *I*sd, *R*s, *R*sh, and *m*, respectively.

*F*[∗] denotes the fitness value function. Therefore, for the *i*-th moth *AMi*, its fitness value is indicated as *F*[*AMi*]. Similarly, the fitness value vector of *AM* can be represented as follows:

$$F[\mathbf{AM}] = \begin{bmatrix} F[\mathbf{AM}\_1] \\ F[\mathbf{AM}\_2] \\ \vdots \\ F[\mathbf{AM}\_N] \end{bmatrix} \tag{11}$$

Similarly, for the estimating a PV model's parameters, *F*[∗] is defined as objective functions of the PV model.

Due to each moth has its own target flame, the number of the initial flames is equivalent to moths. The matrix *AF* is assumed to be the size of initial flames as follows:

$$AF = \begin{bmatrix} AF\_1 \\ AF\_2 \\ \vdots \\ AF\_N \end{bmatrix} = \begin{bmatrix} af\_{11} & af\_{12} & \cdots & \cdots & af\_{1D} \\ af\_{21} & af\_{22} & \cdots & \cdots & af\_{2D} \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ af\_{N1} & af\_{N2} & \cdots & \cdots & af\_{ND} \end{bmatrix} \tag{12}$$

where *AFi* is corresponding to the *AMi*, *i* ∈ {1, 2, ··· , *N*}. *D* and *N* are the flames' dimensional number and population size, respectively.

Similarly, for the *i*-th flame *AFi*, its fitness value is described as *F*[*AFi*]. The fitness value vector of *AF* is expressed as below:

$$F[AF] = \begin{bmatrix} F[AF\_1] \\ F[AF\_2] \\ \vdots \\ F[AF\_N] \end{bmatrix} \tag{13}$$

The maximum number of iterations and the current number of iterations are set as *K* and *k*, respectively, *k* ∈ {1, 2, ··· , *K*}. The flame generation mechanism is introduced as follows:

• Step one: when the current iterations' number *k* is one, the moths {*AM*1, *AM*2, ··· , *AMN*} are sorted according to their corresponding fitness value \* *F*[*AM*1], *F*[*AM*2], ··· , *F*[*AMN*] + from small to large, and the *i*-th moth after sorting is set as *AMsi*, *AMsi* ∈ {*AMs*1, *AMs*2, ··· , *AMsN*}. Then, the *AMsi*, *<sup>i</sup>* <sup>∈</sup> {1, 2, ··· , *<sup>N</sup>*} means the *<sup>i</sup>*-th flame *AFi*. Thus, the *AF* and its corresponding fitness value *F*[*AF*] can be initialed based on the sorted *AM* and *F*[*AM*], respectively.

• Step two: when the current number of iterations *k* is greater than one but less than or equal to *<sup>K</sup>*. We sort *AM*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>) and *AF*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>) from small to large according to their corresponding fitness values *<sup>F</sup>*[*AM*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>)] and *<sup>F</sup>*[*AF*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>)]. Next, the top *<sup>N</sup>* individuals are selected as new flames *AF*(*k*) from *AM*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>) and *AF*(*<sup>k</sup>* <sup>−</sup> 1). The *<sup>F</sup>*[*AM*(*<sup>k</sup>* <sup>−</sup> 1)] and *AM*(*<sup>k</sup>* <sup>−</sup> 1) represent the fitness value vector and the position vector of moths at the (*k* − 1)-th iterations, respectively. Similarly, the fitness value vector and position vector of flames at the (*<sup>k</sup>* <sup>−</sup> 1)-th iterations are *<sup>F</sup>*[*AF*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>)] and *AF*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>), respectively.

From the above demonstration, *AF* denotes the essence of *AM*(*<sup>k</sup>* <sup>−</sup> 1) and *AF*(*<sup>k</sup>* <sup>−</sup> <sup>1</sup>). Therefore, for the estimating a PV model's parameters, each dimension of *AFi* = [*a fi*1, *a fi*2, ··· , *a fiD*] corresponds to an estimated parameters of the PV model; *D* stands for the number of the estimated parameters.

#### *3.2. Spiral Flight Search Mechanism*

Furthermore, since the moths fly toward their respective target flame in spiral, the spiral flight search mechanism has been developed to simulate the moth's logarithmic spirally flying curve, as below:

$$AM\_{l}(k+1) = \begin{cases} D\_{l} \cdot e^{bt\_{\ast}} \cos(2\pi t) + AF\_{l}(k), \; i \le F\_{mu} \\\ D\_{l} \cdot e^{bt\_{\ast}} \cos(2\pi t) + AF\_{F\_{\text{mu}}}(k), \; i > F\_{\text{mu}} \end{cases} \tag{14}$$

where *AMi*(*k* + 1) indicates the position of the *i*-th moth *AMi* after renewing, *i* ∈ {1, 2, ··· , *N*}; *Di* = |*AFi* − *AMi*| denotes the distance between the *i*-th flame *AFi* and the *AMi*; *b* is a constant for the logarithmic spiral shape; *t* is a random number of [−1, 1], which denotes the distance between the next position of the moth and the flame (*t* = −1 is the smallest distance between *AMi* and *AFi*, and *t* = 1 is the farthest between *AMi* and *AFi*). For diverse *t* values, the spirally flying trajectory in one dimension is displayed in Figure 2.

**Figure 2.** Geometric trajectory diagram of flying moth catching flame around logarithmic spiral curve.

*Fnu* is the number of the flames during the iteration process. Note that as the number of iterations increases, *Fnu* gradually decreases and eventually equals to 1. The process of adaptively reducing the number of flames can be expressed in Formula (15) as below:

$$F\_{mu} = round \left[ N - k \times \frac{N-1}{K} \right] \tag{15}$$

where *N* and *K* are the maximum number of flames and iterations, respectively; *k* denotes the current iterative number. Besides, *round*[*x*∗] is the function that can make *x*∗ be rounded to its nearest integer. Note that with *k* = 0, *Fnu* = *N*; when *k* = *K*, *Fnu* = 1 denotes that moths utilize the best flame to update their own positions at the last iteration in Formula (14).

In general, the flames surrounded by their corresponding moths can be randomly distributed in the search area. Consequently, the MFO can obtain the good balance between the local exploitation and the global exploration [29].

#### **4. Improve Moth-Flame Optimization Algorithm**

In the original MFO [29], the moths always flying towards their corresponding best target flames, resulting in the fast communication between moths. Therefore, the moths are easily trapped into local optimum when facing complex multi-modal problems. To address this problem, this paper develops an improved MFO (IMFO) algorithm. In the IMFO, we propose a double-flames generation (DFG) strategy to generate two different types of target flames for guiding moths flying. One type of flames is named local flame (LF), which can be created by dividing the entire swarm into several sub-swarms and then select the local best moths in a corresponding sub-swarm; another one is called global flame (GF) that is generated by combining all the moths' current personal best positions (pbests). Moreover, two different update strategies are developed for updating the positions of moths; each moth only adopts one of the two update strategies at each iteration. In addition, to ensure a great balance between the exploitation and exploration, we develop a probability to rationally select one of the two update strategies for each moth at each iteration. The above process is detailed below.

#### *4.1. Double Flames Generation Strategy*

In this strategy, two types of target flames are produced by adopting different moths' information. The first type of flames is the LFs, which can be generated by the following description:


The second type is GF, which is generated by combining all the moths' pbests. The calculation formula of GF is displayed in Formula (16), we can see from the formula that the GF carries the information about all moths.

$$\text{GF} = \frac{1}{N} \sum\_{i=1}^{N} \text{pbest}\_i \tag{16}$$

#### *4.2. Update Formulas*

Furthermore, two different update strategies are created for generating new moths. Particularly, the two update strategies correspond to two types of flames, respectively as follows:

$$AM\_i(k+1) = \left| \text{LF}\_{\alpha}(k) - AM\_i(k) \right| \times \varepsilon^{bt} \times \cos(2\pi t) + \text{LF}\_{\alpha}(k) \ (\phi > P) \tag{17}$$

$$AM\_i(k+1) = \left| \text{GF}(k) - AM\_i(k) \right| \times \epsilon^{\text{It}} \times \cos(2\pi t) + \text{GF}(k) \ (\phi \le P) \tag{18}$$

where *AMi*(*k* + 1) and *AMi*(*k*) respectively represent the updated position of the *i*-th moth at the *k*-th and (*k* + 1)-th iteration, *i* ∈ {1, 2, ··· , *N*}; *b* indicates a constant for the logarithmic spiral shape; LFα(*k*) and GF(*k*) denote two type of flames; *t* is a number that randomly distributed in the interval of [−1,1].

From the Formula (17), we can observe that as the local best flame in the α-th sub-swarm, α ∈ {1, 2, ··· , *m*}, LFα(*k*) can effectively guide its corresponding moth *AMi*(*k*) to perform the local search and explore a new potential place in the solution area. On the other hand, we can see from the Formula (18) that the moths in the entire swarm can fly towards GF(*k*) for improving the accuracy of solutions. Particularly, instead of using the best flame, Formula (18) adopts GF(*k*), namely the average value of all the moths' pbests to avoid the fast communication between moths and improve the premature of the moths. In general, the two different update strategies make moths obtain the promising compromise between global exploration and local exploitation.

In addition, we develop a probability to rationally select one of the above two update strategies at each iteration. Specifically, a random number φ distributed in [0,1] is created during each iterative process. If the value of φ is larger than *P*, the Formula (17) can be selected to update the *i*-th moth *AMi*; otherwise, the Formula (18) be done for updating the *AMi*. Therefore, it is significant to acquire a suitable *P* value for balancing the exploitation and exploration abilities. The setting of *P* value is displayed in Section 6.

*4.3. Process of IMFO*

The pseudo code of IMFO is expressed in the Algorithm 1, where *k* denotes the number of the current iteration; LF<sup>α</sup> denotes the local best flame of the α-th sub-swarm, α ∈ {1, 2, ··· , *m*}, where *m* indicates the number of sub-swarms. It can be seen from the Algorithm 1 that the complexity of IMFO is comparable to the original MFO. Moreover, the flow chart of IMFO is described in Figure 3, where the DFG strategy with two different update strategies are adopted to seek the best solution in the search space.

#### **Algorithm 1: IMFO**

```
1: /*Initialization*/
2: Initialize the position AMi of moths, i ∈ {1, 2, ··· , N};
3: Calculate the fitness value F[AMi] of moths, initialize the pbesti
                                                                     , gbest;
4: /* DFG strategy*/
5: k = 1;
6: for α = 1 to m do
7: subswarmα =
                 -
                  AM(α−1)∗n+1, AM(α−1)∗n+2, ··· , AMα∗n
                                                           .
                                                            ;
8: Select the best moth of sub − swarmα as LFα(k);
9: end for
10: Calculate the GF(k) with formula (16);
11: while (condition of termination not met) do
12: k = k + 1;
13: for i = 1 to N do
14: Create a random number φ;
15: if φ > P
16: Update the AMi(k) with formula (17);
17: else
18: Update the AMi(k) with formula (18);
19: end if
20: Update the pbesti
                      , LFα, GF, gbest, i ∈ {1, 2, ··· , N};
21: end for
22: end while
```
**Figure 3.** Flow chart of the improved moths-flames optimization (IMFO).

#### **5. Results and Analysis**

To show the validity of the proposed IMFO method, it is applied to identify the parameters of three different PV models involving the SDM, DDM, and PMM. For the SDM and DDM, reference [18] gives the measured current and voltage values from a 57 mm diameter commercial silicon R.T.C. France silicon solar cell working at a temperature of 33 ◦C under irradiance of 1000 W/m2. Besides, as a PMM, the Photowatt-PWP201 is applied to evaluate the IMFO for identifying the corresponding

parameters [18,38,39]. Particularly, the Photowatt-PWP201 contains 36 silicon cells with series conducting under 1000 W/m<sup>2</sup> at 45 ◦C. Considering fair comparison, we utilize the same search upper and lower boundaries [24,26,27] of each parameter of three PV models, as shown in Table 1.


**Table 1.** Parameters boundaries of the three different photovoltaic (PV) models.

To indicate the excellent performance of the IMFO method, it has been compared with eight well-established and competitive methods. These compared methods were the basis MFO [30], opposition-based MFO method (OMFO) [33], hybrid water cycle–moth-flame optimization method (WCMFO) [34], brain storm optimization method (BSO) [40], comprehensive learning PSO (CLPSO) method [41], artificial bee colony (ABC) method [20], sine cosine algorithm (SCA) [42], and improved JAYA (IJAYA) method [26]. All the compared methods were independently conducted 30 times on each PV model. For each running, the maximum number of evaluations for the compared methods is set to 50,000. Table A1 of Appendix A shows the parameter settings of the comparison methods. Note that in the IMFO, the population size of moths is set as 100, and the number of sub-swarms and *P* are set as four and 0.4, respectively. Moreover, the accuracy of the nine compared methods were illustrated by comparing the best values in their RMSE. Also, their robustness and convergence speed were evaluated through the analysis of data results and convergence curves.

#### *5.1. Results on the Single Diode Model*

For the SDM, RMSE and the estimated five parameters values are shown in Table 2, where we highlight the overall best and the second best RMSE values in gray boldface and boldface, respectively. Interestingly, both the IMFO and WCMFO achieve the best RMSE value (9.8602 <sup>×</sup> 10−4) among the nine algorithms; besides, the IJAYA acquires second best RMSE value (9.8606 <sup>×</sup> 10−4), followed by ABC, CLPSO, MFO, OMFO, BSO, and SCA. RMSE is applied to denote the accuracy of experimental results because of the information of the accurate values of the parameters is not available. Although the gap between the best and second best RMSE values is extremely subtle, it is important to decrease the difference between the true and estimated parameter values in objective function. Because the smaller of objective value RMSE, the more accurate the estimated parameters. Moreover, the extracted best parameters from IMFO are employed to plot *I*-*V* and *P*-*V* curves. This further demonstrates the accuracy of the extracted parameters on SDM. From Figure A1 of Appendix A, we can see that the measured and simulated current and voltage values acquired by IMFO are extremely consistent over the entire voltage range. In addition, the individual absolute errors (IAE) between the simulated and measured current values are displayed in Table A2 of Appendix A. Note that compared with 2.5 <sup>×</sup> <sup>10</sup><sup>−</sup>3, all the IAE values are smaller, demonstrating the preciseness of the extracted parameters from IMFO.


**Table 2.** Comparison among different algorithms on the single diode model.

Note: **9.8602** × **10**−**<sup>4</sup>** : both the IMFO and WCMFO achieve the best RMSE value among the nine algorithms; **9.8606** × **10**−**<sup>4</sup>** : the IJAYA acquires second best RMSE value (9.8606 × 10−4), followed by ABC, CLPSO, MFO, OMFO, BSO, and SCA.

#### *5.2. Results on the Double Diode Model*

For the DDM, the values of seven extracted parameters with the comparison results of RMSE are presented in Table 3. It can be seen that the proposed IMFO obtain the best RMSE result (9.8252 <sup>×</sup> <sup>10</sup><sup>−</sup>4) among the nine methods; the second best RMSE result (9.8371 <sup>×</sup> <sup>10</sup><sup>−</sup>4) is achieved by WCMFO. Besides, the *I*-*V* and *P*-*V* curves are rebuilt in Figure A2 through using the best model that estimated by IMFO. Furthermore, via using IMFO, we can obtain IAE values listed in Table A3 of Appendix A, where each of all the IAE values is also smaller than 2.5 <sup>×</sup> 10−3. In addition, we can see from the Figure A2 of Appendix A that the measured and simulated current and voltage values obtained by IMFO are highly in coincidence. Therefore, IMFO can extract the parameters of DDM with high accuracy.

**Table 3.** Comparison among different algorithms on the double diode model.


Note: **9.8252** × **10**−**<sup>4</sup>** : It can be seen that the proposed IMFO obtain the best RMSE result among the nine methods; the second best RMSE result ( **9.8371** × **10**−**<sup>4</sup>** ) is achieved by WCMFO.

#### *5.3. Results on the PV Module Model*

For the PMM, it has five parameters that need to be estimated. Table 4 presents the best RMSE and the five extracted parameters values for each of the nine compared methods on 30 tests. From the Table 4, we can see that IMFO achieves the best RMSE value (2.4251 <sup>×</sup> <sup>10</sup><sup>−</sup>3); the IJAYA has the second best RMSE value (2.2453 <sup>×</sup> <sup>10</sup><sup>−</sup>3). Furthermore, Figure A3 of Appendix <sup>A</sup> shows that the *<sup>I</sup>*-*<sup>V</sup>* and *<sup>P</sup>*-*<sup>V</sup>* curves features of the estimated parameters by IMFO are good in coincidence with the measured values. In addition, Table A4 of Appendix A indicates that each of all the IAE values is smaller than 4.8 <sup>×</sup> <sup>10</sup><sup>−</sup>3. From these results, IMFO can achieve the great accuracy parameters extraction.


**Table 4.** Comparison among different algorithms on the PV module model.

Note: IMFO achieves the best RMSE value **2.4251** × **10**−**<sup>3</sup>** ; the IJAYA has the second best RMSE value **2.4251** × **10**−**<sup>3</sup>** .

#### *5.4. Statistical Results and Convergence Curves*

In this section, IMFO is compared with the other eight methods on the reliability and convergence speed by the convergence curves and statistical results. Table 5 displays the nine algorithms' statistical results over 30 independent tests on each of three PV models, where the minimum (min), mean and standard deviation (SD) values of RMSE represent the accuracy, average preciseness and reliability of the extracted parameters, respectively. Besides, we conduct the Wilcoxon signed-rank examination at 5% significant level [43] to verify the great differences between IMFO and other compared methods. Sign "+" in the Table 5 indicates that the IMFO is greatly superior to its competitors.


**Table 5.** Comparisons on the statistical results of different algorithms for three different PV models.

We can clearly see from the Table 5 that the IMFO algorithm achieves the more outstanding performance than other eight algorithms on the reliability and average accuracy of the three models. For the SDM, WCMFO and IJAYA obtain the second-best average accuracy and reliability, respectively. For the DDM, the second-best reliability and average accuracy are acquired by IJAYA and CLPSO, respectively. For the PMM, the IJAYA achieves the second-best result both on average accuracy and reliability. Moreover, the results of Wilcoxon signed-rank test from Table 5 demonstrate that IMFO presents the greatly superior to all the compared methods on all the three models. Figure A4 of Appendix A displays the box-plots, indicating the distribution of all the 30 independent runs' results acquired by the nine different methods. Note that the sign "+" in Figure A4 represents the abnormal value during the plotting. The span of the data distributions demonstrates that the superior performance is also obtained by IMFO algorithm.

Furthermore, Figure 4 gives the convergence curves of nine methods, which are plotted by using the average RMSE value on the 30 independent tests. Clearly, IMFO acquired the fastest convergence speed among the nine methods on each of the three PV models.

**Figure 4.** Convergence curves of different algorithms for three models.

In general, according to the above comparisons, we can indicate that the IMFO method expresses the superior performance on searching preciseness, reliability and faster convergence performance when extracting the three different PV models' parameters. Besides, IMFO performs the superior and competitive performance in contrast with eight mature heuristic methods.

#### **6. Discussion**

#### *6.1. Discussion of Parameter*

In this paper, the parameter *P* is used to rationally select one of the two update strategies for each moth at each iteration. Thus, it is significant to set a suitable *P* value for balancing the local exploitation and global exploration abilities. In this section, we test the influences of different *P* values on IMFO performance through comparing the preciseness and reliability when extracting the parameters of the three different PV models. The maximum number of evaluations is also set as 50,000 on each running; the population size of the moths and number of sub-swarms are set as 100 and 4, respectively.

We evaluate the IMFO with three different *P* values: 0.4, 0.5 and 0.6. In addition, the IMFO with each different *P* value is independently conducted 30 times on each model. Table 6 shows that *P* = 0.4 provides the best values on all the three different PV models according to all criteria. This means that *P* = 0.4 can obtain the best performance on accuracy and reliability when estimating the three models' parameters.



#### *6.2. Discussion of IMFO*

To demonstrate that IMFO can effectively escape the local optimum when solving multimodal problems, we further tested the performance of IMFO, MFO [30], OMFO [33], WCMFO [34], BSO [40], CLPSO [41], ABC [20], SCA [42], and IJAYA [26] on the CEC2017 benchmark suite [44]. Due to the space constraints, the 30 benchmark functions of CEC2017 were listed in Table A5 of the Appendix A. Moreover, according to the characteristics of the 30 benchmark functions, they can be classified into unimodal, multimodal, hybrid, and composition problems. In addition, each function has the same search boundary range (−100,100) on each dimension. Note that *F*(*x*<sup>∗</sup> ) is the optimal value of each function; *x*∗ is the best solution corresponding to the optimal value. Here, owing to the limited space, we select F4, F7, and F8 from the multimodal functions, and F12 and F18 from the hybrid functions for evaluating the nine compared algorithms. Each evaluated algorithm was conducted 30 times independently on each of the five selected benchmarks. The mean values (Mean) of the corresponding errors are used as rating criteria. The comparison results of the nine algorithms with 30 dimensions are displayed in Table 7, where we highlight the best and second-best Mean results in gray boldface and boldface, respectively.

From the Table 7, we can see that IMFO achieves the best error means among the nine algorithms on all the five complex functions. Moreover, the indicators of IMFO on the five benchmark functions are all superior to the conventional MFO. For example, IMFO can provide the results of errors' mean values 5.06 and 7.30 × 10 on multimodal functions F4 and F7, respectively, which are both close to the optimal error value 0. However, MFO only can obtain the results of errors' mean values 8.91 <sup>×</sup> 102 and 3.42 <sup>×</sup> <sup>10</sup><sup>2</sup> on multimodal functions F4 and F7, respectively. The above analysis shows that IMFO can find a more promising solution than the MFO of the multimodal problem in the search space. This indicates that MFO is easily trapped into the local optimum when solving complex multimodal problems, however, IMFO can effectively escape the local optimum to find a more promising solution on the multimodal problems.


**Table 7.** Comparisons between IMFO and eight algorithms on five benchmark functions of CEC2017 with 30 dimensions.

#### **7. Conclusions**

The PV models' parameters are located in the multi-modal and nonlinear solution space with various local optima so that it is extremely tricky for various existing MFO algorithms to extract a set of optimal parameters of the PV models. This paper proposes an improved MFO (IMFO) algorithm for estimating the parameters of PV models. In IMFO, the DFG strategy has been first developed to generate two different types of high-performance target flames for effectively searching the global optimal solution. To effectively tackle the global exploration and local exploitation, two different update strategies are developed. In addition, we develop a probability to select one of above two update strategies for each moth during the iterative process, which ensures the balance between the global exploration and local exploitation. Due to effectively combining the DFG strategy with the two update strategies, IMFO can effectively accurately and reliably identify the different PV models' parameters.

In the future, IMFO will be adopted to settle multi-objective and constrained problems or economic dispatch issues in power systems. Furthermore, some other improvements will be proposed to expand the use of complex renewable energy algorithms by optimization algorithms.

**Author Contributions:** Conceptualization, H.S., C.L., and Z.Y.; Methodology, H.S., C.L., Y.X., and Q.K.; Software, H.S., C.L., H.W., and Z.C.; Writing—Original draft preparation, H.S. and C.L.; Writing—Review and editing, H.S. and C.L.

**Funding:** This work was supported by the National Natural Science Foundation of China under Grants 61503177, 81660299, and 61863028, by the China Scholarship Council under the State Scholarship Fund (CSC No. 201606825041), by the Science and Technology Department of Jiangxi Province of China under Grants 20161ACB21007, 20171BBE50071, and 20171BAB202033, and by the Education Department of Jiangxi province of China under Grants GJJ14228 and GJJ150197.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A**




**Table A2.** Absolute error of IMFO for each measured on the single diode model.

**Table A3.** Absolute error of IMFO for each measured on the double diode model.



**Table A4.** Absolute error of IMFO for each measured on the PV module model.

**Table A5.** CEC2017 benchmark functions with initialization and search range: (−100,100)D.


**Figure A1.** Comparisons between the experimental data and simulated data obtained by IMFO for single diode model: *I-V* and *P-V* characteristics.

**Figure A2.** Comparisons between the experimental data and simulated data obtained by IMFO for double diode model: *I-V* and *P-V* characteristics.

**Figure A3.** Comparisons between the experimental data and simulated data obtained by IMFO for PV module model: *I-V* and *P-V* characteristics.

**Figure A4.** Best RMSE boxplot over 30 runs of different algorithms for three models.

#### **References**


© 2019 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 (http://creativecommons.org/licenses/by/4.0/).
