Two-stage stochastic-robust model for the self-scheduling problem of an aggregator participating in energy and reserve markets

This paper addresses a two-stage stochastic-robust model for the day-ahead self-scheduling problem of an aggregator considering uncertainties. The aggregator, which integrates power and capacity of small-scale prosumers and flexible community-owned devices, trades electric energy in the day-ahead (DAM) and real-time energy markets (RTM), and trades reserve capacity and deployment in the reserve capacity (RCM) and reserve deployment markets (RDM). The ability of the aggregator providing reserve service is constrained by the regulations of reserve market rules, including minimum offer/bid size and minimum delivery duration. A combination approach of stochastic programming (SP) and robust optimization (RO) is used to model different kinds of uncertainties, including those of market price, power/demand and reserve deployment. The risk management of the aggregator is considered through conditional value at risk (CVaR) and fluctuation intervals of the uncertain parameters. Case studies numerically show the economic revenue and the energy-reserve schedule of the aggregator with participation in different markets, reserve regulations, and risk preferences.


Introduction
With the target of decarbonization, renewable generators are increasingly used to supply electricity instead of traditional fossil-fired generators [1,2].However, they introduce uncertainties caused by unpredictable weather issues [3].Demand-side resources (DRs) can provide local energy and a flexibility service to compensate for uncertain power fluctuation and relieve the power balancing burden of the upstream grid [4].However, it is difficult for small-scale DRs to take part in electricity markets directly, because their behavior has only a small influence on the markets.Also, large numbers of small-scale participants greatly enlarge the computational burden.To address these issues, an aggregation of small participants is required.An aggregator is a service provider in the demand side that gathers and manages groups of small-scale prosumers and other distributed devices [5,6].It can be a physical or non-physical entity, such as a retailer, a distribution company, or an operator of a local energy system, including a microgrid [7], a community energy system [8], a combined cooling, heating and power system [9], or a virtual power plant (VPP) [10].The aggregator can combine renewable generators with flexible DRs, thereby helping to produce stable power.The aggregator helps the prosumers and other small-scale DRs to participate in various kinds of electricity markets as a price taker [11] or even a price maker [12].The effectiveness of the aggregator in improving system flexibility with high commercial benefit is evaluated in [13], by formulating it as a chance constrained optimization model incorporated the uncertainties of renewables.
The aggregator makes an energy or joint energy-reserve schedule and participates in various markets with the target of maximizing commercial revenue.Reference [14] proposes a bidding strategy for a prosumer aggregator in day-ahead joint energy and reserve markets.The aggregator can manage the flexible resources of prosumers to handle the uncertainties caused by renewable energy generation and power consumption.Reference [15] proposes an energy-reserve scheduling model for an integrated community energy system in day-ahead joint energy and reserve markets with the uncertainties resulting from market prices and renewable generation.In [16], a detailed energy and reserve model for an energy storage system is developed in the stochastic day-ahead unit commitment model.The energy storage system participates in both day-ahead energy and reserve markets with the uncertainties of electricity load, wind power and PV power.A two-stage model can be used in the dayahead self-scheduling problem, since the uncertainty is usually not realized until reaching the operational time.The two stages are defined as "here-and-now" stage (first stage or day-ahead stage), and "wait-and-see" stage (second stage or real-time stage).The energy storage agent in [17] makes a strategic bidding decision as a price maker in energy and reserve markets under wind power generation uncertainty.The energy and reserve markets clear jointly in the first stage, and a real-time balancing market is considered after the realization of the uncertainty in the second stage.
The delivery regulations in the reserve market are much stricter than in the energy market.The promised power level has to be reached within a certain time period, depending on the reserve type.Also, the reserve power has to remain at the target level for at least a certain delivery duration [18].For example, in the Italian ancillary service market, according to the UVAM project launched in 2018 [19], the tertiary spinning reserve should be reached within 15 min and last for at least 120 min, while the tertiary replacement reserve should be reached within 120 min and last for at least 480 min.Primary and secondary reserve trading is still not open to the aggregator.The aggregator's offer/bid size of reserve in the ancillary service market should be no less than 1 MW [20].
There exist uncertainties in the self-scheduling problem of the aggregator [21].These are usually modeled by different methods to avoid risk in decision making.In [22,23], stochastic programming (SP) is applied by generating scenarios to model different realizations of the uncertain parameters.In [24,25], conditional value at risk (CVaR) is employed in the stochastic model to control the risk of profit variability.In [15,26], a robust optimization (RO) approach is used to handle the uncertainties including those of energy price, ancillary service price, wind power, PV power, etc., by achieving the worst realization of these uncertainties.References [27,28] use adaptive robust optimization to avoid the over-conservativeness of conventional RO.
Despite these comprehensive studies, there still exist some gaps which the present work seeks to fill: 1. Few existing papers consider both day-ahead and real-time market stages for energy service and reserve service of the aggregator in detail.This means that the commercial results are not sufficiently reliable.References [14][15][16] consider the energy and reserve markets, although only in the day-ahead stage while neglecting the profit/cost in the real-time stage from the deviation of energy schedule and the reserve deployment used to balance the power system.References [11,17] consider both day-ahead and real-time market stages.However, at the real-time stage, they do not differentiate the remunerations for real-time energy service and for reserve deployment.These have different economic benefits.2. The regulations for reserve service provided by the aggregator are neglected in most existing work.However, as in the official documents [18][19][20], the regulations including minimum offer/bid size and minimum delivery duration need to be strictly followed by all aggregators to provide a certain quality of reserve service for power system security.The reserve schedule of the facilities in the aggregator should be modeled carefully.In [14,15], only charging and discharging power limits are considered for the reserve schedule of the electric energy storage (SE), while the SOC limit is modeled only for the energy schedule.References [16,17] neglect the ramping limit of the reserve schedule of the natural gas turbine (GT).Therefore, the reserve schedules in existing work can be unreasonable.

Few existing studies combine different methods to
deal with different kinds of uncertainties.SP is used by [22][23][24][25], where the uncertainties are modeled by scenarios.Although SP is logically easy to understand, probabilistic distributions of the uncertain parameters are required to generate scenarios, and these are not always available.Also, the increasing number of scenarios may result in computationally complex problems.RO is used by [26,27], where the uncertainties are modeled by fluctuation intervals.It is generally easier to obtain fluctuation intervals than probabilistic distributions and the computational burden is also lower than SP.However, the solutions of RO are too conservative in some cases.References [27,28] use adaptive robust optimization to avoid the over-conservativeness of RO.However, the solution method is complicated.
This paper addresses a two-stage stochastic-robust model for the day-ahead self-scheduling problem of aggregator trading energy and reserve services in various markets under reserve regulations with different kinds of uncertainties.The main contributions of this paper include: 1.A two-stage optimization model is built to support the aggregator of small-scale flexible prosumers and multiple community-owned devices to coordinately trade energy and reserve services in various markets including the day-ahead energy (DAM), reserve capacity (RCM), real-time energy (RTM) and reserve deployment markets (RDM).The impacts of natural gas price in day-ahead natural gas (DGM) and realtime natural gas markets (RGM) are also considered.2. Reserve regulations of the aggregator, including minimum offer/bid size and minimum delivery duration, are modeled to provide a certain quality of reserve service for power system security.The reserve schedules of the facilities in the aggregator are carefully modeled.Auxiliary continuous/binary variables and big M value are introduced to linearize the model into a mixed integer linear programming (MILP) problem.3. A combination approach of SP and RO is provided to solve different kinds of uncertainties including market price, power/demand and reserve deployment uncertainty.This uses the advantages of both SP and RO.The risk preference of the aggregator is managed by the CVaR value and the fluctuation intervals.
The remainder of the paper is organized as follows: the two-stage stochastic-robust model for the day-ahead selfscheduling problem of the aggregator is built in Sect.2; Section 3 analyzes the case studies and Sect. 4 draws the conclusions.

Market framework
The market framework is developed in the market layer in Fig. 1.The aggregator trades electrical energy, reserve capacity and reserve deployment, and buys natural gas in six types of markets.
In DAM, the aggregator makes a day-ahead energy schedule and trades electrical energy under the single pricing mechanism with the market operator a day before the operational day (day D-1).
In RCM, the aggregator calculates the reserve capacity based on the day-ahead energy schedule and trades it with the system operator.The aim of the RCM is to save enough reserve capacity in D-1, so that it can be called and deployed in the real-time stage to help the system operator balance the power system when a sudden power shortage or surplus appears.
The real-time power output of the aggregator may deviate from the day-ahead energy schedule because of the uncertainties which are not realized until arriving at the operational day (day D).This deviation can be traded in RTM with a dual pricing mechanism, in which the energy buying price is always higher than, and the energy selling price is always lower than, the price in the DAM.It can also be regarded as a kind of energy imbalance penalty of the aggregator for not following the day-ahead energy schedule.DAM and RTM can be collectively referred to as the energy market.
In RDM, the reserve service will receive an energy payment if it is called by the system operator.The reserve capacity is deployed to maintain the balance of the power system.If the aggregator cannot supply the amount of the reserve it promised in the RCM, it will be penalized during the settlement.RCM and RDM can be collectively referred to as the reserve market.
In DGM, the aggregator makes its day-ahead natural gas schedule and buys natural gas on day D-1.In RGM, the aggregator trades the amount of natural gas that deviates from its day-ahead schedule.The natural gas buying price is always higher than, and the natural gas selling price is always lower than, the price in DGM, and can also be regarded as a kind of natural gas imbalance penalty of the aggregator for not following the day-ahead natural gas schedule.DGM and RGM can be collectively referred to as the natural gas market.
Here we use a general market framework.In the real world, although the market frameworks in different countries or regions can be different, the generality of this paper is not affected.For example, the names of the markets can be different, RTM can be replaced by the electrical energy imbalance payment in the settlement, and some markets can be operated and cleared jointly, etc.

Uncertainty modeling
Two different methods are generally used to model the decision-making problem under the impact of uncertainty, namely, stochastic programming (SP) and robust optimization (RO).
In SP, uncertainties are modeled based on the generation of scenarios, which represent different realizations of the uncertain parameters.To generate scenarios, the probabilistic distributions of these uncertain parameters are required.However, these are not always available.Also, the increasing number of scenarios may, in some cases, result in computationally complex problems.
In RO, uncertainties are modeled using predicted fluctuation intervals.The RO approach can achieve the worst realization among all possible uncertain outcomes, and therefore obtains solutions from the worst possible scenario.It is generally easier to obtain fluctuation intervals than probabilistic distributions, as needed in SP, and the computational burden is also lower.However, the solutions of RO can be too conservative in some cases.
To take advantage of both methods, a combination of SP and RO is used to model the uncertainties, including market price, power/demand and reserve deployment uncertainties.The approach is shown in Fig. 2.
The market price uncertainty consists of RTM and RDM price uncertainties.The uncertainties of prices affect only the optimality of decisions but not the feasibility of the aggregator.There also exist many methods in the literature to generate accurate price scenarios.Therefore, they are modeled into a scenario-based SP problem.The power/demand uncertainty consists of available PV capacity and electricity demand uncertainties.Conservative RO is used based on the fluctuation intervals of uncertain factors, because these uncertainties affect not only the optimality but also the feasibility of the solution.Furthermore, available PV capacity is affected by weather issues and electricity demand is affected by consumer behavior, both of which cannot be forecasted accurately through scenarios.The reserve deployment uncertainty is the uncertainty of the system operator calling for reserve in the real-time stage.It is also modeled into an RO problem, because it can affect the solution feasibility and the requirement of the system operator is difficult to forecast accurately through scenarios.Other parameters, for example, DAM, RCM, DGM and RGM prices, are considered as deterministic parameters because their predictions are always quite precise.

Decision-making procedure of the aggregator
As in the decision-making layer in Fig. 1, the target of the aggregator is to minimize its overall commercial cost (maximize its overall commercial profit) of trading energy and reserve in all kinds of markets.2) is the profit aggregator earnings in DAM.The single pricing mechanism is assumed in DAM, which means the power selling and buying share the same market price, with the withdraw direction of electricity from the aggregator defined as positive.The second term in (1) as shown in (3) is the cost aggregator spending in DGM for natural gas purchasing.The injection direction of natural gas to the aggregator is defined as positive.The third term in (1) as shown in ( 4) is the profit aggregator earning in RCM from selling upward and downward reserve capacities.

Natural gas market
The start-up and shut-down costs of GT are determined in the day-ahead stage in (5) and cannot be changed at the real-time stage.At the real-time stage, after realizing what may happen in the operational time, several scenarios are set to form the stochastic analysis for the market prices uncertainty.The aggregator trades energy in RTM following (6).A dual pricing mechanism is used in RTM, in which the buying price is always higher and the selling price is always lower than the single DAM price.The cost aggregator spending in RGM for natural gas purchasing is calculated by (7).A dual pricing mechanism is also used in RGM, in which the buying price is always higher and the selling price is always lower than the DGM price.The reserve deployed can receive an energy payment in RDM according to (8).The upward reserve can receive profit, though the downward reserve needs to give some money back.When the downward reserve is deployed, the aggregator can save the fuel and operational costs from the decreased energy production, and therefore, the aggregator needs to give some parts of its saving back.The reserve unsupplied in the reserve deployment is penalized by (9).The satisfaction cost of the prosumers is calculated by (10), including the costs of demand curtailment, PV output management and PV generation.The last term in (1) as shown in (11) is the operational cost of the community-owned devices, GT and SE. (

Day-ahead stage constraints of the aggregator
Constraint ( 12) represents the power balance equation of the aggregator in the day-ahead stage, while constraint (13) limits the power output of the aggregator.Constraint ( 14) represents the natural gas balance of the aggregator in the day-ahead stage, and constraint ( 15) limits the natural gas consumption of the aggregator.
Constraint (16) shows that the upward reserve capacity that the aggregator can provide is the sum of the upward reserve capacities of electricity producing devices, including PV, GT, SE, and the downward reserve capacities of electricity consuming devices, including electricity demand (DE).Constraint (17) shows that the downward reserve capacity that the aggregator can provide is the sum of the downward reserve capacities of PV, GT and SE.Only demand curtailment is considered in this paper, and thus demand management can only provide downward reserve which contributes to the upward reserve of the aggregator.(10) The aggregator of the demand-side small-scale resources needs to follow some regulations when participating in the reserve market to ensure the reserve quality for system balancing.The main regulations include the minimum offer/bid size and the minimum delivery duration.Constraints ( 18)-( 19) define the maximum and minimum offer/bid sizes of upward and downward reserve that the aggregator can provide according to the regulations.Binaries I u ag,t and I d ag,t are used to set the on/ off states of the reserve service.Constraints ( 20)-( 21) find the start and end times of the upward and downward reserve services.Constraints ( 22)-( 23) control the minimum delivery duration ( ) of the upward and downward reserve services.These durations, for example, should be at least 120 min for the tertiary spinning reserve according to the regulations.Constraints ( 24)-( 25) keep the provided reserve service stable during at least the minimum delivery duration.Because the size of the reserve capacity should always follow the size in the last time interval unless there exists a start or end signal of reserve services.Constraints ( 24)-( 25) are non-linear because of the absolute values, which can be linearized by constraints ( 26)- (27), respectively.y u,su ag,t , y d,su ag,t and I u,su,1 ag,t , I d,su,1 ag,t are auxiliary variables and auxiliary binary variables used to help the linearization.M is a sufficiently big parameter.In (26)

Real-time stage constraints of the aggregator
Constraint (28) is the power balance equation at the realtime stage after the reserve deployment, while constraint (29) limits the power output of the aggregator before the reserve deployment.Constraints ( 30)- (31) indicate that the reserve can be deployed in the real time should be positive and no more than the reserve being called by the system operator.The reserve being called by the system operator is defined by the uncertain percentage of the reserve capacity offer/bid in RCM, which are ρ RC,u ag,t and ρ RC,d ag,t in ( 30) and (31), respectively.Constraint (32) represents the natural gas balance and constraint (33) limits the natural gas consumption after the reserve deployment.The binary variable I RT ag,t,w is used to constrain that the upward reserve and downward reserve cannot be deployed simultaneously.Constraint (34) calculates the energy trading in the RTM, using p RT + ag,t,w and p RT − ag,t,w to distinguish the selling direction and buying direction.Constraints (35)-(36) set that the energy trading in both directions is positive.Constraint (37) calculates the natural gas trading in RGM, using g RT + ag,t,w and g RT − ag,t,w (40)

Structure of the aggregator
The demand-side aggregator can aggregate prosumers with community-owned devices, the structure of which is shown in the physical layer in Fig. 1.Prosumers own rooftop PV panels and can manage their PV outputs and electricity demand.The community-owned devices include GT and SE.

Community-owned devices
In the day-ahead stage, the energy conversion efficiency of GT is limited by (46), whereas the upper bound and lower bound of the power output of GT are limited by (47).The binary variable I DA gt,t is used for the on/off state of GT, while the start-up and shut-down states of GT are calculated by (48).Constraints (49)-(50) limit the ramping ability of GT.During the time when GT starts up and shuts down, the impact of the minimum power output should be considered.Constraints (51)-(52) limit the charging and discharging power of SE, in which the binary variable I DA se,t is introduced to characterize the charging and discharging states.Equation (53) presents the electrical energy stored in the SE at the end of each time interval, while (54) imposes the limitation of the state of charge (SOC) of the SE.In (55), the SOC of the SE should go back to the initial value to avoid the impact of the usage on the following day. (45)

 
Community-owned devices can provide reserve capacity according to their capacity margins after knowing the day-ahead energy schedule.Constraints (56)-(57) limit the upward and downward reserve capacities provided by GT, while (58)-( 59) are the ramping limitations of GT.For the SE, Eqs. ( 60)-(61) set the upward and downward reserve capacities according to the charging and discharging power limitation.The constraints of SOC are considered by (62)-(65).Theoretically, at the end of the day, the SOC of the storage needs to go back to the initial state in order to start a new round of work on the following day.Therefore, to ensure that the reserve of SE can be deployed in the real-time stage without affecting its usage for the following day no matter how much reserve will be called by the system operator, Eq. (66) guarantees that the upward and downward reserve capacities supplied by the SE cannot exist simultaneously, and (67) forces the sum of the upward and downward reserve capacities provided throughout a day to be equal, considering the discharging and charging efficiencies.(

Prosumers
Prosumers can also provide reserve capacity through PV output and demand management when they can receive a satisfactory compensation fee.In the day-ahead stage, constraint (69) limits that the PV output should be lower than its available capacity and higher than the minimum value that can be achieved through PV management.Constraints (70)-(71) set the upward and downward reserve capacities that the PV generator can provide.Constraint (72) shows that the reserve capacity of DE is provided by demand curtailment, while deferrable demand is not considered in this paper.In the real-time stage, constraint (73) limits that the PV output after PV output management should be lower than its available capacity, which is an uncertain factor, and higher than the minimum value that can be achieved through PV output management.Constraint (74) limits that the electricity demand after demand curtailment should be lower than the forecasted electricity demand in real time, which is an uncertain factor, and higher than the minimum value that can be achieved through demand curtailment.

Time scale
Variables

Risk management of the aggregator
In the real-time stage, the uncertain available PV capacity, electricity demand and reserve deployment can be modeled as (77)-(80).RO is used to find the worst realization of these parameters, the specific method of which can be found in [15,26].P RT ,ca pv,t , D RT i,t , ρ RC,u ag,t , and ρ RC,d ag,t are the mean values of the upper and lower bounds of the corresponding fluctuation intervals, whereas P RT ,ca pv,t , D RT i,t , ρ RC,u ag,t , and ρ RC,d ag,t are half of the corresponding fluctuation intervals.The risk management of the uncertain parameters can be realized by adjusting the fluctuation intervals through γ pv i,t , γ de i,t , γ RC,u ag,t , and γ RC,d ag,t ranging from 0 to 1.The risk-averse aggregator chooses larger fluctuation intervals to avoid commercial risk.On the other hand, the risk-neutral aggregator chooses smaller fluctuation intervals to obtain higher profit (lower cost).
The uncertain RTM price and RDM price are described by generating scenarios.All scenarios are included in set W, and the CVaR value is introduced to measure the risk caused by uncertain parameters [24,25] F AG is the total cost of the aggregator in (1).A weight factor β taking values from 0 to 1 models the trade-off between the aggregator profit and the risk of profit variability corresponding to a specific probability level α .When the aggregator is risk-averse, it desires higher importance of the risk term, which leads to a more conservative behavior in marketplaces.Therefore, a higher value of β means that the aggregator is more risk-averse, while a lower value of β means that the aggregator is more risk-neutral.κ is the auxiliary variable representing value-at-risk (VaR), and the non-negative variable ξ w is the excess cost over κ in scenario w.

Case study
The proposed model after linearization is a MILP.To evaluate the performance of the model, case studies are analyzed by GUROBI 9.1.1 on MATLAB R2020a with the YALMIP toolbox.The experiments are performed on a laptop equipped with an i7-9750H CPU and 16 GB RAM.The computational time of all the cases is within 3000 s with a gap of 0.01.This is adaptable for the day-ahead self-scheduling problem and can be extended to problems of larger scale.

Basic data
The community-owned devices of the aggregator including a GT and an SE.There are 20 prosumers owning roof-top PV panels and flexible electricity demands that can provide and consume electricity at the same time.There are also 20 flexible electricity consumers that can curtail their demand when the receiving profit is higher than their satisfaction losing cost.The maximum PV output management is 40% of its available capacity, while the maximum demand curtailment is 15% of the demand value.The technical parameters of the communityowned devices are given in Table 1 [29][30][31].A typical day (85) ξ w ≥ 0 (86) (2)−( 23), ( 26)−( 29), (32)−( 41), (44)−(80) in July 2021 in northern Italy is considered in the case studies in order to fully analyze the operation of PV panels.The deterministic electricity demand and available PV capacity of the prosumers/consumers are set as the average values of all the days in July 2021 from the Italian transmission system operator (TSO)-Terna, which are given by the black curves in Fig. 3 [32].In the real-time stage, the electricity demand and available PV capacity of the prosumers/consumers are uncertain parameters described by the predicted fluctuation intervals, which are shown by the gray shadows in Fig. 3a and b, respectively [32].The reserve deployment is also set by the predicted fluctuation intervals, ranging from 40 to 100%.Tertiary spinning reserve is considered in this case study.The minimum delivery duration is 120 min, and the minimum offer/bid size is 1 MW.
The market data are collected from the Italian power exchange-GME [33].Some prices in practice are adjusted to be consistent with the model, since the Italian market has its special rules which are not considered in this paper.The DAM price is set as the average DAM price of the 31 days in July 2021.This is shown in Fig. 4a.The RCM price is set as 0.2 of the DAM price.The natural gas price is a daily price.The DGM price is set as the average DGM price of the 31 days in July 2021, which is 35.631€/MWh.A stable natural gas market is considered where RGM prices are the same as the DGM price.The prices with uncertainties are described by scenarios.For the RTM price, since the Italian TSO calculates it as an energy imbalance penalty in the settlement based on the DAM price level and the real-time situation, five scenarios consisting of five pairs of buying and selling prices are generated from the DAM price data of 31 days in July 2021 through K-means clustering, as shown in Fig. 4b.For the RDM price, the marginal prices of the balancing market of 31 days in July 2021 are collected.Five scenarios consisting of five pairs of upward and downward reserve prices are generated through K-means clustering, as shown in Fig. 4c.Therefore, the uncertain market prices are represented by 25 scenarios.The possibilities

Effects of market participation
In cases 1 and 2, the uncertainties of all parameters are initially ignored.All market prices in these two cases are set as the average values of 31 days in July.All electricity demands, PV outputs and reserve deployments are set as the mean values of the upper and lower bounds of the corresponding fluctuation intervals.Comparing case 2.a (case 2 scenario a) with case 1, as shown by the red and black curves in Fig. 5, dayahead energy schedule changes when the aggregator can sell reserve in the RCM and RDM.From 8:15 am to 16:00 pm (quarter 33-64) and from 18:15 pm to 22:00 pm (quarter 73-88), the aggregator decreases its power output in order to provide more upward reserve capacity, because in these periods, the revenue of selling upward reserve is much higher than selling energy.From 6:15 am to 8:00 am (quarter 25-32) and from 17:15 pm to 18:00 pm (quarter 69-72), the aggregator increases its power output in order to provide more downward reserve capacity, because the profit earned from selling downward reserve capacity and deployment is higher than the cost from increasing the power production.As is shown in Table 3, although the day-ahead energy cost in DAM, satisfaction cost of prosumers and operational cost of community-owned devices are all higher in case 2.a than in case 1, the total cost of the aggregator decreases from 9082.017 € in case 1 to 5107.061 € in case 2.a, thanks to the revenue from the reserve market.To give more specificity, the energy-reserve schedules of all community-owned devices and prosumers inside the aggregator are shown in Fig. 6.In Fig. 6a, as is shown by the blue bars, during 6:15 am-8:00 am (quarter 25-32) and 16:15 pm-18:00 pm (quarter 65-72), GT provides downward reserve.During other periods, GT provides upward reserve.In order to provide spinning reserve, during 0:15 am-6:00 am (quarter 1-24), GT is turned on and maintains the minimum power output when it decides to participate in the reserve market.During 7:15 am-8:00 am (quarter 29-32) and 16:15 pm-18:00 pm (quarter 65-72), GT does not increase the power output when providing downward reserve capacity, because it has enough downward margin.As is shown in Fig. 6b, for most of the time, SE is used to react to the price fluctuations, though it can only provide limited reserve service directly.The requirements of the SE participating in the reserve market are quite strict to ensure that the SE can provide the reserve deployment at the real-time stage without affecting its usage for the next day.
For prosumers, the total power output of PVs is shown in Fig. 6c.With the help of PV output management, during 5:15 am-6:00 am (quarter 21-24) and 8:15 am-16:00 pm (quarter 33-64), PVs lower the power output to provide upward reserve capacity.During 6:15 am-8:00 am (quarter 25-32), PVs increase the power output to provide downward reserve capacity.During 16:15 pm-18:00 pm (quarter 65-72), PVs produce downward reserve without increasing the power output, because they have enough downward margin.For DEs, the total forecasted demands in the day-ahead stage need to be supplied regardless of whether DEs provide reserve (in case 2.a) or not (in case 1).The demand curtailment can only provide downward reserve service, and this contributes to the upward reserve of the aggregator.As shown in Fig. 6d, DEs provide reserve only when they can receive enough satisfaction compensation fee for the demand curtailment.

Reserve market
Uncertainty Scenario description

Effects of reserve regulations
In case 2.d, the effects of reserve regulations are analyzed.In case 2.b, only one side of the reserve service is needed by the system operator for the whole day.When only upward reserve is needed, the cost of the aggregator increases to 5399.726 €, different from case 2.a.As shown in Fig. 7a, the power output of the day-ahead schedule in case 2.b is always lower than that in case 1 to provide enough upward reserve capacity, except during 0:15 am-6:00 am (quarter 1-24) and during 22:15 pm-24:00 am (quarter 89-96), during which GT needs to keep at least its minimum power output to provide upward spinning reserve.When only downward reserve is needed by the system operator, the cost increases to 6441.654 € different from case 2.a.The power output of the aggregator is always higher or equal to the power output in case 1, as is shown in Fig. 7b, so as to provide enough downward reserve capacity.In case 2.c, the effects of minimum offer/bid size regulation of reserve capacity are analyzed.The cost of aggregator increases to 6528.916 € more than in case 2.a, when the minimum offer/bid size increases from 1 to 3 MW.As is shown in Fig. 8a, from the aspect of power value, the aggregator provides more reserve capacity, especially downward reserve capacity than in case 2.a.However, the time of upward reserve service decreases a lot during the early morning and the late night.This is because the larger scale limitation of reserve capacity decreases the profit of selling upward reserve during these periods when the reserve capacity price and deployment price are quite low and highly fluctuating.When the minimum offer/bid size decreases from 1 to 0 MW, the cost In case 2.d, the effects of the minimum delivery duration regulation are analyzed.The cost increases to 5229.855 € more than in case 2.a, when the minimum delivery duration increases from 120 to 180 min.The downward reserve service remains longer than case 2.a, as is shown in Fig. 9a.However, the power of downward reserve capacity decreases during 5:15 am-8:00 am (quarter 21-32) compared to 6:15 am-8:00 am (quarter 25-32) in Fig. 5.Because providing downward reserve during this period is not sufficiently profitable, and thus, when the minimum delivery duration is forced to increase, the aggregator lowers the power of the reserve capacity.The cost decreases to 4834.184 € different from case 2.a, when the minimum delivery duration decreases from 120 to 60 min.As shown in Fig. 9b, the aggregator provides upward reserve during the whole day to maximize the commercial revenue.The reserve capacity values change in every hour, except during 9:15 am-16:00 pm (quarter 37-64), when the reserve capacity provided reaches the upper limit.

Effects of natural gas market
Case 2.e is set to analyze how RGM prices can affect the schedule of the aggregator.In case 2.a (base case), a stable natural gas market is considered where RGM price is equal to the DGM price.Considering the increasingly fluctuating market environment, the effects of the dual price mechanism of RGM need to be considered.In case 2.e, when RGM+ t is set as 1.25  4. Compared with case 2.a, the day-ahead energy schedule, upward and downward reserve capacities, upward and downward reserve deployments and day-ahead natural gas schedule are largely not affected.However, in the real-time stage, the aggregator starts buying electricity from RTM to replace producing electricity from the natural gas bought from RGM because the price of RGM now is not sufficiently profitable.The total cost of the aggregator increases by about 12% from 5107.061 to 5711.371 €.When RGM+ t is set as 1.5 • DGM t and RGM− t as 0.5 • DGM t , the scenario is represented by case 2.e-(1.5, 0.5) as in Table 4.The aggregator increases its day-ahead power output and buys less electricity from DAM, through which it can provide more reserve capacity but less upward reserve capacity.In the real-time stage, both upward reserve deployment and downward reserve deployment decrease, because reserve deployment needs the support of natural gas from RGM, which is now, however, less profitable.The total cost increases by about 17% from 5107.061 to 5956.472 €.In order to provide more reserve service and save economic costs, the aggregator can equip itself with natural gas storage to compensate for the deviations in the real-time natural gas schedule.However, it is not the focus of this paper and thus is not explored further.

Effects of uncertainties and risk management
In case 3.a, the power/demand uncertainty and reserve deployment uncertainty are considered using RO with data given in Fig. 3 and fluctuation intervals given in Sect.3.1.For simplicity, the control parameters of power/ demand uncertainty are represented by parameter γ 1 = γ de i,t = γ pv i,t , and the control parameters of reserve deployment uncertainty are represented by parameter γ 2 = γ RC,u ag,t = γ RC,d ag,t .Twelve sub-scenarios with different risk preferences are generated as in Tables 5 and 6.In   Table 5, the control parameter γ 2 is set as 0 and γ 1 is set as 0 (same as case 2.a), 0.2, 0.4, 0.6, 0.8, and 1.In Table 6, the control parameter γ 1 is set as 1 and γ 2 is set as 0, 0.2, 0.4, 0.6, 0.8, and 1.
From the results shown in Tables 5 and 6, it can be seen that the total cost of aggregator declines when γ 1 or γ 2 decreases.This is because when the aggregator is more risk-neutral, its strategy is less conservative so it can save more cost (earn more profit) while taking more commercial risk.The satisfaction cost of prosumers (and consumers) goes down when γ 1 decreases, as is shown in Table 5.Because γ 1 controls the power/demand uncertainty which is the uncertainty of prosumers, prosumers are less conservative and save more cost when γ 1 is smaller.The reserve deployment profit increases when γ 2 decreases as is shown in Table 6.This is because the reserve deployment uncertainty causes the profit loss, which is lower when γ 2 is smaller.
In case 3.b, the market price uncertainty is further considered using the SP with the price scenarios given in Fig. 3. γ 1 and γ 2 are fixed as 1.The risk management through the CVaR value is introduced and analyzed through six sub-scenarios in Table 7, by setting the weight factor β as 0, 0.2, 0.4, 0.6, 0.8, and 1.
It can be seen that when β decreases (the aggregator is more risk-neutral), the CVaR value increases, which means that aggregator takes more commercial risk.For most of the time, there is a trade-off between the CVaR value and the total cost of the aggregator.When the CVaR value is higher, the total cost of the aggregator is lower, except when β ≈ 1 .This means that a mutual bet- ter performance of commercial profit and commercial risk may happen in some extreme cases.However, in the average sense, commercial profit and commercial risk are in an antagonistic relationship, i.e., one at the cost of the other.Moreover, when β decreases, day-ahead energy cost increases and reserve deployment profit also increases.This means that when the aggregator is more risk-neutral, it tends to produce more upward reserve by decreasing the power output in the day-ahead stage.Otherwise, when the aggregator is more risk-averse, it tends to increase the power output in the day-ahead stage and sell more energy in the DAM.
In case 3.a, RO is used for power/demand uncertainty and reserve deployment uncertainty.From Tables 5 and  6, the total cost of the aggregator goes up sharply with the increase of γ 1 and γ 2 .Therefore, if the control param- eters are not chosen carefully, the problem can easily receive over-conservative results.However, no matter what are the values of γ 1 and γ 2 , the computational time is always under 20 s, which is close to the deterministic problem (when γ 1 and γ 2 are set as 0).In Table 7, when SP is further used for the market price uncertainty, the computational time increases significantly to about 3000 s.However, the total cost of the aggregator fluctuates slightly with different β.It means that although the SP increases the computational complexity, it does not increase the conservativeness of the results.Therefore, this paper categorizes the uncertainties following Sect.2.2 and uses a combination approach of RO and SP to avoid the over-conservative results and over-complex computation of RO and SP, respectively.
It can also be seen from Tables 3, 4, 5, 6 and 7 that the aggregator avoids unsupplied reserve because of the heavy penalty price.Moreover, trading energy in the RTM is unprofitable compared to in the DAM, because of the dual price mechanism, which makes the aggregator always try its best to follow its day-ahead energy schedule and trades only a small energy deviation in the RTM.

Conclusion
In this study, a two-stage stochastic-robust model is built to solve the day-ahead self-scheduling problem of the aggregator.It can trade electrical energy and reserve in the DAM, RCM, RTM and RDM under uncertainties including those of market price, power/demand and reserve deployment.The reserve regulations from reserve market rules are modeled to limit the minimum offer/ bid size and minimum delivery duration in the reserve market.The uncertainties are modeled by a combination method of SP and RO.The risk management through CVaR value and fluctuation intervals is considered to reflect the risk preference of the aggregator.
The developed model can help the aggregator earn more profit by participating in the energy market and reserve market jointly, compared to only participating in the energy market.The commercial profit and the commercial risk are trade-off problems of the aggregator under uncertainties.By selecting the appropriate weight factor of CVaR and fluctuation intervals in the model, the aggregator can make corresponding optimal strategies under its risk preference.The model can also improve the coordination of the energy and reserve services provided by the aggregator by optimizing the energy and reserve schedules coordinately under a holistic market framework.From the perspective of the TSO, this model can ensure the quality of reserve service through the reserve regulations.This can help the aggregator provide a reliable balancing service in the real-time operation of the power system.
In future studies, we will focus on how the aggregator simultaneously trades multiple types of reserve or even other kinds of ancillary service.This can further optimize the self-scheduling decision.How to activate the potential of the SE to provide more reserve service directly considering its complex technical limitations is another point to be discussed in the future.Future study can further extend to the market operation mechanism, as how to achieve the incentive-compatibility between the aggregator and the market operator is also an interesting topic to be analyzed.

Page 2 of 20
Wang et al.Protection and Control of Modern Power Systems (2023) 8:45

Fig. 3 Fig. 4
Fig. 3 DE and available PV capacity of a prosumer/consumer

Fig. 5
Fig. 5 Energy-reserve schedule of the aggregator in case 2.a

Fig. 6 Fig. 7
Fig. 6 Energy-reserve schedule of all community-owned devices and prosumers in case 2.a

Fig. 8 Fig. 9
Fig. 8 Energy-reserve schedule of the aggregator in case 2.c g

OBJECTIVE: Minimize the overall cost of aggregator Market layer
is used to limit that only the direction of the aggregator choice in the RDM will be penalized.
w ≤ 0 according to (40b) and a RD,u ag,t,w ≥ 0 according to (40a), and thus, a RD,u ag,t,w equals 0. When I RT ag,t,w is 1, a RD,u ag,t,w ≤ ρ RC,u ag,t • A RC,u ag,t,w

Table 3
Cost and profit of the aggregator in case 1 and case 2.a

Table 4
Schedule of the aggregator in case 2.a and case 2.e

Table 7
Results of risk management through β RT + ag,t , g RT −