Research on Economic optimal dispatching Strategy of Microgrid based on Model Predictive Control

. Because of the energy crisis caused by the shortage of fossil energy, countries begin to study low-carbon new energy and micro-grid systems related to new energy, and more importantly the energy dispatching of micro-grid is the focus of the whole micro-grid system. The application of model predictive control to the energy dispatching of microgrid has become one of the mainstreams, but the prediction error will affect the power balance of the actual system. Aiming at the above problems, the improved MPC strategy which deals with prediction error by adding power compensation is put forward. Through real-time monitoring of photovoltaic, fan and load power, the difference between the real value and the predicted value is compared. And in the MPC rolling optimization stage, the power difference compensation is given to the power interaction of the distribution network to eliminate the influence of prediction error. The simulation results show that the total cost of the improved MPC strategy is 22.69% lower than that of the traditional MPC strategy.


Introduction
In recent years, the problem of resource utilization caused by environmental pollution and energy shortage has become increasingly prominent and the demand for energy is increasing every year. It is one of the important ways to solve the above problem to research and develop the low carbon new energy represented by wind and light instead of the traditional fossil energy and to improve the permeability of the new energy in the power grid [1]. The microgrid with high permeability of new energy, because it improves the utilization and reliability of distributed generation, realizes the integrated operation of distributed power and load through the large-scale access and application of distributed generation, especially renewable energy. It is an important means to realize national sustainable development, efficient use of renewable energy and wide access to new energy in distribution network. However, because of the intermittent and instability of new energy, the traditional energy management strategy can not meet the actual control needs with the characteristics of microgrid. In order to ensure the safe, economical and reliable operation of microgrid, it is necessary to study the problem of energy management in microgrid [2].
At present, the related research of microgrid energy optimization mainly includes three aspects: real-time energy distribution, pre-day scheduling and closed-loop energy management [3], while model predictive control is the mainstream of closed-loop energy management. In reference [4], based on the actual microgrid system, the operation economy of multi-energy complementary microgrid under different seasonal conditions is discussed and analyzed. In reference [5], a multi-time scale energy management optimal scheduling scheme for microgrid is proposed, which consists of two stages: pre-day economic optimal scheduling and intra-day scheduling. In reference [6], aiming at minimizing the operating cost of microgrid, a multi-time-scale energy management strategy for microgrid of the energy storage system containing sodium and sulfur was proposed. The solution of each time-scale model was solved by particle swarm optimization (PSO). In reference [7], by using mixed integer quadratic programming model and model predictive control method, the online energy management of home energy local area network is realized, and its running cost is minimized. However, these microgrid models do not fully consider the impact of the prediction error on the system, but only through the feedback correction in the model prediction mode to achieve the purpose of closed-loop rolling optimization, and the effect of reducing the prediction error is not obvious enough.
In this paper, the topology and operation mode of microgrid system are studied. The mixed integer programming (MIP) is used to model each module of the system and the model predictive control (MPC) is used to realize the on-line optimization and economical optimal choice of microgrid energy management. On the one hand, the MPC method is used to reduce the disturbance effect of the system, while on the other hand the improved MPC is used to eliminate the fluctuation of the actual system power balance caused by the prediction error through the power compensation method.
The topology of the microgrid system is shown in figure  1. Its basic units include: distribution network, bidirectional inverter, energy storage part, photovoltaic and fan power generation, load, a total of five main parts of the unit.

Energy storage system model
Because of the intermittency of non-renewable energy generation and the power flow fluctuation in the power grid, it is necessary to add energy storage equipment to the micro-grid to improve the reliability and stability of the system energy supply. For the energy storage unit, we define According to the mixed logic model, the formula (3) is equivalent to the following linear inequalities.
The upper and lower limits of the maximum power interaction of the battery are

Power interaction Model between Microgrid and Distribution Network
When the micro-grid is connected to the grid, we define ( ) Also by using mixed logic modeling, logical auxiliary variables ( ) g k  and continuous auxiliary variables between microgrid and distribution network is defined as follows: According to the mixed logic model, formula (6) is equivalent to the following linear inequality.

Economic and optimal Energy Management of Microgrid based on MPC
In this paper, the optimal strategy of energy management in microgrid is to minimize the total operating cost under the condition of satisfying the constraint conditions, that is, by making decisions on the reasonable charge and discharge of energy storage and the power interaction value with the distribution network at every moment to achieve the optimal management allocation in the expected time period.

Objective function
The objective function of the total operating cost of the microgrid is as follows Where k is the discrete sampling time and T is the prediction time domain. bat M as battery maintenance, which is used to reduce the charge and discharge frequency of energy storage system and [2 ( ) ( )] b bat z k P k  is the true power value of the energy storage unit exchanged at k time. Because renewable energy pollution is small, MPPT is preferred to control new energy generation.

Constraints
Firstly, the system needs to meet the power balance constraints at every moment, so there is

Control Strategy based on traditional MPC
Firstly, according to the predicted PV, fan and load power, combined with the objective function (9) and various constraints, the optimal power dispatching value of battery and inverter at each time in the next 24 hours can be obtained. Then, as the sampling time goes on, the first time value of the optimal control scheme (battery and inverter power scheduling) for each sampling period (24 hours) is solved by rolling through the whole system. According to the system state space model and the current state calculation, the next state of the system is regarded as the initial state of the system at the next moment. Thus the optimal control of MPC control strategy is the set of the first component of each cycle optimal control scheme. The discrete sampling time is set to be 1 hour.

Improved MPC Control Strategy based on Prediction error
Because of the difference between the forecast value and the real value of the new energy generation and load of the system, the energy scheduling scheme based on the predicted value will not satisfy the energy balance of the real system, so this paper improves grid P of the formula (10). In this paper, in the pre-day scheduling phase of conventional MPC control strategy, we still choose the forecast value of the next 24 time period as the background data. However, in the rolling optimization and feedback stages, the true value of the new energy and load in each period is detected to stabilize the system power balance by power compensation (by improving the value of grid P ).
Therefore, considering the instability of the system caused by the prediction error, this paper proposes to compensate the scheduling power allocation of the MPC control strategy according to the prediction error difference.

Description of numerical examples
Referring to the data in reference [4] and taking the topological structure of microgrid shown in figure 1 as an example, the new energy sources of power generation include a photovoltaic system with installed capacity of 800kW and a fan unit with an installed capacity of 800kW. Figure 2 shows the predicted and true power generation for PV and fan and the predicted and true demand for load 24 hours a day. The total capacity of battery is 2500kWh. The maximum charge and discharge power value of battery is 800kW, upper and lower limits of SOC is 0.9 and 0.5 respectively. The charge efficiency and discharge efficiency are both 0.95.The battery maintenance cost is 0.025 yuan / kW. The maximum interactive power between microgrid and distribution network is 800kW. The price of electricity purchased from distribution network is as shown in Table 1. The price of electricity for sale is 0.58 yuan / kW. In this paper, Yalmip modeling is used in Matlab. In the simulation stage, Yalmip automatically selects bnb (branch and bound) algorithm to solve the problem. The initial SOC of the battery is 0.7, the predicted time domain is 24 h, and the simulation sampling time is 1 hour. The second day scenario of microgrid is the same as the first day.

Comparison between improved MPC Model and traditional MPC Model
The traditional MPC strategy calculates the optimal control scheme of battery power and interacting power with the distribution network for the next day based on the predicted information (photovoltaic, wind and load power) as shown in Figure 3. From the reference formula (4) of the initial charge of the battery and the interactive power variation of battery in figure 3, the residual capacity of the battery in one day can be obtained as shown in figure 4.  Figure 4 shows that the residual capacity of MPC strategy battery at 23 hours is 1388.9kWh. According to figure 3, the power interaction of the MPC strategy battery at 23 hours is 0.0009 kW, and the power interaction at 24 time is 734.9527 kW. Finally, according to formula (4), the residual capacity of the battery at 25 hours can be calculated to be 2087.1 kWh，according to the residual capacity at 23 hours.
In figure 3, the battery power and the value of the interactive power of the distribution network at each time of the day can be used, according to formula (9), to calculate the cost price at each time, and the total cost of 24 hours a day is 1280.6 yuan by summing up.
However, because of photovoltaic generation, fan generation and demand load related to the overall prediction error as shown in figure 5, it will lead to the actual system power imbalance. The system will take relevant actions to compensate for the fluctuation caused by the imbalance of power, and the system will remove part of the load in time when the power of the demand load is not satisfied. The power output of photovoltaic or fan is limited to achieve the balance of actual power in the case of excess power demand. The reference [8] for load cutting and limiting compensation costs for new energy generation is 1.5 yuan / kW and 0.07 yuan / kW, respectively. According to figure 5, the total cost of compensating prediction error is 615.55 yuan, so the total operating cost plus compensation cost of traditional MPC is 1896.1 yuan. In order to eliminate the influence of compensation cost, this paper directly compensates the interactive power of distribution network by feedforward control according to the difference between the real value and the predicted value of the new energy and load power at each time, thus realizing the power balance of the actual system without additional load shedding or limiting the power generation. The improved MPC strategy is based on the error between the predicted value and the real value. The optimal control scheme for battery power and power interaction with distribution network is shown in figure 6. Also based on the battery power and the value of the interactive power of the distribution network at each time of the day in figure  6, the total cost of the improved MPC is 1465.9 yuan according to formula (9). The change of battery residual capacity in a single day is similar to figure 4 (because predictive error compensation power is added only to the power that interacts with the distribution network, the battery output power does not need to be compensated) so the remaining battery power is still 2087.1kWh. It can be seen that the total cost of improving MPC is 1465.9 yuan per day, which is lower than the total cost of traditional MPC control strategy of 1896.1 yuan per day, and the total cost is reduced by 22.69%.

Conclusion
Because of the rolling optimization and feedback correction model, the traditional MPC can reduce the influence of the inevitable disturbance and improve the robustness of the system, so it is widely used. However, due to the influence of power forecasting error in PV and fan power generation, the actual system will face the power imbalance and the compensation cost caused by timely load cutting and limiting the generation power, which will increase the total operating cost. In this paper, the microgrid model is combined with mixed integer programming and model predictive control. According to the real-time monitoring of photovoltaic, fan and load power, the difference between the real value and the predicted value is compared. In the MPC rolling optimization stage, the power difference compensation is given to the power interaction of the distribution network, and the compensation cost caused by the prediction error is completely eliminated. The simulation results show that the total cost of the improved MPC strategy is 22.69% lower than that of the traditional MPC strategy.