Stochastic Optimization for Security-Constrained Day-Ahead Operational Planning Under PV Production Uncertainties: Reduction Analysis of Operating Economic Costs and Carbon Emissions

This paper presents a general operational planning framework for controllable generators, one day ahead, under uncertain re-newable energy generation. The effect of photovoltaic (PV) power generation uncertainty on operating decisions is examined by incorporating expected possible uncertainties into a two-stage unit commitment optimization. The planning objective consists in minimizing operating costs and/or equivalent carbon dioxide (CO2) emissions. Based on distributions of forecasting errors of the net demand, a LOLP-based risk assessment method is proposed to determine an appropriate amount of operating reserve (OR) for each time step of the next day. Then, in a first stage, a deterministic optimization within a mixed-integer linear programming (MILP) method generates the unit commitment of controllable generators with the day-ahead PV and load demand prediction and the prescribed OR requirement. In a second stage, possible future forecasting uncertainties are considered. Hence, a stochastic operational planning is optimized in order to commit enough flexible generators to handle unexpected deviations from predic-tions. The proposed methodology is implemented for a local energy community. Results regarding the available operating reserve, operating costs and CO2 emissions are established and compared. About 15% of economic operating costs and environmental costs are saved, compared to a deterministic generation planning while ensuring the targeted security level.

The net demand forecast in scenario ω at time step t, the difference between the total load demand forecast and photovoltaic generation forecast. r ω (t) Expected operating reserve requirements for the electrical system in scenario ω at time step t.

Parameters ε
The risk index of LOLP (Loss of Load Probability). p m , p m The minimum and maximum power generation limits of generator m. The operating costs for generator m producing p m (t) or p m,ω (t). ce m (p m (t)) The CO 2 equivalent emission costs for generator m producing p m (t) or p m,ω (t).

I. INTRODUCTION
Renewable energy sources (RES) like wind or solar power generation are intermittent. They are sensible to meteorological changing, which makes it unrealistic to forecast them accurately. Because of their pollution free characteristic and decreased costs, small-scale RES generators are more and more used for residential applications. They increase local profits in energy self-production and self-consumption for citizens, limit greenhouse emissions and differs infrastructure investments in transmis-sion & distribution capacities [1]. Classically, with forecasting data of load demand and renewable generation, determinist unit commitment methods find the optimal scheduling of all controllable generators to balance the electrical system while minimizing the operating cost at each time step of the next day [2]. However, uncertainties in generation and consumption forecasting induce unavoidable deviations between scheduled and optimal generation decisions. In isolated micro grids and balancing areas, the largescale development of small-sized variable RES increases local dynamic power imbalances between power generation and consumption [3]. Primary frequency controllers of existing conventional generators are strongly solicited to provide operating reserve (OR) in order to compensate unexpected power imbalances [4], [5]. Therefore, sizing and providing OR requirement is essential to ensure the power system security [6]. OR must be well quantified to avoid extra operational costs due to unnecessary scheduled commitments of generators. Moreover, an optimal reserve allocation among available controllable generators is required by considering a trade-off between their dynamic response and operational cost.
In order to ensure the security of the electrical system, a risk level is usually prescribed before the operation decision of the electrical system. Based on a probabilistic analysis of forecasting errors, additional reserve power is determined and implemented in a deterministic unit commitment (DUC) as an additional and potential power that could be used during the operation [7]. For example, in [8] the reserve is optimized by a constrained unit commitment optimization with a loss of load probability index. A probabilistic method for quantifying the required OR by using forecast errors quantiles of wind production has been presented in [9].
A stochastic unit commitment (SUC) uses a representation of the uncertain forecasting by various possible scenarios in the UC formulation and, so, include uncertainties in the solution search [10]- [13]. The uncertainty behavior of variables and their inter-actions that may potentially change the state of the system are represented. This modelling enables the determination of possible system's states and consequences when constraints are not satisfied. Fundamental concepts of SUC, including different problem formulations and the most common decomposition techniques applied to solve the problem can be found in [14].
In contrast to scenario-based stochastic programming models, robust unit commitment (RUC) methods try to incorporate uncertainty without the information of underlying probability distributions, and instead with only the range of the uncertainty. In place of minimizing the total expected cost as in SUC, RUC minimizes the worst-case cost regarding all possible outcomes of the un-certain parameters. Certainly, this type of models produces very conservative solutions, but computationally it can avoid incorporating a large number of scenarios. In [15], a robust interval uncertainty method and a scenario-based method are detailed and compared. The results conclude that the performance of interval-based approach is greatly dependent on interval choices, while the computational cost is low. Compared to interval-based robust optimization, the scenario-based method leads to solutions with higher accuracy, but with higher computational complexity. A great challenge of scenario-based SUC is the speed up of the problem solving. To tackle this problem, we propose the determination of a limited number of scenario and the refined exploitation of fast generators to counter pass probable uncertainties.
In chance-constrained unit commitment (CCUC), certain constraints are only satisfied under a preset probability in [16]. To avoid the overestimated costs caused by extreme worst-case that are unlikely to happen, a trade-off is performed between cost and robustness by means of setting a probability of the selected solution to be feasible. Despite the computational difficulty, a joint CCUC is considered in UC with a joint probabilistic constraint for the RES uncertainty in [17]. However, a drawback of CCUC is that probabilistic 97040 VOLUME 9, 2021 constraints can be nonconvex and hard to evaluate, thus making these approaches potentially computationally demanding.
By comparison with RUC and CCUC, it is clear that SUC adds an acceptable extra computational complexity in solving methods while preserving accuracy of results.
However, the quantification and pre-allocation of the reserve power one day-ahead in a SUC is still a problem since efficiency and reliability when solving such a problem is greatly dependent on the number of scenarios. To overcome these disadvantages, [18] merges a probabilistic reserve constraint technique and a SUC approach with a limited number of scenarios to overcome the problem of computational cost. By considering also the additional stochasticity from RES, [19] proposes a conditional value of risk during the SUC procedure to deal with RES uncertainties whereas, the separated commitment of slow and fast generators according to the uncertainty modelling would be an improvement.
Previously, a two-stage unit commitment strategy has been formulated with wind uncertainty by considering various locations of wind generators and transmission line failures [20]. Once the commitment decisions of slow generators are made in the first stage, they are unalterable in the second stage. Whereas for each fast generator, the commitment and the set point are adjustable in the second stage. However, the overall method cannot be adapted for urban networks or microgrids, because the transmission constraints complicate the building of scenarios. Also specificities of small power systems are not taken into account. In our study, a co-optimization framework will be presented for a local energy community with PV generation and Combined Heat and Power (CHP) generation comprising slow/fast generators that can be used for electrical energy compensation and emergency generation.
The literature review shows that probabilistic-based DUC and scenario-based SUC have certain advantages regarding reserve allocation onto controllable generators. They should be properly adapted and combined. Based on the literature review, a stochastic optimization framework for day-ahead unit commitment is proposed in this study to take into account the PV production uncertainty. The proposed operational planning scheme is organized in two stages, but with different tasks regarding the uncertainty handling. The first stage calculates ad hoc requirements on reserve supply from a probabilistic-based uncertainty analysis on past forecasting PV errors, and then, performs an optimal DUC with a Mixed-Integer Programming (MIP) method. The second stage is a stochastic operational planning. With an uncertainty prediction by considering various future scenarios and their corresponding probabilities, a SUC is formulated and applied to bring enough flexibility through the decided power scheduling of fast generators in case of possible deviation from forecasting values.
The contributions of this paper are: 1) A risk constraint based method is detailed to determine the OR after a probabilistic analysis of past forecasting errors; 2) In a first stage, forecasted data and the required OR are considered and a DUC method is applied to optimize the generation planning one day-ahead; 3) In a second stage, occurrences of probable uncertainties are considered and the strategy is to use flexible generators to compensate them. Therefore, the commitment of slow generators is not changed. By considering probable PV production scenarios, a SUC method optimally recalculates the dispatching of the power reserve and the optimal generation planning of fast generators in order to adapt the OR capacity; 4) Mono-objective and multi-objective optimization are compared by considering operating economic costs and/or the CO2 equivalent emission environmental costs.
The paper is organized as follows: Section 2 explains the reserve determination, which is based on a risk assessment method; Section 3 describes the mathematical formulation of the Unit Commitment. Section 4 details the scheme of the two-stage optimization algorithm for the deterministic and stochastic operational planning. Section 5 presents the obtained results in a local energy community with DER, as well as the impact analysis of the uncertainty propagation on the cost, risk criteria and the self-production rate of electricity from RES. Perspectives and conclusions are given in section 6.

II. RISK CONSTRAINED PROBABILISTIC METHOD FOR RESERVE DETERMINATION
In recent decades, many techniques for forecasting have been developed and they all own two characteristics. Forecasting is a stochastic problem by nature and produces outputs in a probabilistic form, such as a probability density function, a prediction interval, some quantile of interest, a forecast under a scenario, etc. Current energy management systems cannot yet take probabilistic inputs, so the most commonly used forecasting output form is still the future expected value of a random variable. Moreover, forecast errors are inevitable due to the stochastic nature of forecasting. The motivation of our research work is not to focus on an improvement of forecasting techniques. It is first to analyze forecast error uncertainty regardless of applied forecasting technique and then to propose a method for planning generators in order to be able to balance possible errors.
To get forecasting errors, a homemade BP neural networks (BPNN) is used to generate PV power and load forecast data with their confidence intervals (CI) or prediction intervals ( Fig. 1 and Fig. 2) [21]; but other forecasting techniques [22] could also be employed.
Forecast error uncertainty analysis is based on obtained forecasting errors. Operating reserve power is essential to ensure the power balance between intermittent RES generation and load demand in case of mismatch. To achieve an optimal generation planning with the consideration of reserve allocation, reserve requirements for all the electrical system must be quantified in advance. As uncertainties in energy VOLUME 9, 2021 forecasting vary in the day, an appropriate level of minimum power reserve must be determined for each considered time step. To set a desired level of system security, a risk index must be prescribed. Then the operating reserve (OR) power must be quantified in advance (one day-ahead) by carrying out a risk-constrained probabilistic method. According to the forecasted renewable energy generation uncertainty and load uncertainty at each time step, the probabilistic reliability is assessed by an index as the Loss of Load Probability (LOLP). LOLP is the probability that a power shortage may occur. It is a measure of the expectation that the load demand may exceed generating capacity of an electrical system during a given time step.
The positive net demand deviation represents the power losses, which may be caused by an unexpected increase in demand or an overestimation of PV generation capacity (Fig. 3).
An acceptable risk (ε) corresponds then to the area in red and the reserve power (r(t)) to cover this risk appears in green on the characteristic. The risk is assessed when the required  reserve is enough to cover the net demand deviation D(t): (1) f (x) is an approximated continuous function representing the probability density function of the net demand error. φ(r(t)) is the cumulative distribution function at time step t, considering a reserve requirement r(t)).
In order to assess the electrical system security level, the system operator can set a prescribed risk index; hence, the required reserve is obtained by the inverse cumulative distribution function: φ −1 (1 − ε) (Fig. 4).  For the ease of illustrations, consider normal distributions as pdf approximations because they are simple to implement and well known to be used for easy fast testing. Then, from the historic database of PV and load demand forecasting errors, the mean value and the standard deviation of the forecasted net demand errors are easily obtained at each time step and can be used to develop the normal pdf approximation. Fig. 5 shows the obtained characteristic of the risk according to the power reserve at 11:00 time step. A ε = 5% risk (LOLP index) requires a 21.5 kW reserve to obtain the wished security level.

III. GENERAL SCHEME AND FORMULATION OF THE UNIT COMMITMENT A. TASK
The required OR (r(t)) as well as the missed energy from passive renewables (net demand D(t)) must be provided by controllable generation units (Fig. 6). Among a set of M controllable generation units, the unit commitment (UC) problem is a mathematical optimization that must decide whether a controllable generation unit is used to produce energy and how much power (p m ) each unit is producing at any time step to match the demand and the required reserve power while minimizing an objective function.

B. INTEGRATION OF UNCERTAINTIES IN THE OPTIMIZATION PROCESS
The main difficulty lies in the need of making decisions about the unit commitment before knowing how and when uncertainties will affect the electrical system balancing. The most used strategy is to consider two stages, thereby to solve this optimization problem and find optimal solution in expectation of uncertainty [22], [23] (Fig. 7). The first stage is executed before the uncertain event realization and is based on the modelling of past forecasting errors with pdf to calculate the power reserve. The optimal dispatch and power scheduling of generation is determined with the expected consumption forecast, generation forecast and the required power reserve The second stage is based on a number of reasonable operating conditions that may arise in the future and so consider a probable uncertainty realization. Here, the uncertain PV production forecasting errors is represented in scenarios (rather than their distributions in the first stage). After the occurrence of forecasting uncertainties in each scenario ω, a second optimal dispatch is computed. The future uncertainties are taken into account with possible scenarios and the commitment of fast generators and the power scheduling of all generators are decided. The second stage is used to plan fast generators as flexible generators to erase future uncertainties. Hence at the end of second stage, fast generators are able to provide fast reserve and erase the future uncertainties, which are modeled by scenarios with corresponding probabilities.

C. CONSTRAINTS 1) POWER BALANCING AND RESERVE PROVISION
The balance between generation and consumption is expressed as a first equality constraint. The total amount of conventional generation at time step t must meet the net demand forecast and the required reserve for all time steps: The index ω indicates the considered scenario, as ω = 0 is the forecasted scenario. For large power systems, losses in the distribution network must be added in the power balancing equation. The power reserve has a cost even when it is not used. Especially in small power systems, the cost of reserve is high. Hence it is important to have OR optimal dispatching techniques taking into consideration all conventional unit constraints.

2) GENERATOR LIMITS
The commitment orders of controllable generation units are modelled as binary decision variables (δ m ). The power generation limits between the minimum power (p m ) and rated power (p m ) of each generator m is expressed as: ∀m ∈ M, ∀t ∈ T, ∀ω ∈ W (3) Here p m,ω (t), r m,ω (t) and δ m,ω (t) are all scenariodependent variables

IV. TWO STAGE OPTIMIZATION ALGORITHM A. FIRST STAGE: DETERMINISTIC OPERATIONAL PLANNING WITH A MILP OPTIMIZATION
The operating costs and the CO 2 equivalent emission costs of each Micro Gas Turbine (MGT) m are modelled as linear functions c m (p m ) and ce m (p m ) respectively in order to influence the objective function [24]. Operating costs (in euros per kW.h) are dependent on consumed gas and operating points of MGTs. CO 2 equivalent emission costs are estimated regarding the greenhouse gas emissions (CO 2 , CO and NO x ). The emissions of CO and NO x are converted to CO 2 equivalent emissions according to [24]: 1g of NOx is considered equivalent to 298g of CO2; 1g of CO equivalent to 3g of CO 2 . c u m u m (t) and c d m d m (t) are the start-up and shutdown penalty on the operating costs, ce u m u m (t) and ce d m d m (t) are the start-up and shutdown penalty on the CO 2 equivalent emission costs. The start-up penalty is assumed equal to the operating costs / emission costs during a 5 minutes full load operation. The shut-down penalty is assumed equal to the costs of a full load operation during 2.5 minutes [25].
The economic cost-based mono-objective function for the operational planning in the first-stage is formulated as: subject to (2),(3) ( , p, r) F F is the set of feasible solutions, i.e. set of feasible scheduling decision variables of commitment δ m (t), and power generation p m (t) for MGT m at time step t. The notation ω = 0 for the unique considered scenario is omitted for the ease of equation writing. Similarly, the emission-based mono-objective function for the operational planning in the first-stage is formulated by considering the CO 2 equivalent emission cost: The cost and emission-based multi-objective function is formulated as the sum of the two above functions:

B. BUILDING OF NET DEMAND SCENARIOS FOR THE REPRESENTATION OF FUTURE UNCERTAINTIES
The challenge of building scenarios for the SUC problem is to generate several representative operating points that will properly guide the SUC optimization of the second stage.
Interest of the second optimization is to consider in advance a realizable unit commitment scheduling of fast generators and a power rescheduling of all generators in case of unexpected uncertainties at least cost. The set of scenarios W must take into account all the possible net demand events over the generation scheduling period (the following 24h) with the consideration of different PV generation scenarios. Scenarios with different PV generation predictions are built according to probabilistic characteristics of forecasting errors. Based on the given large data set, the probability distribution of the PV forecast error at each time step t is approximated as a distribution function [26]. For a fixed standard deviation (SD), an occurrence probability can be calculated [27] and so a corresponding future scenario can be considered.
As example, the set of available past PV forecast errors on 23 th June at 11:00 and has as the mean value and standard deviation time µ PV ,t=11:00 = 0.03 and σ PV ,t=11:00 = 0.2, respectively. 97044 VOLUME 9, 2021  If the probability of errors is approximated by a normal distribution then this simplified model can be exploited to consider and build possible future scenarios. As shown in Fig. 9, 68.2% of samples fall within an interval of ±1 SD from the mean, while 95.4% of samples are within an interval of ± 2 SD, and 99.7% of samples are within ±3 SD from the mean.
By considering three standard deviations around the mean, six scenarios can then be built with the PV forecasting time series ( pv (t)). The occurrence probability of each scenario is deduced from the area of corresponding portion under the pdf curve. For example, the probability of scenario 3 (s3) is 34.1% regarding the area under pdf curve in the interval and so is obtained following: By doing so, for each scenario, the expected net demand D ω (t) is calculated, and the operating cost is, hence, obtained by considering different deviations [28]. These deviations are considered as constant all the day in order to estimate margins after propagation in the UC optimization algorithm. Hence, the dispatching adjusts the previous scheduled power in the first stage, according to the varying reserve requirement of each scenario in the second stage.
It must pointed that other types of distributions for the approximation can be also considered as the aim is to generate future scenarios with their probabilities for consideration in the second optimization stage.

C. SECOND STAGE: STOCHASTIC OPERATIONAL PLANNING 1) RESERVE QUANTIFICATION FOR EACH SCENARIO
The difference between the PV generation value in a considered scenario and the predicted PV power one day ahead can be one value among six possibilities: {µ pv,ε (t) ± 0.5σ pv,ε (t), µ pv,ε (t) ± 1.5σ pv,ε (t), µ pv,ε (t) ± 2.5σ pv,ε (t)}. Hence, the required reserve power r ω (t) is deduced: The optimization process must minimize the cost of the deterministic operational planning decisions of the first-stage (including the cost of the scheduled reserves) added with the expected cost of the second-stage decisions (including reserve provision called upon regarding each possible scenario). The trade-off that needs to be considered in the reserve dispatching is the flexibility of fast units versus their higher operating costs (due to their higher marginal fuel costs).
In this study case, fast generators can change commitment within one time step and have similar start up and turnoff costs to those of slow units. The unit commitment of slow generators ∀m ∈ M SLOW in the first stage is kept in the second stage but their references may change. Only fast generators are committed in the second stage optimization (∀m ∈ M FAST , Fig. 10).  The purpose of the optimization function is to minimize the total costs of first and second stages, considering the recourse cost of the second-stage with a weighted probability. So, the cost-based mono-objective function of the operational planning in the second-stage is formulated to take into account the occurrence probability (π ω ) of each scenario ω: where ω=1 π ω = 1. F is the set of scheduling decision variables δ m,ω (t) and p m,ω (t). Thus, this expected cost is directly affected by the uncertainty of the PV forecasting, which is modelled through scenarios and their probabilities.
Similarly, an emission-based mono-objective function for the operational planning in the second-stage is formulated by considering the CO 2 equivalent emission cost: The cost & emission-based multi-objective function is formulated as the sum of the two above functions over the whole set of scenarios: Mixed-Integer Linear Programming (MILP) is implemented for operation planning, and is solved by branchand-cut algorithms, i.e. branch-and-bound algorithm combined with cutting planes [29].

V. APPLICATION FOR THE OPERATIONAL PLANNING OF AN URBAN ENERGY SYSTEM A. PRESENTATION OF THE STUDIED ELECTRICAL SYSTEM
The studied local energy community includes 120kW residential rated loads, a set of 20 passive PV generators with 180kW rated power, and three Combined Heat and Power (CHP) based MGTs (M = 3): 60kW (MGT 1) and two of 30 kW (MGT 2 ad MGT 3). All generators and electrical loads are connected locally in a residential district, thus voltage drops as well as line losses are ignored. Since PV generators are closely located in the current urban network, the received solar irradiation is assumed to be the same. CHP have constraints in response times and minimum electrical power generation, regarding heat power generation, because heat is in the form of hot water. In this study, with the largest rated power and more heat to consume, MGT 1 is a slow-start generator and its commitment cannot be rescheduled in the second stage. MGT 2 and MGT 3 are flexible generators (fast-start generators with a short time response) and their power reference can be rescheduled during the second stage.
The wish is to increase the self-consumption of the local generated electricity while decreasing power exchanges with the bulk power system. In this purpose, the presented methodology is implemented to make operate the local energy community autonomously. The profiles of the half-hourly electricity consumption forecast, and half-hourly forecasted daily PV generation for the corresponding day are given in Fig. 11. Under this situation, the forecasted daily PV energy is 539 kWh; the forecasted daily load demand energy is 1082 kWh. The operating cost functions of MGTs c m (p m (t)) and CO 2 equivalent emission cost functions are approximated as linear functions in their operating range.
The optimization application is using YALMIP [30] and IBM ILOG CPLEX Optimization Solver [31] with Matlab R2018b. The used computer has 8 GB of installed RAM and a 2.70 GHz processor.

B. RESULTS WITH A DETERMINISTIC OPTIMIZATION 1) QUANTIFICATION OF THE OR WITH THE N-1 CRITERION
Traditionally, OR is scheduled by determinist methods as a percentage of the load demand or generation, or by the N-1 criterion as the capacity of the largest power generation unit. Under N-1 criterion, in case of tripping of the largest generation unit, the scheduled OR must be capable of restoring the power. In this study, with the integration of a high penetration of RES, if PV generation is regarded as the tripping generation unit, the power reserve is then calculated according to the largest loss of PV production. The N-1 criterion is implemented as following: 1) The UC and generation scheduling are calculated by considering only the load demand (no PV generation as the previous case).
2) According to the PV production forecast, the power set point of MGTs is reduced to satisfy the power balancing constraint.
3) If one (or many) MGT power reference is under their minimum power, the MGT power reference is increased and forced to be equal to their minimum power. In consequence, the PV production is reduced to satisfy the power balancing constraint and a part of PV generation is lost.
With this criterion, all MGTs are committed by considering no PV generation, their power set points are reduced (to the minimum value if necessary) and so they are always able to produce the power for the load demand in case of the loss of the entire PV power. Fig. 12 shows the generation planning results following the N-1 criterion and the corresponding operating cost at each time step. -all committed MGTs must remain committed with their minimum power reference and -the PV power exceeds the load demand during the day (Fig. 11).
With this N-1 strategy, the daily PV self-consumption rate of PV generation is 17% and the PV self-production is 9%. The effective OR is regarded as the difference between the total power ratings and the set point of committed generators at each time step. When the PV production is reduced, the lost PV power can be used as operating reserve because the PV production can be in-creased if necessary (more load demand as forecasted, faults on a MGT, . . . ). So, the effective reserve is now the addition of the scheduled lost PV power and power margin of committed MGTs ( Fig. 13(a)). Such PV generators enabling a dispatched power limitation is called PV Active Generators (PV AGs). Fig. 13(b) demonstrates that effective (and available) reserve under N-1 criterion is over scheduled, compared with the required reserve for obtaining a 5% LOLP. The gap between the effective daily reserve and the required daily reserve is large from 9:30 to 15:00, and indicates an oversized reserve quantification. While from 15:30 to 19:00, the obtained effective reserve is possibly less than the reserve requirement, which implies a possible risk of a power deficit. It is the reason why determinist methods for OR calculation are gradually replaced by probabilistic methods with a desired security level.
From these results, we can conclude that it is not rational to schedule OR by N-1 criterion, since it is rare to lose all predicted PV power. In case of forecasting error, just a part of the predicted PV power is usually lost. Moreover, the N-1 criterion leads to a sub-optimal decision as the PV production uncertainty is unknown and not quantified. The obtained reserve can be over scheduled during one period, while a deficit of reserve may occur during another period. It is the reason why determinist methods for OR calculation are gradually replaced by probabilistic methods with a desired security level.

2) QUANTIFICATION OF THE OR WITH A RISK ASSESSMENT
When the reserve requirement is quantified by the risk assessment, Fig. 14 shows obtained power set points of generators. All MGTs are switched off between 13:00 and 15:00. With this LOLP risk strategy, the PV self-consumption rate of PV generation is 67% and the PV self-production is 25%. The PV production must be limited (operating under the MPPT point) as it is sometimes more than the load. By this way, as the PV production can be increased if necessary, the shaded power constitutes an OR that is available. Then, the positive effective OR is provided both by the PV limitation (r pv (t)) and by the difference between the maximum generation limits of committed MGTs and their output power at each time step. The available reserve power from the PV limitation is integrated in the optimization formulation, the general balancing constraint formulation (3)(4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14) is adapted as: It is observed that the obtained available effective reserve is equal or superior to the reserve requirement ( Fig. 15(a)). The pre-set security level is obtained. The required daily reserve is 426.5 kWh; the effective daily reserve is 762.5 kWh, which gives rise to a ratio of required reserve to effective reserve 56%. Compared with the N-1 criterion, here the reserve scheduling is more reasonable with a higher reserve utilization rate. Fig. 15(b) shows reserve power allocation in slow generator and fast generators.

C. RESULTS WITH THE STOCHASTIC-BASED METHOD
Based on the probabilistic distributions of the PV generation errors at each time step, six additional scenarios with their corresponding probabilities are considered for the next day to take into account the unexpected variation of PV generation, as explained in Section 4.3 (Fig. 17). Different levels of grey from dark to light indicate the possibility of occurrence from high to low, which imply 40% (dark grey), 80% (middle grey), 99% (light grey) of probability intervals. The load demand forecast is also shown in Fig. 16.
After the stochastic optimization with the different considered PV generation scenarios and the forecasted load demand is done, the generation scheduling is obtained (Fig. 17). The commitment of slow generator MGT 1 is kept whereas the planning of generators (MGT 2 and MGT 3) has changed (in comparison with the first stage, Fig. 16) in order to be able to compensate possible PV production uncertainties and according to nonlinear characteristics of generators.
The required reserve for each scenario is different and is calculated according to: 1) The deterministic load reserve, which is allocated at first-stage; 2) The stochastic PV reserve, which is re-scheduled based on the expected PV generation under each scenario. For   example, the reserve requirement in the worst case regarding the net demand deviation (scenario 1), and effective reserve after stochastic optimization are shown in Fig. 18. Even in the worst case situation (scenario 1), effective reserve is capable of covering all reserve requirement at each time step.
By comparing the reserve under the stochastic optimization ( Fig. 18(a)) with the one under the deterministic optimization (Fig. 15), the reserve requirement has been more precisely calculated and re-scheduled regarding each scenario, as well as obtaining the wished high security level. Meanwhile, compared with Fig. 15(c), Fig. 18(b) illustrates that more reserve power is provided thanks to the commitment availability of fast generators. Daily reserve energy from slow generator is 208 kWh in both deterministic and stochastic unit commitment. As for reserve from fast generators, the daily reserve energy has increased to 450 kWh in the scenario-based stochastic optimization, compared with 390 kWh of reserve energy in the deterministic case, i.e. the daily reserve energy from fast generators has increased 15%.

1) IMPACTS OF THE SCENARIO-BASED UNCERTAINTY MODELLING ON THE COST
The scenario-based optimization is implemented with three objective functions respectively: 1) cost-based mono-objective; 2) CO 2 equivalent emission-based monoobjective; and 3) multi-objective of cost and emission.
Here a multi-objective optimization is taken as an example to analyze the costs and emissions at each time step under six scenario S1-S6, and results are shown in Fig. 19. As illustrated in figures, at each time step, costs and emissions may fluctuate because of PV generation fluctuations around the forecast value. Fig. 19(a) demonstrates impacts of PV uncertainties onto fuel costs and CO 2 equivalent emissions by considering only the 1 st stage optimization. In this way, PV deviation pv ω (t) must be compromised by effective reserve, which is considered as an additional cost for scenario ω. Fig. 19(b) shows fuel costs and CO 2 equivalent emission after the 2 nd stage optimization. Costs and emissions are optimized because reserve is properly scheduled during the 2 nd stage optimization regarding uncertainties under each scenario. Table 1 compares fuel costs and CO 2 equivalent emissions before and after the 2 nd stage optimization. The fuel cost and CO 2 equivalent emission cost vary according to the committed MGTs as well as considered PV generation. The fuel cost and CO 2 -equivalent emission cost can be approximated by a  normal distribution. For example, the pdf of the fuel cost at 17:00 is shown in Fig. 20 with a mean µ cost,t=17:00 = 8 and a standard deviation σ cost,t=17:00 = 0.1, as well as the pdf of the CO 2 -equivalent emission cost with µ emission,t=17:00 = 46, σ emission,t=17:00 = 0.4. The fitted pdf curved is obtained for each time step according to the corresponding histogram.
2) IMPACTS OF THE CHOSEN RISK CRITERIA Criteria for the system security induce different costs. Meanwhile, when the LOLP assessment is considered in the reserve determination during operational planning, different outcomes are obtained under deterministic and scenario-based stochastic optimization algorithm. Table 2 shows the day-ahead operational planning results under different risk criterions. After the application of scenario-based stochastic multi-objective optimization, expected optimal operating cost / emission cost with LOLP in 1 st Stage and 2 nd Stage are reduced by up to around 15%, compared to the N-1 criterion deterministic case. The total energy of the day-ahead reserve requirement and effective reserve are also compared.

3) IMPACTS OF THE RES SELF-PRODUCTION RATE
To study the impact of the RES penetration on operating cost and CO 2 -equivalent emission cost, different RES self-production rates are considered. RES self-production rate is defined as the share of PV electricity over the total local electricity demand. The higher the PV self-production rate is, the more independent the power system is. Fig. 21 shows the cost and emissions under different PV self-production rates under multi-objective criterion. In the studied case, the maximum PV self-production rate is 28%. With the increase of PV self-production rate, the difference between costs of the deterministic N-1 criterion and costs of the LOLP criterion (based on 1 st stage and 2 nd stage optimization) gradually increases. Similarly, CO 2 -equivalent emissions have tendency to decrease under LOLP criterion, compared with the N-1 criterion. As the self-production rate grows, comparing to 2nd stage emission, the 1st stage is more environmental friendly. The operating costs are similar with a slightly difference. As for the risk level, 2 nd stage planning results provide a higher level of power security because more effective reserve power is available in case of power losses. As shown in Table 2, more effective reserve (available reserve) is obtained under 2 nd stage than in 1 st stage.
Overall, with the presented scenario-based optimization approach, the 2 nd stage optimization shows its advantages of more flexible operation planning regarding the reserve provision, giving rise to a higher security level.

VI. CONCLUSION
This work presents an optimization framework to address the problem of the optimal operational scheduling of micro grids. A two-stage optimization algorithm of generation scheduling is presented for an urban MG with optimal reserve dispatching. The proposed method deals with the uncertainty in forecast errors with the optimal operational planning of controllable generators, so that the minimum cost of the operation or/and CO2 emissions one day ahead can be achieved.
In a first stage, the required half-hourly OR is decided with a prescribed LOLP-based risk level, applied on the pdf of the past net demand forecast errors. Then, a deterministic unit commitment gives the generation scheduling and includes PV and load forecasting in addition to OR that are calculated from past uncertainties realizations. Secondly, a stochastic day-ahead operational planning is implemented. The PV uncertainty is then considered according to different scenarios and their probabilities of occurrence at each halfhour. For each scenario, OR can be recalculated by considering the same level of security. Based on the presented PV scenario and by maintaining the commitment of slow generators, a stochastic operational planning considers possible commitment of additional fast generators if necessary and adapts power set-points of all generators to take into account future uncertainties.
Results are presented according to three different objective functions: 1) economic operating cost-based monoobjective; 2) CO 2 equivalent emission-based mono-objective; and 3) multi-objective of cost and emission. Three cases regarding reserve scheduling are compared: N-1 criterion, optimization with probabilistic analysis (1 st stage) and optimization with scenarios regarding probabilities of occurrence (2 nd stage). Both economic operating costs environmental costs are saved while ensuring the targeted security level. Moreover, as shown, this framework enables the analysis of the impact of RES penetration ratio on costs and emissions.
Further works will be oriented to the integration of storage systems as an alternative for fast power reserve provision in replacement of fast generators and for CO2 abatement.