Abstract
How to accurately and efficiently extract photovoltaic (PV) model parameters is the primary problem of photovoltaic system optimization. To accurately and efficiently extract the parameters of PV models, an enhanced mothflame optimization (EMFO) with multiple flame guidance mechanism is proposed in this study. In EMFO, an adaptive flame number updating mechanism is used to adaptively control the flame number, which enhances the local and global exploration capabilities of MFO. Meanwhile, a multiple flame guidance mechanism is designed for the full use of the position information of flames, which enhances the global diversity of the population. The EMFO is evaluated with other variants of the MFO on 25 benchmark functions of CEC2005, 28 functions of CEC2017, and 5 photovoltaic model parameter extraction problems. Experimental results show that the EMFO has obtained a better performance than other compared algorithms, which proves the effectiveness of the proposed EMFO. The method proposed in this study provides MFO researchers with ideas for adaptive research and making full use of flame population information.
1. Introduction
The optimization problem is an application technology based on mathematics, applied to solve various engineering problems. The solution to most problems that can be transformed into optimization problems will be gained by using the optimization problem technology. However, some problems are nondeterministic polynomial (NP)hard problems, and it is difficult to find the optimal solution by utilizing the optimization problem technology. To find the global optimal solution to the optimized problems, a series of intelligent algorithms have been proposed in the literature. In recent decades, optimization algorithms have been widely used to optimize NPhard problems [1], which can be classified into four categories, i.e., evolutionary algorithms, physicsbased algorithms, swarm intelligencebased algorithms, and humanbased algorithms. In 1975, Holland [2] proposed a genetic algorithm (GA) based on the evolutionary process of organisms. In 1982, Kirkpatrick et al. [3] simulated the annealing process of metallurgy for designing the simulated annealing (SA) algorithm. In 1991, Colorni et al. [4] proposed the ant colony optimization (ACO), which is inspired from the colony behavior of ants’ foraging. In 1995, Eberhart and Keendy et al. [5] proposed a particle swarm optimization (PSO) based on the foraging behavior of birds. In 1997, Storn and Price [6] proposed differential evolution (DE) based on GA. In the last decade, many excellent algorithms have been proposed to solve complex engineering problems [7], such as monarch butterfly optimization (MBO) [8, 9], kill herd [10], slime mold algorithm (SMA) [11], harris hawks optimization (HHO) [12], earthworm optimization algorithm (EWA) [13], elephant herding optimization (EHO) [14], moth search (MS) [15] and naked molerat (NMR) [16]. In addition, many optimization algorithms have been utilized to successfully solve the reallife applications [17–23].
These algorithms have successfully optimized various complex optimization problems and have also been widely used to solve engineering, scientific, and imageprocessing problems. Although a lot of research has been performed on these algorithms, they still face some challenges. For example, PSOs are prone to premature when it is used to solve many multimodal problems. Therefore, it is still a challenge to develop a populationbased heuristic search algorithm to effectively prevent falling into the local optimum and maintain a faster convergence rate.
The mothflame optimization (MFO) is a natural heuristic algorithm proposed by Mirjalili [24] in 2015. The algorithm is based on a special navigation mechanism, in which moths use lateral positioning when flying around the moonlight at night. Since MFO is simple, flexible, and easily implemented, MFO has been widely used in engineering and scientific fields.
In literature [25], MFO was used to solve the optimal powerflow problem. The experimental results demonstrated that MFO is robust and superior to other algorithms. Sapre et al. [26] proposed the oppositionbased mothflame optimization (OMFO), in which the oppositionbased learning mechanism, Cauchy mutation, and boundary constrainthanding method were integrated into the MFO algorithm. Experiment results showed that the OMFO has obtained high optimization ability and fast convergence speed, and can effectively jump out of the local optimum. Zhao et al. [27] proposed an ameliorated mothflame optimization (AMFO), in which a crisscross mechanism was utilized to improve the search ability of MFO.
Xu et al. [28] proposed an enhanced mothflame optimizer with a mutation strategy for global optimization, in which Gaussian mutation, Cauchy mutation, and Lévy mutation were combined with MFO (GMFO, CMFO, and LMFO), respectively. To optimize the pose of target, a new improved MFO combined with DE was designed by Li et al. [29]. In [30–32], and a chaotic map method was used to control different parameters of MFO. To effectively jump out of the local optimum, a Lévy flightbased mothflame optimization (LMFO) was proposed by Li et al. [33]. Sayed and Hassanien [34] proposed that MFO is integrated into the SA algorithm (SAMFO), in which the exploration ability of the SA and the learning mechanism of the MFO were utilized to balance the global exploration and local exploitation of the population. The PSO is embedded into MFO for enhancing the performance of the canonical MFO in solving realworld complex problems [35–37].
NadimiShahraki et al. [38] proposed a migrationbased MFO (MMFO) algorithm for avoiding premature. In the MMFO, a random migration operator was utilized to improve the position of the poor moth in the early iterations. Furthermore, new qualified solutions are separately stored in a guided archive to keep population diversity. NadimiShahraki et al. [39] proposed a multitrial vectorbased MFO (MTVMFO) algorithm. In the MTVMFO, the multitrial vector (MTV) mechanism is used to replace the movement strategy of MFO for the use of a combination of different movement strategies, each of which is adjusted to accomplish a particular behavior. Truong [40] proposed a new MFO algorithm, in which a new encoding scheme was used to help reduce the search domain and speed up the computing time by utilizing a shorter length binary vector.
Although those variants described above have improved the performance of the canonical MFO to a certain extent, they exhibit poor performance in solving nondifferentiable, nonlinear, and nonseparable multimodal problems and especially did not solve two important defects of MFO. For example, the number of flames linearly decreases, regardless of whether the population falls in the local optimal trap. This weakens the ability of the population to jump out of the local trap. Furthermore, the original flameguiding mechanism only distributes the information of a flame to the moth so that the moth is easy to fall into local optimal traps. To solve the above problems, an enhanced MFO (EMFO) with multiple flame guidance is proposed in this study. In the EMFO, to improve the global search capability of the algorithm, the flame number is adaptively controlled according to the current population situation. Meanwhile, a multiple flame guidance mechanism is designed to fully utilize the information of the flames. To verify the performance of the EMFO, it is compared with the stateoftheart algorithms on 25 benchmark functions of CEC 2005 and a realworld problem.
The main contributions of this study can be summarized as follows:(1)An adaptive flame number updating mechanism is proposed to enhance the global exploration ability of the population by adaptively controlling the flame number according to the population situation.(2)To enhance the search ability and make full use of the information of the flames, a multiple flame guidance mechanism is designed by utilizing the information of multiple flames.(3)To systematically verify the superiority of the proposed EMFO algorithm, 25 complex benchmark functions and parameter extraction of photovoltaic models are utilized to estimate the overall performance of EMFO.
The section of this study is arranged as follows. Section 2 explains the basic concept of the MFO algorithm. Section 3 addresses a specific description of the EMFO algorithm. In Section 4, the experimental results are presented. The realworld problem simulation is described in Section 5. Section 6 summarizes the study and the prospects for future research.
2. MothFlame Optimization Algorithm
The MFO is a heuristic optimization algorithm proposed by Mirjalili in 2015. This algorithm is based on the special navigation mechanism of moths. Figure 1 shows the conceptual model of horizontal positioning of moths, which simulates the process that moths fly around the moonlight at a fixed angle. Since the moon is very far away from the moths, the moths can keep flying straight using this approximate parallel light. Although this navigation mechanism is very effective for moths, there are many artificial or natural light sources in reality. This kind of light source is very close to the moth compared with the moon. The moths fly around the light source at a fixed angle, which leads to navigation failure and a spiral flight path, as shown in Figure 2.
In the MFO, there are two candidate solutions (moth and flame). The moth is a moving entity in the search space, utilized to find the optimal solution. The position of the best moth obtained so far is viewed as flame. The moth searches around the flame and updates its position to find a better solution in each iteration. The moth population consists of moths, as represented in the following formula:where denotes the number of moths, and stands for the dimensions of the problem. For all moths, the following set is used to store the fitness values.where denotes the fitness value of the th moth.
The other core of the MFO is the flame population , which is represented in the following formula:
The set of fitness values is described in the following formula:where denotes the fitness value of the th flame.
Both moths and flames are candidate solutions. The difference between them is the way that they are treated and updated in each iteration. In the search space, moths are the actual moving subjects, and flames are obtained the best position so far. Each moth searches around a flame, and the current optimal solution stored in the flame is updated when a better solution is found. Under this mechanism, the moth will not miss its optimal solution.
The position of each moth is updated according to the following formula:where represents the th moth, and represents the th flame. Besides, represents the spiral function.
According to the behavior of the moth spiral approaching the flame, a logarithmic spiral search is defined as follows:where is a constant for defining the shape of the logarithmic spiral, and is a random in the range [−1, 1]. is the distance between moth and flame, which is expressed as follows:where represents the th moth, and represents the th flame. Meanwhile, indicates the distance of the th moth for the th flame.
As shown in Figure 3, the parameter in the spiral search defines how close the next position of the moth should be to the flame ( is the closest position to the flame, while is the farthest position). To further enhance the exploitation global exploration capability and of the MFO, a parameter is used to improve the search speed of moths and define the value range of to [, 1]. In the iteration process, the linearly decreases from 1 to 2. The spiral search shows that the moths can surround the flames instead of just flying in the space between them, which balances the global exploration capability and local exploitation capability of MFO.
To increase the possibility of finding a better solution, the best solution obtained so far is considered to be the flame. Therefore, the matrix always contains the best solution obtained so far. After each iteration, the flame position will be reordered according to the fitness value for updating the flame sequence, as shown in Figure 4. In the next generation, moths update their positions based on the flames, which are in the flame sequence corresponding to them.
If each position of moths is updated based on different positions in the solution space, the local exploitation capability of the algorithm will be greatly reduced. To solve this problem, a reduction mechanism of the flame number is proposed to timevaryingly reduce the number of flames in the iterative process, as presented in the following formula:where is the maximum number of flames, and is the current iteration number. Besides, stands for the number of flames, and is the maximum iteration number.
3. Enhanced MFO with Multiple Flame Guidance Mechanism
In the basic MFO, the reduction in the number of flames is based on a fixed timevarying reduction mechanism, which makes MFO easy to fall into the local optimal solution trap. To solve this problem, an adaptive flame number updating mechanism is utilized to adaptively control the number of flames. In addition, a multiple flame guidance mechanism is used to enhance the search ability of the population by using simultaneously multiple flames to search.
3.1. Adaptive Flame Number Updating Mechanism
When the global optimal value does not change every ten generations, the flame quantity will be updated as follows:
On the contrary, the updating formula of flame’s number is as follows:where and are the initial values of the updating step of flame’s number, denotes the number of flames. The and are change rates, which are utilized to determine the degree of change of and , respectively.
In this mechanism, the number of flames will exponentially increase when the global optimal solution is not updated for hundreds of generations, which can effectively solve the problem that the probabilistic stagnation of the algorithm leads to a drastic change in the flame’s number. In addition, after the global optimal solution is updated for hundreds of generations, the reduction step of flame’s number gradually decreases so that the population will maintain the diversity.
3.2. Multiple Flame Guidance Mechanism
Inspired by DE, the difference vector of the two flames randomly selected from the flame population is regarded as the direction vector that is used to guide another flame to search, which can increase the diversity of the population. To balance the multiple flame guidance mechanism and the spiral search mechanism of the MFO, a judgment parameter is added and randomly selected from the range [0, 1]. The multiple flame guidance mechanism is executed when is not satisfied, as shown in formula (11). The schematic diagram in space of this mechanism is shown in Figure 5.where , , and are distinct indexes. represents the th moth, and represents the th flame. is a random in interval [0, 1].
Based on the above description, the pseudocode of the EMFO algorithm is presented in Algorithm 1.

4. Experimental Simulation and Results
In the simulation environment of this experiment, the CPU is Intel(R) Core (R) i77500. The CPU main frequency is 2.70 GHz, and memory is 12.00 GB. The MATLAB R2018b is selected as the development environment.
To verify the performance of the EMFO, some classical variants of the MFO and the original MFO are selected, for example, MFO with Gaussian mutation (GMFO) [28], MFO with Cauchy mutation (CMFO) [28], MFO with Lévyflight mutation (LMFO) [33], ameliorated MFO (AMFO) [27], and oppositionbased MFO (OMFO) [26]. A total of 25 benchmark functions of CEC 2005 [41] are used to test the performance of the EMFO and compared algorithms. In 25 benchmark functions, the functions F1F5 are continuous unimodal functions while F6F14 are multimodal and have a significant number of local minima. Besides, F15F25 are hybrid composition functions.
Additionally, to further verify the performance of the EMFO and the contribution of each component of the proposed algorithm, two stateoftheart algorithms (EMFO [42] and SaDN [43]), MFO with adaptive flame number (MFOAFN) updating mechanism, and MFO with multiple flame guidance (MFOMFG) mechanism were added to the comparison experiment for solving 28 functions of CEC2017 [44]. A total of 28 benchmark functions were composed of 1 unimodal function F1, 7 simple multimodal functions (F3F9), 10 hybrid functions (F10F19), and 10 composition functions (F20F29). It is noteworthy that F2 of CEC2017 is not used because it is an unstable problem.
The population size of all algorithms is set as 100, and the dimension of problems is 30 for all the 25 functions of CEC2005. The dimensions are 10, 30, 50, and 100 for CEC2017, and the total number of function evaluations of each algorithm is set to 10000D. The parameters , , , and of the EMFO are set as 2.5, 2.5, 0.8, and 0.5, respectively. In addition, other parameters of compared algorithms follow their original studies.
In this simulation, the mean value and standard deviation of the function error value () are recorded for testing the performance of each algorithm, where gbest is the best solution found by the algorithm in a run, and is the theoretical global optimum of the benchmark functions.
4.1. Comparison on Solution Accuracy
Table 1 shows the optimization results of the algorithm’s solution accuracy. In each row of the table, the first part lists the mean value of 25 runs, and the second part is the standard deviation of the solutions. The value and H value of the nonparametric statistical test with a significance level = 0.05 are presented in the third and fourth lines. The symbol “ǂ” is tagged in the back of the mean value yielded by the algorithm that is significantly worse than the EMFO. If the EMFO is worse than other algorithms, a “ξ” is added to the back of the mean value of the corresponding algorithm. The symbol “∼” indicates that there is no significant difference between the EMFO and compared algorithm. The last row of the table presents a summary of a total number of “ǂ,” “ξ,” and “∼.” In addition, the best results are bold to clearly show.
Table 1 clearly shows that the EMFO has obtained the best performance on 18 functions that consisted of 3 unimodal functions (F1, F3, and F4), 5 multimodal functions (F6, F9F11, and F13), and 10 hybrid functions (F16F25), which demonstrates that the EMFO is promising in solving unimodal functions. Meanwhile, the EMFO is worse than the AMFO on 2 functions (F5 and F7), which could be because the spiral search operator of the EMFO has poor search ability for the boundary neighborhood while the crisscross optimization method of the AMFO enhances the exploitation ability of the population to the boundary neighborhood. In addition, the MFO has gained the best performance on 4 functions (F2, F8, F12, and F24) and is better than the EMFO on 3 functions (F5, F8, and F12). The LMFO is best on 6 functions (F5, F7, F14, F15, F21, and F24). This may be because the multiple flame guidance mechanism decreases the search performance in solving the rotated problems. The GMFO and CMFO only have gained the best performance on function F24, and OMFO only is best on function F24.
In terms of the statistical results of Wilcoxon’s ranksum test, the EMFO is significantly better than the MFO, AMFO, GMFO, CMFO, LMFO, and OMFO on 14, 22, 16, 18, 15, and 16 out of 25 functions, and inferior to them on 3, 2, 3, 3, 5, and 2 out of 25 ones, respectively. Therefore, we can say that the EMFO produces the best results for these benchmark test functions.
Table 2 expresses the average ranks of the mean value of the function error value () with 51 runs, according to Friedman’s test for the compared algorithms. The best ranks are shown in bold. Table 2 clearly shows that the EMFO is ranked first for all dimensions. Regarding mean ranking and summary rank, the EMFO has obtained the best performance, which demonstrates that the EMFO is promising and significate. In addition, the EMFO is better than the MFOAFN and MFOMFG for all dimensions using CEC2017, which indicates that there is a synergy between the adaptive flame number updating mechanism and the multiple flame guidance mechanism.
4.2. The Comparison Results of Convergence Speed
In Figure 6, the vertical axis is the nature logarithm of the mean value over independent 25 runs, and the horizontal axis is the sampling point where 30 sampling points are taken from FES = 1000 and mod (FES, 10000) = 0.
(a)
(b)
It can be clearly seen from Figure 6 that the EMFO obtains the best convergence speed on 10 functions (F4, F6, and F18F25), which indicates that the adaptive flame number updating mechanism and the multiple flame guidance mechanism can improve the convergence speed of the canonical MFO algorithm. Although the EMFO gained poor convergence performance on 9 benchmark functions (F1F3, F9F11, F13, F16, and F17), it obtains strong global exploration ability and achieves the best convergence accuracy. This may be because the adaptive flame number updating mechanism enhances the ability of the population to jump out of the local optimal trap. The EMFO gains poor convergence speed on the other 6 functions (F5, F7, F8, F12, F14, and F15), which could be because the EMFO needs a longer time to jump out of the local optimum. In addition, the MFO outperforms the other 6 algorithms on 5 functions (F1F3, F8, and F12), and the CMFO gains the best performance on 2 functions (F5 and F7). The LMFO is best on 3 test functions (F5, F7, and F15).
In terms of convergence speed, the EMFO is significantly speeder than MFO, AMFO, GMFO, CMFO, LMFO, and OMFO on 15, 21, 20, 20, 18, and 21 out of 25 functions. Meanwhile, the EMFO is clearly slower than MFO, AMFO, GMFO, CMFO, LMFO, and OMFO on 7, 2, 3, 3, 5, and 2 out of 25 ones, respectively. Therefore, the results of convergence speed indicate that the EMFO generates a promising convergence speed for these benchmark test functions.
4.3. Comparison Results of Time Complexity
The total comparisons of the average time complexity of 25 functions in one iteration of about eight algorithms are shown in Figure 7 in the form of a bar plot. In Figure 7, it is clearly shown that the mean CPU time of the OMFO is the best and that of the CMFO is worst. The mean CPU time of the EMFO is the fourth and only 16.476 seconds longer than the OMFO. Although the time complexity of the EMFO is not the best, it can achieve acceptable convergence speed and promising convergence accuracy.
5. The Application of Parameter Extraction of Photovoltaic Models
It is well known that solar energy is the most important renewable energy resource [45], and its main application is photovoltaic (PV) power generation [46], which is because solar energy can be directly converted into electricity by using the PV system. However, the conversion efficiency of the PV model is significantly affected by model parameters. To solve this problem, the EMFO is utilized to extract the parameters of the PV models.
5.1. PV Models and Fitness Functions
The singlediode and doublediode models [47] are the most widely used, which can explain the currentvoltage features of the PV systems. The singlediode model, the diode model, the PV module, and the fitness function are addressed as follows.
5.1.1. SingleDiode Model
The output current and voltage of the singlediode model are calculated by using the following formula [48]:where and are the output current and the output voltage of the singlediode model, respectively. and denote the series resistance and the shunt resistance, respectively, and stands for the diode ideal factor. and are the photogenerated current and the diode current, respectively. represents the junction thermal voltage, generated by using the following formula:where denotes the Boltzmann constant () and stands for the temperature of junction in Kelvin. represents the electron charge ().
The unknown parameters (, , , , and ) of the singlediode model will be extracted.
5.1.2. DoubleDiode Model
The relationship between output current and voltage of the doublediode model is described in the following formula:where denotes the current th diode, and represents the th diode ideal factor. and are the output current and the output voltage.
The unknown parameters (, , , , , , and ) of the singlediode model will be extracted.
5.1.3. PV Module
The output current and voltage of the PV module are described in the following formula:where denotes the number of solar cells that are connected in series, and is the number of solar cells that are connected in parallel. In the simulation, is set to 1, because the used PV modules are all in series. Therefore, the output current and voltage of the used PV module are represented in the following formula:
The unknown parameters (, , , , and ) of the PV module will be extracted.
5.1.4. Fitness Functions
The purpose of parameter extraction of the PV models is to minimize the error between simulated and measured current data . The absolute error current (AEC) of the individuals is calculated as follows [49].
The AEC of the singlediode model is generated by the following formula:
The AEC of the doublediode model is calculated by the following formula:
The AEC of the PV module is described in the following formula:
To quantify the overall error between the simulated and measured current, the root mean square error is utilized as the fitness function, which is represented as the following formula:where denotes the feasible solution consisted of the unknown parameters to be extracted, and indicates the number of measured current data. Furthermore, is the fitness value of feasible solution . It is clearly shown that the smaller the fitness value, the more accurate the extracted parameters.
5.2. Parameter Setting
The currentvoltage data of single (PVF1) and double (PVF2)diode models are gained from [50], measured on a 57 mm diameter commercial silicon R.T.C. France solar cell under 1000 at 33 . Three different PV modules are utilized, i.e., polycrystalline PhotowattPWP201 (PVF3), monocrystalline STM640/36 (PVF4), and polycrystalline STP6120/36 (PVF5). The polycrystalline PhotowattPWP201 is measured under 1000 at 45 [50]. The monocrystalline STM640/36 and the polycrystalline STP6120/36 are measured under 51 and 55, respectively, whose currentvoltage data are gained from [51, 52]. The feasible range of parameters to be extracted is shown in Table 3. In addition, the parameter setting of the simulation is consistent with that in Section 4.
5.3. Comparison of Solution Accuracy
The basic settings of Table 4 are the same as Table 1. From Table 4, it can be clearly seen that the EMFO outperforms 6 compared algorithms on 2 functions (PVF1 and PVF2) and provides the secondbest result on 2 functions (PVF3 and PVF5). Additionally, the EMFO obtains the fourthbest result on function PVF4. The simulation results demonstrate that the EMFO is effective to accurately extract parameters of the PV models.
5.4. The Comparison Results of Convergence Speed
In Figure 8, the vertical axis is the nature logarithm of the mean value over independent 25 runs, and the horizontal axis is the sampling point where sampling points are taken from FES = 1000 and mod (FES, 10000) = 0.
(a)
(b)
(c)
(d)
(e)
It can be clearly observed from Figure 8 that the EMFO obtains the best convergence performance on 3 functions (PVF1–PVF3) and gains the thirdbest convergence speed on 2 functions (PVF4 and PVF5). The results described above indicate that the EMFO is promising and significant in solving the parameters’ extract problems of the PV models.
6. Conclusions
To enhance the exploration ability and avoid to fall into the local trap, an enhanced MFO with multiple flame guidance mechanism is proposed in this study, named EMFO for short. In EMFO, an adaptive flame number updating mechanism is utilized to adaptively adjust flame’s number for helping the moth population escape the local optimal trap. Besides, a multiple flame guidance mechanism is designed to fully use the position information of flames, which enhances the diversity of flame guidance information and avoids premature. To verify the performance of the EMFO, it is used to optimize 25 benchmark functions of the CEC 2005, 28 test functions of CEC2017, and a realworld optimization problem, compared with the stateoftheart algorithms. The results show that the EMFO has obtained promising performance, and gained higher convergence accuracy and faster convergence speed than the compared algorithms.
In future work, the EMFO will be further tested on newer, more complex test functions and more complex application problems to verify its robustness.
Data Availability
All data used to support the findings of this study are included within the article.
Conflicts of Interest
The authors declare that there are no conflicts of interest.
Authors’ Contributions
Zhenyu Wang and Zijian Cao conceptualized the study; Zijian Cao developed methodology; Chen Liu and Haowen Jia investigated the study; Zhenyu Wang and Chen Liu prepared the original draft; Zijian Cao reviewed and edited the manuscript; Zijian Cao and Fuxi Liu contributed to funding acquisition. All authors have read and agreed to the published version of the manuscript. In particular, Feng Tian worked to publish the whole paper.
Acknowledgments
This research was partially funded by the Shaanxi Natural Science Basic Research Project (grant no. 2020JM565).