Research on Renewable Energy Planning Considering the Flexible Region of the Microgrid

: A microgrid can e ﬀ ectively improve the system reliability of a distribution network. When a fault occurs, the microgrid only has a determined division scheme under a ﬁxed boundary method, and it is di ﬃ cult to adapt to the random load and distributed power. In this paper, a novel renewable energy planning method considering the ﬂexible region of the microgrid is proposed. Based on the randomness of the load and the output of distributed generations (DG) in the microgrid, the dynamic division method of the microgrid is proposed and the optimal allocation model of the distributed energy in the microgrid is established. Further, the model and method proposed are veriﬁed by the IEEE-33 bus test system. The simulation results show that the allocation of renewable energy in the microgrid considering the ﬂexible region of the microgrid can e ﬀ ectively increase the utilization of renewable energy and improve the reliability of microgrid operation.


Introduction
With the development of human society, energy consumption has increased year by year. The consumption of fossil energy directly leads to an energy crisis and environmental protection problems. The application of renewable energy in a microgrid can effectively alleviate fossil energy consumption and reduce the environmental pressure. A microgrid is an effective strategy to cope with these two challenges [1]. Meanwhile, due to the intermittence and volatility of renewable energy, energy storage [2,3] and demand side response, resources are needed in the microgrid to reduce the adverse effect on renewable energy in the distribution network. Therefore, how to allocate renewable energy in the microgrid has become an urgent problem to be solved.
In the existing research, the configuration of distributed energy in the microgrid has different objectives, such as economic, reliability, security and stability objectives. The authors of [4] established a life cycle adaptive optimal configuration scheme of a microgrid based on the economic objective and analyzed the sensitivity of key factors that determined the influence degree on the optimization results. The microgrid can operate in two ways: grid-connected operation and isolated network operation. The existing researchers also studied the optimal allocation of distributed energy in the microgrid under the two different operation modes. Under the grid-connected operation mode, the authors of [5] proposed two business models for the capacity configuration of a grid-connected microgrid, referring to the existing distributed photovoltaic operation mode, and optimized the wind/solar/storage configuration in the microgrid with the objectives of economy, reliability and renewable energy utilization. For the distributed energy configuration in the microgrid under the isolated network Appl. Sci. 2020, 10, 7544 2 of 14 operation mode, the authors of [6] established an optimization model of the microgrid economy, considering various elements, and studied the optimal of the capacity configuration of the distributed power supply in the microgrid on the independent island. Meanwhile, due to the access of distributed energy, the operation efficiency of the microgrid can be improved by the optimal configuration of the distributed energy and the management of the demand side. The authors of [7] studied the bi-level optimization configuration method of an AC-DC microgrid considering the operation optimization of the microgrid, the distributed power generation and the demand side response to improve the economy and stability of the microgrid, and analyzed the influence of the intermittence and uncertainty of renewable energy generation on the optimal allocation of the microgrid. The distribution network planning in the market is more difficult than that in the monopoly mode [8]. Demand side response is an effective means of load regulation under the market mechanism. Demand side response refers to the user's response according to the current electricity price or incentive mechanism, so as to change the original power consumption mode and meet the demand of the power grid. It is verified that the demand side response can effectively reduce the power grid cost and save energy consumption in [9].
The existing configuration method of distributed generation in the microgrid is based on the definition of a microgrid by the U.S. Department of Energy. According to the definition, there are four characteristics for a microgrid: it has a clear electrical boundary, it is a single controllable whole, it can connect with the large grid or operate isolated and it contains distributed power and load. A clear electrical boundary can ensure that each microgrid is controlled as a whole to keep the power balance of the load and the distributed generation. In the existing research, most of the research on microgrids is based on the fixed boundary, so that the configuration of distributed generation in the microgrid can guarantee the power balance between the power and load of each microgrid in the distribution network. However, the power balance ensures the optimal operation of a single microgrid, which does not mean the overall optimal operation for microgrids. Such a fixed boundary microgrid division method does not consider the impact of different microgrid divisions' schemes on the distribution network. Compared with the fixed boundary division method of the microgrid, the dynamic boundary division method of the microgrid can dynamically adjust the boundary of the microgrid according to the real-time operation mode of the load and renewable generation. By optimizing the boundary of each microgrid, the power balance between the output power and load power in each microgrid can be realized. The boundary of each microgrid in the distribution network can also be adjusted accordingly after greatly adjusting the operation mode of the system. Therefore, how to determine the dynamic boundary of microgrids to realize the optimal operation of microgrids is an urgent problem.
At present, there is little research on the dynamic boundary of microgrids. A flexible virtual microgrid boundary model is proposed in [10] to meet the self-sufficiency of the microgrid adaptively, which effectively solves the self-sufficiency problem of microgrids. The authors of [11] proposed a flexible microgrid demarcation method to improve the reliability model of the distribution network, which meets the interests of power companies and users. In [12], a dynamic microgrid boundary and a distributed synchronous generator are used to realize fault isolation and load recovery. In [13], a bi-level programming model is proposed, which uses the feature decomposition in the distribution network spectrum to determine the boundary of the microgrid. In the above research, the dynamic boundary method of the microgrid is used in the reliability evaluation of the distribution network with multiple microgrids. However, the allocation of renewable energy in the microgrid considering the dynamic boundary has not been reported, and the demand side response in the microgrid is not considered in the boundary division of the microgrid. Such configuration methods will lead to a high cost of the energy storage configuration in the microgrid and will affect the overall feasibility of the configuration scheme.
This paper studies the coordinated allocation of renewable energy considering the flexible region of the microgrid. The construction and operation cost of the microgrid can be reduced and the operation efficiency of the microgrid can be improved by the coordinated configuration of renewable energy considering the flexible region of the microgrid and the demand side response. The definition and Appl. Sci. 2020, 10, 7544 3 of 14 division method of the flexible region of the microgrid are introduced in the second chapter. The third chapter introduces the models of wind power generation, photovoltaic, energy storage and demand side response in the microgrid. Based on these models, the optimal allocation model of wind turbine, photovoltaic power generation and energy storage considering the flexible region of the microgrid and demand side response is proposed and solved. Finally, the model and calculation method proposed in this paper are verified by a test system.

Dynamic Boundary of the Microgrid
A dynamic microgrid can be defined as a "microgrid whose boundary can expand or contract, that is, when the operation mode of distribution network changes, the balance between generation and load can be maintained at any time".
From the above definition, when the local available generation capacity and load provided by distributed generations (DG) are unbalanced, more DG need to be added to the microgrid. In order to realize the dynamic adjustment of the microgrid boundary and ensure the final stability of the system, each node must be controlled by an agent. In this way, the size of the microgrid can be adjusted by the agent to control whether the corresponding node is connected to the microgrid, so as to maintain the local generation load balance. A controllable switch needs to be installed on the cache node to make the microgrid run in a specific time. However, this will make the power system operation more complex and increase the cost greatly.
Considering the purpose of the dynamic boundary division of the microgrid in this paper, the dynamic boundary of the microgrid can be defined as, "in order to ensure the real-time balance between the available generation capacity and load demand in the microgrid, the boundary of the microgrid can be dynamic adjusted with the change of system operation mode by controlling the line breaker or tie line breaker in the microgrid", in this paper.
Considering that the power generation resources in the distribution network are limited, to suppress the disturbance propagation and reduce the uncertainty of the distribution network on fault and supply-demand balance, microgrid operation is formed in emergency, thus improving the power supply quality of the power grid in case of a disturbance. In this paper, a dynamic boundary microgrid is proposed to ensure the power supply of load nodes. A microgrid containing more DG can provide more reliable power supply services, however, the users' requirements for reliability limit the size of the microgrid. Therefore, the size of the microgrid depends on the tradeoff between the controllability and power supply reliability of the microgrid [14]. Considering all possible operation modes in the distribution network, the boundary of the dynamic microgrid is controlled according to the uncertainty of the load and DG. Under different operation modes, the microgrid can be divided into a smaller microgrid, or parallel operation can form a larger microgrid. In the distribution network considering the dynamic boundary division of the microgrid, a disconnector and circuit breaker can be used to optimize the dynamic boundary of the microgrid while isolating the fault [15,16].

Demand Side Response Model
Demand side response can adjust and change the load through response mechanisms such as price or incentive. The total power consumption of the transferable load remains unchanged during the transfer period, but users can delay or move forward the load time, which can reduce the peak valley difference of the load. The demand side management can shift the peak load to the off-peak period, which can not only save the power cost, but also relieve the load pressure of the power grid. The demand side response scheme in this paper is mainly based on the response to the node price and the load level of the distribution network itself.
In this paper, the operation objective of the demand side response is to make the load demand of the microgrid fit the distributed generations in time sequence and apply renewable energy as much as possible. Therefore, the demand side response model can be expressed as follows: where T is the dispatching cycle, which is generally set as 24 h; P Wind (t), P PV (t), P ES (t) and P G (t) are, respectively, the output power of wind, photovoltaic, energy storage and oil generator, in the period t; and L befo (t), L SLin (t) and L SLout (t) are, respectively, the load after response, the load in and the load out of demand side in the period t.
The transferable load model adopted in this paper is as follows: where N SL is the total number of translatable load types; N SLa is the number of translatable load types whose operation duration is greater than one scheduling period; h max is the maximum power supply duration of the translatable load unit; x k (t) is the number of units transferred in by the class k load in period t; y k (t) is the number of units transferred out by the class k load in period t; and P l,k is the power of the class k translatable load in the working period l. Among them, 0 ≤ k ≤ N SL . In the microgrid, the demand side response scheme in this paper is mainly based on the response to the node price and the load level of the distribution network itself. By adjusting the real-time price, the load can be moved from the peak period to the off-peak period to improve the utilization rate of new energy. At the same time, the power trade between microgrids and the distribution network can be carried out through the tie line to improve the economic benefits of the system. According to the tie line node price, load forecast and wind power generation forecast, the dispatching center of the microgrid shall formulate the generation scheme of the controllable units, the power purchase scheme from the main network or the other microgrids and the operation scheme of energy storage equipment, and report the purchase of electricity to the main network and other microgrids. For the fluctuation of the distribution network load and intermittent energy, the principle of local balance is preferred. The dispatching center of the main network formulates the dispatching scheme according to the power purchase reported on the distribution network and the bidding function of the main network unit, and finally determines the power purchase plan from the generation side and the electricity sales to the distribution network. When more than one operator is involved, the dispatching center of each microgrid coordinates the power selling or purchasing requests of each operator.

Wind Turbine Model
The wind turbine model in this paper is the commonly used wind turbine model [17][18][19]. The output power of the wind turbine is given as where v is the wind speed; P r is the rated output power of the wind turbines; C in , C out and C rated are cut-in wind speed, cut-out wind speed and rated wind speed of the wind turbines, respectively; and C 1 , C 2 and C 3 are the parameters related to the wind turbines.

Photovoltaic Power Generation Model
The common photovoltaic power generation model [20] is adopted in this paper. The photovoltaic output power P PV is obtained from the output power, light intensity and ambient temperature under the standard rated conditions (solar irradiance G STC is 1000 W/m 2 , relative atmospheric optical mass is AM1.5, battery temperature T STC is 25 • C). The model is as follows: where P STC is the rated output power of photovoltaic under the standard rated conditions; G c is the irradiance at the working point; k is the power temperature coefficient; and T c is the battery temperature at the working point.

Energy Storage Model
The energy storage equipment mentioned in this paper is the battery energy storage. The energy storage model in this paper is as follows [21]: where P ch_max is the maximum charging power of the energy storage, and P dch_max is the maximum discharging power of the energy storage. (6) where E min and E max are the minimum and maximum energy stored in the energy storage, respectively; and E bat (t) is the energy stored in the energy storage at time t.
The available power of the energy storage is shown as follows.

Optimal Configuration Model of Wind/Solar/Storage Considering Demand Side Response Under Dynamic Boundary of Microgrid
In order to meet the supply sufficiency problem of the reliability demand, the service quality of the load is guaranteed by the division of the microgrid dynamic boundary. In this paper, the boundary of the microgrid is adjusted to provide the boundary conditions for DG to meet the needs of the load demand.
When DG are put into operation in case of an emergency, considering the limited generation resources in the distribution network, faults in the complex control system may shut down the whole system. In order to restrain the propagation of disturbance and reduce the uncertainty of voltage sag, surge, fault and balance of supply and demand, the microgrid is formed and operated in the island in an emergency, so as to effectively improve the power supply quality of the grid. However, this will increase the number of microgrids in the distribution network. Users' requirements for reliability limit the size of the microgrid, and the microgrid with more distributed energy resources will provide more reliable power supply services. The boundaries of the microgrid depend on the trade-off between the controllability and the power supply reliability of the microgrid [13]. Therefore, considering all possible operation schemes of the distribution network, the boundaries of the microgrid are controlled according to the uncertainty of the load and DG. The boundary of each microgrid can be established in each operation mode scenario of the distribution network and changes with the operation mode. Based on the different operation modes of the microgrid, the microgrid can be split into a new and smaller microgrid and can also parallel in the grid to form a large microgrid. The storage also can be stored in a network, and this network includes the DG, energy storage and load. The network can be planned with the economic, reliability, security or stability as the objectives. However, it is necessary to consider the network as a whole. If the boundary of the microgrid is static, the possible loss of load will be greater. When the boundary is dynamic, the dynamic range of the boundary division will be larger [22,23]. The load, flexible load, dynamic boundary of the microgrid and fault of the distribution network are the input conditions of the configuration in this paper.

Objective Function
The basic problem of this paper is to minimize the cost of the distribution network on the premise of meeting the load demand, that is, to obtain the maximum economic benefits with the same investment. Considering the installation and operation costs of wind turbine, photovoltaic and energy storage in the microgrid; considering the interaction benefits between the microgrid and large grid, that is, the microgrid delivers power to the large grid or from the large grid to the microgrid; and considering the penalty cost of the load loss and the incentive cost of the transferable load, then, considering the dynamic boundary of the microgrid and the demand side response, the objective function of the optimal configuration model of wind/solar/storage is as follows: Among them, C MG is the total equivalent annual cost of the system. There is an equal annual cost of the three areas in the system, where C MG,i is the microgrid area, C connect is the grid area connected to the external grid and C loss is the load loss area. The equivalent annual cost of these three areas can be expressed as follows: (C PV,k + C BESS,k + C grid,k + C LS,sub,k − C PV,sub,k )} C PV,k = C PV,init,k + C PV,rep,k − C PV,sal,k + C PV.om,k C BESS,k = C BESS,init,k + C BESS,rep,k − C BESS,sal,k + C BESS,om,k C G,k = C G,init,k + C G,rep,k C grid,k = c grid,in,k p grid,buy,k − c grid,out,k p grid,sell,k C LS,sub,k = c LS,k p LS,sub,k C PV,sub,k = c PV,k p PV,sub,k Here, C MG,k is the total annual equivalent cost of the system; C PV,k refers to the total annual equivalent cost of photovoltaic; C PV,init,k and C PV,rep,k refer to the annual equivalent cost of the initial investment and replacement of photovoltaic equipment, respectively; C G,k refers to the total annual equivalent cost of the diesel engine; C G,init,k and C G,rep,k refer to the annual equivalent cost of the initial investment and replacement of the diesel engine, respectively; and C LS,sub,k is the penalty for the loss of load. Therefore, the equal annual cost of the microgrid area C MG,i , the grid area connected to the external grid C connect and the load loss area C loss can be expressed as follows: C Connect,t = C Connect,PV + C Connect,BESS + C Connect,Grid + C Connect,LS,sub + C Connect,PV,sub +C Connect,kW_ES + C Connect,S + C Connect,G C Loss,t = C Loss,PV + C Loss,BESS + C Loss,Grid + C Loss,LS,sub + C Loss,PV,sub + C Loss,Loadcurtailment +C Loss,kW_ES + C Loss,S + C Loss,G C Connect,grid = c Connect,grid,in p Connect,grid,buy − c Connect,grid,out,k p Connect,grid,sell C Connect,LS,sub = c Connect,LS p Connect,LS,sub C Loss,grid = c Loss,grid,in p Loss,grid,buy − c Loss,grid,out,k p Loss,grid,sell C Loss,LS,sub = c Loss,LS p Loss,LS,sub C Loss,PV,sub = c Loss,PV p Loss,PV,sub

Constraints
Therefore, referring to various studies in the literature [24][25][26][27], the constraints considering the demand side response are as follows: (1) System operation power balance constraint (2) Renewable energy penetration constraint To ensure the power supply reliability of the microgrid, there is a minimum power of the permeability of the renewable energy.
where R new is the penetration of the renewable energy, and R new,min is the minimum penetration of the renewable energy. (3) Battery charge and discharge constraints where P gridout is the output power from the microgrid to the distribution network, and P gridout,max is the upper limitation of the output power from the microgrid to the distribution network.
where m load is the value of the load transfer, and M load is the upper limitation of the load transfer.

Algorithm Flow of Distributed Energy Allocation Model under the Dynamic Boundary of the Microgrid
When the distribution network breaks down, the disconnectors and breakers in the distribution network with a dynamic boundary can also be used to optimize the dynamic boundary of the microgrid.
The formation method of the dynamic boundary can adopt the following algorithm.
(1) Obtain the distribution network structure and the system data, including the conventional generator output power data, wind turbine data, wind speed data, energy storage data and reliability requirement. (2) Suppose that the proportion of controllable load in the load P L connected to node N is a, and the uncontrollable load is 1 − a. If a > 0, an additional node is set up to connect with L through the branch with a switch, so the value of the load at the node is aP L , and the load connected to L becomes simply uncontrollable.

Example Analysis
This paper takes the IEEE 33 bus standard system as a test example to verify the impact of the dynamic boundary partition on the distributed energy allocation of the distribution network. The grid structure of the simulation system adopts the IEEE-RTS distribution network, and the grid structure diagram is shown in Figure 1. The load distribution of the simulation system adopts the standard load of IEEE-RTS [28].

Example Analysis
This paper takes the IEEE 33 bus standard system as a test example to verify the impact of the dynamic boundary partition on the distributed energy allocation of the distribution network. The grid structure of the simulation system adopts the IEEE-RTS distribution network, and the grid structure diagram is shown in Figure 1. The load distribution of the simulation system adopts the standard load of IEEE-RTS [28].

Model Parameter Setting
The initial investment cost of the photovoltaic module is 1176.5 USD/kW, and the annual operation cost is 2.9 USD/kW. The initial investment cost of the wind turbine is 1470.6 USD/kW, and the annual operation cost is 14.7 USD/kW. The installation cost of the energy storage is 455.9 USD/kW, and the annual operation cost is 0.7 USD/(kW·h). The demand side response load in the distribution network is configured.
The cut-in wind speed is 3.75 m/s, the cut-out wind speed is 23 m/s and the rated wind speed is 12 m/s; the output model parameters C1, C2 and C3 are 0.1203, −0.08 and 0.0128, respectively. Then, the data of wind speed are one year's wind speed data in Alberta, Canada [29]. The NaS battery has the advantages of high energy and power density, high efficiency, convenient maintenance and a good load fluctuation response characteristic. It is suitable for large-scale production and application [30]. In this paper, the NaS battery is selected as the energy storage unit. The diesel engine is installed with 50 kW at node 8, and with 20 kW at node 27. In this paper, there are several nodes that are allowed to allocate the renewable energy generator, and they are nodes 2,4,6,8,10,12,13,16,18,20,22,24,26,28 and 31. The maximum installed capacity is 2000 kW for the wind turbine, photovoltaic generator and energy storage at each installed node. The total active load of the distribution network is 3715 kW, and the load parameters of the IEEE-33 bus standard system are shown in Table 1. Table 1. Load parameters of the IEEE-33 bus standard system.

Model Parameter Setting
The initial investment cost of the photovoltaic module is 1176.5 USD/kW, and the annual operation cost is 2.9 USD/kW. The initial investment cost of the wind turbine is 1470.6 USD/kW, and the annual operation cost is 14.7 USD/kW. The installation cost of the energy storage is 455.9 USD/kW, and the annual operation cost is 0.7 USD/(kW·h). The demand side response load in the distribution network is configured.

The Optimal Allocation Scheme Considering the Dynamic Boundary
Distributed energy is allocated considering the fixed boundary and dynamic boundary, respectively, and according to the method mentioned before, we can get the optimal configuration results of the distributed energy and energy storage in Table 2. Table 2 shows the coordinated configuration results of the distributed energy considering the fixed boundary. Table 2. Optimal allocation scheme of the distributed energy considering the dynamic boundary.

Configuration of Energy Storage
Other allocation scheme (scheme 1) On the basis of the above input conditions, the wind turbine, photovoltaic generator and energy storage are installed in the IEEE-33 bus standard system. The optimal allocation scheme of DG considering the dynamic boundary is scheme 2, and the other allocation scheme is scheme 1. In the optimal allocation scheme, the wind turbine, photovoltaic generator and energy storage are located at nodes 6, 24 and 31, respectively; in the other allocation scheme, the wind turbine, photovoltaic generator and energy storage are located at nodes 2, 8 and 28, respectively. Under the same configuration capacity, the DGs are installed at different locations in the two schemes, and the comprehensive income of the two schemes is 0.4013 M USD and 0.6716M USD, respectively. Due to the same configuration capacity, the installation cost of DG in the two schemes is the same. However, due to the different operation modes, the operation cost of scheme 1 is obviously higher than that of scheme 2, and the loss of load cost of scheme 1 is also higher than that of scheme 2.

Power Supply Area Analysis and Comprehensive Benefit Analysis of the Distribution Network Planning Island
On the basis of the above input conditions, the wind turbine, photovoltaic generator and energy storage are configured in the IEEE-33 bus standard system. When a failure occurs, the microgrid operates considering the fixed boundary in scheme 1, and the dynamic boundary in scheme 2. The results of scheme 1 considering the fixed boundary island division are shown in Figure 2a and the results of scheme 2 considering the dynamic boundary island division are shown in Figure 2b. In the fixed boundary island division, the wind turbine, photovoltaic generator and energy storage are located at nodes 6, 24 and 31, respectively; in the dynamic boundary island division, the wind turbine, photovoltaic generator and energy storage are located at nodes 6, 24 and 31, respectively. The configuration positions of the wind turbine, photovoltaic generator and energy storage considering the fixed boundary are the same as when considering the dynamic boundary. The local consumption of active power to reduce the network loss is considered, therefore the wind/solar/storage should be configured in the node with the concentrated load. The influence of the boundary on the reliability and comprehensive benefits of the system mainly lies in the difference of the load power supply guaranteed by dividing the island when an operation failure occurs. Therefore, in terms of long-term scale, to ensure the comprehensive benefits of the system, the configuration positions of the wind turbine, photovoltaic generator and energy storage should be in the load concentration area, no matter whether they are the fixed boundary island division or the dynamic boundary island division. the fixed boundary are the same as when considering the dynamic boundary. The local consumption of active power to reduce the network loss is considered, therefore the wind/solar/storage should be configured in the node with the concentrated load. The influence of the boundary on the reliability and comprehensive benefits of the system mainly lies in the difference of the load power supply guaranteed by dividing the island when an operation failure occurs. Therefore, in terms of long-term scale, to ensure the comprehensive benefits of the system, the configuration positions of the wind turbine, photovoltaic generator and energy storage should be in the load concentration area, no matter whether they are the fixed boundary island division or the dynamic boundary island division.  Distributed energy is allocated considering the fixed boundary and dynamic boundary, respectively, and we can get the optimal configuration results of the distributed energy and energy storage in Table 3. It can be seen from Table 3 that the configuration capacities of the wind turbine and photovoltaic generator considering the fixed boundary island are as follows: at node 6, the configuration capacities of the wind turbine, photovoltaic generator and energy storage are 200, 400 Distributed energy is allocated considering the fixed boundary and dynamic boundary, respectively, and we can get the optimal configuration results of the distributed energy and energy storage in Table 3. It can be seen from Table 3 that the configuration capacities of the wind turbine and photovoltaic generator considering the fixed boundary island are as follows: at node 6, the configuration capacities of the wind turbine, photovoltaic generator and energy storage are 200, 400 and 120 kW, respectively; at node 24, the configuration capacities of the wind turbine, photovoltaic generator and energy storage are 380, 760 and 228 kW, respectively; at node 31, the configuration capacity of power generation, photovoltaic generation and energy storage are 250, 500 and 150 kW, respectively. Considering the dynamic boundary island division, the configuration capacity of the wind turbine, photovoltaic generator and energy storage is, respectively, 440, 220 and 132 kW at node 6, 420, 840 and 252 kW at node 24 and 270, 540 and 162 kW, respectively, at node 31. The configuration of the wind turbine, photovoltaic generator and energy storage considering the dynamic boundary is larger than the fixed boundary. When the system failure occurs, the boundary is dynamic if the dynamic boundary of the microgrid is considered. Therefore, it can dynamically adjust the scope of the microgrid, reduce the load loss capacity of the distribution network according to the operation mode and improve the reliability of the distribution network. At the same time, because of the penalty function factor of the system load loss, dynamic adjustment of the boundary of the microgrid can reduce the load loss cost and improve the operation efficiency of the distribution network. Therefore, the configuration capacity of the wind turbine, photovoltaic generator and energy storage considering the dynamic boundary of the microgrid is larger than that considering the fixed boundary of the microgrid. Meanwhile, it can be seen from the optimization results that in the areas with a relatively concentrated load distribution, the capacity of the wind turbine, photovoltaic generator and energy storage configuration is relatively large. This trend is the same for the scheme of the dynamic boundary of the microgrid method and the scheme of the fixed boundary of the microgrid method.  Table 4 shows the microgrid considering the fixed boundary division and dynamic boundary division, and the configuration positions of the wind turbine, photovoltaic generator and energy storage in the scheme considering the fixed boundary division and dynamic boundary division. Based on the fixed microgrid division scheme and the dynamic microgrid boundary division scheme, the microgrid in the distribution network is divided into three microgrids, including microgrid {node 2, node 3, node 22, node 23, node 24}, microgrid {node 4, node 5, node 6, node 7, node 8} and microgrid {node 26, node 27, node 28, node 29, node 30, node 31, node 32}. The microgrid is formed when the available generation capacity of the system in the microgrid meets the load demand. The wind turbine, photovoltaic generator and energy storage in the microgrid provide energy to the load in the microgrid. When the available generation capacity cannot meet the load demand of the microgrid, the microgrid cannot be formed, and the load in the microgrid is all off-load. For the microgrid considering the dynamic boundary division, it includes microgrid {node 1, node 2, node 3, node 22, node 23, node 24}, microgrid {node 4, node 5, node 6, node 7, node 8, node 9} and microgrid {node 25, node 26, node 27, node 28, node 29, node 30, node 31, node 32}. The above boundary is the largest range formed by the microgrid. The boundary of the microgrid can be adjusted according to the system operation state, illumination of photovoltaic and wind power. For the microgrid considering the dynamic boundary, when the system fails, the dynamic microgrid will be formed according to its operation mode to reduce the system load loss as much as possible and improve the system comprehensive benefits. The annual load loss and annual comprehensive benefits of the two different microgrid formation schemes are shown in Table 3, where the annual load loss considering the dynamic boundary is less than the microgrid considering the static boundary 33.45% and the annual comprehensive benefits considering the dynamic boundary are also better than the microgrid considering the static boundary 26.65%.

Conclusions
In this paper, a novel renewable energy planning method considering the flexible region of the microgrid is studied. The dynamic division strategy of the microgrid is proposed, and on this basis, the dynamic boundary division model of the microgrid is established. Based on the flexible region of the microgrid, the optimal allocation model of renewable energy in the microgrid is established. The application shows that the renewable energy configuration considering the flexible region of the microgrid can effectively improve the utilization rate of renewable energy, the reliability of microgrid operation and the comprehensive benefits of the microgrid. The scheme obtained has better comprehensive benefits than the planning considering the division of the microgrid with a fixed boundary.
Author Contributions: K.L. put forward the research direction and contributed to the conception of the study. D.S. contributed significantly to analysis and manuscript preparation, completed the construction of the method, theory and algorithm and wrote the manuscript. N.S. performed the experiment and the data analyses. K.L., D.S. and N.S. helped perform the analysis with constructive discussions. All authors have read and agreed to the published version of the manuscript.
Funding: This research was funded by "Research on complex power quality disturbance identification and fault diagnosis based on deep learning", grant number 52077089.

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