Research on Two-Level Energy Optimized Dispatching Strategy of Microgrid Cluster Based on IPSO Algorithm

This paper considers the economy and stability of the microgrid cluster system, and proposes a two-level energy optimization dispatching strategy for the microgrid cluster, which aims to coordinate the economic benefits and operational risks of the microgrid while reducing the interactive power and fluctuations between the microgrid cluster and the distribution network, and reduce line loss. The first level takes the microgrid as the research object, takes the highest economic benefit and the lowest operational risk as the optimization goals, uses the improved PSO algorithm to solve the problem, and builds the unit risk-economic benefit ratio screening solution set, and then formulates the internal dispatching candidate strategy of the microgrid. The second level is based on the premise that the interactive power between the microgrid cluster and the distribution network is minimized, and the optimal internal dispatching strategy of each microgrid is determined. Then the line loss of the microgrid cluster system is considered, and the microgrid cluster energy complementary scheme is formulated. Finally, a practical example verifies the feasibility and effectiveness of the two-level dispatching strategy and the improved algorithm.


I. INTRODUCTION
In recent years, the use of renewable energy to replace traditional fossil energy and distributed power generation as a supplement to traditional centralized power generation has become an important transformation direction for the development of the energy and power industry [1]- [3]. However, power generation from renewable energy sources such as wind turbines and photovoltaics has greater volatility and uncertainty. If it is directly connected to the power system for operation, it will cause a greater impact on the operational stability of the system [4]- [6]. Microgrid is an effective way to consume and manage renewable energy, and it can coordinate distributed power sources, energy storage systems, and loads to achieve the goals of improving energy utilization efficiency and reducing polluting gas emissions [7]. However, a single microgrid has shortcomings such as limited capacity and The associate editor coordinating the review of this manuscript and approving it for publication was Subrata Banerjee . weak anti-interference ability. Microgrid cluster [8]- [11] can increase the penetration rate of distributed power generation through the coordinated operation and energy complementation between internal sub-microgrids, and realize the efficient use of renewable energy. Compared with a single microgrid, the power coordinated control of a microgrid cluster is more complicated.
Studying the energy dispatching of microgrid clusters is of great significance to realize the promotion and application of microgrid clusters in power systems. [12] established different distributed power models in the microgrid, and proposed an optimized dispatching method for microgrid clusters from the perspective of centralized control. [13] established an interactive optimization model for multi-microgrids based on the multi-agent system architecture, took into account the different operating states of each microgrid, optimized the output of each microgrid and distributed power sources, and adopted a particle swarm optimization algorithm to solve the problem. [14] aimed at the multi-level microgrid cluster system in grid-connected operation, with the goal of minimizing the total operating cost, constructed a multi-time scale microgrid cluster energy management optimization model, and performed static optimization of the microgrid operation based on forecast data a few days ago. Although the economic benefits of the microgrid cluster have been improved, the reliability of power supply has been neglected. The abovementioned researches all use centralized optimization methods to solve the problem. The upper-layer control center obtains the operating status and information of the entire system and makes unified decisions. Therefore, the demand for the communication system is high and the reliability is poor. [15], [16] studied the energy management methods of microgrid clusters from the perspective of distributed control. [17] proposes a novel energy management framework based on tube-based model predictive control for microgrid clusters, which can be robust to system uncertainties in energy dispatching strategies. But its framework is only suitable for off-grid microgrid clusters. [18] solves the power sharing problem in a networked hybrid AC/DC microgrid cluster by using back-to-back converters. Both AC and DC microgrid clusters adopt hierarchical distributed collaborative control strategies (internal microgrid control), but this model is only applicable to independent microgrid systems. [19] uses a two-level optimization decision-making model to solve the interactive optimization problem after multiple microgrids are connected to the active distribution network, and uses an improved hierarchical genetic algorithm to solve the problem. Through the interaction of multiple agents, the economics, power quality, operational reliability and environmental protection benefits of the system are improved. [20] draws on the prospect theory to deal with the power exchange coordination problem between multiple microgrids, and analyzes the influence of the target weights of users and operators on the game effect. [21] proposed a multi-microgrid distributed energy management system architecture to solve the coordinated operation of interconnected wind, solar, and biomass microgrid systems, and built a solution algorithm based on the multi-microgrid-multi-energy coupling matrix and distributed stochastic programming methods. Most of the research at this stage only focuses on the internal dispatch of the microgrid or the coordinated dispatch of the microgrid cluster. However, there are interactions and influences among multiple microgrid power generation plans. Therefore, the energy dispatching optimization model that takes into account different goals within and outside the microgrid has practical application value. And there are few studies to establish a quantitative description model of the relationship between risk and economy in order to achieve the optimal balance result.
Based on the existing research, this paper proposes a twolevel energy optimization dispatching strategy for microgrid cluster, which can ensure the stability of microgrid cluster while taking into benefits of microgrids. The first level takes the microgrid as the research object, and establishes an optimization model with the highest economic benefits and the lowest operating risk as the goal. And by improving the PSO algorithm to solve the problem, by constructing the unit risk-economic benefit ratio screening solution set, and formulating the initial internal dispatching strategy of the microgrid. On the basis of the first level, the second level aims at the minimum PCC power and its fluctuations, and establishes an optimization model. After obtaining the best internal dispatching strategy for each microgrid, with the goal of minimizing the line loss of the microgrid cluster system, the energy complementary scheme between microgrids is formulated.

II. TWO-LEVEL OPTIMIZATION MODEL ESTABLISHMENT
The first level adopts the CVar model to evaluate the operation risk caused by the load shortage and the new energy surplus electricity, and combines the new energy consumption and the income from the sale of electricity to establish a microgrid economic benefit-risk model. In order to make full use of the complementary advantages of energy and avoid long-distance grid-connected transmission of fluctuating energy, the second level considers the interactive power between the microgrid cluster and the distribution network, as well as the line loss of the microgrid cluster system, and establishes an optimization model.
where F 1 is the economic benefit of the microgrid. C 1 and C 2 are the income from new energy consumption, and income from surplus electricity, respectively. C DG and C Grid are the fuel cost of diesel generators and the cost of electricity purchased from the first-level grid, respectively.
where P 1 and P 2 are the new energy power consumed by the load and the surplus electricity power on-grid, respectively. P Grid is the input power of the external grid. price 1 and price 2 are the time-of-use electricity price and the new energy feedin tariff, respectively.

2) OBJECTIVE FUNCTION 2: THE LOWEST OPERATION RISK INDEX
The main risks of microgrid operation are load shortage risk and renewable resources overflow risk. Because the randomness of wind, light resources and load brings errors to source load forecasting, this paper incorporates the forecasting error into the objective function through operational risk index, and VOLUME 9, 2021 describes the probability distribution of the microgrid forecasting error with a Gaussian probability density function.
where F 2 is the risk index of microgrid operation. W 1,CVaR and W 2,CVaR are functions of load loss risk and new energy overflow risk respectively.
where W 1 and W 2 are the penalty functions for load shortage and new energy overflow, respectively. P loss and P overflow are load loss power and new energy overflow power, respectively. f (P loss ) and f (P overflow ) are the probability density functions of load and new energy based on Gaussian forecast errors, respectively. α is the confidence level of the occurrence of the risk, taking 0.95. β 1 and β 2 are the penalty coefficients for load lack of electricity and new energy overflow, respectively, taking 0.15 and 0.03. In summary, in the first level of optimization, the output power of the distributed power sources and energy storage systems of each microgrid is used as the decision variable. Defined the multi-optimization goals of the maximum benefit and minimum risk of the microgrid, calculated the hourly benefits and risks in a 24-hour period of 1 day, and established the internal energy dispatch of the multi-objective microgrid. Conditions such as power balance constraints and distributed energy output constraints of each microgrid constitute the constraints of the microgrid-level optimization model.

3) CONSTRAINTS
Total power balance constraint of microgrid: where P Load , P Bat , P WT , P PV are the power of microgrid load, storage battery, wind power, and photovoltaic respectively. Power constraints of diesel generators: where P max DG and P min DG are respectively the upper and lower limits of the output of diesel generators.
Distributed electric element climbing power constraint: where P max Gi , P min Gi are the upper and lower limit values of the output of each unit, including P WT , P PV , P DG , P Bat , P Grid . Energy storage constraints: where SOC max t and SOC min t are the maximum and minimum state of charge. P max Bat and P min Bat are the maximum and minimum power of the battery.
Tie line power constraints: where P max Grid and P min Grid are the maximum and minimum power allowed to be transmitted between the microgrid and the outside.

B. OPTIMIZED DISPACHING MODEL OF MICROGRID CLUSTER 1) OBJECTIVE FUNCTION 1: MINIMIZE THE PCC INTERACTIVE POWER AND ITS FLUCTUATION
In order to reduce the impact of the microgrid cluster system access on the stability of the distribution network, the PCC exchange power is used as the decision variable, and the objective function is to minimize the PCC interaction power and its fluctuations. In order to reduce the impact of renewable energy grid-connection on the distribution network. The mathematical expressions of the interactive power and fluctuation of the microgrid cluster system and the distribution network are as follows: where P i,t Load is the total load of microgrid i in time t. P i,t WT , Bat are respectively the output of wind power, photovoltaic, diesel generator, and battery in time t.
where P i,t PCC is the PCC interactive power of microgrid i in time t.
Considering that the units of the two objective functions are the same, the linear weighting method is used to transform the multi-objective optimization problem into a single-objective optimization problem. The mathematical expression is: where µ I and µ f are the weight coefficients of the objective function.

2) OBJECTIVE FUNCTION 1: MINIMIZE LINE LOSS
Since long-distance distribution paths will cause power transmission loss, it is necessary to reasonably plan the energy complementation between microgrids to avoid the situation where the PCC power change rate is not high, and the actual power interactive transmission is frequent and wasteful. Taking the minimization of formula (18) as the goal, the energy complementation between microgrids is optimized and planned.
where F 4 is the line loss of the microgrid cluster system. L and T are the number of branches of the microgrid cluster system and the length of the scheduling period. R l is the impedance value of the corresponding branch, and P l,t , Q l,t , V l,t are the active and reactive power and voltage values of the corresponding branch.

3) CONSTRAINTS
Power balance constraints: PCC interactive power constraints: where P i,t max PCC and P i,t min PCC are the upper and lower limits of the interactive power, respectively.
Considering the load flow constraints of the microgrid cluster system, for the radial microgrid cluster network, the branch load flow model is: where P ij and Q ij are the active power and reactive power flowing from node i to node j on lines i-j, respectively. r ij and x ij are the resistance and reactance of line i-j, respectively. P j and Q j are the injected active and reactive power at node j.
The node voltage of each microgrid should meet: where V i,max and V i,min are respectively the upper and lower limits of the node voltage of i-th microgrid.

III. MODEL SOLVING METHOD
In this paper, an improved particle swarm algorithm is used to solve the multi-objective model of the microgrid, and the unit risk-return index is constructed to further filter the solution set. Then the PCC power and its fluctuation are minimized as the goal to obtain the internal dispatching plan of the microgrid. With the goal of minimizing the line loss, the net power complementary scheme of the microgrid cluster is obtained.

A. TWO-LEVEL OPTIMIZATION STRATEGY PROCESS
In the multi-objective optimization model of the first-level microgrid, the optimal solutions of the two types of objective functions are not unified, and there are contradictions between economic benefits and risk indicators. Therefore, the first-level model is a nonlinear problem. Therefore, an improved PSO algorithm is used to solve the problem. At the same time, the surplus power of the microgrid means that the risk of new energy overflow occurs, and the purchase of electricity from the grid means the risk of load shortage. The quantitative relationship between economic benefit and risk is described by building the unit risk-economic benefit ratio, as shown in formula (25).
In the calculation results, the solution with the lowest γ value is selected to avoid the situation of low profit and high risk. According to the screening results, the internal energy dispatching plan of the microgrid is formulated, which is also a candidate strategy for the second level optimization.
In the second level of optimization, firstly, by formula (17) the PCC power and its fluctuation are minimized as the goal, and the best net power combination is obtained from each microgrid candidate dispatching plan. At the same time, the final internal dispatching plan of each microgrid was determined. Then through formula (18), with the lowest line loss of the microgrid cluster system as the goal, the net power complementary scheme of the microgrid cluster with lower energy loss is obtained. The two-level optimization process of microgrid cluster energy dispatching strategy is shown in Figure 1.

B. IMPROVED PARTICLE SWARM OPTIMIZATION ALGORITHM
Optimal dispatch of microgrid has the characteristics of high dimensionality, nonlinearity, and multiple constraints. Compared with algorithms such as genetic algorithm and artificial neural network, the particle swarm algorithm is outstanding in the global optimization problem of nonlinear problems, and its robustness is strong. It can achieve high accuracy and convergence speed for solving specific engineering problems. At the same time, it is easier to apply when solving optimization problems. Therefore, the first-level microgrid optimization model is solved by particle swarm optimization. Based on the fuzzy optimization theory, the maximum fuzzy satisfaction method is used to transform the multi-objective optimization problem into a non-linear single-objective optimization problem, and the improved particle swarm optimization algorithm combined with the tabu search idea is used to optimize the solution.

1) FUZZY MODEL ESTABLISHMENT
First determine the membership function. In this paper, the descending half-linear is used as the membership function for the multi-objective optimization of the microgrid, and then the fuzzy membership variable λ is introduced. According  to the principle of maximum membership, the fuzzy nonlinear multi-objective optimization problem is transformed into a single-objective optimization problem. The membership function is shown in formula (26).

2) MICROGRID MODEL SOLUTION
The particle swarm optimization algorithm (PSO) has strong robustness when calculating nonlinear optimization problems, and at the same time requires relatively low initial value, but its local search ability is poor, and premature convergence is prone to occur. The tabu search algorithm (TS) has a good local search ability, and it can jump out of the local optimal solution when searching, but it has relatively high requirements for the initial value, and the quality of the initial value directly affects the efficiency of the tabu search. Therefore, this paper uses the complementarity of TS and PSO to propose an improved particle swarm optimization algorithm combined with the idea of tabu search to solve the multi-objective optimization problem of microgrid. The algorithm flow chart is shown in Figure 2.

IV. SIMULATION ANALYSIS A. OVERVIEW OF THE EXAMPLE SYSTEM
This paper takes the Mao'er Hill Microgrid Cluster Demonstration Project in Guangxi Province, China as an example for    simulation analysis. Mao'er Hill is located in the northwest of Xing'an County, Guilin City, Guangxi Province. It belongs to mountainous terrain. At present, the electricity load in the area is mainly hotels, tourist centers, residential areas, etc. The structure of the microgrid cluster is shown in Figure 3, and the detailed configuration and unit parameters are shown in Table 1 and Table 2, respectively. The electricity price of new energy is 0.04 $/kW·h, and the electricity purchase cost is shown in Table 3.
The internal energy optimization dispatching of the microgrid selects MG1 for analysis. The main parameter values of distributed power sources are shown in Table 4. The upper and lower limits of the node voltage are 1.1 and 0.9 respectively. The maximum power of the tie line is 100kW. SOC max = 80%, SOC min = 20%. The source-load power prediction error of MG1 on a summer day is shown in Figure 4. When the IPSO algorithm is used to optimize the solution, the maximum number of iterations is 200, and the calculation result is an average of 30 times.

B. ANALYSIS OF OPTIMIZATION RESULTS
The IPSO algorithm is used to solve the internal energy optimization scheduling model of the microgrid, and 15 solutions of the maximum and minimum γ are selected from the obtained solutions, as shown in Figure 5. γ greater than 1 indicates that the risk is greater than the benefit. For example, the income from new energy consumption and the income from surplus electricity cannot make up the cost of purchasing electricity from the upper-level grid.
When γ min = 0.688 and γ max = 1.289, the corresponding net power of the microgrid is shown in Figure 6. From 13:00 to 18:00, in the γ max scheme, the generator provides power for the load, which increases the surplus power to the grid, so its electricity sales income is greater than the γ min scheme, but the diesel generator cost is greater than the electricity sales income, which results in the actual total revenue being less than the γ min scheme. Therefore, to increase the revenue of the microgrid, it is necessary to consider not only the revenue from the surplus power, but also the fuel cost of diesel generators, the revenue of new energy consumption, and the cost of power purchase from the superior grid.  When γ min = 0.688, formulate the day-ahead optimized dispatching plan for MG1, as shown in Figure 7. It can be seen that due to the time-of-use electricity price, the electricity price is lower from 00:00 to 06:00, so the priority is to purchase electricity from the upper-level grid. From 06:00 to 10:00 (and from 20: 00 to 00:00), the electricity price is high, so the distributed power output in the system increases, reducing the purchase of electricity from the upper-level grid to reduce the operating cost of the microgrid. From 10:00 to 17:00, PV and WT power generation surplus are large, and the load first consumes new energy power generation. After the new energy generation meets the load demand, the battery is charged, or the surplus power is sold to obtain income. From 17: 00 to 20: 00, the night load is mainly met by wind power, diesel generators and power purchase from the grid, and the battery is used to flexibly respond to WT power fluctuations and maintain system stability.
Under the respective γ min schemes, the net power after MG1∼MG4 optimized dispatching is shown in Figure 8. Among them, MG1 and MG2 have a relatively high photovoltaic power generation surplus, which can be used to feedin grid. MG3 and MG4 are mainly manifested in obtaining energy from the distribution network. Through complementary power, each microgrid can obtain support from other microgrids, and can sell surplus power to the outside, improving the economy and reliability of its own operation. Figure 9 shows the convergence curves of the improved particle swarm optimization algorithm (IPSO) proposed in this paper, the standard particle swarm optimization algorithm (PSO), and the tabu search algorithm (TS) for the optimization of the first-level objective function. It can be  seen from the figure that after adopting the IPSO, the economic benefits of the microgrid have been improved, and the operating risk index of the microgrid have been reduced, thus proving the effectiveness of the improved algorithm.
In the pareto solution set of each microgrid, three groups of dispatching schemes with the smallest γ value are selected to provide candidates for the second-level dispatching. The risks and economic benefits of each scheme are shown in Table 3. Among them, MG1 and MG2 have a relatively high photovoltaic power generation margin, and can be fed-in grid, so the income is relatively high. The economic benefits of MG3 and MG4 are low, and the risk-economic benefit ratio is also higher than that of MG1 and MG2. Therefore, MG3 and MG4 mainly have the risk of load shortage. The increase of load shortage will increase the power purchase cost of the microgrid and decrease the profit, which in turn will increase the value of γ keep rising.
Each net power combination includes 4 microgrids, and each microgrid only selects the net power characteristic curve corresponding to one internal dispatching scheme. F 3 minimization is the optimal combination scheme for the microgrid optimized dispatching strategy. The net power curve  corresponding to the backup dispatching strategy shaded in Table 3 is the optimal dispatching scheme combination of the microgrid cluster. Figure 10 shows the PCC power curve obtained from the γ min microgrid net power curve in Figure 8 and the PCC power curve corresponding to the optimal net power combination scheme. According to Figure 10, the comparison shows that the Peak cut effect after selecting the optimal combination is more obvious. Compared with the γ min scheme of each microgrid at the first level, the total economic benefit is reduced by 1.57%, but the PCC power index F 3 is reduced by 28%. Indicating that the method in this paper can effectively reduce the interactive power and fluctuations between the microgrid cluster system and the distribution network, and reduce the impact of microgrid cluster on the operation of the distribution network. From 10:00 to 17:00, the optimal scheduling combination can greatly improve the PCC power fluctuation. During this time period, photovoltaic power generation is sufficient and concentrated. After the wind and solar power generation meets the internal demand of the microgrid, there is still surplus power that can be connected to the internet. By selecting the best net power combination, due to the low power interaction cost between microgrids, the internal power generation of the microgrid cluster can be complemented at a lower price, making full use of the power generation resources of each microgrid, and reducing the cost of some microgrids. It reduces the power purchase cost of some microgrids, and also reduces the PCC's surplus power, making the power curve flat.
In the strong time period of wind and solar power generation (from 10: 00 to 17: 00, 21: 00 and 24: 00), the optimal net power optimization combination is used for power complementation. In order to make the dispatching model more suitable for the usage scenarios, this paper adopts the strategy of preferential energy complementation between the closer microgrids. The energy complementation scheme for the main time period of the microgrid cluster is shown in Figure 11 (for example, P1G is the power delivered by the distribution network to MG1, and a negative value indicates that the microgrid sells electricity to the distribution network through PCC). It can be seen from Figure 3 that the distance between MG1 and PCC is the closest. After MG1 supplements the power of the microgrid cluster, the surplus power is transmitted to the distribution network. MG2 is the farthest from the PCC, and MG2 has a photovoltaic power generation margin. Therefore, when performing power interaction, priority is given to absorbing MG2 surplus electricity between microgrids. From 10: 00 to 17: 00, the surplus power of MG1 and MG2 should be given priority to meet the load shortage of MG4 and MG3. After 18:00, the internal dispatching power of the microgrid cluster is insufficient, and the power distribution network is needed for assistance. Priority is given to MG2 and MG3, which are farther apart, and the remaining load shortage is supplemented by the distribution network. Figure 12 shows the line loss before and after the microgrid cluster energy optimization and complementation. It can be seen from the figure that the line loss has been reduced after the energy complementary scheme is adopted, especially during the peak load period, the effect is more obvious. In the case of high power generation from new energy sources, the line loss index F4 has been reduced by 26%. Each microgrid can interact with neighboring microgrids from near to far according to its own operational needs and economic goals. Through the coordination and complementarity between multiple microgrids, the full utilization of power generation resources in the microgrid can be realized. The loss of microgrid clusters and distribution lines is reduced, and energy transmission efficiency is improved.
Under the proposed strategy, the frequency stability analysis is carried out by taking the interconnected MG2 and MG3 as an example. Each microgrid controller provides a frequency reference value by controlling the output active  power of the energy storage device, and coordinately controls each micropower source and load to maintain the microgrid frequency stability. It can be seen from Figure 13 that when the MG3 wind power output decreases, the MG2 frequency remains stable. The frequency of MG3 remained stable when the load of MG2 surged. When the photovoltaic output of the two microgrids both increase, the frequency increases. When the MG2 load is cut out, the MG3 frequency remains at a normal value, and MG2 restores the frequency stability by adjusting the internal micro power supply. Therefore, considering the intermittent characteristics of the power supply and the uncertainty of the load, each microgrid adjusts the internal micropower supply and the load to restore frequency stability, and the microgrids will not affect each other.

V. CONCLUSION
This paper proposes a two-level energy optimized dispatching strategy for microgrid clusters. The first level aims at the highest economic benefit and the lowest operational risk of the microgrid. The microgrid optimization model is established and solved by the IPSO algorithm. According to the constructed risk-economic benefit ratio, the solution set is selected and the microgrid optimal dispatching candidate strategy is formulated. The second level takes the minimum PCC power and its fluctuation as the goal. After obtaining the optimal internal dispatching strategy of each microgrid, the minimum line loss of the microgrid cluster system is taken as the goal is to formulate an energy complementary scheme between microgrids. The results show: 1) The two-level energy optimized dispatching strategy proposed in this paper not only takes into account the balance of the first-level microgrid's profit and risk, but also ensures the stability and reliability of the second-level microgrid cluster, and reduces the line loss.
2) The improved multi-objective particle swarm optimization (IPSO) solves the problems of poor local search ability of the PSO algorithm and prone to premature convergence. It is used to solve the optimization model of the microgrid and improves the accuracy of the objective function.
3) The microgrid cluster energy complementary scheme proposed in this paper has certain practicability, promotes the efficient consumption and utilization of renewable energy and distributed power, and has broad application prospects.
The interconnection of multiple microgrids may cause voltage quality problems such as voltage harmonics and three-phase unbalance. In the future, voltage quality problems can be studied on the basis of this research.