Optimal Placement and Sizing of Distributed Generators Based on Swarm Moth Flame Optimization

In order to deal with the problem of environmental pollution and energy consumption, developing clean and renewable energy to maintain the sustainable development of society has become an urgent matter for human beings. Therefore, distributed generation (DG) is widely concerned by engineers. However, the output of DG is generally random and intermittent. When it is connected to different locations, different capacities and different types of power grids, the safe and stable operation of the power system will be affected to different degrees. When selecting the optimal DG access scheme, power grid planners must consider the influence of capacity, type and location to ensure a safer, more stable, more reliable and more efficient power grid operation. Therefore, this paper proposes an objective function considering integrated power losses, voltage profile and pollution emission, and swarm moth flame optimization algorithm (SMFO) is used to solve. Finally, based on IEEE-33 bus, the effectiveness of the proposed algorithm is verified.


INTRODUCTION
Unreasonable distributed generation (DG) installation will increase the power loss of the distribution network and even lead to system instability (Gandomkar et al., 2005;Lund, 2006;Wang et al., 2014), on the other hand, increase the economic cost of grid-connection (Moradi and Abedini, 2016;Ogunjuyigbe et al., 2016;Meena et al., 2017). According to statistics, more than 80% of power failure accidents are closely related to the distribution network, so it is extremely urgent to choose an appropriate DG access way to the distribution network (Devi and Subramanyam, 2007;Mehleri et al., 2012;Paterakis et al., 2015). Therefore, it is necessary to study the optimal location and sizing of DG.
Nowadays, DG connected to the distribution network is mainly the intermittent power source whose output is related to the natural environment, such as wind power (Kansal et al., 2013;Murty and Kumar, 2015;Liu et al., 2020). The randomness of its output adds greater uncertainty to the load prediction, planning and operation of the power network, and increases the difficulty of the planning and design of the distribution network with DG (El-Zonkoly, 2011;Ameli et al., 2014;Poornazaryan et al., 2016). The problem of location and capacity of distributed power supply access to distribution network is an optimization problem that needs to consider the cooperation of multiple factors (Afzalan et al., 2012;Song et al., 2018Song et al., , 2020. Thus, it is necessary to comprehensively consider various technical indicators to obtain a practical and feasible solution in line with the planning area (Mitra et al., 2013;Naik et al., 2013;Iqbal et al., 2017). Literature (Lin and Bie, 2018) constructed a distribution network expansion planning model aiming at economic and environmental benefits. Literature (Kaur et al., 2014) proposes a method considering the load characteristics and regenerated DG probability to improve the voltage stability margin. Literature (Hung et al., 2010) proposes a location selection method based on node pricing that takes profit, network losses reduction and voltage improvement of DG as optimization objectives.
In the research of DG planning, the solution of a large number of planning models is relatively complex, so the study and selection of solving algorithms directly affect the choice of planning schemes (Gayme and Topcu, 2013;Calderaro et al., 2014;El-Fergany, 2015). At present, there are mainly mathematical optimization and meta-heuristic algorithm to solve the objective function (Zhu et al., 2006;Hedayati et al., 2008;Acharya et al., 2016). However, the mathematical optimization has been abandoned by the majority of scholars due to its low computational efficiency and only applicable to smallscale distribution networks, and meta-heuristic algorithm has been developed rapidly (Das et al., 2016;Hamida et al., 2018;He et al., 2020). Literature (Abri et al., 2013) applied genetic algorithm (GA) to optimize this problem for newly added load nodes in the expansion planning of distribution network, and then simulated annealing algorithm was used to optimize individual schemes generated in the process of genetic algorithm, thus reducing the load sizing of DG access to distribution lines and the influence of power flow of distribution network. Literature (Varesi, 2011) proposed an improved particle swarm optimization algorithm based on hybrid simulated annealing method to optimize the location and volume of distributed power supply. However, the convergence speed of the above algorithm is relatively slow, the efficiency is low, and the result is easy to appear in the local optimal situation. Therefore, an objective function considering power losses, voltage profile and pollution emission is proposed in this paper, and which is solved by swarm moth flame optimization (SMFO). Finally, the method is verified based on IEEE-33 bus, and the results verify the effectiveness of the method.
The remaining of this paper is organized as follows: section "Problem Formulation" develops the objective function. In section "Swarm Moth-Flame Optimizer Moth Flame Optimization, " SMFO is described. Comprehensive case studies are undertaken in section "Case Studies." And section "Conclusion" summarizes the main contributions of the paper.

Objective Function
DG planning is an optimization problem with multiple optimization objectives and multiple constraints. Through the study on the influence of the distribution network connected with DG, this paper takes the losses reduction index, environmental emission reduction index and voltage profile index as the optimization objectives, so as to minimize the power loss of the distribution network.

Power Losses
When DG planning is carried out in the distribution network, the corresponding network losses calculation formula should be selected according to the characteristics of load in the distribution network to be planned to calculate the active power losses of the distribution network. The connection of DG will change the power losses of the distribution network, and the change effect on the power losses is related to the grid-connected location and sizing, so the losses reduction index is established to measure the influence of DG grid-connected on the active power losses. The losses reduction index is expressed as (Home-Ortiz et al., 2019): where E P represents the power losses reduction index, P Ploss and P DGloss represent the active power losses of the distribution network before installing DG and after installing DG, respectively. The larger the losses reduction index E P is, the greater the role of DG in reducing the line losses of the distribution network after DG planning. R l is the resistance on the lth line; I l is the current on the lth line.

Environmental Emission Reduction Index
Since the vast majority of electric energy in the power grid is generated by thermal generators, power generation releases a variety of polluting gases into the atmosphere at the same time.
The three gases that are more destructive to the environment are CO 2 , NO x , and SO 2 . Because the three gases have great differences in their destructiveness to the environment, NO x and SO 2 will cause acid rain and do more serious harm to the environment, so they cannot be treated equally. Therefore, the corresponding weight coefficient is introduced into the formula to distinguish their destructiveness. Thus, the environmental protection emission reduction index can be expressed as (Varesi, 2011): where E E is the environmental emission reduction index.w C , w N , and w S represent the weight coefficients of environmental pollution of CO 2 , NO x , and SO 2 , which are set as 0.5, 0.25, and 0.25, respectively.M DGC , M DGN , and M DGS represent the quality of reducing CO 2 , NO x , and SO 2 emissions after DG planning, respectively. M PC , M PN , and M PS , respectively, represent the quality of CO 2 , NO x , and SO 2 emitted by the distribution network before installation of DG. The higher the E E is, the greater the role of DG in reducing the emission of polluting gases. In addition, Table 1 lists the emissions of three types of DG and thermal power generation (Home-Ortiz et al., 2019).

Voltage Profile Index
The voltage profile index of each node in the distribution network is an important symbol to measure the power quality of the distribution network. The addition of DG will support the node voltage. The voltage profile index is established to measure the improvement effect of DG on the node voltage profile, and its expression is as follows (Home-Ortiz et al., 2019): where, E V is the node voltage profile index. N represents the total number of nodes in the planned distribution; V Pi represents the voltage of the ith node in the distribution network before installing DG; V N denotes the rated voltage of distribution network; V DGi represents the voltage at the ith node after DG is incorporated into the distribution network. The greater the voltage profile index E V is, the greater the effect of DG gridconnection on reducing the voltage offset of each node of the distribution network.

Objective Function
where ω P = 0.5 represents the weight coefficient of the losses reduction index, ω E = 0.25 represents the weight coefficient of the environmental emission reduction index, ω V = 0.25 represents the weight coefficient of the voltage profile index. Besides, the weight coefficient can be reselected by engineers based on the actual application.

Constraint
Power Balance where P Gi and Q Gi respectively represent the active power output and reactive power output of the power supply at ith node in the distribution network. P DGi and Q DGi are, respectively, the active power and reactive power of DG output at ith node. U i is the voltage of the ith node; G ij and B ij represent the admittance and susceptance between the ith node and the jth node; θ ij is the power angle between ith node and the jth node; P Li and Q Li , respectively, represent the active power and reactive power required by the load on ith node in the distribution network (Home-Ortiz et al., 2019).

DG Sizing
Due to the limitation of the working principle, structure and production model of the production DG, and the influence of environmental factors on the operation of the production DG, the power dispatching cannot be completely controlled, which will have a great impact on the power flow, relay protection, voltage and waveform of the original power grid. Therefore, the power allowed to access the power grid DG is limited (Home-Ortiz et al., 2019).
where P iDGmin represents the minimum sizing of the DG connected by the ith node; P iDG represents the active power sent to the power grid by DG connected to the ith node; P iDGmax represents the maximum sizing of the DG connected by the ith node. P iload is the total load on the ith node.
SWARM MOTH-FLAME OPTIMIZER MOTH FLAME OPTIMIZATION Inspiration Moths, a close relative of butterflies, belong to the order Lepidoptera of the class Insects. There are many kinds of moths, but most of them are nocturnal and phototropic (Mirjalili, 2015). Therefore, there is a folk saying that "moths burn themselves in the fire," and the inspiration of the optimization algorithm of moths in the fire is also derived from the biological behavior of "moths in the fire." However, according to biologists, "moth to the fire" is not a suicide behavior, but the moth itself has a navigation mechanism. While moths have compound eyes, they have poor vision. At night, when they cannot see the road clearly, they can only determine their current position and the next direction of flight by evaluating the relative position of themselves and the light source (usually moonlight). This Orientation method is called Transverse Orientation (Yıldız and Yıldız, 2017). However, if artificial light, such as streetlights, is considered, moths are always observed approaching light in a spiral shape due to such a short distance. As shown in Figure 1, SMFO has two main features: A. Each flame is surrounded by multiple moths at the same time for greater utilization, and the flame with higher brightness (i.e., smaller fitness function) will attract more moths; B. A ring network is constructed between the flames so that moths can be guided to look for brighter flames more effectively, which may lead to broader exploration, that is, there is a higher possibility to avoid local optima.

Mathematical Model
There are two important components in SMFO, namely moth and flame. Both essentially are the solution, the difference is that the moths in the main body of the actual search algorithms of spiral flight and the flame are moths to search the optimal where I represent a function that randomly generates the position of the moth and its corresponding fitness value, and its description is shown in Equation (9). M represents the set of moth positions and OM represents the set of moth fitness values.
P represents the main function that the moth follows when flying in the search space. When the moth flies to a new position, it updates its own position and returns to M, which is described in Equation (10). In Equation (10), the updated position set of moths is represented by * M to distinguish them (Yıldız and Yıldız, 2017).
T is an end judge function that returns a Boolean value. When the return value is true, the algorithm stops running and prints the current global optimal value. When the return value is false, the function continues. Its description is shown in Equation (11): Meta-heuristic algorithm is usually initialized by random generation of population, and SMFO is no exception. Suppose M is an M by n matrix, as shown in Equation (12). Where M represents the number of individual moths and N represents the number of variables (dimensions) in the optimization problem (Abd El Aziz et al., 2017).
Meanwhile, the array OM stores fitness values corresponding to individual moths, as shown in Equation (13). M is the number of moths.
The SMFO has another important component, the flame. It is also assumed that F is an m * n matrix for storing the flame, as shown in Equation (14). Where M represents the number of individual moths and N represents the number of variables (dimensions) in the optimization problem.
Similarly, an array OF stores the fitness value corresponding to flame F, as shown in Equation (15). Hence, the brightness of each flame may be calculated based on the normalization of their fitness functions, as follows: where BF i denotes the brightness of the ith flame, OF i represents the fitness function of the ith flame. In SMFO, a brighter flame (which has a smaller fitness function) will attract more moths than those of its adjacent flames via the ring network. The comparison of each flame's brightness and movement of moths to a brighter flame usually leads to a continuous variation of population size of each moth swarm to achieve a wider exploration. However, the participation of too many flames for moth swarm attraction may result in a local optimum. Based on the above, the brightness of a flame is compared with that of only two adjacent flames in SMFO, and thus a proper trade-off between a wider exploration and deeper exploitation may be obtained through construction of a ring network among all flames. For the pth individual of the ith moth swarm, it will immigrate to its adjacent moth swarm, i.e., the (i−1) moth swarm or the (i+1) moth swarm, according to their brightness.
A moth will gradually approach to the corresponding flame with a logarithmic spiral, which may be calculated as (Abd El Aziz et al., 2017): In the process of SMFO search, moths individual M i is a phototropism, will lock the flame F j the flight movement of conforms to logarithmic spiral function, began to the location of the screw flight behavior is moths the current position, end position is the position of the fire, at the same time in the process of flight moths can't fly out of the specified area (the search space),  description of the process is using a mathematical formula (Yıldız and Yıldız, 2017): where M i is the ith a moth individual, F j is the jth flame. D pi is the distance between the pth moth and the ith flame in the ith moth swarm. b is the spiral shape constant determining the shape of the logarithmic spiral, and distance coefficient r is a random number uniformly distributed in [−1, 1]. In addition, individual optimization track is shown in Figure 2.

CASE STUDIES
In this paper, IEEE-33 bus is selected to verify the effectiveness of the algorithm, and the topology structure of the system is shown in Figure 3. The system consists of 32 branches. In addition, the system voltage U N = 12.66 kV, the base capacity S b = 10 MW, the active load P = 715 kW, the reactive load Q = 450 kVar. Proposed project: three types of DG are connected in IEEE-33 bus, that is photovoltaic (PV) station, wind turbine and micro turbine. In addition, GA is used in this paper for comparison. In order to make a fair comparison, the population size of the two algorithms is set as 50 and the maximum number of iterations is 80. And the proposed method was coded in MATLAB 2017b. Figure 4 shows the convergence curves of the four algorithms. It can be seen that SMFO has an excellent search mechanism and can converge to the minimum value with fewer iterations to avoid falling into the local optimum. Table 2 for both algorithms after 100 iterations run results, as you can see, after installing DG, can reduce the power losses of system to some extent, the obtained high economic benefits, among them, SMFO to obtain the total power consumption of the prior to the introduction of DG decreased by 58.63%, and obtain the total power consumption of the GA was down 36.63% from before the installation of DG, thus, SMFO has strong search result, better quality can be acquired in less number of iterations of the solution. In addition, Figure 5 shows the voltage profile curves of the two algorithms with and without DG installation, which effectively proves that DG has a significant optimization effect on improving the voltage profile of the distribution network, because DG is always installed near the load.

CONCLUSION
In this paper, SMFO is used to optimize the location and sizing of DG, and its contributions are as follows: 1. The objective function with three indexes of distribution network losses reduction index, voltage profile index and environmental emission reduction index is established to optimize the distribution network comprehensively; 2. Through IEEE-33 bus test, it is effectively verified that SMFO has a strong global search effect and convergence ability, and can avoid falling into local optimum under complex objective function; 3. After installing three types of DG, PV station, wind turbine and micro turbine, the connection of micro turbine can stabilize the instability of PV station and wind turbine. The results show that the power losses of the distribution network optimized by SMFO decreases by 50.37% and GA decreases by 45.37%, which effectively verifies the effectiveness of the algorithm. Besides, voltage profile is significantly improved.
In the future, a more advanced multi-objective decision making method will be used to solve this problem.

DATA AVAILABILITY STATEMENT
The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author/s.

AUTHOR CONTRIBUTIONS
ZT: conceptualization, data curation, methodology, and writing-original draft. MZ: formal analysis, visualization, and resources. LS: writing-review and editing.