# Research on Renewable Energy Planning Considering the Flexible Region of the Microgrid
## 3 Model and Solution of Distributed Energy Allocation in the Microgrid under Dynamic Boundary  
### Related Component Model of the Microgrid  
#### 3.1.1 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:  
\[\left\{ \begin{array}{l}\min\sum\limits_{t=1}^{T}\left|L(t)-P_{Wind}(t)-P_{PV}(t )-P_{ES}(t)-P_{G}(t)\right|\\ L(t)=L_{before}(t)+L_{SLin}(t)-L_{SLout}(t)\end{array} \right. \tag{1}\]  
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_{before}(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:  
\[\left\{ \begin{array}{l}L_{SLin}(t)=\sum\limits_{k=1}^{N_{SL}}x_{k}(t)P_{1,k} +\sum\limits_{h=1}^{h_{max}\sim 1}\sum\limits_{k=1}^{N_{SL}}x_{k}(t-h)P_{(h+1),k} \\ L_{SLout}(t)=\sum\limits_{k=1}^{N_{SL}}y_{k}(t)P_{1,k}+\sum\limits_{h=1}^{h_{ max}\sim 1}\sum\limits_{k=1}^{N_{SL}}y_{k}(t-h)P_{(h+1),k}\end{array} \right. \tag{2}\]  
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\leq k\leq 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.