Natural gas unavailability, price uncertainty, and emission reduction policy in stochastic programming-based optimal bidding of compressed air energy storage and wind units

Today, with growing expansion of renewable energy resources, electricity production is accompanied by uncertainties. The usage and optimal management of energy storage is one of the effective ways to compensate for these uncertainties. Compressed air energy storage (CAES) is one of the two bulk electricity storage methods for power systems, burning natural gas (NG) to extract the stored energy. Therefore, the NG price uncertainty and gas availability along with carbon emission resulting from burning NG can affect optimal bidding result of this unit. Hence, this study addresses the optimal bidding problem of CAES and wind units, considering the aforementioned issues, while taking into account uncertainties of day-ahead (DA) and balancing market prices, wind speeds, and NG prices and availability. Furthermore, the dynamics of natural gas ﬂow in the pipeline is modelled. The stochastic programming (SP) method is proposed for solving this problem while taking risk into consideration. The scheduling has been presented for participation of generating company in DA and carbon emission markets. Simulation results indicate the capability of the proposed method in optimal bidding of CAES units while taking gas-burning related constraints into consideration.


Literature review
Modern power systems are restructured and privately-owned generation companies (GenCos) seek to maximise their profits. These companies have to participate in electricity markets where their generation schedules are determined and any deviation from this schedule may be penalised by the system operator.
Due to the growing increase in electricity demand and environmental issues, renewable energy resources are experiencing a rapid growth [1,2]. The uncertainty in renewable resources' outputs along with uncertainty in electricity and fuel prices affect the optimal schedule of GenCos. Since these uncertainties can bring about penalties and reduce the GenCo's profit, they must be accounted for in solving the optimal bidding problem. This is achieved via appropriate methods of scheduling under uncertainty. The most commonly used methods for scheduling under CAES [13][14][15][16][17]. Optimal operation scheduling of a wind power integrated CAES was carried out in [13]. Scheduling of CAES in energy and reserve markets was presented in [14]. In [15], expectations of electricity and gas prices were used in three different deterministic methods to solve optimal operation strategy problem of CAES. Dynamic programming was employed in [16] for optimal management of a hybrid power plant comprising wind turbines, photovoltaic panels and CAES. Authors of [17] proposed look-ahead participation of CAES in day-ahead (DA) and real-time (RT) markets. In the look-ahead scheduling strategy, the final amount of the stored energy is considered as one of the optimisation variables optimised to maximise the expected profit accounting for the future.
RO is one of the methods that is being examined for CAES scheduling and optimal bidding. This method was proposed in [8] for self-scheduling of a GenCo owning thermal and CAES units under price uncertainty. Optimal bidding and offering of a merchant CAES was carried out in [9] using RO. This study assumed that CAES can operate in simple-cycle mode, making it like a simple-cycle gas generator. An adaptive robust selfscheduling was proposed in [10] for wind and CAES units, whose robustness level is adjustable and can be controlled according to the users' decisions.
Information gap decision theory (IGDT), which is a nonprobabilistic interval optimisation-based method, formulates robust and opportunistic formulations under uncertainty; it was used in [18,19] for CAES scheduling and bidding. Authors of [18] proposed an IGDT-based risk-constrained bidding and offering strategy for a CAES unit in which the electricity price uncertainty was taken into account. Authors of [19] used IGDT for risk-constrained self-scheduling of a solar-based CAES with waste heat recovery for participation in electrical and thermal markets where only solar generation uncertainty was considered. Both studies assume that CAES is able to operate in simple-cycle mode.
Several studies employed SP for scheduling or optimal bidding of CAES units. The stochastic self-scheduling of wind, thermal and CAES units with demand response was carried out in [20]. Authors of [21] used SP for self-scheduling of CAES in energy and reserve markets considering its thermodynamic characteristics. Look-ahead risk-constrained stochastic scheduling of a system including wind, thermal and CAES units was presented in [22]. Optimal bidding of a GenCo comprising thermal, wind and CAES units in DA as well as balancing and reserve markets was carried out in [3], where uncertainties of energy and reserve market prices and wind speeds were taken into account and CVaR was used as the risk index. The method was verified by comparing its results with those of two other studies; then, it was further investigated using the historical data of a real system. SP was also used in [4] for risk constrained optimal bidding of wind and CAES units in DA, intraday, and balancing markets. Authors of [5] used SP for risk-constrained scheduling of a smart multi-carrier energy hub (SMEH) including wind, CAES and combined heat and power (CHP) units, thermal storage, electrical demand response and thermal demand response. In this study, the uncertainties of electrical and thermal demands as well as wind generator's out-put were considered by scenarios, while CVAR was used as a risk measure. A similar method was used in [23] for optimal scheduling of smart residential energy hub (SREH). The study considered the uncertainties of electricity market prices, electrical, thermal and cooling demands, and solar radiation, and used CVaR as a risk measure.
Finally, there are a few recent studies that employ hybridised robust and stochastic methods for optimal bidding of CAES units. A synthetic stochastic-robust approach was proposed for this problem in [24], where uncertain parameters include electrical energy tariff and maximum cavern potential. Modelling the uncertainty of the former is done by using stochastic optimisation, whereas uncertainty of the latter is modelled by a robust method. Authors of [25] proposed a hybrid robust-stochastic approach for optimal bidding and offering of CAES. The study modelled market price uncertainty via SP and maximum capacity of cavern via RO.

Novelty and contributions of this research
CAES units burn natural gas (NG) in discharging and simplecycle modes. NG prices are volatile and NG pipelines may be congested [26]. However, based on the literature review, there is no study considering the uncertainty and variability of NG prices in optimal bidding problem of CAES units. Also, no research examines the effect of NG unavailability and dynamics of natural gas flow in the pipeline on this problem. NG combustion by CAES leads to carbon emissions. Nevertheless, to the best of our knowledge, no research accounted for these emissions in the optimal-bidding problem via an appropriate mechanism. According to the above information, the novelty and contributions of this study are as follows: 1. investigating the effects of uncertainty and variability of NG prices and NG unavailability in optimal bidding of CAES. 2. modelling the dynamics of NG flow in the pipeline and examining the effect of initial linepack on optimal bidding of CAES. 3. exploring the effects of two different emission reduction policies on optimal bidding of CAES.
It should be noted that this research is an extension of the research presented in [3], where we focused on using SP for optimal bidding of a GenCo including CAES, in energy and reserve markets, while using CVaR for risk management. Also, in [3], the NG price was assumed to have a given constant value and its unavailability and dynamic flow in the pipeline, and the emissions caused by NG combustion was not taken into account.

Study organisation
The rest of this study is organised as follows: Section 2 describes the problem and the proposed solution method. Section 3 gives the problem formulation of the proposed optimal bidding method. Sections 4 presents the simulation results and Section 5 concludes the study.

Electricity market structure
A two-settlement electricity market was used in the formulation comprising a DA market (DAM) and a balancing market (BM). The DAM is a pool-based market cleared by a market operator who identifies accepted bids and market clearing price (MCP) and pays each GenCo according to its actual generation multiplied by MCP. Furthermore, the considered BM has a dualpricing scheme in which penalty costs are imposed to the Gen-Cos deviating from the accepted bids. In BM, negative/positive imbalance prices are higher/lower than the corresponding DA prices to encourage GenCos not to deviate from their accepted bids [27]. Finally, it is supposed that the GenCo is not large enough to have any effect on the market prices, that is, it is price-taker. So, the GenCo proposes a price equal to or slightly lower than zero to make sure that its bid is accepted; afterwards, it will be compensated according to the MCP [28].

Carbon emission consideration in optimal bidding
Two mechanisms are tested for considering emission in the optimal bidding problem: Cap and trade and fixed emission quota [29]. In cap and trade systems, like European Union Emission Trading Scheme (EU ETS), the allowances are fixed for each GenCo and the GenCo can either buy or sell the extra allowances. In the fixed emission quota scheme, the allowances of each GenCo are determined beforehand, and the Gen-Cos must not violate the limit. Another mechanism that can be adopted for emission consideration in optimal bidding is charging the GenCos with emission taxes. However, since this method can be easily modelled by using an effective NG price, it is not considered here.

NG price consideration
Because of the asynchrony between gas and electricity markets, the gas spot price may be uncertain for some (or all) hours of the next day at the time of bidding in DA electricity market, making it necessary to account for this uncertainty. Furthermore, NG prices can be assumed fixed during each gas day or during each hour. Most researches use daily fixed prices, but there are some related researches that use hourly fixed NG prices, for example, [5]. Here, we assume that the NG prices are fixed during each gas day. Also, we assume that the gas market is closed after the electricity market (which makes the NG price uncertain while bidding in electricity market), but the two gas and electric days start simultaneously. If the last assumption is not considered, the only difference will be that each electric day spans over two gas days and the gas price would be known for the first part of the electric day. The interested readers can refer to [30,31] for more information about this asynchrony and its effects.

Uncertain parameters
The uncertain parameters considered in this study include DAM and BM prices, wind speeds, the price of NG, and available NG, and NG demand of city (which is assumed to be located at the same node of CAES). These parameters are described as stochastic processes and are modelled by scenarios. With regard to the NG price, it should be noted that the price of NG is considered constant within each gas day. However, if hourly gas prices are present in a gas market, the formulation can be adapted with minimum effort.

Two-stage SP
One of the most commonly used methods for decision-making under uncertainty is SP. Most of SP models divide decisionmaking into two stages as follows [32]: The 1 st stage variables are named 'here-and-now' variables and the 2 nd stage variables are named 'wait-and-see' variables. In this study, the amount of optimal power bids are the 1 st stage decision variables, and the other variables are the 2 nd stage decision variables.

Scenario generation and reduction
In a real power system, DAM and BM prices have strong correlations. Since the scenario generation considering these correlations is not the contribution of this study, here the historical data of these prices, which are actual occured scenarios, are used as their correlated scenarios, also done by [3,27]. Furthermore, because of the lack of enough information, some appropriate arbitrary scenarios are selected for NG unavailability, as in [26]. Additionally, some arbitrary scenarios are considered for city gas demand. It should be noted that, despite the fact that scenario generation and reduction is not the focus of this study and thus is not done here, assuming any appropriate scenario generation and reduction method, would  Because, if the scenario generation and reduction method generate better scenarios, they can be used in SP, and if it leads to worse scenarios, available historical data can be used instead (which are also used here).
To examine the degree of volatility of NG, the NG prices of 2017 of Iberian gas market is used [33]; the percentage of the change of the NG prices per day for two consecutive days are computed and presented in Figure 1, which clearly shows the highly volatile nature of NG prices. So, five scenarios are considered for NG prices, as̄N G * [0.9, 0.95, 1, 1.05, 1.1], that is, five equally distributed gas prices with a mean value and four values of ±5% and ±10% around the mean value, with probabilities equal to 0.1, 0.25, 0.4, 0.15, 0.1, respectively. Furthermore, the effect of different probabilities of NG price scenarios will be examined in the simulation results section.
For wind speed scenario generation, historical wind speed data of each hour are first used to fit a Weibull distribution function for wind speed in that hour. Then, the scenarios are generated, using roulette-wheel method and reduced by a simultaneous reduction method [34].

Risk management
Because of the existence of uncertain parameters, the profit of the GenCo is at risk. In modern power markets, risks have a key role in assessing the performance of GenCos. Value-at-Risk (VaR) and CVaR are the most commonly used indicators of risk.
VaR of profit at the confidence level of ∈ (0, 1) is displayed as VaR α and according to Figure 2 is defined as: Values between 0.9 and 0.99 are mostly chosen for confidence level. According to Figure 2, CVaR α is defined as the

FIGURE 2
Probability density function of the profit expected value of the profits smaller than VaR α : Here, CVaR is employed as the risk-controlling index. CVaR α displays the expected profit of (1-α) × 100% of scenarios with the smallest profits. Therefore, by taking CVaR into consideration, the expected profit of these scenarios is increased [32].

Value of stochastic solution (VSS)
The VSS is a metric for determining how good the SP solution is, compared with a deterministic one and can be computed as below [35]: where z S * is the objective value of the solution of the SP problem and z D * is the solution of the expected value problem (EVP). In EVP, all uncertain parameters are set to their expected values and the resultant problem is solved to determine the here-and-now variables. Then, the here-and-now variables are set to the previously computed values and scenarios of uncertain variables are considered again. The value z D * is the solution of the revised SP problem. The values of VSS may be divided into z D * to become dimensionless (per unit).

PROBLEM FORMULATION
The optimal bidding problem is formulated as a mixed-integer linear programming problem (MILP), in which SP is used to account for parameters' uncertainties and CVaR is used as a riskcontrolling index.

Objective functions
The objective function of the optimal bidding problem is formulated as follows: wherēis the expected profit in all scenarios; CVaR is conditional value-at-risk; and β∈[0,1] is a weighing coefficient used for converting the bi-objective problem to a single objective one. In fact, β is the risk aversion factor of the GenCo and increasing its value will make the GenCo more risk-averse. The expected profit can be expressed as follows: where T S st is the profit at time interval t and scenario s and prob s is the probability of scenario s;. ß s,t is calculated as follows: where D s,t , B+ s,t , B− s,t , CS and CB are the prices of DA energy, positive and negative imbalance energies, and sold and purchased emission allowances, respectively. Also im + st and im − st are positive and negative imbalance energies at time interval t and scenario s, respectively. Furthermore, E Sell s and E Buy s are carbon emission allowances sold and purchased in scenario s, respectively. The right side of this relationship was arranged in four lines. The first line calculates the income from selling (or the cost of buying) energy in DA market. The second line shows the income from the selling excess power (positive imbalance), and the cost of negative imbalances in BM. The third line demonstrates the revenue from selling excess emission allowance and the cost of buying extra emission allowance. Finally, the last line is the cost of CAES unit calculated as below: The costs of CAES is the summation of cost of CAES in discharging, simple-cycle and charging modes. In discharging and simple-cycle modes, NG is consumed, whose purchasing cost is considered in the above equation. However, since the cost of purchasing electricity for charging mode was considered in Equation (6), it is not repeated here. CVaR can be computed as below: where VaR is the value-at-risk and η s is an auxiliary variable. In order to calculate CVAR, some constraints are needed which will be introduced in the constraints section.

Constraints related to electricity markets
The constraints related to the DAM and BM are as follows: Equation (9) represents the energy balance equation. In case of a deviation, positive or negative energy imbalances would be appropriately defined using these equations. Also, Equations (11) to (13) emphasise that the GenCo cannot have both positive and negative imbalances simultaneously.

Constraints related to carbon emission
CAES burns NG in discharging and simple-cycle modes, leading to carbon emissions. In order to calculate the value of carbon emissions resulting from CAES operating in these modes, the heat rates of these modes are used to calculate the amount of NG that would be burnt in each of these modes; then the carbon content of NG (i.e. the amount of CO 2 eq emitted due to burning NG) is used to calculate the carbon emissions value [36].
where E s is the total CO 2 eq emitted in scenario s and CC NG is the carbon content of NG. The cap and trade mechanism can be formulated by the following equations [29]: It should be noted that, since selling and purchasing of emission allowance is not valid in fixed emission quota scheme, only a revised form of Equation (15) (i.e. E s ≤ E max ) is needed and other equations must be neglected.

CVaR-related constraints
In order to calculate CVaR, the following linear constraints are included in the optimisation problem [27]: which are used to calculate the VaR.

Constraints related to CAES units
Equations (22) to (31) are used to model CAES.
Equations (22) and (23) determine CAES operating mode and make sure that at any given time, CAES operates in only one of the modes. Equations (24) to (26) specify the limits of CAES power in charging, discharging and simple-cycle mode, respectively. Equation (27) defines the net power output of CAES. Finally, Equations (28) to (31) calculate, update and constrain the stored energy in CAES reservoir.

NG availability constraint
There are two main types of gas delivery services, that is, firm and interruptible. Due to the lower price of the interruptible gas transportations, this type of transportation is common among the gas-fired units [30]. However, in case of a gas load peak or congestion in gas pipelines, the gas provided to the customers with interruptible contracts are the first to be lowered or totally curtailed. This issue can be formulated as follows [26]: where G max s,t is maximum available NG for CAES at time t of scenario s. Equation (32) calculates the amount of NG burned at time t and scenario s and Equation (33) limits its value to the maximum gas pipeline capacity at time t of scenario s.

NG pipeline modelling constraints
The previous section does not consider the dynamics of NG flow in the pipeline. The gas dynamics are modelled here. Considering a maximum inflow of gas pipeline, it is assumed that the outflow of pipeline supplies a city NG demand as well as CAES demand. Further it is assumed that supplying city gas demand has priority over supplying CAES gas demand (which is the case in actual systems). Modelling of NG pipeline has been done in Equations (34) to (44) [37]: Pip Equations (34) and (35) show the pressure limit of the sending and receiving nodes of gas pipeline, respectively. Equation (36) is used to calculate the pressure in the pipeline. Equation (37) calculates the amount of gas stored in the pipeline, that is, linepack, and Equations (38) and (39) relate variations of this variable to the inflow and outflow of the pipeline. Equation (40) states that the final linepack must be equal to or greater than the initial linepack. Equation (41) considers the limitations of the gas inflow to the pipeline and Equation (42) calculates the gas flow through pipeline as the mean of gas inflow and outflow. Equation (43) states that the outflow of the gas pipeline must be equal to the sum of the city and CAES gas demands. Equation (44) connects the flow of gas passing through the pipeline to the pressure at its two ends.

Constraints related to wind units
The power output of a wind plant in any scenario cannot exceed the wind power realisation in that scenario:

Final optimal bidding formulation
The final formulation of the scheduling problem is as follows: Extracting optimal solution for the GenCo

End
Step 1 Step 2 Step 3 Step 4 Aggregating scenarios of different uncertain variables to compose a complete scenario set units Data of wind and CAES , gas pipeline, and emission reduction policy Natural gas unavailability scenarios City natural gas demand scenarios

FIGURE 3
The flowchart of the proposed stochastic programming (SP)based optimal bidding problem Among the above-mentioned equations, only Equation (44) consists of non-linear sentences, which is linearised by the method introduced in [38]. Thus, the scheduling presented in Equation (46) would be a two-stage stochastic mixed-integer linear programming (SMILP).

Algorithm for solving optimal bidding problem
The flowchart of the proposed SP-based optimal bidding method is given in Figure 3. This method involves the following steps: Step 1: The data of CAES and wind units, the data concerning emission reduction policy, and the historical data pertaining to wind speeds are imported. Furthermore, the historical data of DA and BM prices of a given period of a real power system are imported as DAM and BM price scenarios. Moreover, NG price, NG unavailability, and city gas demand scenarios are selected as stated in Section 2.4.3.
Step 2: Using the historical data of wind speeds, wind speed scenarios are generated by the method explained in Section 2.4.3 and afterwards, scenario reduction method is used to reduce their number. Finally, all scenarios of all uncertain variables are aggregated to form a complete scenario tree and their aggregated probabilities are calculated.
Step 3: The proposed two-stage stochastic MILP problem (Equation 35) is solved in view of the risk index using an appropriate solver; and the optimal bids of the GenCo in the DA energy market are determined for the entire time period. Step 4: Optimal solution including GenCo's optimal bids for the DA energy market; the amount of generation/consumption of each unit in each scenario; the amount of NG consumption, carbon emission and emission allowance trading in each scenario; the optimal amount of expected profit; and the optimal CVaR value are extracted.

SIMULATION RESULTS
Since this research is an extension of the research presented in [3], the proposed method was previously verified in the study and no further verification is needed. The historical data of DA and BM prices of 21 working days of April 2016 of the Iberian Peninsula system were used as the correlated scenarios [39]. Furthermore, wind speed historical data extracted from [40] were used to generate 1000 wind scenarios, which are then reduced to six scenarios. The generated wind speed scenarios are then converted to wind power scenarios assuming the presence of 50 Siemens Wind Turbine SWT-2.3-108. The data of CAES presented in Table 1 were extracted from [18]. The stochastic MILP problems were implemented on GAMS software and were solved by CPLEX solver.

Joint bidding versus independent bidding
In this section, scenarios of DAM, BM and NG prices as well as wind speeds are considered and the average value of NG prices is assumed to be 12 $/MWh (i.e. gas price scenarios are 10.8, 11.4, 12, 12.6 and 13.2 $/MWh). The total number of scenarios for optimal bidding problem of CAES and wind units is Nes* Nws* Ngs = 21*6*5 = 630. The results of joint and independent bidding of CAES and wind units are presented in Table 2. It is seen from this table that in all cases, VSS percent is over 10% which shows the advantage of SP over deterministic optimal bidding. Furthermore, joint optimal bidding leads to $552 (5.84%) increase in the expected profit and $1228 (93.67%) increase in CVaR. It should be noted that, in this study the over-bar sign is used for expected values of variables.

Evaluating the effect of β on optimal bidding results
In order to evaluate the effect of weighing parameter on optimal bidding results, the optimal bidding problem of CAES and wind units is solved for different values of β; and the results are presented in Table 3 and Figure 4. The number of scenarios is the same as that in Section 4.1. Table 3 clearly shows that increasing the values of β leads to an increase in CVaR and a decrease in the expected profit in the optimal solution. However, the values in the range from 0.4 to 0.6 can make a good compromise between the expected profit and CVaR values; for example, increasing β from 0 to 0.4 would lead to a $1074 increase in CVaR at the expense of a $380 decrease in the expected profit.
Furthermore, Figure 4 shows that while β increases, the GenCo becomes more risk-averse, as expected, and tends to bid lower powers to the DA market to avoid the high imbalance penalties incurred in the worst scenarios.

Computational cost and scalability of the proposed approach
The simulation times for all cases are reported in their corresponding table, which show that the proposed method can solve the problems in a reasonable time. Furthermore, in order to examine the scalability of the method, in case 3 of Table 4, the number of CAES units were increased and their simulation times were shown in Figure 5, which shows the almost linear variations of simulation time. It should be noted that the problem is being solved for a single GenCo. Therefore, a limited number of units will be present in the problem.

Gas price variability and uncertainty effect on optimal bidding results
In order to investigate the effect of NG price uncertainty on optimal bidding results, the optimal bidding problem of a GenCo was solved again using the NG price expectation (11.94 $/MWh) instead of its scenarios. For a single CAES unit, if NG price uncertainty is neglected, the SP method reaches an expected profit of $6587, which is $113 (1.69%) lower than the expected profit earned by taking NG price uncertainty  Table 2). Also, neglecting NG price uncertainty while solving optimal bidding problem leads to an expected profit equal to $9864, which is $139 (1.39%) lower than the expected profit earned by taking NG price uncertainty into account for the joint optimal bidding of CAES and wind units (case 3 of Table 2).
In order to investigate the effects of different probabilities of NG price scenarios on optimal bidding results, the optimal bidding problem was solved for different sets of probabilities with β = 0; whose results are presented in Table 4. It is obvious from this table that the probabilities of NG price scenarios have a considerable effect on optimal bidding result. By assuming higher probabilities for lower NG price scenarios, the expected profit is increased.
During different seasons of a year, electricity and NG prices experience various high and low values. To examine the effect of different gas prices on optimal bidding results, the optimal bidding problem of CAES and wind units was solved assuming only electricity price and wind speed scenarios, while supposing that NG prices are definite. The expectations of NG consumption of CAES in discharging and simple-cycle modes for each of gas prices are calculated using the heat rates of these modes and are depicted in Figure 6. As expected, this figure shows that higher values of NG price lead to lower usage of CAES and subsequently lower profits for CAES. Another interesting implication of this figure is that, at lower NG prices, simple-cycle mode is the dominant operating mode of CAES; but as the NG price increases, this mode quickly becomes uneconomical and CAES operates mostly in discharging mode.

Carbon emission reduction policy consideration in optimal bidding of CAES
The carbon content of NG is assumed to be 0.066 KgCo 2 eq/MJ [36], and the purchase and sale price of emission  allowance is assumed to be 0.010 and 0.005 $/KgCo 2 eq, respectively. Furthermore, it is assumed that GenCos can purchase or sell up to half of their total emission allowance in the emission market. In this section, Nes* Nws* Ngs = 21*6*5 = 630 scenarios are considered for DAM, BM and NG prices and wind powers. Tables 5 and 6 present the optimal bidding results of GenCo working under cap and trade and fixed emission quota mechanisms for different values of emission allowance (or fixed emission quota), respectively. By checking the expected values of gas consumptions in Tables 5 and 6, it can be said that, generally, with an increase in emission allowance (or fixed emission quota), CAES would operate more in simple-cycle mode and less in discharging mode. The reason is that, with regard to the scenarios, there are hours with high electricity prices that make the simple-cycle mode more economical. However, since generation in simplecycle mode causes twice more emissions than the discharging mode; with low emission allowances, the CAES output in simple-cycle mode become highly constrained and CAES can-not reach its maximum simple-cycle output. Additionally, since CAES cannot work in two modes simultaneously, when fully operating in simple-cycle mode is not possible, fully working in discharging mode becomes more economical. On the other hand, by increasing the emission allowance values, CAES can operate more peak hours in simple-cycle mode with full capacity and hence the share of simple-cycle mode operation is increased compared to discharging mode operation.
Furthermore, by comparing the expected values of emissions for the two emission reduction policies, it is observed that at lower emission allowances, cap and trade system leads to more carbon emissions, and higher simple-cycle mode generations; but at higher emission allowances, all these conditions are reversed. One possible explanation is that with low emission allowances in cap and trade system, CAES can buy emission allowance to operate in simple-cycle mode in suitable scenarios and gain more profits; but at higher emission allowance in cap and trade system, CAES can generate the desired amount of power in simple-cycle mode at peak hours and instead of operating in highly emission-producing simple-cycle mode during less profitable hours, it operates in discharging mode and sells its excess emission allowance. It should be noted that based on the above discussion, it is obvious that the expected profit of a GenCo with cap and trade system would be higher than that of a GenCo with fixed emission quota.
The reason why GenCo does not buy more emission allowance for CAES in any of the studied cases with cap and trade system is that, the purchase price of carbon emission allowance is high. So, GenCo only buys a minimum amount of emission allowance for scenarios that can become more profitable despite the cost of purchasing emission allowance.

4.6
Gas unavailability consideration in optimal bidding of CAES In this study, the Equations (32) and (33) are used to account for the unavailability of NG for CAES. Figure 7 depicts four scenarios considered for NG availability. Since the maximum gas consumption of CAES in simple-cycle mode is lower than 1200 MBTU, gas availability scenario 1 corresponds to 'fully available'. In gas availability scenario 2, the CAES gas consumption  is unconstrained in discharging mode, but its maximum generation capacity in simple-cycle mode will be about 100.84 MW. In gas availability scenarios 3 and 4, CAES output would be partially constrained in both discharging and simple-cycle modes because of gas-supply shortage. The total number of scenarios in this case is Nes* Nws* Ngs* Nus = 21*6*5*4 = 2520.
The results of optimal bidding problem of CAES and wind considering these scenarios are presented in Table 7. This table shows that NG congestion leads to drastic reduction in the expected profit ($1036 or 10.35% reduction) and CVaR ($553 reduction). It is also observed that when congestion is considered, the expected gas consumption of CAES in discharging mode increases (from 1330 GJ to 1579 GJ, i.e. 249 GJ increase) along with a considerable reduction in the expected gas consumption of CAES in simple-cycle mode (from 7950 GJ to 6082 GJ, i.e. 1868 GJ decrease). The reason is that when NG unavailability is considered, the CAES can consume lower amounts of NG. Since CAES burns less NG in discharging mode, it is less likely to be affected (or being severely affected) by NG unavailability in different scenarios. So, in case of gas unavailability, discharging mode of CAES becomes more economical, while the simple-cycle mode drastically loses its profitability due to the prospect of its output  being curtailed or lowered because of gas unavailability in some scenarios.
Since hours 8 to 10 (especially 10) have relative high DA prices in most scenarios, GenCo would normally consider high power sale bids for that hours (Figure 4). Therefore, the NG unavailability has the most severe effect on that hours (see gas availability scenario 4 in Figure 7).

4.7
Modelling the dynamics of NG flow in the pipeline in optimal bidding of CAES In this study, Equations (32) and (34)-(44) are used to model the NG pipeline. Five scenarios are considered for city NG demand as shown in Figure 8. The probability of the second scenario of city NG demand is assumed to be 0.6 and the probability of other scenarios is assumed to be 0.1. The number of total scenarios in this study is Nes* Ncs = 21*5 = 105. The data of the gas pipeline is presented in Table 8 [37]. Also, in this study, the value of β parameter is considered 0.4. The results of this study are presented in Table 9.
It is obvious from Table 9 that modelling the pipeline, given the dynamic limitation of NG flow, leads to a large decrease in the mathematical expectation of profit ($532 or 8.69% decrease). It is also observed that when the dynamics of NG flow in the pipeline is taken into account, the expected gas consumption of CAES in discharging mode increases (from 1031 GJ to 1146 GJ, i.e. 115 GJ increase) and also expected gas consumption of CAES in the simple cycle mode decreases signif- Time (s) 10 156

FIGURE 9
The expected values of CAES power generation in the cumulative scenarios in which the city gas demand scenario 5 is considered icantly (from 6899 GJ to 5783, i.e. 1116 GJ decrease). On the other hand, it is clear that although in city gas demand scenarios 3 to 5 the gas demand in some hours exceeds the maximum inflow of the pipeline, the scheduling is able to supply the total city gas demand and even some pipeline capacity remains for CAES gas consumption. For example, the expected values of CAES power generation in the cumulative scenarios in which the city gas demand scenario 5 is considered is shown in Figure 9. This figure clearly shows that, although in these scenarios the city gas consumption is higher than the maximum inflow at hours 8 to 12, the CAES works in discharging mode at hours 9 and 10 and uses gas. This is because of the gas stored in CAES, that is, linepack. Therefore, in order to better evaluate the impact of initial linepack, the optimal bidding problem is solved for different values of initial linepack and the results are presented in Tables 10-12. It is worth noting that, according to Equations (34) to (37), the minimum and maximum energy stored in the gas pipeline are 18,433 and 29,839 MBtu, respectively. By examining the values in Table 10, it can be seen that there is no feasible solution for the initial linepack equal to 19,000 MBtu. The reason of this is that the gas stored in the pipeline is not sufficient and the city's gas demand rises before there is enough opportunity to store enough gas in the pipeline. Because of this, it is not possible to supply city gas demand during its peak hours. As the value of linepack increases, the expected profit increases at first and then declines. This is due to the Equation (40), which implies that the final linepack should not be less than the initial linepack. Thus, by increasing the initial linepack, the final amount of linepack increases; and in order to provide this final value, the pipeline will be able to supply less gas, which ultimately limits the gas consumption of CAES and reduces the expected profit. Tables 11 and 12 show the expected CAES gas consumptions and expected profits of cumulative scenarios corresponding to each of the city gas demand scenarios for different initial linepacks. It is clear from these tables that the city gas demand scenarios 1 and 2, in which the peak city gas demand is less than the maximum inflow of the gas pipeline (2,500 MBtu), have approximately the same responses. But in other city gas demand scenarios, increasing gas demand in the city leads to a restriction on the gas consumption of CAES and thus a decrease in its profits.

CONCLUSION
Stochastic Programming was used for solving joint optimal bidding of CAES and wind units. First, the joint optimal bidding was compared with independent optimal bidding, showing the superiority of the former. Then, the effect of the risk-aversion parameter β was tested on optimal bidding results and a range was proposed for it to make a good compromise between CVaR and the expected profit. Afterward, the effects of NG price uncertainty on optimal bidding results were investigated using five simple and not too distanced gas price scenarios, making it clear that neglecting gas price uncertainty would lead to unneglectable reduction in the expected profit. Besides, the effect of NG price variability on CAES profitability was examined which showed that at lower gas prices, CAES would be more profitable in simple-cycle mode, but with an increase in NG price, the profitability of this mode is drastically reduced. On the other hand, as NG price increases, CAES profitability in discharging mode increases at first, reaches a peak, and then gradually falls to zero. Afterwards, the effect of two different emission reduction policies, cap and trade and fixed emission quota, on optimal bidding results of CAES was investigated thoroughly. It is concluded that emission reduction policies have considerable effects on optimal bidding of CAES, altering its expected profit, CVaR and the profitability of discharging and simple-cycle modes.
In the next section, the effects of gas unavailability were tested on optimal bidding results. It is found that NG unavailability has severe effects on the expected profit and profitability of discharging and simple-cycle modes of CAES which can lead to very high imbalance penalties if it is not accounted for.
Finally, a dynamic gas pipeline modelling was carried out and the effects of the dynamic NG flow and initial linepack on optimal bidding results were investigated. It is concluded that the dynamic behaviour of NG in the pipeline has important role in maximum available gas for CAES and must be modelled appropriately in the optimal bidding problem. Considering NG price uncertainty, gas unavailability, dynamics of natural gas flow in the pipeline and emission reduction policies in solving the optimal bidding problem of CAES, using other methods such as robust, robust-stochastic, or IGDT can be the subject of future studies.

Nomenclature
A 0 initial level of storage of CAES A min minimum level of storage of CAES A max maximum level of storage of CAES P min co minimum compression capacity of compressor P max co maximum compression capacity of compressor P min d minimum generation capacity of expander P max d maximum generation capacity of expander H R d heat rate of CAES in discharging mode H R sc heat rate of CAES in simple-cycle mode vom co variable operation and maintenance cost of compressor vom x variable operation and maintenance cost of expander D day-ahead market price B+ positive imbalance prices B− negative imbalance prices NG natural gas price Sell sale price of carbon emission allowances Buy purchase price of carbon emission allowances P for forecasted wind power generation E max total Emission allowance of the GenCo E max Buy maximum amount of emission allowance that can be purchased E max Sell maximum amount of emission allowance that can be sold G max maximum gas pipeline capacity min minimum pressure of gas nodes max maximum pressure of gas nodes K lp linepack constant of gas pipeline K gas flow constant of gas pipeline LP 0 initial linepack of gas pipeline max in maximum inflow of gas pipeline G City city gas demand bp bids for power generation im + positive energy imbalance sold to balancing market im − negative energy imbalance purchased in balancing market p u power output of unit u profit expected profit z objective Value z S * the objective value of the solution of the stochastic programming problem z D * objective value of the solution of the expected value problem P c power input of CAES in charging mode P d power output of CAES in discharging mode P sc power output of CAES in simple-cycle mode IC binary variable presenting charging status of CAES ID binary variable presenting discharging status of CAES IS binary variable presenting simple-cycle status of CAES A amount of energy stored in CAES A f final amount of energy stored in CAES auxiliary positive variable E Sell carbon emission allowances sold E Buy carbon emission allowances purchased E total carbon emissions of CAES Sell binary variable presenting emission allowance sale Buy binary variable presenting emission allowance purchase G d natural gas burnt by CAES in discharging mode G sc natural gas burnt by CAES in simple-cycle mode G CAES total natural gas burnt by CAES Send pressure of sending node of gas pipeline Recv pressure of receiving node of gas pipeline pip average pressure in gas pipeline LP linepack of gas pipeline in inflow of gas pipeline out outflow of gas pipeline pip average gas flow in gas pipeline

Constants
CVaR α conditional value-at-risk with confidence level α ER energy ratio of CAES

Indices
M a large enough positive number Ncs number of city gas demand scenarios Nes number of electricity price scenarios Ngs number of natural gas price scenarios Nus number of gas pipeline unavailability scenarios Nws number of wind power scenarios prob s probability of occurrence of scenarios s index for scenarios t index for time periods u index for all units va auxiliary binary variable

Variables
VaR α value-at-risk with confidence level α VSS value of stochastic solution α confidence level for calculating value-at-risk