## 4 Multi-Time Scale Dispatching Model of Active Power and Reactive Power Based on MPC
### Day-Ahead Optimal Dispatching Model
The reactive power of a Doubly fed Induction Generator (DFIG) includes stator side reactive power and network side reactive power so that the reactive power regulation range of DFIG is:  
\[Q_{\max}^{\text{WT}}=Q_{s,\max}^{\text{WT}}+Q_{c,\max}^{\text{WT}} \tag{14}\] \[Q_{\min}^{\text{WT}}=Q_{s,\min}^{\text{WT}}+Q_{c,\min}^{\text{WT}}\] \[Q_{\min}^{\text{WT}}\leq Q_{i}^{\text{WT}}\leq Q_{\max}^{\text{WT}}\]  
where \(Q_{\max}^{\text{WT}}\) and \(Q_{\min}^{\text{WT}}\) are the maximum and minimum reactive power output of the WT, \(Q_{s,\max}^{\text{WT}}\) and \(Q_{s,\min}^{\text{WT}}\) are the maximum and minimum reactive power output of the inverter on the stator side of the WT. \(Q_{c,\max}^{\text{WT}}\) and \(Q_{c,\min}^{\text{WT}}\) are the maximum and minimum reactive power output of the inverter on the network side of the WT. The specific derivation process is shown in [20]. The reactive power output of PV is limited by the rated power of its converter:  
\[\left(P_{i,pre}^{\text{PV}}\right)^{2}+\left(Q_{i}^{\text{PV}}\right)^{2} \leq\left(S_{i,N}^{\text{PV}}\right)^{2} \tag{15}\]  
where \(S_{N}^{\text{PV}}\) is the rated capacity of the PV inverter. * Active power and reactive power output constraints of gas turbines. As a controllable distributed power source, a gas turbines's power transmission is through the grid-connected inverter, and its active power and reactive power can be independently controlled and limited by the capacity of the inverter:  
\[\left(P_{i}^{\text{GT}}\right)^{2}+\left(Q_{i}^{\text{GT}}\right)^{2}\leq \left(S_{i,N}^{\text{GT}}\right)^{2} \tag{16}\]  
where \(S_{i,N}^{\text{GT}}\) is the rated installed capacity of GT. The active power climb rate constraints of the gas turbine is:  
\[-R_{i,down}^{\text{GT}}\leq P_{i}^{\text{GT}}(t+1)-P_{i}^{\text{GT}}(t)\leq R _{i,up}^{\text{GT}} \tag{17}\]  
where \(R_{i,up}^{\text{GT}}\) and \(R_{i,down}^{\text{GT}}\) are the limit upslope rate and the limit downslope rate of GT, respectively. * Active power and reactive power constraints of VPSSH. VPSSH constraints include capacity constraints, multi-operating condition constraints and storage capacity constraints, as shown in Equations (1)-(8). * Active power and reactive power output constraints of battery energy storage. BES constraint is similar to VPSSH but it has no phase modulation state. First, BES is constrained by the capacity of the inverter:  
\[\left(P_{i}^{\text{BES}}\right)^{2}+\left(Q_{i}^{\text{BES}}\right)^{2}\leq \left(S_{i,N}^{\text{BES}}\right)^{2} \tag{18}\]  
where \(S_{i,N}^{\text{BES}}\) is the rated capacity of the BES inverter. BES cannot be in the state of charging and discharging at the same time, and it needs to meet the daily operating capacity balance, then:  
\[ \begin{split} u_{ch,i}+u_{dch,i}\leq 1\\ 0\leq P_{ch,i}\leq u_{ch,i}P_{ch,i}^{\max}\\ 0\leq P_{dch,i}\leq u_{dch}j_{dch,i}^{\max}\\ P_{i}^{\text{BES}}=P_{dch,i}-P_{ch,i}\\ E_{\text{SOC},i}(t+1)=E_{\text{SOC},i}(t)+\eta P_{ch,i}(t) \Delta T-P_{dch,i}(t)\Delta T/\eta\\ E_{\text{SOC},i}^{\min}\leq E_{\text{SOC},i}\leq E_{\text{SOC},i }^{\max}\end{split}  \tag{19}\]  
where \(u_{ch,i},\ u_{dch,i}\) are the charging and discharging state of BES, and are 0-1 variables; \(P_{ch,i},\ P_{dch,i}\) are the BES charging and discharging power; \(P_{ch,i}^{\max},\ P_{dch,i}^{\max}\) are the maximum charging and discharging power of BES; \(E_{SOC,i}\) is the storage energy of BES; \(\eta\) is the charge and discharge efficiency of BES; and \(E_{\text{SOC},i}^{\min},\ E_{\text{SOC},i}^{\max}\) are the minimum and maximum storage energy of BES. * Reactive power constraints of SVG. \[Q_{\min}^{\text{SVG}}\leq Q_{i}^{\text{SVG}}\leq Q_{\max}^{\text{SVG}}\] (21) where \(Q_{\min}^{\text{SVG}},\ Q_{\max}^{\text{SVG}}\) are the minimum and maximum reactive power of SVG, respectively. * Constraint of capacitor banks. \[ \begin{split} Q_{i}^{\text{CBs}}=n_{CBs}Q_{N}^{\text{CBs}}\\ -N_{\max}^{\text{CBs}}\leq n_{CBs}(t+1)-n_{CBs}(t)\leq N_{\max}^{ \text{CBs}}\\ \sum_{t=1}^{T-1}n_{CBs}(t+1)-n_{CBs}(t)\leq R_{\max}^{\text{CBs}}\end{split}