Skip to main content

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

Abstract

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.

1 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 day-ahead 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. 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. 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.

  3. 3.

    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. 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 real-time natural gas markets (RGM) are also considered.

  2. 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. 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 self-scheduling problem of the aggregator is built in Sect. 2; Section 3 analyzes the case studies and Sect. 4 draws the conclusions.

2 Problem description

2.1 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.

Fig. 1
figure 1

Model structure

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.

2.2 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.

Fig. 2
figure 2

Uncertainty modeling

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.

2.3 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. The objective function (1) includes ten terms. In the day-ahead stage, the first term in (1) as shown in (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. 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.

$$\min \sum\limits_{t \in T} {\left( \begin{gathered} - F_{t}^{DA} + F_{t}^{DG} - F_{t}^{RC} + CO_{t}^{sud} + \hfill \\ \sum\limits_{w \in W} {\pi_{w} \cdot \left( \begin{gathered} - F_{t,w}^{RT} + F_{t,w}^{RG} - F_{t,w}^{RD} + \hfill \\ CO_{t,w}^{RP} + CO_{t,w}^{saf} + CO_{t,w}^{op} \hfill \\ \end{gathered} \right)} \hfill \\ \end{gathered} \right)}$$
(1)
$$F_{t}^{DA} = \lambda_{t}^{DAM} \cdot p_{ag,t}^{DA}$$
(2)
$$F_{t}^{DG} = \lambda_{t}^{DGM} \cdot g_{ag,t}^{DA}$$
(3)
$$F_{t}^{RC} = \lambda_{t}^{RCM} \cdot \left( {A_{ag,t}^{RC,u} + A_{ag,t}^{RC,d} } \right)$$
(4)
$$CO_{t}^{sud} = co_{gt}^{su} \cdot I_{gt,t}^{DA,su} + co_{gt}^{sd} \cdot I_{gt,t}^{DA,sd}$$
(5)
$$F_{t,w}^{RT} = \lambda_{t,w}^{RTM + } \cdot p_{ag,t,w}^{RT + } - \lambda_{t,w}^{RTM - } \cdot p_{ag,t,w}^{RT - }$$
(6)
$$F_{t,w}^{RG} = \lambda_{t}^{RGM + } \cdot g_{ag,t,w}^{RT + } - \lambda_{t}^{RGM - } \cdot g_{ag,t,w}^{RT - }$$
(7)
$$F_{t,w}^{RD} = \lambda_{t,w}^{RDM,u} \cdot A_{ag,t,w}^{RD,u} - \lambda_{t,w}^{RDM,d} \cdot A_{ag,t,w}^{RD,d}$$
(8)
$$CO_{t,w}^{RP} = \lambda_{t}^{RP} \cdot \left( {A_{ag,t,w}^{RP,u} + A_{ag,t,w}^{RP,d} } \right)$$
(9)
$$CO_{t,w}^{saf} = \sum\limits_{i \in I} {\left[ \begin{gathered} co_{i,de}^{sa} \cdot \left( {\widetilde{D}_{i,t}^{RT} - d_{i,t,w}^{RT} } \right) + \hfill \\ co_{i,pv}^{sa} \cdot \left( {\widetilde{P}_{i,pv,t}^{RT,ca} - p_{i,pv,t,w}^{RT} } \right) + \hfill \\ co_{i,pv} \cdot p_{i,pv,t,w}^{RT} \hfill \\ \end{gathered} \right]}$$
(10)
$$\begin{aligned} CO_{t,w}^{op} & = co_{gt} \cdot p_{gt,t,w}^{RT} \\ & \quad + co_{se} \cdot \left( {p_{se,t,w}^{RT,dch} + p_{se,t,w}^{RT,ch} } \right) \\ \end{aligned}$$
(11)

2.3.1 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.

$$\begin{aligned} p_{ag,t}^{DA} & = \sum\limits_{i \in I} {\left( {p_{i,pv,t}^{DA} - D_{i,t}^{DA} } \right) + p_{gt,t}^{DA} } \\ & \quad + \left( {p_{se,t}^{DA,dch} - p_{se,t}^{DA,ch} } \right) \\ \end{aligned}$$
(12)
$$- \overline{{P_{ag}^{DA,c} }} \le p_{ag,t}^{DA} \le \overline{{P_{ag}^{DA,p} }}$$
(13)
$$g_{ag,t}^{DA} = g_{gt,t}^{DA}$$
(14)
$$0 \le g_{ag,t}^{DA} \le \overline{{G_{ag}^{DA} }}$$
(15)

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.

$$\begin{aligned} A_{ag,t}^{RC,u} & = \sum\limits_{i \in I} {\left( {A_{i,pv,t}^{RC,u} + A_{i,de,t}^{RC,d} } \right)} \\ & \quad + A_{gt,t}^{RC,u} + A_{se,t}^{RC,u} \\ \end{aligned}$$
(16)
$$A_{ag,t}^{RC,d} = \sum\limits_{i \in I} {A_{i,pv,t}^{RC,d} } + A_{gt,t}^{RC,d} + A_{se,t}^{RC,d}$$
(17)

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_{ag,t}^{u}\) and \(I_{ag,t}^{d}\) 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 (\(\Xi\)) 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.

$$I_{ag,t}^{u} \cdot \underline{{A_{ag}^{RC,u} }} \le A_{ag,t}^{RC,u} \le I_{ag,t}^{u} \cdot \overline{{A_{ag}^{RC,u} }}$$
(18)
$$I_{ag,t}^{d} \cdot \underline{{A_{ag}^{RC,d} }} \le A_{ag,t}^{RC,d} \le I_{ag,t}^{d} \cdot \overline{{A_{ag}^{RC,d} }}$$
(19)
$$I_{ag,t}^{u,su} = I_{ag,t}^{u} - I_{ag,t - 1}^{u}$$
(20)
$$I_{ag,t}^{d,su} = I_{ag,t}^{d} - I_{ag,t - 1}^{d}$$
(21)
$$I_{ag,t + \xi }^{u} \ge I_{ag,t}^{u,su} \left( {\xi \in \Xi } \right)$$
(22)
$$I_{ag,t + \xi }^{d} \ge I_{ag,t}^{d,su} \left( {\xi \in \Xi } \right)$$
(23)
$$- \left| {I_{ag,t}^{u,su} } \right| \cdot M \le \left( \begin{gathered} A_{ag,t}^{RC,u} - \hfill \\ A_{ag,t - 1}^{RC,u} \hfill \\ \end{gathered} \right) \le \left| {I_{ag,t}^{u,su} } \right| \cdot M$$
(24)
$$- \left| {I_{ag,t}^{d,su} } \right| \cdot M \le \left( \begin{gathered} A_{ag,t}^{RC,d} - \hfill \\ A_{ag,t - 1}^{RC,d} \hfill \\ \end{gathered} \right) \le \left| {I_{ag,t}^{d,su} } \right| \cdot M$$
(25)

Constraints (24)–(25) are non-linear because of the absolute values, which can be linearized by constraints (26)–(27), respectively. \(y_{ag,t}^{u,su}\), \(y_{ag,t}^{d,su}\) and \(I_{ag,t}^{u,su,1}\), \(I_{ag,t}^{d,su,1}\) are auxiliary variables and auxiliary binary variables used to help the linearization. M is a sufficiently big parameter. In (26), \(y_{ag,t}^{u,su}\) can represent \(\left| {I_{ag,t}^{u,su} } \right|\). Because when \(I_{ag,t}^{u,su} \ge 0\), according to (26b)–(26c) \(y_{ag,t}^{u,su} \ge I_{ag,t}^{u,su}\) and according to (26d)–(26e) \(y_{ag,t}^{u,su} \le I_{ag,t}^{u,su}\). Thus, \(y_{ag,t}^{u,su} = I_{ag,t}^{u,su}\). When \(I_{ag,t}^{u,su} \le 0\), according to (26b)–(26c) \(y_{ag,t}^{u,su} \ge - I_{ag,t}^{u,su}\) and according to (26d)–(26e) \(y_{ag,t}^{u,su} \le - I_{ag,t}^{u,su}\). Thus, \(y_{ag,t}^{u,su} = - I_{ag,t}^{u,su}\). Equation (27) follows the same rule as (26) to represent \(\left| {I_{ag,t}^{d,su} } \right|\) by \(y_{ag,t}^{d,su}\).

$$\left\{ {\begin{array}{*{20}l} { - y_{ag,t}^{u,su} \cdot M \le \left( \begin{gathered} A_{ag,t}^{RC,u} - \hfill \\ A_{ag,t - 1}^{RC,u} \hfill \\ \end{gathered} \right) \le y_{ag,t}^{u,su} \cdot M} \hfill & {\quad \quad ({\text{a}})} \hfill \\ {y_{ag,t}^{u,su} \ge I_{ag,t}^{u,su} } \hfill & {\quad \quad ({\text{b}})} \hfill \\ {y_{ag,t}^{u,su} \ge - I_{ag,t}^{u,su} } \hfill & {\quad \quad ({\text{c}})} \hfill \\ {y_{ag,t}^{u,su} \le I_{ag,t}^{u,su} + \left( {1 - I_{ag,t}^{u,su,1} } \right) \cdot M} \hfill & {\quad \quad ({\text{d}})} \hfill \\ {y_{ag,t}^{u,su} \le - I_{ag,t}^{u,su} + I_{ag,t}^{u,su,1} \cdot M} \hfill & {\quad \quad ({\text{e}})} \hfill \\ \end{array} } \right.$$
(26)
$$\left\{ \begin{aligned} & - y_{{ag,t}}^{{d,su}} \cdot M \le \left( \begin{gathered} A_{{ag,t}}^{{RC,d}} - \hfill \\ A_{{ag,t - 1}}^{{RC,d}} \hfill \\ \end{gathered} \right) \le y_{{ag,t}}^{{d,su}} \cdot M \\ & y_{{ag,t}}^{{d,su}} \ge I_{{ag,t}}^{{d,su}} \\ & y_{{ag,t}}^{{d,su}} \ge - I_{{ag,t}}^{{d,su}} \\ & y_{{ag,t}}^{{d,su}} \le I_{{ag,t}}^{{d,su}} + \left( {1 - I_{{ag,t}}^{{d,su,1}} } \right) \cdot M \\ & y_{{ag,t}}^{{d,su}} \le - I_{{ag,t}}^{{d,su}} + I_{{ag,t}}^{{d,su,1}} \cdot M \\ \end{aligned} \right.$$
(27)

2.3.2 Real-time stage constraints of the aggregator

Constraint (28) is the power balance equation at the real-time 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 \(\widetilde{\rho }_{ag,t}^{RC,u}\) and \(\widetilde{\rho }_{ag,t}^{RC,d}\) 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_{ag,t,w}^{RT}\) 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_{ag,t,w}^{RT + }\) and \(p_{ag,t,w}^{RT - }\) 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_{ag,t,w}^{RT + }\) and \(g_{ag,t,w}^{RT - }\) to distinguish the buying direction and selling direction. Constraints (38)–(39) set that the natural gas transactions in both directions are positive.

$$\begin{aligned} \left( \begin{gathered} p_{ag,t,w}^{RT} + \hfill \\ A_{ag,t,w}^{RD,u} - A_{ag,t,w}^{RD,d} \hfill \\ \end{gathered} \right) & = \sum\limits_{i \in I} {\left( {p_{i,pv,t,w}^{RT} - d_{i,t,w}^{RT} } \right)} \\ & \quad + p_{gt,t,w}^{RT} + \left( \begin{gathered} p_{se,t,w}^{RT,dch} - \hfill \\ p_{se,t,w}^{RT,ch} \hfill \\ \end{gathered} \right) \\ \end{aligned}$$
(28)
$$- \overline{{P_{ag}^{RT,c} }} \le p_{ag,t,w}^{RT} \le \overline{{P_{ag}^{RT,p} }}$$
(29)
$$0 \le A_{ag,t,w}^{RD,u} \le I_{ag,t,w}^{RT} \cdot \widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u}$$
(30)
$$0 \le A_{ag,t,w}^{RD,d} \le \left( {1 - I_{ag,t,w}^{RT} } \right) \cdot \widetilde{\rho }_{ag,t}^{RC,d} \cdot A_{ag,t,w}^{RC,d}$$
(31)
$$g_{ag,t,w}^{RT} = g_{gt,t,w}^{RT}$$
(32)
$$0 \le g_{ag,t,w}^{RT} \le \overline{{G_{ag}^{RT} }}$$
(33)
$$p_{ag,t,w}^{RT + } - p_{ag,t,w}^{RT - } = p_{ag,t,w}^{RT} - p_{ag,t,w}^{DA}$$
(34)
$$p_{ag,t,w}^{RT + } \ge 0$$
(35)
$$p_{ag,t,w}^{RT - } \ge 0$$
(36)
$$g_{ag,t,w}^{RT + } - g_{ag,t,w}^{RT - } = g_{ag,t,w}^{RT} - g_{ag,t,w}^{DA}$$
(37)
$$g_{ag,t,w}^{RT + } \ge 0$$
(38)
$$g_{ag,t,w}^{RT - } \ge 0$$
(39)

Constraints (30)–(31) are non-linear constraints because of the multipliers of binary variable \(I_{ag,t,w}^{RT}\) and continuous variable \(A_{ag,t,w}^{RC,u}\). They can be linearized by constraints (40)–(41) respectively, with the help of two auxiliary variables \(\alpha_{ag,t,w}^{RD,u}\) and \(a_{ag,t,w}^{RD,d}\). M is a sufficiently big parameter. In (40), \(\alpha_{ag,t,w}^{RD,u}\) can represent \(I_{ag,t,w}^{RT} \cdot \widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u}\) for the following reasons. The binary variable \(I_{ag,t,w}^{RT}\) can be 0 or 1. When \(I_{ag,t,w}^{RT}\) is 0, \(a_{ag,t,w}^{RD,u} \le 0\) according to (40b) and \(a_{ag,t,w}^{RD,u} \ge 0\) according to (40a), and thus, \(a_{ag,t,w}^{RD,u}\) equals 0. When \(I_{ag,t,w}^{RT}\) is 1, \(a_{ag,t,w}^{RD,u} \le \widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u}\) according to (40c) and \(a_{ag,t,w}^{RD,u} \ge \widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u}\) according to (40d), and thus, \(a_{ag,t,w}^{RD,u} = \widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u}\). Equation (41) follows the same rule as (40) to represent \(\left( {1 - I_{ag,t,w}^{RT} } \right) \cdot \widetilde{\rho }_{ag,t}^{RC,d} \cdot A_{ag,t,w}^{RC,d}\) by \(a_{ag,t,w}^{RD,d}\).

$$\left\{ {\begin{array}{*{20}l} {0 \le A_{ag,t,w}^{RD,u} \le \alpha_{ag,t,w}^{RD,u} } \hfill & {\quad \quad ({\text{a}})} \hfill \\ {a_{ag,t,w}^{RD,u} \le I_{ag,t,w}^{RT} \cdot M} \hfill & {\quad \quad ({\text{b}})} \hfill \\ {a_{ag,t,w}^{RD,u} \le \widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u} } \hfill & {\quad \quad ({\text{c}})} \hfill \\ {a_{ag,t,w}^{RD,u} \ge \widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u} - \left( \begin{gathered} 1 - \hfill \\ I_{ag,t,w}^{RT} \hfill \\ \end{gathered} \right) \cdot M} \hfill & {\quad \quad ({\text{d}})} \hfill \\ \end{array} } \right.$$
(40)
$$\left\{ \begin{aligned} & 0 \le A_{{ag,t,w}}^{{RD,d}} \le a_{{ag,t,w}}^{{RD,d}} \\ & a_{{ag,t,w}}^{{RD,d}} \le \left( {1 - I_{{ag,t,w}}^{{RT}} } \right) \cdot M \\ & a_{{ag,t,w}}^{{RD,d}} \le \widetilde{\rho }_{{ag,t}}^{{RC,d}} \cdot A_{{ag,t,w}}^{{RC,d}} \\ & a_{{ag,t,w}}^{{RD,d}} \ge \widetilde{\rho }_{{ag,t}}^{{RC,d}} \cdot A_{{ag,t,w}}^{{RC,d}} - I_{{ag,t,w}}^{{RT}} \cdot M \\ \end{aligned} \right.$$
(41)

Constraints (42)–(43) calculate the upward and downward reserve unsupplied considering reserve deployment uncertainty. \(I_{ag,t,w}^{RT}\) is used to limit that only the direction of the aggregator choice in the RDM will be penalized.

$$A_{ag,t,w}^{RP,u} \ge I_{ag,t,w}^{RT} \cdot \left( \begin{gathered} \widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u} - \hfill \\ A_{ag,t,w}^{RD,u} \hfill \\ \end{gathered} \right)$$
(42)
$$A_{ag,t,w}^{RP,d} \ge \left( {1 - I_{ag,t,w}^{RT} } \right) \cdot \left( \begin{gathered} \widetilde{\rho }_{ag,t}^{RC,d} \cdot A_{ag,t,w}^{RC,d} - \hfill \\ A_{ag,t,w}^{RD,d} \hfill \\ \end{gathered} \right)$$
(43)

Constraints (42)–(43) are non-linear constraints because of the multipliers of binary and continuous variables. Two auxiliary variables \(a_{ag,t,w}^{RP,u}\) and \(a_{ag,t,w}^{RP,d}\) are used to form the linearized constraints (44)–(45). M is a sufficiently big parameter. \(a_{ag,t,w}^{RP,u}\) can represent \(I_{ag,t,w}^{RT} \cdot \left( {\widetilde{\rho }_{ag,t}^{RC,u} \cdot A_{ag,t,w}^{RC,u} - A_{ag,t,w}^{RD,u} } \right)\) and \(a_{ag,t,w}^{RP,d}\) can represent \(\left( {1 - I_{ag,t,w}^{RT} } \right) \cdot \left( {\widetilde{\rho }_{ag,t}^{RC,d} \cdot A_{ag,t,w}^{RC,d} - A_{ag,t,w}^{RD,d} } \right)\), which follows the same rule as constraints (40)–(41) and therefore, is not repeated.

$$\left\{ \begin{aligned} & A_{{ag,t,w}}^{{RP,u}} \ge a_{{ag,t,w}}^{{RP,u}} \\ & a_{{ag,t,w}}^{{RP,u}} \le I_{{ag,t,w}}^{{RT}} \cdot M \\ & a_{{ag,t,w}}^{{RP,u}} \ge 0 \\ & a_{{ag,t,w}}^{{RP,u}} \le \widetilde{\rho }_{{ag,t}}^{{RC,u}} \cdot A_{{ag,t,w}}^{{RC,u}} - A_{{ag,t,w}}^{{RD,u}} \\ & a_{{ag,t,w}}^{{RP,u}} \ge \left( \begin{gathered} \widetilde{\rho }_{{ag,t}}^{{RC,u}} \cdot A_{{ag,t,w}}^{{RC,u}} - \hfill \\ A_{{ag,t,w}}^{{RD,u}} \hfill \\ \end{gathered} \right) - \left( \begin{gathered} 1 - \hfill \\ I_{{ag,t,w}}^{{RT}} \hfill \\ \end{gathered} \right) \cdot M \\ \end{aligned} \right.$$
(44)
$$\left\{ \begin{aligned} & A_{{ag,t,w}}^{{RP,d}} \ge a_{{ag,t,w}}^{{RP,d}} \\ & a_{{ag,t,w}}^{{RP,d}} \le \left( {1 - I_{{ag,t,w}}^{{RT}} } \right) \cdot M \\ & a_{{ag,t,w}}^{{RP,d}} \ge 0 \\ & a_{{ag,t,w}}^{{RP,d}} \le \widetilde{\rho }_{{ag,t}}^{{RC,d}} \cdot A_{{ag,t,w}}^{{RC,d}} - A_{{ag,t,w}}^{{RD,d}} \\ & a_{{ag,t,w}}^{{RP,d}} \ge \left( \begin{gathered} \widetilde{\rho }_{{ag,t}}^{{RC,d}} \cdot A_{{ag,t,w}}^{{RC,d}} - \hfill \\ A_{{ag,t,w}}^{{RD,d}} \hfill \\ \end{gathered} \right) - I_{{ag,t,w}}^{{RT}} \cdot M \\ \end{aligned} \right.$$
(45)

2.4 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 roof-top PV panels and can manage their PV outputs and electricity demand. The community-owned devices include GT and SE.

2.4.1 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_{gt,t}^{DA}\) 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_{se,t}^{DA}\) 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.

$$p_{gt,t}^{DA} = \eta_{gt} \cdot g_{gt,t}^{DA}$$
(46)
$$I_{gt,t}^{DA} \cdot \underline{{P_{gt} }} \le p_{gt,t}^{DA} \le I_{gt,t}^{DA} \cdot \overline{{P_{gt} }}$$
(47)
$$I_{gt,t}^{DA,su} - I_{gt,t}^{DA,sd} = I_{gt,t}^{DA} - I_{gt,t - 1}^{DA}$$
(48)
$$p_{gt,t}^{DA} - p_{gt,t - 1}^{DA} \le \left[ \begin{gathered} \left( {1 - I_{gt,t}^{DA,su} } \right) \cdot R_{gt}^{u} + \\ I_{gt,t}^{DA,su} \cdot \underline{{P_{gt} }} \\ \end{gathered} \right]$$
(49)
$$p_{gt,t}^{DA} - p_{gt,t - 1}^{DA} \ge \left[ \begin{gathered} - \left( {1 - I_{gt,t}^{DA,sd} } \right) \cdot R_{gt}^{d} - \\ I_{gt,t}^{DA,sd} \cdot \underline{{P_{gt} }} \\ \end{gathered} \right]$$
(50)
$$0 \le p_{se,t}^{DA,ch} \le I_{se,t}^{DA} \cdot \overline{{P_{se}^{ch} }}$$
(51)
$$0 \le p_{se,t}^{DA,dch} \le (1 - I_{se,t}^{DA} ) \cdot \overline{{P_{se}^{dch} }}$$
(52)
$$E_{se,t}^{DA} = E_{se,t - 1}^{DA} + \left( \begin{gathered} p_{se,t}^{DA,ch} \cdot \eta_{se}^{ch} - \hfill \\ p_{se,t}^{DA,dch} /\eta_{se}^{dch} \hfill \\ \end{gathered} \right) \cdot \Delta t$$
(53)
$$\underline{SOC} \le {{E_{se,t}^{DA} } \mathord{\left/ {\vphantom {{E_{se,t}^{DA} } {S_{se} }}} \right. \kern-0pt} {S_{se} }} \le \overline{SOC}$$
(54)
$$SOC_{96}^{DA} = SOC_{0}^{DA}$$
(55)

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.

$$0 \le A_{gt,t}^{RC,u} \le I_{gt,t}^{DA} \cdot \overline{{P_{gt} }} - p_{gt,t}^{DA}$$
(56)
$$0 \le A_{gt,t}^{RC,d} \le p_{gt,t}^{DA} - I_{gt,t}^{DA} \cdot \underline{{P_{gt} }}$$
(57)
$$\left[ \begin{gathered} \left( {p_{gt,t}^{DA} + A_{gt,t}^{RC,u} } \right) - \hfill \\ \left( {p_{gt,t - 1}^{DA} - A_{gt,t - 1}^{RC,d} } \right) \hfill \\ \end{gathered} \right] \le \left[ \begin{gathered} \left( {1 - I_{gt,t}^{DA,su} } \right) \cdot R_{gt}^{u} + \hfill \\ I_{gt,t}^{DA,su} \cdot \underline{{P_{gt} }} \hfill \\ \end{gathered} \right]$$
(58)
$$\left[ \begin{gathered} \left( {p_{gt,t}^{DA} - A_{gt,t}^{RC,d} } \right) - \hfill \\ \left( {p_{gt,t - 1}^{DA} + A_{gt,t - 1}^{RC,u} } \right) \hfill \\ \end{gathered} \right] \ge \left[ \begin{gathered} - \left( {1 - I_{gt,t}^{DA,sd} } \right) \cdot R_{gt}^{d} - \\ I_{gt,t}^{DA,sd} \cdot \underline{{P_{gt} }} \\ \end{gathered} \right]$$
(59)
$$0 \le A_{se,t}^{RC,u} \le \overline{{P_{se}^{dch} }} - p_{se,t}^{DA,dch} + p_{se,t}^{DA,ch}$$
(60)
$$0 \le A_{se,t}^{RC,d} \le \overline{{P_{se}^{ch} }} + p_{se,t}^{DA,dch} - p_{se,t}^{DA,ch}$$
(61)
$$\begin{gathered} E_{se,t}^{DA,RC,u} = E_{se,t - 1}^{DA,RC,u} + E_{se,t}^{DA} - \\ E_{se,t - 1}^{DA} - \left( {A_{se,t}^{RC,u} /\eta_{se}^{dch} } \right) \cdot \Delta t \\ \end{gathered}$$
(62)
$$\begin{gathered} E_{se,t}^{DA,RC,d} = E_{se,t - 1}^{DA,RC,d} + E_{se,t}^{DA} - \\ E_{se,t - 1}^{DA} + A_{se,t}^{RC,d} \cdot \eta_{se}^{ch} \cdot \Delta t \\ \end{gathered}$$
(63)
$$\underline{SOC} \le {{E_{se,t}^{DA,RC,u} } \mathord{\left/ {\vphantom {{E_{se,t}^{DA,RC,u} } {S_{se} }}} \right. \kern-0pt} {S_{se} }} \le \overline{SOC}$$
(64)
$$\underline{SOC} \le {{E_{se,t}^{DA,RC,d} } \mathord{\left/ {\vphantom {{E_{se,t}^{DA,RC,d} } {S_{se} }}} \right. \kern-0pt} {S_{se} }} \le \overline{SOC}$$
(65)
$$A_{se,t}^{RC,u} \cdot A_{se,t}^{RC,d} = 0$$
(66)
$$\sum\limits_{t \in T} {A_{se,t}^{RC,u} } /\eta_{se}^{dch} \cdot \Delta t = \sum\limits_{t \in T} {A_{se,t}^{RC,d} } \cdot \eta_{se}^{ch} \cdot \Delta t$$
(67)

At the real-time stage, the community-owned devices follow almost the same power constraints as in the day-ahead stage, except that they need to consider the scenarios of uncertain parameters represented by the subscript w. The on/off state of GT is determined in the day-ahead stage and cannot be changed in the real-time stage.

$$\begin{aligned} & p_{gt,t,w}^{RT} = \eta_{gt} \cdot g_{gt,t,w}^{RT} \\ & I_{gt,t}^{DA} \cdot \underline{{P_{gt} }} \le p_{gt,t,w}^{RT} \le I_{gt,t}^{DA} \cdot \overline{{P_{gt} }} \\ & p_{gt,t,w}^{RT} - p_{gt,t - 1,w}^{RT} \le \left[ \begin{gathered} \left( {1 - I_{gt,t}^{DA,su} } \right) \cdot R_{gt}^{u} + \\ I_{gt,t}^{DA,su} \cdot \underline{{P_{gt} }} \\ \end{gathered} \right] \\ & p_{gt,t,w}^{RT} - p_{gt,t - 1,w}^{RT} \ge \left[ \begin{gathered} - \left( {1 - I_{gt,t}^{DA,sd} } \right) \cdot R_{gt}^{d} - \hfill \\ I_{gt,t}^{DA,sd} \cdot \underline{{P_{gt} }} \hfill \\ \end{gathered} \right] \\ & 0 \le p_{se,t,w}^{RT,ch} \le I_{se,t,w}^{RT} \cdot \overline{{P_{se}^{ch} }} \\ & 0 \le p_{se,t,w}^{RT,dch} \le (1 - I_{se,t,w}^{RT} ) \cdot \overline{{P_{se}^{dch} }} \\ & E_{se,t,w}^{RT} = E_{se,t - 1,w}^{RT} + \left( \begin{gathered} p_{se,t,w}^{RT,ch} \cdot \eta_{k}^{ch} - \hfill \\ p_{se,t,w}^{RT,dch} /\eta_{k}^{dch} \hfill \\ \end{gathered} \right) \cdot \Delta t \\ & \underline{SOC} \le {{E_{se,t,w}^{RT} } \mathord{\left/ {\vphantom {{E_{se,t,w}^{RT} } {S_{se} }}} \right. \kern-0pt} {S_{se} }} \le \overline{SOC} \\ & SOC_{96,w}^{RT} = SOC_{0,w}^{RT} \\ \end{aligned}$$
(68)

2.4.2 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.

$$\underline{{P_{i,pv,t}^{DA} }} \le p_{i,pv,t}^{DA} \le P_{i,pv,t}^{DA,ca}$$
(69)
$$0 \le A_{i,pv,t}^{RC,u} \le P_{i,pv,t}^{DA,ca} - p_{i,pv,t}^{DA}$$
(70)
$$0 \le A_{i,pv,t}^{RC,d} \le P_{i,pv,t}^{DA} - \underline{{P_{i,pv,t}^{DA} }}$$
(71)
$$0 \le A_{i,de,t}^{RC,d} \le \overline{{D_{i,t}^{c} }}$$
(72)
$$\underline{{P_{i,pv,t}^{RT} }} \le p_{i,pv,t,w}^{RT} \le \widetilde{P}_{i,pv,t}^{RT,ca}$$
(73)
$$\underline{{D_{i,t}^{RT} }} \le d_{i,t,w}^{RT} \le \widetilde{D}_{i,t}^{RT}$$
(74)

2.5 Time scale

Variables in the day-ahead stage are hourly variables, because of the hourly clearing of DAM and RCM. Variables in the real-time stage are 15-min variables. Therefore, index t represents a 15-min time interval, and all the day-ahead stage variables represented by \(x^{DA}\) and \(x^{RC}\) need to follow (75)–(76), which means that for an hourly variable, during the quarters belonging to the same hour, its values should be same.

$$x_{t}^{DA} = x_{t^{\prime}}^{DA} ,t^{\prime} \in H_{t}$$
(75)
$$x_{t}^{RC} = x_{t^{\prime}}^{RC} ,t^{\prime} \in H_{t}$$
(76)

2.6 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_{pv,t}^{RT,ca}\), \(D_{i,t}^{RT}\), \(\rho_{ag,t}^{RC,u}\), and \(\rho_{ag,t}^{RC,d}\) are the mean values of the upper and lower bounds of the corresponding fluctuation intervals, whereas \(\widehat{P}_{pv,t}^{RT,ca}\), \(\widehat{D}_{i,t}^{RT}\), \(\widehat{\rho }_{ag,t}^{RC,u}\), and \(\widehat{\rho }_{ag,t}^{RC,d}\) are half of the corresponding fluctuation intervals. The risk management of the uncertain parameters can be realized by adjusting the fluctuation intervals through \(\gamma_{i,t}^{pv}\), \(\gamma_{i,t}^{de}\), \(\gamma_{ag,t}^{RC,u}\), and \(\gamma_{ag,t}^{RC,d}\) 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).

$$- \gamma_{i,t}^{pv} \le \frac{{\tilde{P}_{i,pv,t}^{RT,ca} - P_{i,pv,t}^{RT,ca} }}{{\widehat{P}_{i,pv,t}^{RT,ca} }} \le \gamma_{i,t}^{pv}$$
(77)
$$- \gamma_{i,t}^{de} \le \frac{{\widetilde{D}_{i,t}^{RT} - D_{i,t}^{RT} }}{{\widehat{D}_{i,t}^{RT} }} \le \gamma_{i,t}^{de}$$
(78)
$$- \gamma_{ag,t}^{RC,u} \le \frac{{\widetilde{\rho }_{ag,t}^{RC,u} - \rho_{ag,t}^{RC,u} }}{{\widehat{\rho }_{ag,t}^{RC,u} }} \le \gamma_{ag,t}^{RC,u}$$
(79)
$$- \gamma_{ag,t}^{RC,d} \le \frac{{\widetilde{\rho }_{ag,t}^{RC,d} - \rho_{ag,t}^{RC,d} }}{{\widehat{\rho }_{ag,t}^{RC,d} }} \le \gamma_{ag,t}^{RC,d}$$
(80)

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]. The two-stage self-scheduling problem after taking the CVaR value into account is transformed into the following:

$$\min \left( {1 - \beta } \right) \cdot F^{AG} + \beta \cdot CVaR$$
(81)
$${\text{s}}.{\text{t}}.\;\;F^{AG} = \sum\limits_{t \in T} {\left( \begin{gathered} - F_{t}^{DA} - F_{t}^{RC} + CO_{t}^{sud} + \hfill \\ \sum\limits_{w \in W} {\pi_{w} \left( \begin{gathered} - F_{t,w}^{RT} - F_{t,w}^{RD} + CO_{t,w}^{RP} \hfill \\ + CO_{t,w}^{saf} + CO_{t,w}^{op} \hfill \\ \end{gathered} \right)} \hfill \\ \end{gathered} \right)}$$
(82)
$$CVaR = \kappa + \frac{1}{1 - \alpha }\sum\limits_{w} {\pi_{w} \xi_{w} }$$
(83)
$$F_{w}^{AG} - \kappa \le \xi_{w}$$
(84)
$$\xi_{w} \ge 0$$
(85)
$$(2){-}(23),(26){-}(29),(32){-}(41),(44){-}(80)$$
(86)

\(F^{AG}\) is the total cost of the aggregator in (1). A weight factor \(\beta\) 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 \(\alpha\). 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 \(\beta\) means that the aggregator is more risk-averse, while a lower value of \(\beta\) means that the aggregator is more risk-neutral. \(\kappa\) is the auxiliary variable representing value-at-risk (VaR), and the non-negative variable \(\xi_{w}\) is the excess cost over \(\kappa\) in scenario w.

3 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.

3.1 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 community-owned devices are given in Table 1 [29,30,31]. A typical day 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.

Table 1 Main parameters
Fig. 3
figure 3

DE and available PV capacity of a prosumer/consumer

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 of all the scenarios are the same, which is 4%. Other parameters are given in Table 1 [29,30,31]. Three cases for analysis are set in Table 2, with case 2.a set as the base case.

Fig. 4
figure 4

Market prices

Table 2 Description of cases

3.2 Results and discussion

3.2.1 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, day-ahead 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.

Fig. 5
figure 5

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

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

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

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.

3.2.2 Effects of reserve regulations

In case 2.b–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.

Fig. 7
figure 7

Energy-reserve schedule of the aggregator in case 2.b

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 of the aggregator decreases to 5091.198 € different from case 2.a, because the aggregator can provide an extra small amount of downward reserve capacity during 9:15 am–13:00 pm (quarter 37–52) comparing to case 2.a, as is shown in Fig. 8b.

Fig. 8
figure 8

Energy-reserve schedule of the aggregator in case 2.c

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.

Fig. 9
figure 9

Energy-reserve schedule of the aggregator in case 2.d

3.2.3 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 \(\lambda_{t}^{RGM + }\) is set as \(1.25 \cdot \lambda_{t}^{DGM}\) and \(\lambda_{t}^{RGM - }\) as \(0.75 \cdot \lambda_{t}^{DGM}\), the sub-scenario is represented by case 2.e-(1.25, 0.75) as in Table 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 \(\lambda_{t}^{RGM + }\) is set as \(1.5 \cdot \lambda_{t}^{DGM}\) and \(\lambda_{t}^{RGM - }\) as \(0.5 \cdot \lambda_{t}^{DGM}\), 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 downward 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.

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

3.2.4 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 \(\gamma_{1} = \gamma_{i,t}^{de} = \gamma_{i,t}^{pv}\), and the control parameters of reserve deployment uncertainty are represented by parameter \(\gamma_{2} = \gamma_{ag,t}^{RC,u} = \gamma_{ag,t}^{RC,d}\). Twelve sub-scenarios with different risk preferences are generated as in Tables 5 and 6. In Table 5, the control parameter \(\gamma_{2}\) is set as 0 and \(\gamma_{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 \(\gamma_{1}\) is set as 1 and \(\gamma_{2}\) is set as 0, 0.2, 0.4, 0.6, 0.8, and 1.

Table 5 Results of risk management through γ1 (\(\gamma_{2} = 0\))
Table 6 Results of risk management through γ2 (\(\gamma_{1} = 1\))

From the results shown in Tables 5 and 6, it can be seen that the total cost of aggregator declines when \(\gamma_{1}\) or \(\gamma_{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 \(\gamma_{1}\) decreases, as is shown in Table 5. Because \(\gamma_{1}\) controls the power/demand uncertainty which is the uncertainty of prosumers, prosumers are less conservative and save more cost when \(\gamma_{1}\) is smaller. The reserve deployment profit increases when \(\gamma_{2}\) decreases as is shown in Table 6. This is because the reserve deployment uncertainty causes the profit loss, which is lower when \(\gamma_{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. \(\gamma_{1}\) and \(\gamma_{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.

Table 7 Results of risk management through β

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 \(\beta \approx 1\). This means that a mutual better 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 \(\gamma_{1}\) and \(\gamma_{2}\). Therefore, if the control parameters are not chosen carefully, the problem can easily receive over-conservative results. However, no matter what are the values of \(\gamma_{1}\) and \(\gamma_{2}\), the computational time is always under 20 s, which is close to the deterministic problem (when \(\gamma_{1}\) and \(\gamma_{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.

4 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.

Availability of data and materials

All data included in this study are available upon request by contact with the corresponding author.

Abbreviations

DAM:

Day-ahead energy market

RCM:

Reserve capacity market

RTM:

Real-time energy market

RDM:

Reserve deployment market

DGM:

Day-ahead natural gas market

RGM:

Real-time natural gas market

GT:

Natural gas turbine

SE:

Electric energy storage

PV:

Photovoltaic panel

DE:

Electricity demand

SP:

Stochastic programming

RO:

Robust optimization

t (T):

Index (set) of time interval

\(\xi\)(\(\Xi\)):

Index (set) of reserve delivery duration

Ht :

Set of time interval t that belongs to the same hour H

w (W):

Index (set) of scenarios

i (I):

Index (set) of prosumers

DA, RT:

Index of day-ahead stage and real-time stage

\(\eta_{gt}\) :

Electricity production efficiency of GT

\(\eta_{se}^{ch} ,\eta_{se}^{dch}\) :

Charging/discharging efficiency of SE

\(\overline{{P_{ag}^{DA,p} }} ,\overline{{P_{ag}^{DA,c} }}\) :

Maximum energy aggregator can produce/consume in DA

\(\overline{{P_{ag}^{RT,p} }} ,\overline{{P_{ag}^{RT,c} }}\) :

Maximum energy aggregator can produce/consume in RT

\(\overline{{G_{ag}^{DA} }} ,\overline{{G_{ag}^{RT} }}\) :

Maximum natural gas aggregator can consume in DA/RT

\(\overline{{A_{ag}^{RC,u} }} ,\underline{{A_{ag}^{RC,u} }}\) :

Maximum/minimum upward reserve capacity aggregator can provide

\(\overline{{A_{ag}^{RC,d} }} ,\underline{{A_{ag}^{RC,d} }}\) :

Maximum/minimum downward reserve capacity aggregator can provide

\(\overline{{P_{gt} }} ,\underline{{P_{gt} }}\) :

Maximum/minimum power output of GT

\(R_{gt}^{u} ,R_{gt}^{d}\) :

Ramp-up/ramp-down limit of GT

\(\overline{{p_{se}^{ch} }} ,\overline{{p_{se}^{dch} }}\) :

Maximum charging/discharging power of SE

\(S_{se}\) :

Capacity of SE

\(\overline{SOC} ,\underline{SOC}\) :

Maximum/minimum state of charge of SE

\(\lambda^{DAM}\) :

Energy price in DAM

\(\lambda^{RCM}\) :

Reserve capacity price in RCM

\(\lambda_{t}^{DGM}\) :

Natural gas price in DGM

\(\lambda_{t}^{RGM + } ,\lambda_{t}^{RGM - }\) :

Natural gas buying/selling price in RGM

\(\lambda^{RP}\) :

Reserve unsupplied penalty fee

\(c_{gt}^{su} ,c_{gt}^{sd}\) :

Start-up/shut-down price of GT

\(co_{i,de}^{sa} ,co_{i,pv}^{sa}\) :

Cost of demand curtailment and PV output management of prosumer i

\(co_{i,pv}\) :

Cost of PV generation of prosumer i

\(co_{gt} ,co_{se}\) :

Cost of GT/SE operation

\(D_{i}^{DA}\) :

DE in DA of prosumer i

\(\overline{{D_{i}^{c} }}\) :

Maximum demand curtailment of prosumer i

\(\underline{{D_{i}^{RT} }}\) :

Minimum DE after demand curtailment in RT of prosumer i

\(P_{i,pv}^{DA,ca}\) :

Available PV capacity in DA of prosumer i

\(\underline{{P_{i,pv}^{DA} }} ,\underline{{P_{i,pv}^{RT} }}\) :

Minimum PV output after the PV output management in DA/RT

\(\lambda^{RTM + } ,\lambda^{RTM - }\) :

Energy selling/buying price in RTM

\(\lambda^{RDM,u} ,\lambda^{RDM,d}\) :

Reserve deployment price of upward/downward reserve in RDM

\(\widetilde{D}_{i}^{RT}\) :

DE in RT of prosumer i

\(\tilde{P}_{i,pv}^{RT,ca}\) :

Available PV capacity in RT of prosumer i

\(\widetilde{\rho }_{ag}^{RC,u} ,\widetilde{\rho }_{ag}^{RC,d}\) :

Upward/downward reserve deployment percentage of the aggregator

\(p_{ag}^{DA} ,g_{ag}^{DA}\) :

Energy/natural gas schedule of aggregator in DA

\(A_{ag}^{RC,u} ,A_{ag}^{RC,d}\) :

Upward/downward reserve capacity schedule of aggregator

\(p_{ag}^{RT} ,g_{ag}^{RT}\) :

Energy/natural gas schedule of aggregator in RT

\(p_{ag,t}^{RT + } ,p_{ag,t}^{RT - }\) :

Energy deviation selling/buying in RTM of aggregator

\(g_{ag,t}^{RT + } ,g_{ag,t}^{RT - }\) :

Natural gas deviation buying/selling in RGM of aggregator

\(A_{ag}^{RD,u} ,A_{ag}^{RD,d}\) :

Upward/downward reserve aggregator provides in reserve deployment

\(A_{ag}^{RP,u} ,A_{ag}^{RP,d}\) :

Upward/downward reserve unsupplied of aggregator

\(p_{gt}^{DA} ,p_{gt}^{RT}\) :

Electricity produced by GT in DA/RT

\(g_{gt}^{DA} ,g_{gt}^{RT}\) :

Natural gas consumed by GT in DA/ RT

\(p_{se}^{DA,ch} ,p_{se}^{RT,ch}\) :

Charging power of SE in DA/RT

\(p_{se}^{DA,dch} ,p_{se}^{RT,dch}\) :

Discharging power of SE in DA/RT

\(E_{se}^{DA} ,E_{se}^{RT}\) :

Energy stored in SE in DA/RT

\(d_{i}^{RT}\) :

Electricity demand of prosumer i in RT

\(p_{i,pv}^{DA} ,p_{i,pv}^{RT}\) :

PV output of prosumer i in DA/RT

\(A_{gt}^{RC,u} ,A_{se}^{RC,u} ,A_{i,pv}^{RC,u}\) :

Upward reserve capacity of GT, SE and PV of prosumer i

\(A_{gt}^{RC,d} ,A_{se}^{RC,d} ,A_{i,pv}^{RC,d} ,A_{i,de}^{RC,d}\) :

Downward reserve capacity of GT, SE and PV and DE of prosumer i

\(E_{se}^{DA,RC,u} ,E_{se}^{DA,RC,d}\) :

Energy stored in SE after considering the upward/downward reserve capacity

\(I_{gt}^{DA}\) :

On/off state of GT

\(I_{gt}^{DA,su} ,I_{gt}^{DA,sd}\) :

Start-up and shut-down states of GT

\(I_{ag}^{u} ,I_{ag}^{d}\) :

On/off states of upward and downward reserve capacity of the aggregator

\(I_{ag}^{u,su} ,I_{ag}^{d,su}\) :

Start/end states of upward and downward reserve capacity of the aggregator

References

  1. He, Q., Lin, Z., Chen, H., Dai, X., Li, Y., & Zeng, X. (2022). Bi-level optimization based two-stage market clearing model considering guaranteed accommodation of renewable energy generation. Protection and Control of Modern Power Systems, 7(1), 1–13.

    Article  Google Scholar 

  2. Wang, J., Xin, H., Xie, N., & Wang, Y. (2022). Equilibrium models of coordinated electricity and natural gas markets with different coupling information exchanging channels. Energy, 239, 121827.

    Article  Google Scholar 

  3. Fu, X., Wu, X., Zhang, C., Fan, S., & Liu, N. (2022). Planning of distributed renewable energy systems under uncertainty based on statistical machine learning. Protection and Control of Modern Power Systems, 7(1), 1–27.

    Article  Google Scholar 

  4. Ming, H., Xia, B., Lee, K.-Y., Adepoju, A., Shakkottai, S., & Xie, L. (2020). Prediction and assessment of demand response potential with coupon incentives in highly renewable power systems. Protection and Control of Modern Power Systems, 5(1), 1–14.

    Article  Google Scholar 

  5. Shojaabadi, S., Talavat, V., & Galvani, S. (2022). A game theory-based price bidding strategy for electric vehicle aggregators in the presence of wind power producers. Renewable Energy, 193, 407–417.

    Article  Google Scholar 

  6. Li, Z., Liu, M., Xie, M., & Zhu, J. (2022). Robust optimization approach with acceleration strategies to aggregate an active distribution system as a virtual power plant. International Journal of Electrical Power & Energy Systems, 142, 108316.

    Article  Google Scholar 

  7. Hu, C., Cai, Z., Zhang, Y., Yan, R., Cai, Y., & Cen, B. (2022). A soft actor-critic deep reinforcement learning method for multi-timescale coordinated operation of microgrids. Protection and Control of Modern Power Systems, 7(1), 1–10.

    Article  Google Scholar 

  8. Wang, J., Xie, N., Ilea, V., Bovo, C., Xin, H., & Wang, Y. (2021). Cooperative trading mechanism and satisfaction-based profit distribution in a multi-energy community. Frontiers in Energy Research. https://doi.org/10.3389/fenrg.2021.723192

    Article  Google Scholar 

  9. Yang, Y., Huang, Y., Jiang, P., & Zhu, Y. (2020). Multi-objective optimization of combined cooling, heating, and power systems with supercritical CO2 recompression Brayton cycle. Applied Energy, 271, 115189.

    Article  Google Scholar 

  10. Wang, J., Ilea, V., Bovo, C., Xie, N., & Wang, Y. (2023). Optimal self-scheduling for a multi-energy virtual power plant providing energy and reserve services under a holistic market framework. Energy, 278, 127903.

  11. Zhao, H., Wang, B., Pan, Z., Sun, H., Guo, Q., & Xue, Y. (2020). Aggregating additional flexibility from quick-start devices for multi-energy virtual power plants. IEEE Transactions on Sustainable Energy, 12(1), 646–658.

    Article  Google Scholar 

  12. Ntomaris, A. V., Marneris, I. G., Biskas, P. N., & Bakirtzis, A. G. (2022). Optimal participation of RES aggregators in electricity markets under main imbalance pricing schemes: Price taker and price maker approach. Electric Power Systems Research, 206, 107786.

    Article  Google Scholar 

  13. Wang, S., & Wu, W. (2021). Aggregate flexibility of virtual power plants with temporal coupling constraints. IEEE Transactions on Smart Grid, 12(6), 5043–5051.

    Article  Google Scholar 

  14. Sun, G., Shen, S., Chen, S., Zhou, Y., & Wei, Z. (2022). Bidding strategy for a prosumer aggregator with stochastic renewable energy production in energy and reserve markets. Renewable Energy, 191, 278–290.

    Article  Google Scholar 

  15. Zhou, Y., Wei, Z., Sun, G., Cheung, K. W., Zang, H., & Chen, S. (2018). A robust optimization approach for integrated community energy system in energy and ancillary service markets. Energy, 148, 1–15.

    Article  Google Scholar 

  16. Tang, Z., Liu, J., Liu, Y., & Xu, L. (2020). Stochastic reserve scheduling of energy storage system in energy and reserve markets. International Journal of Electrical Power & Energy Systems, 123, 106279.

    Article  Google Scholar 

  17. Dimitriadis, C. N., Tsimopoulos, E. G., & Georgiadis, M. C. (2022). Strategic bidding of an energy storage agent in a joint energy and reserve market under stochastic generation. Energy, 242, 123026.

    Article  Google Scholar 

  18. Goebel, C., & Jacobsen, H.-A. (2016). Aggregator-controlled EV charging in pay-as-bid reserve markets with strict delivery constraints. IEEE Transactions on Power Systems, 31(6), 4447–4461.

    Article  Google Scholar 

  19. Italian Energy Authority (ARERA), Consultation Document 422/2018/R/eel, 2 Aug. 2018, available online: https://www.arera.it/it/docs/18/422-18.htm

  20. Italian Energy Authority (ARERA), Consultation Document 3 June 2020, 201/2020/R/eel, available online: www.arera.it/it/docs/20/20-20.htm

  21. Yan, C., Tang, Y., Dai, J., Wang, C., & Wu, S. (2021). Uncertainty modeling of wind power frequency regulation potential considering distributed characteristics of forecast errors. Protection and Control of Modern Power Systems, 6(1), 1–13.

    Article  Google Scholar 

  22. Wu, X., Zhao, W., Li, H., Liu, B., Zhang, Z., & Wang, X. (2021). Multi-stage stochastic programming based offering strategy for hydrogen fueling station in joint energy, reserve markets. Renewable Energy, 180, 605–615.

    Article  Google Scholar 

  23. Exizidis, L., Kazempour, J., Papakonstantinou, A., Pinson, P., De Greve, Z., & Vallée, F. (2019). Incentive-compatibility in a two-stage stochastic electricity market with high wind power penetration. IEEE Transactions on Power Systems, 34(4), 2846–2858.

    Article  Google Scholar 

  24. Vahedipour-Dahraie, M., Rashidizadeh-Kermani, H., Shafie-Khah, M., & Catalão, J. P. (2020). Risk-averse optimal energy and reserve scheduling for virtual power plants incorporating demand response programs. IEEE Transactions on Smart Grid, 12(2), 1405–1415.

    Article  Google Scholar 

  25. Mu, Y., Wang, C., Cao, Y., Jia, H., Zhang, Q., & Yu, X. (2022). A CVaR-based risk assessment method for park-level integrated energy system considering the uncertainties and correlation of energy prices. Energy, 247, 123549.

    Article  Google Scholar 

  26. Khojasteh, M., Faria, P., & Vale, Z. (2022). A robust model for aggregated bidding of energy storages and wind resources in the joint energy and reserve markets. Energy, 238, 121735.

    Article  Google Scholar 

  27. Jiang, S., Wu, C., Gao, S., Pan, G., Liu, Y., Zhao, X., & Wang, S. (2022). Robust frequency risk-constrained unit commitment model for AC–DC system considering wind uncertainty. Renewable Energy, 195, 395–406.

    Article  Google Scholar 

  28. Shen, F., Zhao, L., Wang, M., Du, W., & Qian, F. (2022). Data-driven adaptive robust optimization for energy systems in ethylene plant under demand uncertainty. Applied Energy, 307, 118148.

    Article  Google Scholar 

  29. Bovera, F. (2021). United we stand: how aggregates of distributed energy resources can shape the future energy system.

  30. Yang, H., Xiong, T., Qiu, J., Qiu, D., & Dong, Z. Y. (2016). Optimal operation of DES/CCHP based regional multi-energy prosumer with demand response. Applied Energy, 167, 353–365.

    Article  Google Scholar 

  31. Pandžić, H., Morales, J. M., Conejo, A. J., & Kuzle, I. (2013). Offering model for a virtual power plant based on stochastic programming. Applied Energy, 105, 282–292.

    Article  Google Scholar 

  32. https://www.terna.it/en/electric-system/transparency-report

  33. https://www.mercatoelettrico.org/En/default.aspx

Download references

Acknowledgements

This work was supported by National Key Research and Development Project of China under Grant 2018YFB1503000; and China Scholarship Council.

Funding

This work was supported by National Key Research and Development Project of China under Grant 2018YFB1503000; and China Scholarship Council.

Author information

Authors and Affiliations

Authors

Contributions

JW: Conceptualization, Methodology, Formal analysis, Software, Validation, Writing—original draft. NX: Methodology, Investigation, Writing—review and editing, Visualization. CH: Conceptualization, Resources, Supervision. YW: Writing—review and editing.

Ethics declarations

Competing interests

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wang, J., Xie, N., Huang, C. et al. Two-stage stochastic-robust model for the self-scheduling problem of an aggregator participating in energy and reserve markets. Prot Control Mod Power Syst 8, 45 (2023). https://doi.org/10.1186/s41601-023-00320-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s41601-023-00320-y

Keywords