Combined Two-Stage Stochastic Programming and Receding Horizon Control Strategy for Microgrid Energy Management Considering Uncertainty

Microgrids (MGs) are presented as a cornerstone of smart grids. With the potential to integrate intermittent renewable energy sources (RES) in a flexible and environmental way, the MG concept has gained even more attention. Due to the randomness of RES, load, and electricity price in MG, the forecast errors of MGs will affect the performance of the power scheduling and the operating cost of an MG. In this paper, a combined stochastic programming and receding horizon control (SPRHC) strategy is proposed for microgrid energy management under uncertainty, which combines the advantages of two-stage stochastic programming (SP) and receding horizon control (RHC) strategy. With an SP strategy, a scheduling plan can be derived that minimizes the risk of uncertainty by involving the uncertainty of MG in the optimization model. With an RHC strategy, the uncertainty within the MG can be further compensated through a feedback mechanism with the lately updated forecast information. In our approach, a proper strategy is also proposed to maintain the SP model as a mixed integer linear constrained quadratic programming (MILCQP) problem, which is solvable without resorting to any heuristics algorithms. The results of numerical experiments explicitly demonstrate the superiority of the proposed strategy for both island and grid-connected operating modes of an MG.


Introduction
Microgrids (MGs) are micro power systems integrating a number of loads and distributed energy resources (such as photovoltaic (PV), wind, storage systems, controllable distributed generators (DGs), and controllable loads) [1].An MG can operate in both grid-connected or island-mode by connecting and disconnecting from the grid.The potential to integrate intermittent renewable energy sources (RES) in a flexible and decentralized way makes the concept of MGs more attractive.Because of the randomness in power production of RES, load demand, and the electricity price, in addition with the state transitions over the entire time frame of MG energy management caused by the buffering effect of energy storage devices, the optimal operation of MGs comes to be highly computationally complex and challenging.
Although, many kinds of forecast methods have been proposed for forecasting the load demand, wind, PV generation and electricity price, a point forecast is always subject to error and the probability that the forecasting scenario occurs is clearly close to zero.Thus, a deterministic approach will affect the performance of the power scheduling and the operating cost of an MG.The studies considering uncertainty for MG energy management can be categorized into two groups [2]: robust optimization based approaches [2][3][4] and stochastic optimization based approaches [5][6][7][8].In [3], an MG energy management framework for the optimization of individual objectives of MG stakeholders is proposed.The optimal scheduling strategy is achieved by using a robust optimization approach which considers the uncertainties related to the power output of renewable generators and quantify the uncertainties by prediction intervals.Recently, two-stage stochastic programming (SP) has also been applied to MG energy management [5][6][7][8] and it is demonstrated to be a flexible and effective strategy to deal with the uncertainty in MG.For two-stage SP, stochastic variable scenarios are always generated through Monte Carlo simulation (MCS) [5].By considering all possible realizations of each scenario, the risk cost dues to imprecise forecast of stochastic variable is reduced.In [7], a two-stage SP strategy is applied for the energy and reserve scheduling with demand response.In [5], a two-stage SP method for the optimal design of distributed energy system is proposed.Niknam et al. [8] proposes a stochastic model for optimal energy management with the goal of cost and emission minimization and the proposed model is solved by using a complex heuristics algorithm.However, the forecast errors increased as the forecasting time horizons become longer [9][10][11][12], and the SP based open loop strategy cannot deal with the forecast errors effectively without using the updated forecast information.Thus, only with SP strategy, the forecast uncertainty in MG cannot be effectively depressed.
Recording horizon control (RHC), also known as model predictive control (MPC), as an advanced method for process control, has also been used in the power system as it can incorporate both forecasted and newly updated information to make decisions [13,14].In [15], with timely updated wind and market price forecasts, RHC is used for the dispatch of hydrogen storage together with a wind power plant.In [16][17][18], an RHC scheme is proposed to minimize the operating cost of an MG.In [19], an RHC-based power dispatch approach is proposed to minimize the operational cost while accommodating the plug-in electric vehicles (PEV) charging uncertainty by timely update the predictive model.However, all of these methods are deterministic approaches, which do not consider all the possible forecast errors related to load demand, PV and wind power production, and electricity price in the optimization model, which naturally affects the result accuracy and therefore the overall performances of MG.
In this paper, a combined two-stage SP and RHC strategy, named SPRHC, is proposed for microgrid energy management under uncertainty.For the SPRHC strategy, it combines the advantage of SP and RHC by considering the forecast errors through SP and involving a feedback mechanism through RHC with the recently updated forecast information.Thus, the proposed SPRHC strategy can effectively avoid short sighting and further compensate the uncertainty in MG.Through the two-stage SP, the power scheduling decisions are divided in two stages.The first-stage decisions (such as the unit commitment of DGs and the charging/discharging schedule of battery storage system) are made prior to the observation of the random scenarios, while the second-stage decisions (such as the economic power dispatch of committed DGs, power exchange between MG and the utility, the load shedding, and the power generation curtailment) are made adaptively according to the first-stage decisions and the observation of the real scenario.The optimization model involves the forecast uncertainty of load demand, PV and wind production, and electricity price.The complicated SP problem is transferred into a deterministic optimization problem with multiple deterministic scenarios generated by MCS strategy.In order to reduce the computational burden, a scenario reduction method named backward reduction algorithm (BRA) [20] is applied to remove the similar scenarios and keep a good approximation of the uncertainty.In order to further compensate the uncertainty within the MG energy management, a feedback mechanism based on RHC is proposed to be incorporated with two-stage SP.The results of numerical experiments explicitly show benefits of the proposed strategy for an MG operating in both grid-connected and island operating modes.
The main contributions of this paper are: (1) the forecast errors of load demand, PV and wind power production, and electricity price are considered for MG energy management and the problem is formalized into a two-stage SP; (2) An RHC based feedback mechanism is combined with SP strategy by using the lately updated forecast information, which can effectively avoid short sighting and further compensate the uncertainty; (3) In order to avoid the simultaneous charging and discharging of battery systems, a proper strategy is proposed to guarantee a correct behavior while keeping the model as a mixed integer linear constrained quadratic programming (MILCQP) model, which is solvable without resorting to any heuristics algorithms; (4) The superiority of the proposed SPRHC strategy is demonstrated through case studies that involve both island mode cases and grid-connected mode cases.This paper's order is as follows.In Section 2, scenario generation and reduction strategy is proposed.Section 3 proposes the two-stage SP formulation for MG energy management.In Section 4, RHC is introduced.Section 5 shows the numerical experiments.Finally, the conclusions are given in Section 6.

Modeling the Uncertainty in an MG
Many kinds of forecast methods have been proposed for forecasting the load demand, wind and PV generation, and electricity price related with different time horizon periods (1 h ahead, 2 h ahead, and so on) [9,[21][22][23][24][25][26].However, the probability that the forecasting scenario occurs is clearly close to zero, since a point forecast is always subject to an error [27].Therefore, SP is applied to reduce the risk costs due to imprecise forecast by considering several possible realizations of each scenario.For SP, the scenarios of random variables (such as load demand, wind and PV generation, and electricity price) should be firstly generated according to its probabilistic characteristics.However, it is hard to directly find out their probabilistic characteristics since they involve many random factors, such as illumination intensity, cloud cover, temperature variations, etc. [6].Generally, the forecast error of load demand, wind and PV generation, and electricity price are fitted well to certain standard probabilistic distribution [28].Thus, the forecast error models are applied for scenario generation.
In most literature, the normalized forecast error of load demand, wind and PV power production, and electricity price are assumed to follow the normal distribution [29,30], i.e., e ∼ N(0, δ).Furthermore, as shown in [9][10][11][12]25,26], for the forecasts of load demand, wind and PV generation, and electricity price, longer time horizon periods present larger forecast errors (here described by larger normalized standard deviation values) and the forecast errors depend significantly on the forecast methods [9].In this paper, the MCS [31] approach is used to generate stochastic variable scenarios for a certain time horizon according to time-horizon-dependent empirical probability distribution functions (PDFs) of forecast error, as shown by ( 1) to ( 4).
It should be noted that the forecast errors depend significantly on the forecasting techniques [9] and the forecasting techniques play an important role in the operation of proposed approach; however, the development of such forecasting techniques is outside the scope of this paper.Thus, the analysis of the performance of the forecasting techniques is not discussed here.Without loss of generality, the standard deviations (δ ) are assumed to be linearly increasing with the distance from current time step, as shown by ( 5) to (8): Thus, the forecast errors of e PV t,s , e Wind t,s , e Load t,s , and e Price t,s are generated by a random number generator of normal distribution with standard deviation linearly increasing with the distance from current time step, which is in accordance with the forecast error distribution model.
According to the generated forecast errors through MCS, a certain number (such as N 0 ) of scenarios are generated, and each scenario consists of a vector as shown by (9) and with the probability 1 / N 0 :

Scenario Reduction
In addition, a higher number of scenarios can result in a better modeling of the uncertainty in an MG, but it is at the expense of increasing the computational burden.Thus, a scenario reduction method is needed to remove the similar scenarios and keep a good approximation of the uncertainty.The backward reduction algorithm (BRA), which has been proven to provide very good performances in the two-stage mixed integer stochastic programming [13], is adopted in this paper.The diagram of BRA [20] is shown in Figure 1.Let the distance between two scenarios be described as a two-norm, as shown in (10): Then, the BRA is implemented until S scenarios are remaining.The probabilities for the preserved scenarios can be calculated by (11): ∈ J, where J j = {i ∈ J : j = j(i)} and j(i) ∈ arg min j/ ∈J d i,j f or each i ∈ J. (11)

Two-Stage Stochastic Programming Formulation for Microgrid Energy Management
The multi-stage SP model [32][33][34] allows revision of the planning decisions sequentially when the uncertainty realized hourly [33].However, for the multi-stage SP model, the problem becomes extremely large when the number of stages increase [32], even though a relatively small number of nodes are allowed in each stage.With an RHC strategy, as proposed in the next section, the two-stage SP model can also sequentially make the decisions with hourly updated forecast information, which compensates for the lack of additional stages for uncertainty unveiling.Thus, the two-stage SP model is applied in this paper.In order to consider the forecast error of the load demand, PV and wind power production, and electricity price for the MG energy management under uncertainty, a two-stage stochastic programming formulation is developed in this section.

Objective Function
The operation cost of an MG consists of the start-up/shut-down cost and fuel cost of controllable DGs, degradation cost of battery, load shedding cost, and power generation curtailment cost.In a grid-connected mode, the operation cost of an MG also contains the cost of power purchased from the utility minus the profit gained by exporting power to the utility.Considering the uncertainty of load demand, PV and wind power generation, and electricity price, the costs of MG can be formulated as a two-stage objective function as shown in (12): where u SU i,t and u SD i,t can be calculated by ( 13) and ( 14), respectively.
The cost function of the ith DG is approximated with a quadratic function [35], as shown in (15): where a i , b i , c i are the cost coefficients of the ith DG.
For the two-stage SP problem, the objective function, as shown by (12), contains two parts.The first part represents the first-stage costs and the second part represents the second-stage costs.In the first stage, it makes the decisions (i.e., the unit commitment of DGs and the charging/discharging power of battery) before the actual realization of the uncertainty becomes available.In the second stage, it makes the decisions (i.e., the economic power dispatch of committed DGs, power exchange between MG and the utility, the load shedding, and the power generation curtailment) depending upon the particular realization of each scenario.The objective is to make proper decisions in the first stage in order to minimize the sum of first stage costs and the expected costs of second stage [13].

First-Stage Constrains
In the first stage, the constraints of the battery are shown in ( 16) to ( 23 Soc min Soc t Soc max ,∀t = 1, ..., T, It should be noted that the constant ( 20) is normally fulfilled even if not included in the model [14].However, in some cases, the decisions might use simultaneous charging and discharging of battery units in order to absorb power from the system without affecting its state of charge (SoC) [36].In order to avoid the simultaneous charging and discharging of battery system, as discussed in [36], the binary variables St Char and St DisChar are introduced and redefine the constant ( 20) as ( 21) to (23).In this way, it can guarantee a correct behavior while keeping the model as a MILCQP model:
The power balance constraint is shown in (30):

Receding Horizon Control
The buffering effect of battery storage system in the MG makes the state transitions over the entire time horizon of MG energy management, which increases the computational complexity.The charging/discharging schedule strategy of battery storage system and the unit commitment of DGs are associated with the MG operating cost.Furthermore, the forecast errors of load demand, PV and wind power production, and electricity price have great influence on the scheduling strategy.Because of the forecast errors increasing as the forecasting time horizons become longer, the SP based open loop strategy cannot deal with the forecast errors effectively without using the updated forecast information.In this paper, RHC strategy is proposed to be combine with the SP strategy.By using the lately updated forecast information, RHC can further compensate the uncertainty through a feedback mechanism.
The flowchart of SPRHC based MG energy management and the receding horizon procedure are shown in Figure 2. The basic idea of RHC is to calculate the optimal control sequences yet implement only the first step of them and ignore the rest [37].In other words, the two-stage SP problem as illustrated in Section 3 is solved and derives the control sequences of a certain scheduling horizon T (d t , d t+1 ,. . .,d T , where d t denotes the decision at time interval t), yet only the first time step of the control actions, i.e., d t , are implemented.As shown in Figure 2, at each time step t, the load demand, PV and wind production, and electricity price forecasts are updated.Based on the forecast information, several possible scenarios are derived through scenario generation and reduction strategy.According to the reduced set of scenarios, the two-stage SP problem as illustrated in Section 3 is solved and derives the control sequences of a certain scheduling horizon, yet only the first time step of the control actions are implemented in the first stage.Then, the second stage control actions at time interval t are made according to the first stage decisions and the particular realization of the real scenario.The system response to the control actions at time interval t will be measured as the next available information for solving the two-stage SP problem in the next interval.In the next time interval t + 1, the system information (e.g., the load demand, PV and wind production, and electricity price forecasts) is updated and the two-stage SP problem is resolved.By implementing these steps with an RHC strategy, the feedback mechanism can further compensate the uncertainty in MG.

Numerical Experiments
In this paper, a typical low voltage MG [38] is used to verify the effectiveness of the proposed SPRHC scheduling strategy for MG energy management under uncertainty.The test MG system consists of three PV generators, two wind generators, three controllable distributed generators (DGs), and one battery storage system, as shown in Figure 3.The forecast and real aggregated power production curves of PV and Wind as well as the load demand are collected and modified from Elia [39].The degradation cost of battery (i.e., Price Bat ) are collected from [6].In order to reduce the negative impacts of the uncertainty in MG to the external macro-grid, the selling price (i.e., Price export t,s ) is always set lower than purchasing price to incite local use of PV and wind power [40].In this paper, the price of exported power to the utility (i.e., Price export t,s ) is assumed to be 0.2 multiplied by the purchasing price (i.e., Price import t,s ).The normalized standard deviations (i.e., δ PV , δ Wind , δ Load , δ Price ) of forecast errors for PV, wind, load, and electricity price are collected and modified from [26,27,30,41].All the data used for simulation is shown in Table 1.The simulations were run on a PC with Intel(R) Core(TM) i7-2600 CPU @3.40GHz and 4.00 GB memory.The IBM ILOG CPLEX v12.60 optimization solver is utilized for solving the MICQP model.MATLAB 2015b and the YALMIP toolbox [42] are used for linking the CPLEX solver and computing the model.
In order to capture complete cycles of the load, solar, wind and electricity price profiles, the problem is investigated in 24 h horizon with 1 h time resolution in this paper.As described in Section 2, the scenario generation methodology was firstly implemented to create 500 scenarios for 24 h ahead with hourly resolution.Then, the created equiprobable scenarios were reduced to 10 scenarios using the scenario reduction algorithm outlined in Section 2. Figures 4-7 illustrates the generated 500 equiprobable scenarios for 24 h ahead and the final reduced set of 10 scenarios by applying the BRA algorithm on the original 500 scenarios of imported electricity price, load, PV and wind, respectively.As shown in Figures 4-7, one can observe that the prediction errors increased as the forecasting time horizons become longer.In order to analyze the superiority of the proposed SPRHC strategy, the following strategies are implemented for the MG in both grid-connected operating mode and island operating mode: (1) SPRHC: the 24 h horizon power schedule was obtained by solving the two-stage stochastic programming problem described in Section 3 with the proposed SPRHC strategy.(2) SP: the 24 h horizon power schedule was obtained by solving the two-stage stochastic programming problem described in Section 3 with only an SP strategy.(3) RHC: the 24 h horizon power schedule was obtained by solving the optimization problem with only RHC strategy based on forecasted values of load demand, PV and wind power production, and electricity price, without considering the forecast errors.(4) Benchmark: the 24 h horizon power schedule was obtained by solving the optimization problem with perfect forecast, it assumes that the operator knows all the future realizations of the uncertainty in PV, wind, load, and electricity price.
Figure 8 shows the comparison of 24 h horizon power schedule obtained through SPRHC, SP, RHC, and Benchmark strategies when the MG is in grid-connected mode.For the power schedule shown in Figure 8d, it is optimal as the operator is assumed to know the perfect information.As shown in Figure 8d, the battery is charged during the 2nd-6th, 13th, and 17th time intervals, as the price is lower, while it is discharged during the 9th-12th, 14th, and 21st time intervals, as the price is higher during those time intervals.During the 10th-12th time intervals, all three DGs are turned on and output the maximum power to sell to the utility, as the price is higher during this period.However, only DG2 is turned on during the 14th time interval (the price is also very high), because the high price is sustained for only one time interval, and only DG2 can cover the on/off cost for selling the power to the utility.During the 9th time interval, DG1 and DG2 are turned on to compensate the load demand, and during the 21st time interval, only DG1 is turned on to compensate the load demand.During the other time intervals, the power demand is compensated by the utility, as the price is lower during those time intervals.As shown in Figure 8a-d, the power schedule obtained through the SPRHC strategy is more similar to the Benchmark than that obtained through SP and RHC strategies.The reason is as follows: although the SP strategy can provide a scheduling plan that minimizes the risk from the impact of uncertainty, it did not use the lately updated forecast information through an RHC mechanism, while the RHC strategy did not consider the forecast errors, which will have a higher risk from the impact of inaccurate forecasts; the SPRHC strategy considered the forecast errors through SP and involved a feedback mechanism through RHC by using the lately updated forecast information, which can effectively avoid short sighting and further compensate the uncertainty.Figure 9 shows the comparison of a 24 h horizon power schedule obtained through SPRHC, SP, RHC, and Benchmark strategies when the MG is in island mode.The power schedule obtained through the Benchmark strategy is also optimal.As shown in Figure 9d, the battery is charged when the load demand is low and the PV and wind power production is high, while it is discharged when the load is high and the PV and wind power production is low.The unit commitment of DGs is also optimal, which is decided according to the generation cost coefficients, load demand, PV and wind production curves.Similar to the power schedule in grid-connected mode, the power schedule obtained through SPRHC strategy is also more similar to the Benchmark than that obtained through SP and RHC strategies, as can be seen from Figure 9a-d.In order to evaluate the performance of the generated power schedules obtained through SPRHC, SP, and RHC strategies shown in Figures 8 and 9, the power schedules are fed into 500 possible random scenarios that are regenerated with the scenario generation strategy shown in Section 2. In order to make a fair comparison, the simulations for the SPRHC, SP and RHC consider the same set of scenarios.The statistics of MG total operating cost with SP, RHC and SPRHC strategies are shown in Table 2.Both the comparison of the approximated probability distribution function (PDF) and cumulative distribution function (CDF) of MG total operating cost with SPRHC, SP and RHC strategies are illustrated in Figure 10.As shown in Figure 10a,b, the operating cost when the MG is in island mode is higher than when it is in grid-connected mode.Because the uncertainty can be compensated by the utility when the MG is in grid-connected mode, while in island mode, the uncertainty in the MG can only be compensated by the high cost of DGs or load shedding.As shown in Table 2, the maximum costs of the SP strategy is a little lower than that of the SPRHC strategy.The SP procedure seems to be more effective to avoid scenarios where the costs can be very high.However, as shown in Figure 10, the probability of scenarios where the costs can be very high is very small.Thus, the proposed SPRHC strategy is more economic than both the SP and RHC strategies in the long term.

Conclusions
In this paper, an SPRHC strategy is presented for microgrid energy management under uncertainty.The uncertainties of RES, load, and electricity price are involved in the MG SPRHC optimization model.MCS based scenario generation and BRA based scenario reduction strategies are applied to transfer the complicated SP problem to a deterministic optimization problem.Furthermore, in the scenario generation and reduction process, the rate of forecast errors increased as the forecasting time horizons becoming longer was taken into account.The comparison results of the MG total operating cost with SPRHC, SP and RHC strategies demonstrate the superiority of the proposed strategy for both island and grid-connected operating modes of an MG.

Figure 3 .
Figure 3.The low voltage MG for case study.

Figure 4 .
Figure 4. Scenario generation and reduction of price profile for imported power from the utility (a) generated 500 imported electricity price scenarios for 24 h ahead with increasing standard deviation; (b) reduced set of 10 final scenarios by applying the BRA algorithm to the original 500 scenarios.

Figure 5 .
Figure 5. Scenario generation and reduction of aggregated load demand (a) generated 500 load scenarios for 24 h ahead with increasing standard deviation; (b) reduced set of 10 final scenarios by applying the BRA algorithm on the original 500 scenarios.

Figure 6 .
Figure 6.Scenario generation and reduction of aggregated photovoltaic (PV) power (a) generated 500 PV scenarios for 24 h ahead with increasing standard deviation; (b) reduced set of 10 final scenarios by applying the BRA algorithm to the original 500 scenarios.

Figure 7 .
Figure 7. Scenario generation and reduction of aggregated wind power production (a) generated 500 wind scenarios for 24 h ahead with increasing standard deviation; (b) reduced set of 10 final scenarios by applying the BRA algorithm to the original 500 scenarios.

Figure 10 .
Figure 10.Probability distribution function (PDF) and cumulative distribution function (CDF) of MG total operating cost with SP, RHC and SPHC strategy (a) PDF in grid-connected mode; (b) CDF in grid-connected mode; (c) PDF in island mode; (d) CDF in island mode. s t = 1, ..., T and s = 1, ..., S.

Table 2 .
Statistic of microgrid (MG) total operating cost with stochastic programming (SP), recording horizon control (RHC) and combined stochastic programming and recording horizon control (SPRHC) strategies.