## 3 Uncertainty Analysis and Simulation
### Uncertainty Simulation  
The PDFs of the WPP output, PV output, and load are continuous probability distribution functions (CPDFs). In general, discrete PDFs are required for MECS scheduling. Therefore, a discretization process for continuous PDFs must be completed before the uncertainty simulation. Thus, the uncertainty simulation comprises three steps: PDF discretization, scenario simulation, and scenario reduction. (1) PDF discretization  
The discretization process involves dividing the continuous function curve into a number of segments corresponding to certain intervals. In general, these intervals can be equal or unequal. In the former case, all scenarios can be considered, and, in fact, the probabilities of some scenarios may not reflect the real probabilities. In the latter case, the probability can be captured more accurately. In this study, the Wasserstein method is adopted for the discretization of PDFs. More details on this method may be found in Reference [22]. It is assumed that \(f_{\mathrm{c}}(x)\) is a CPDF to be discretized using \(N\) points. Then, the optimal discrete points \(z_{n}(n=1,2,\ldots,N)\) under the Wasserstein distance indicator are obtained by  
\[\int_{-\infty}^{z_{n}}f_{\mathrm{c}}(x)^{1/(1+r)}dx=\frac{2n-1}{2N}\int_{- \infty}^{\infty}f_{\mathrm{c}}(x)^{1/(1+r)}dx. \tag{5}\]  
Then, the discrete probability of \(z_{n}\) is calculated as follows:  
\[p_{d}^{n}=\int_{\frac{z_{n}+1+z_{n}}{2}}^{\frac{z_{n}+z_{n+1}}{2}}f_{\mathrm{c }}(x)^{1/(1+r)}dx,n=1,2,\ldots,N \tag{6}\]  
where \(p_{d}^{n}\) represents the discrete probability of \(z_{n}\). When \(n=0\), \(p_{d}^{0}\) represents the lower bound of the variable \(x\), and its value is \(p_{d}^{0}=\int_{z_{0}}^{z_{1}+z_{n}}f_{\mathrm{c}}(x)dx\). When \(n=N+1\), \(p_{d}^{N+1}\) represents the upper bound of \(x\), and its value is equal to \(\int_{\frac{z_{0}+1+z_{0}}{2}}^{z_{0}+1}f_{\mathrm{c}}(x)dx\). By combining Equations (1) and (3) with Equation (6), the optimal discrete points can be calculated. Correspondingly, the discrete PDFs for the outputs of the WPP, PV, and load can be obtained for the scenario simulation. Figure 2 shows the discretization process (6 discrete points). (2) Scenario simulation  
After the PDFs of the WPP output, PV output, and load have been discretized, the simulation scenarios can be obtained by a sampling method, such as Monte Carlo or Latin hypercube sampling. Monte Carlo is highly versatile and accurate. When the distribution has low probability regions, small  
Figure 2: The discretization of the continuous probability distribution functions (CPDFs) (six discrete points). samples are generally not representative. The Latin hypercube sampling method divides the PDF into several equal intervals to obtain the sample from each interval [12]. However, the probabilities of some scenarios may not reflect the real probabilities [23]. Based on the above analysis, in this study, the Wasserstein method is used to divide the continuous probability distribution curves. Then, the scenario tree method is used to describe the different states of power output, namely, the high, mean, and low (\(z=1,2,3\), respectively). In Equation (5), the optimal discrete points for the WPP and PV outputs are calculated and the simulation interval of the PDF is accordingly divided. The simulation scenario set is gained by using the interval simulation method. Then, we assume \(g_{t}^{z}\) is the expected output in each state at time \(t\). Equation (6) yields the probability \(p_{t}^{z}\) of simulation scenarios in each state at time \(t\). Consequently, the scenario set and probability are \(S=\{g_{t}^{z}|t=1,2,\ldots,T\}\) and \(p=\prod\limits_{t\in T}p_{t}^{z}\), respectively. More details on the scenario simulation can be found in [24]. (3) Scenario reduction  
After the continuous distributions of the random variables have been optimally discretized in each period, the scenario set formed by the entire scheduling interval is large, which results in dimension explosion.