# Power Grid Reliability Evaluation Considering Wind Farm Cyber Security and Ramping Events
## 5 Power System Reliability Assessment
### Modeling of Wind Power and WPRs  
The modeling of wind power is composed by the average output of WTs and power variation results from WPRs. The output of WTs is formulated as Equation (11). \[P^{W}(t)=\left\{ \begin{array}{ll}P_{W0}&0\leq t\leq T_{s}\\ P_{W0}+R_{W}(t-\Delta t)\cdot\Delta t&T_{s}<t\leq T_{s}+D\end{array} \right. \tag{11}\]  
where \(P^{W}(t)\) is the active power of a single WT, \(P_{W0}\) is the annual mean output of wind power, \(R_{W}\) is the ramping rate of wind power, \(T_{s}\) is the start time of WPRs, and \(D\) is its duration. \[\overline{R}_{W}(t)=\frac{1}{\Lambda C_{w}}\sum_{\gamma}^{\Lambda}R_{\gamma}(t )C_{\gamma} \tag{12}\]  
Generally, wind speed varies with different topography. We assumed that the same wind farm would have only one wind speed. If more than one ramping event happens at the same time, the ramping rate can be equivalent to an arithmetic mean, as shown in Equation (12). \(\overline{R}_{w}\) is the equivalent ramping rate of wind power, \(R_{\gamma}(t)\) is the ramping rate of wind farm \(\gamma\) at time t, \(C_{\gamma}\) is the installed capacity of wind farm \(\gamma\), and \(\Lambda\) and \(C_{w}\) are the number and the total power capacity of wind farms, respectively. During a ramping event, those generators with ramping rates lower than WPRs cannot contribute to the power regulation. During a ramping event, the available power capacities of generators are less or equal to the maximum power capacity, as shown in Equation (13). \[\overline{P}_{j}^{S}(t)=\left\{ \begin{array}{ll}P_{j}^{\max}&if\ \overline{R}_{j}\geq \overline{R}_{W}(t)\\ P_{j}^{S}(t)&\ \ \ \ \ \ \ else\end{array} \right.\forall j\in J \tag{13}\]  
where \(P_{j}^{\max}\), \(\overline{R}_{j}\), \(\overline{P}_{j}^{S}(t)\) and \(P_{j}^{S}(t)\) are the maximum power capacity, limitation of ramping rate, the available capacity, and the actual power output of conventional generator \(j\) at time \(t\), respectively. \(J\) is the set of generators. To sample WPRs, a data mining method [31] was used to detect the ramping events in historical wind power data. A nonlinear least square (NLS) analysis was adopted to estimate all the parameters(\(\omega\), \(\mu\), and \(\sigma\)) of the mixture components of a Gaussian model [17]. The cumulative distribution of WPRs, \(F_{G}\), is analytically expressed as:  
\[F_{G}(x|N_{G};\Gamma)=\sum_{i=1}^{N_{G}}\left[\frac{\sqrt{\pi}}{2}\omega_{i} \sigma_{i}erf\left(\frac{\mu_{i}-x}{\sigma_{i}}\right)\right]+C,\forall x\in \chi,\forall i\in\Gamma \tag{14}\]  
where \(\chi\) is the data set of a random variable \(x\), with a total number of \(Nx\); \(i\) is the set of mixture components with a total number of N\({}_{G}\). \(\Gamma\) is the overall parameter matrix. Each vector of \(\Gamma(\gamma_{i})\) defines a mixture component of the Gaussian model. \(\omega\) is the weight; \(\mu\) is the mean value; and \(\sigma\) is the standard deviation. \(erf\) is the Gaussian error function as shown in Equation (15), and \(C\) is a constant solved by Equation (16). The final CDF of the WPRs, \(F(x)\), is analytically formulated as Equation (17). \[erf(x)=\frac{2}{\sqrt{\pi}}\int_{0}^{x}e^{-t^{2}}dt \tag{15}\]  
\[C=F_{G}(-0.1)-\sum_{i=1}^{N_{G}}\left[\frac{\sqrt{\pi}}{2}\omega_{i}\sigma_{i }erf\left(\frac{-0.1-\mu_{i}}{\sigma_{i}}\right)\right] \tag{16}\]  
\[F(x)=F_{G}(x)\times sign(x-Tr) \tag{17}\]  
where \(Tr\) is the threshold for defining WPRs. In this paper, the wind power ramp was defined as same as that in [17], which changes in wind power output larger than 20% of the rated capacity without constraining the ramping duration and rate. The threshold of ramping magnitude, \(TrM\), equaled 0.2. The threshold of ramping rate, \(TrR\), was calculated by \(TrM/(max(Dr))\), where \(\max(Dr)\) represents the maximum value of ramping duration. The inverse function of Equation (14) was used to sample the ramping features, formulated as Equation (18). With separate sampling, the ramping features of duration, ramping rate, and magnitude can be obtained.