# Research on Robust Day-Ahead Dispatch Considering Primary Frequency Response of Wind Turbine
## 3 Optimization Model Considering Primary Frequency Response
### Two-Stage Robust Optimization Model
For the optimization goal specified in Equation (12), the constraints are as follows:  
\[\sum\limits_{i\in m}P^{0}_{G,i,t}+\sum\limits_{i\in m}P^{c,0}_{W,u,t}-P_{L,m, t}-\sum\limits_{l\in m}P^{mn,0}_{l,t}=0 \tag{13}\]  
\[P^{mn,0}_{l}=\frac{\theta^{0}_{m,t}-\theta^{0}_{n,t}}{x_{mn}} \tag{14}\]  
\[\underline{P}_{G,i}\leq P^{0}_{G,i,t}\leq\overline{P}_{G,i} \tag{15}\]  
\[R_{D,i}\leq P^{0}_{G,i,t}-P^{0}_{G,i,t-1}\leq R_{U,i} \tag{16}\]  
\[\underline{P}^{mn}_{l}\leq P^{mn,0}_{l,t}\leq\overline{P}^{mn}_{l} \tag{17}\]  
\[\sum\limits_{i,t}R^{UL0}_{i,t}\geq R^{U,\text{min}}_{t},\;\sum\limits_{R^{U,t} }R^{D,0}_{i,t}\geq R^{D,\text{min}}_{t} \tag{18}\]  
\[P^{0}_{G,i,t}+R^{UL0}_{i,t}\leq\overline{P}_{G,i},\;P^{0}_{G,i,t}-R^{D,0}_{i,t} \geq\underline{P}_{G,i} \tag{19}\]  
where \(P^{c,0}_{W,u,t}\) is the expected output of the wind power unit \(w\) at the moment \(t\); \(P_{L,m,t}\) and \(P^{non}_{m,t}\) indicate the load and load shedding at node \(m\) at the moment \(t\), while \(P^{mn,0}_{l,t}\) is the power of line \(mn\) at \(t\); \(\theta^{0}_{m,t}\) and \(\theta^{0}_{m,t}\) refer to the phase angle between node \(m\) and \(n\) at \(t\); \(x_{mn}\) is for the reactance of line \(mn\), \(\overline{P}_{G,u}\) and \(\underline{P}_{G,u}\) represent the range of output of unit \(u\); \(R_{U,u}\) and \(R_{D,u}\\[\underline{P}_{G,i}\leq P_{G,i,t}^{s}=P_{G,i,t}^{0}+r_{i,t}^{U,s}-r_{i,t}^{D,s} \leq\overline{P}_{G,i} \tag{22}\]  
\[R_{D,i}\leq P_{G,i,t}^{s}-P_{G,i,t-1}^{s}\leq R_{U,i} \tag{23}\]  
\[\underline{p}_{l}^{mn}\leq P_{l,t}^{m,s}\leq\overline{P}_{l}^{mn} \tag{24}\]  
\[P^{mn,0}_{l}=\frac{\theta^{0}_{m,t}-\theta^{0}_{n,t}}{x_{mn}} \tag{14}\]0  
\[P^{mn,0}_{l}=\frac{\theta^{0}_{m,t}-\theta^{0}_{n,t}}{x_{mn}} \tag{14}\]1  
\[P^{mn,0}_{l}=\frac{\theta^{0}_{m,t}-\theta^{0}_{n,t}}{x_{mn}} \tag{14}\]2  
\[P^{mn,0}_{l}=\frac{\theta^{0}_{m,t}-\theta^{0}_{n,t}}{x_{mn}} \tag{14}\]3  
\[P^{mn,0}_{l}=\frac{\theta^{0}_{m,t}-\theta^{0}_{n,t}}{x_{mn}} \tag{14}\]4  
where \(P_{W,w,t}^{r,s}\) is the actual output of unit \(w\) at \(t\); the meaning of the other variants is the same as in the basic scenario, and for the real-time scenario we use the superscript \(s\). From Equations (20)-(24), we find that in the real-time operation, the constraints in different scenarios are similar to those in the day-ahead dispatch, which represent the grid power balance, the unit output and ramping constraints, and the line capacity constraints, respectively; but in the power conservation Equation (20), the power of the wind turbines is no longer the expected value of the wind power output. Moreover, the unit output is re-adjusted on the basis of the day-ahead dispatch before it meets the restraint of Equation (25). The adjusted unit output also meets Equation (22). Since we only consider the power imbalance reserve in the basic scenario in the model, and skip the primary frequency response constraint, the load shedding is provided in the real-time scenario for the sufficient primary reserve and complete wind power accommodation, as in Equations (20) and (26). Equations (27)-(29) depict the relevant constraints for the real-time scenario considering the primary frequency response, whose meanings are shown in Equations (8)-(11). Equation (27) contains all of the units except the fault unit, Equation (28) is for the traditional synchronous generators, while Equation (29) applies to virtual synchronous wind turbines. In the above calculation, \(P_{loss}\) and some other variables about the primary reserve are constant. In most cases, the operator wants to obtain the maximum possible power loss due to the failure of the unit when the system frequency requirement is met. Therefore, when \(P_{loss}\) is a variable, the target can be as follows:  
\[P^{mn,0}_{l}=\frac{\theta^{0}_{m,t}-\theta^{0}_{n,t}}{x_{mn}} \tag{14}\]5  
When \(P_{loss}\) is not fixed, the system inertia will no longer be a constant after the failure, and Equation (3) becomes a new constraint, indicating the inertia of the system after \(P_{loss}\).