## 5 Conclusions  
This paper focuses on the optimal scheduling model of a CVPP consisting of RESs, ESS, and customers in the DA and BE markets. The VPP is assumed to be an active agent in the balancing market with a pre-signed upward reserve capacity contract in the BC market. Therefore, before the DA market gate closure, the CVPP's operators should perform the following tasks simultaneously: determining the VPP's optimal trading strategies in the DA market, evaluating the CVPP's profit opportunities in the BE market, and then calculating the operating plan for each CVPP's component. The challenge here is that the ESS operation is limited by its energy level while activating reserve energy from ESS in the BE market changes this energy level. As a result, the operating plan of ESS and CVPP in the DA market will be affected. To solve this problem, this paper built a two-stage stochastic optimization model to determine the VPP's optimal scheduling in both the DA and BE markets. The ESS operation is described by an energy model in the DA market and a reserve provision model in the BE market. These two ESS models are associated to ensure that the reserve activation does not affect the DA scheduling. The uncertainty in demand, RESs' available power output, and the probability of reserve activation are considered. The influence of the BC contract and reserve activation probability on the CVPP's optimal scheduling are also studied and analyzed. In this paper, the proposed model is verified by an example. The following conclusions are drawn:  
1. The effectiveness of the proposed model is shown by analyzing the results. The proposed model determined the CVPP's optimal scheduling in the DA and BE markets. The RESs and ESS in the CVPP were coordinated to ensure that the CVPP can buy electricity during low-priced hours and sell electricity during high-priced hours in the DA market. The pre-signed BC contract was satisfied, even in an extreme scenario. Based on the probability of reserve activation, the type and amount of reserve energy CVPP should provide in the BE market were determined. This helps increase profit opportunities for CVPP. 2. The results also show the effectiveness of the ESS's reserve provision model. The ESS operating states before and after provisioning reserve energy were determined in detail. The CVPP's trading schedule in the DA market did not change after activating reserve energy from ESS. This is a remarkable advantage of the proposed model. As discussed in Section 1, only a few studies currently focus on the role of ESS in both the energy and reserve markets. Besides, these studies only focus on the ability to adjust \begin{table}
\begin{tabular}{c c c c c} \hline
**Relaxation Level** & **5\%** & **10\%** & **15\%** & **20\%** \\ \hline
**DA profit (USD)** & \(-6231.38\) & \(-6087.32\) & \(-5916\) & \(-5758.29\) \\ \hline
**BE Profit if Reserve Activated (USD)** & 11,656.25 & 11,685.09 & 11,660.63 & 11,642.81 \\ \hline
**Total Profit Considering Reserve Activation** & & & & \\
**Probability (USD)** & \(-6114.81\) & \(-5970.47\) & \(-5799.39\) & \(-5641.86\) \\ \hline \end{tabular}
\end{table} 
Table 4: The CVPP’s profit with different relaxation levels in case the BC contract has Plan 2 and an upward reserve capacity of 4 MW. the ESS's power output to provide reserve service but do not consider maintaining the ESS's predetermined operating plan in the DA market. 3. The ESS plays a vital role in the CVPP's operation. In the DA market, the ESS is fully utilized to profit from energy arbitrage. In the BE market, the ESS's reserve provision ability helps CVPP provide upward reserve energy even if the total available power output of RESs within CVPP is less than the local consumption or the BC contract lasts all day. 4. The reserve activation probability is low, so CVPP focuses on making profits from the DA market rather than the BE market. Consequently, although RES's power output is surplus in some time blocks, the upward capacity is relatively low, just enough for the requirements of the BC contract. 5.