*2.1. Uncertainty Quantification*

We assume that every bid of the market can be connected to a bidder. We assume that there are *K* bidders in the energy market. Similar to the approach of demand factors [12,13], we use simple scalar quantities to characterize the uncertainty of market participants. While in the case of the demand factor the characterizing scalar is formulated as the quotient of the expected energy not supplied (EENS) and the current load, we also account for deviations in the positive direction and define two uncertainty measures corresponding respectively to the positive and negative part of the deviation in question. Based on previous bidding and market behavior of the bidder (or if no data present, then based on the applied technology), we assign the uncertainty quantifiers (*u*<sup>+</sup> *k* and *u*<sup>−</sup> *k* ) for each energy-bidder. The previous market behaviour in this case means that we may analyze how many times and how much the bidder deviated from its previously fixed schedule in relative terms (%) in the positive or in the negative direction, weighted by the quantity of the bid in question. Let us denote the expected relative value in the positive direction of bidder *k* by *u*<sup>+</sup> *k* , while the expected relative value in the negative direction of bidder *k* by *u*<sup>−</sup> *k*. By nature, both *u*<sup>+</sup> *k*and *u*<sup>−</sup> *k*are non-negative quantities.

For example, let us suppose a bidder corresponding to a renewable source with significant uncertainty. If we have for example, a bid/schedule realization history ( *H*) for bidder *k* (For the indexing of bidders we use the variable *k*, while *j* and *i* are used for the indexing of bids.) as

$$H = \begin{pmatrix} 50 & 70 & 100 & 80 & 65 & 65 \\ 41 & 73 & 92 & 80 & 63 & 69 \end{pmatrix} \text{ } \tag{1}$$

*Energies* **2019**, *12*, 2957

Each column of *H* corresponds to a previous auction, where the bid of the bidder has been accepted. The top element of each column holds the nominal bid quantity, while the bottom row corresponds to the realized schedule. In this particular case we have the following signed relative deviation vector *D* (in %).

$$D\_i = 100 \frac{H\_{2,i} - H\_{1,i}}{H\_{1,i}} \quad \rightarrow \quad D = \left( \begin{array}{ccccc} -18 & 4.29 & -8 & 0 & -3.08 & 6.15 \end{array} \right) \tag{2}$$

Taking the positive and the negative part of this vector and weighing with the first row of (1), we ge<sup>t</sup> the expected values

$$
\mu\_k^+ = \frac{\sum\_i \frac{D\_i + |D\_i|}{2} H\_{1,i}}{\sum\_i H\_{1,i}} = 1.63\% \quad \mu\_k^- = \frac{\sum\_i \frac{D\_i - |D\_i|}{2} H\_{1,i}}{\sum\_i H\_{1,i}} = 4.42\% \tag{3}
$$

for bidder *k*. Let us define the positive and negative uncertainty upper bounds *u*<sup>+</sup> and *u*<sup>−</sup>. Bids belonging to bidders with *u*+*k* ≥ *u*<sup>+</sup> and *<sup>u</sup>*<sup>−</sup>*k* < *u*<sup>−</sup> will be called positively uncertain (U+) bids, while bids belonging to bidders with *u*+*k* < *u*<sup>+</sup> and *<sup>u</sup>*<sup>−</sup>*k* ≥ *u*<sup>−</sup> will be called negatively uncertain (U-) bids. Bids belonging to bidders with both *u*+*k* ≥ *u*<sup>+</sup> and *<sup>u</sup>*<sup>−</sup>*k* ≥ *u*<sup>−</sup> will be called bi-uncertain (Ub) bids.

To consider a simple example, if we assume the above bid with *u*+*k* = 1.63%, *<sup>u</sup>*<sup>−</sup>*k* = 4.42% and *u*<sup>+</sup> = *u*<sup>−</sup> = 2%, the bid will be considered as a negatively uncertain bid. In contrast, if *u*<sup>+</sup> = *u*<sup>−</sup> = 1%, the bid will be taken into account as a bi-uncertain bid.

While the above example was demonstrating the case of a supply bid, we apply the same approach for demand bids as well in the proposed framework (domestic consumers may be for example, considered as uncertain demand bidders).

Let us note that uncertainty upper bounds in general may be different in the case of supply and demand bids, however in this paper we will not distinguish between uncertainty bounds of supply and demand bids. As we will see later, we will use these values to account for reserve allocation needed for the coverage of this uncertainty.

#### *2.2. Market Model of the Single Period Case*

We consider a basic portfolio bidding scenario, where participants capable of delivering a certain product (energy or reserve in this case) are represented by supply bids, while entities who are ready to pay for it are submitting demand bids. The market clearing aims to balance the supply with the demand in the terms of the traded quantity and the price.

As in the first step we do not consider multi-period block bids, which define interdependencies over time periods, the calculations for each period may be carried out independently. For this reason, to make the notation more simple, in the first step we describe the calculations regarding only a single time period. Later we discuss how the proposed approach may be generalized for multi-period cases including block orders. Regarding the bid format, the two generally used bid types in portfolio-bidding electricity markets are the step bid and the linear bid. In the case of the step bid the price per unit (PPU) of the bid is independent of the acceptance rate, while in the case of linear bid the price depends on the acceptance rate linearly. In other words, while step bids are parametrized by two values (the quantity (*q*) and the bid PPU), linear bids are parametrized by the quantity, a starting price and a final price. If a linear bid is partially accepted the resulting PPU may be derived as a linear interpolation of the two prices: If for example, the acceptance rate is 0.5, the resulting PPU is the average of the starting price and the final price. In the proposed framework, for the aim of simplicity and computational efficiency, we do not allow linear bids, only step bids.

In the proposed model, there are 3 sub-markets: the energy sub-market and the reserve sub-markets corresponding to positive and negative reserve. The term 'sub-market' is used to emphasize that interdependencies between these markets will be defined and thus they have to be cleared together—in this case the 'market' is composed of the sub-markets and the sub-markets are not independent entities anymore.

We do not consider fill-or-kill type bids in the market model, in other words partial acceptance is allowed for all energy bids. Regarding energy bids with uncertainty levels below the thresholds *u*<sup>+</sup> and *<sup>u</sup>*<sup>−</sup>, the variable *yES j* ∈ [0, 1] denotes the acceptance variable of *j*-th energy supply bid, while *yED j* ∈ [0, 1] denotes the acceptance variable of *j*-th energy demand bid. In the case of uncertain bids, *yESU*<sup>+</sup> *j* ∈ [0, 1], *yESU*<sup>−</sup> *j* ∈ [0, 1] and *yESUb j* ∈ [0, 1] denote the acceptance variables of energy supply bids with (respectively positive, negative or both) uncertainty, while *yEDU*<sup>+</sup> *j* ∈ [0, 1], *yEDU*<sup>−</sup> *j* ∈ [0, 1] and *yEDUb j* ∈ [0, 1] denote the acceptance variables of energy demand bids with uncertainty.

As we will see later, these acceptance indicators will be included in variable vector of the problem. In addition to the acceptance indicators, the variable vector will also hold the income variables, logical integer variables used in the formulation of logical constraints and the market clearing prices (MCP) for energy and reserves. Under market clearing prices we mean prices which are compatible with the bid acceptance and balance constraints (see their formulation later). In other words, if the prices are equal to the market clearing prices, such an acceptance configuration of bids is possible (according to the bid acceptance rules), which ensures the balance of supply and reserve in every sub-market.

#### 2.2.1. Supplementary Reserve Demand Bids

We assume that if uncertainty is present in the dispatch, in the spirit of the uncertain bidder pays principle, reserves must be allocated according to the measure of the uncertainty in question. We assume furthermore that these uncertain sources (being typically non-controllable units) are physically unable to provide reserves which could be used to handle the uncertainty implied by them. As we would like to make uncertain sources and consumers (bidders) pay for the implicated allocation of reserves, we assign obligatory reserve bids in the corresponding (positive, negative or both) reserve markets to each bid submitted in the energy sub-market. We call these compulsorily submitted reserve demand bids *supplementary reserve demand bids* (SRDBs). Both the bid price and bid quantity of these SRDBs are centrally regulated, they are not determined by the bidder. Uncertain energy bids together with the one or two connected SRDB(s) are called *orders*. As we will see later, the acceptance of the bids composing the order is dependent on the total income of the order, thus SRDBs and the related orders define interdependencies between the sub-markets.

Let us assume that *yESUb j* is acceptance indicator of the energy supply bid of the bi-uncertain bidder *k*, the quantity of which is denoted by *qESUb j* , while *pESUb j* stands for price per unit (PPU) of the bid. In the proposed setup, implied by the bid corresponding to *yESUb j* , bidder *k* also compulsorily submits a positive and a negative reserve demand bid, whose acceptance indicators are denoted by *yRD*<sup>+</sup> *ESUb j* and *yRD*<sup>−</sup> *ESUb j* respectively. The upper index in the notation refers to the set of positive/negative reserve demand bids implied by bi-uncertain energy supply bids.

As it is detailed in the following, the proposed concept of supplementary reserve demand bids may be introduced in the market gradually. In the beginning, it is the task of the ISO to allocate reserves and cover the connected costs. Furthermore, it is plausible that the ISO aims to ensure some of the required reserves in the day-ahead reserve markets. According to this consideration, we consider also reserve bids, which are not connected to uncertain energy bids. In the case when SRDBs cover all reserve needs, the model is completely functional without any non-SRDB reserve demand bid. The acceptance indicators of these (non-SRDB) bids are denoted by *yRS*<sup>+</sup> *j* , *yRD*<sup>+</sup> *j* , *yRS*<sup>−</sup> *j* and *yRD*<sup>−</sup> *j* in the case of positive reserve supply, positive reserve demand, negative reserve supply and negative reserve demand respectively.

Returning however to SRDBs, we need to consider the following. As positive deviations must be balanced by negative reserve and vice versa, positively uncertain ES bids (*yESU*<sup>+</sup> *j* ) imply negative reserve demand bids denoted by *yRD*<sup>−</sup> *ESU*+ *j*and negatively uncertain ES bids (*yESU*<sup>−</sup> *j*) imply positive

reserve demand bids denoted by *yRD*<sup>+</sup> *ESU*− *j* . In principle, the reserve amounts allocated for these demand bids cover the corresponding expected uncertainty, thus we may write

$$\begin{aligned} q\_j^{RD+} &= -q\_j^{ESllb} u\_k^- & q\_j^{RD-} &= -q\_j^{ESllb} u\_k^+ \\ q\_j^{RD+} &= -q\_j^{ESll-} u\_k^- & q\_j^{RD-} &= -q\_j^{ESll+} u\_k^+ \end{aligned} \tag{4}$$

We can see in Equation (4) that following the general convention, throughout the paper we use negative sign for the quantities of demand bids.

We also account for uncertainty in the case of energy demand bids—domestic retail electricity suppliers (who submit demand bids in the wholesale market, which is the subject of our study) may have for example, higher uncertainty compared to bidders corresponding to industrial demand. The notation is similar: the bi-uncertain energy demand bid *yEDUb j* implies the a positive and a negative reserve demand bids *yRD*<sup>+</sup> *EDUb j*and *yRD*<sup>−</sup> *EDUb j*.

In our formalism, we consider demand with negative sign, so the row vectors in Equation (1) will be negative. Positive deviations in this case will mean less consumption, which must be balanced by negative reserves and mutatis mutandis. The SRDBs corresponding to demand bids are described by Equation (5).

$$\begin{array}{ll}q\_j^{RD+} \stackrel{EDIlb}{=} & q\_j^{EDIlb} \boldsymbol{u}\_k^{-} & q\_j^{RD-} \stackrel{EDIlb}{=} & q\_j^{EDIlb} \boldsymbol{u}\_k^{+}\\ q\_j^{RD-} \stackrel{EDIl+}{=} & q\_j^{EDIl+} \boldsymbol{u}\_k^{+} & q\_j^{RD+} \stackrel{EDIl-}{=} & q\_j^{EDIl-} \boldsymbol{u}\_k^{-} \end{array} \tag{5}$$

We will suppose that the PPUs of these SRDBs are slightly higher compared to the highest PPU of the submitted reserve supply bids for the corresponding period. The difference is denoted by *ε* and corresponds to the unit of the market (e.g., 1 EUR/MW). The constant *ε* is introduced to avoid the possible overlap of supply and demand price curves in the case of the reserve sub-markets, which would potentially undermine the uniqueness of the optimal solution. The SRDB prices are formally defined as

$$p\_j^{RD+SRDB} = \max\_i (p\_i^{RS+}) + \varepsilon \qquad p\_j^{RD-SRDB} = \max\_i (p\_i^{RS-}) + \varepsilon \tag{6}$$

where *SRDB* ∈ {*EDUb*, *EDU*−} in the case of positive reserve and *SRDB* ∈ {*EDUb*, *EDU*+} in the case of negative reserve.

We assume that the amount of reserve supply is always enough to cover the total reserve demand. This assumption is usually valid in practice because regulators enforce power plants to offer reserve services. In this case the bid curves of the reserve spot markets (either positive or negative) will follow the qualitative scheme depicted in Figure 1.

As all SRDBs are accounted for on the price of the supply bid with the highest PPU +*ε*, the central line segmen<sup>t</sup> in the demand curve (labeled by SRDB in Figure 1) collects all the SRDBs. The line segments before and after it represent other reserve demand bids submitted to the reserve sub-market.

**Figure 1.** The scheme of the reserve spot market (both in the case of + and − reserve). *D*—demand, *S*—supply, *MCP*—market clearing price, *MRSBPPU*—Maximal reserve supply bid PPU, *SRDB*—Supplementary reserve demand bids. By definition, the PPU of SRDBs is equal to the PPU of the highest reserve supply bid + *ε*.
