## 2 Problem Description
### The Reserve Provision Model of ESS  
As mentioned previously, ESS plays essential roles in the CVPP's operation in the energy and reserve markets: compensating for the fluctuation of RESs' power output and  
Figure 3: The CVPP’s optimal scheduling model in the DA and BE markets, considering the BC contract. customers' consumption, providing energy arbitrage in the energy market, and providing reserve service in the balancing market. However, ESS needs to be planned to be able to perform these roles well at the same time. This section proposes constraints describing ESS's status switching when providing upward/downward reserve and the association between its scheduling in the DA market and reserve provision ability. Figure 4 depicts the ESS's ability in reserve provision depending on the type of reserve and the ESS's state before reserve activation. * If TSO requests an upward reserve while the ESS is charging, the ESS's maximum upward reserve power is \(P_{ESS,ch}^{t,s}+P_{ESSmax}\). * If TSO requests an upward reserve while the ESS is discharging, the ESS's maximum upward reserve power is \(P_{ESSmax}-P_{ESS,disch}^{t,s}\). * If TSO requests a downward reserve while the ESS is charging, the ESS's maximum downward reserve power is \(P_{ESSmax}-P_{ESS,ch}^{t,s}\). * If TSO requests a downward reserve while the ESS is discharging, the ESS's maximum downward reserve power is \(P_{ESSmax}+P_{ESS,disch}^{t,s}\). However, these above values are the maximum reserve volume ESS can provide to the balancing market. Actually, the ESS's available upward/downward reserve depends on its energy level and DA operating schedule. Assuming that at time interval \(t\), the CVPP provides reserve energy, and the ESS contributes to this trading. Whether CVPP provides upward or downward reserve is described by binary variables \(u_{RU}^{t,s}\) and \(u_{RD}^{t,s}\). The binary variable \(u_{RU}^{t,s}\) equals one if the CVPP provides upward reserve and zero otherwise. Similarly, the binary variable \(u_{RD}^{t,s}\) equals one if the CVPP provides a downward reserve and zero otherwise. Constraint (1) shows that CVPP cannot provide upward and downward reserve energy at the same time. \[u_{RU}^{t,s}+u_{RD}^{t,s}\leq 1 \tag{1}\]  
Figure 4: The ESS’s ability in reserve provision corresponds to the type of reserve and the ESS’s state before reserve activation. Before providing reserve energy, the ESS is scheduled in the energy market with the charging level \(P_{ESS,ch}^{l,s}\) or discharging level \(P_{ESS,disch}^{l,s}\). Binary variable \(u_{ESS}^{l,s}\) shows the ESS status: 1 if ESS is discharging and otherwise. After reserve activation, the ESS switches to a new status described by a binary variable \(u_{ESS,fatrSR}^{l,s}\). The type of reserve energy sold to the TSO and the ESS status before and after reserve activation lead to four situations, as shown in Figure 5 and Table 1.  
Based on the set of feasible situations shown in Table 1, Equations (2)-(15) are proposed to model the ESS operation in reserve provision. Equation (2) ensures that if the ESS is requested to provide upward reserve while discharging, its new status should be the discharging state. This means that if \(u_{RU}^{l,s}=1\) then situation 2 with \(u_{ESS}^{l,s}=1\) and \(u_{ESSafterSR}^{l,s}=0\) is infeasible. Similarly, if the ESS is requested to provide a downward reserve while charging, its new status should be charging state. With \(bigM\) as a sufficiently large constant, Equations (3) and (4) ensure that at any time, the ESS can only provide one type of reserve energy: upward or downward, corresponding to the CVPP's reserve energy trading. \[-u_{RD}^{l,s}\leq u_{ESSafterSR}^{l,s}-u_{ESS}^{l,s}\leq u_{RU}^{l,s} \tag{2}\]  
\[P_{ESS,RD1}^{l,s}+P_{ESS,RD2}^{l,s}\leq u_{RD}^{l,s}bigM \tag{3}\]  
\[P_{ESS,RU1}^{l,s}+P_{ESS,RU2}^{l,s}\leq u_{RU}^{l,s}bigM \tag{4}\]  
Table 1 shows that depending on the ESS status before and after reserve activation, the amount of upward reserve provided by the ESS can be \(P_{ESS,RU1}^{l,s}\), \(P_{ESS,RU2}^{l,s}\) or both. The