# State Residualisation and Kron Reduction for Model Order Reduction of Energy Systems
## 2 Power System Modelling
### Grid-Forming Converter
#### 2.1.1 Modelling the Grid-Forming Converter Control Loops  
The equations for active power and frequency, \(P/f\), droop control are given as (1)-(4), which model the active power injected by the converter, the measure of this power, the \(P/f\) droop control, and the angle of the converter, respectively.  
\[P=v_{\alpha d}i_{\alpha d}+v_{\alpha q}i_{\alpha q}, \tag{1}\]  
\[\frac{dp_{m}}{dt}+\omega_{c}p_{m}=\omega_{c}P, \tag{2}\]  
\[\omega_{\mathrm{vsm}}=\omega_{0}+m_{p}\Big{(}P_{ref}-p_{m}\Big{)}, \tag{3}\]  
Figure 1: Physical structure of a grid-forming converter and its control loops.  
\[\frac{1}{\omega_{b}}\frac{d\delta_{vsm}}{dt}=\omega_{vsm}-\omega, \tag{4}\]  
where \(\omega=\omega_{0}=1\) is the rotating frequency of the common DQ0 reference frame.  
The equations for reactive power and voltage amplitude (\(Q/V\)), droop control, along with a damping enhancement control and virtual impedance (VI)-based current-limiting control (the principle of the VI current-limiting control is that an emulated impedance is added to the \(R_{f}L_{f}\) filter once the converter's current is larger than \(I_{nom}\), so that the converter's current is limited), are given as (5)-(15). Equations (5) and (6) model the reactive power injected by the converter and the measure of this power, (7) and (8) model the reactive droop control, (9) and (10) model the damping enhancement control, (11)-(14) model the VI current control, and (15) calculates the converter's current.  
\[Q=v_{\omega q}i_{od}-v_{\omega d}i_{\omega q}, \tag{5}\]  
\[\frac{dq_{m}}{dt}+\omega_{c}q_{m}=\omega_{c}Q, \tag{6}\]  
\[v_{\omega d}^{*}=V_{ref}+m_{q}(Q^{*}-q_{m})+\left(M_{ADd}-k_{ff}i_{od}\right) -\Delta v_{VId}, \tag{7}\]  
\[v_{\omega q}^{*}=\left(M_{ADq}-k_{ff}i_{\omega q}\right)-\Delta v_{VIq}, \tag{8}\]  
\[\frac{dM_{ADd}}{dt}=\omega_{ff}\Big{(}k_{ff}i_{od}-M_{ADd}\Big{)}, \tag{9}\]  
\[\frac{dM_{ADq}}{dt}=\omega_{ff}\Big{(}k_{ff}i_{\omega q}-M_{ADq}\Big{)}, \tag{10}\]  
\[\Delta v_{VId}=k_{VI}i_{cd}-X_{VI}i_{\omega}, \tag{11}\]  
\[\Delta v_{VIq}=k_{VI}i_{cq}+X_{VI}i_{cd}, \tag{12}\]  
\[R_{VI}=K_{VI}\text{max}(0,i_{c}-I_{nom}), \tag{13}\]  
\[X_{VI}=K_{X/R}R_{VI}, \tag{14}\]  
\[i_{c}=\sqrt{i_{cd}^{2}+i_{cq}^{2}}. \tag{15}\]  
The equations for the proportional integral (PI) control loop of the output voltage across the capacitor \(C_{f}\) are given as (16)-(19), where (16) and (17) represent the integrator and (18) and (19) create the current reference for the inner current control loop.  
\[\frac{d\xi_{d}}{dt}=k_{iv}(v_{\omega d}^{*}-v_{\omega d}), \tag{16}\]  
\[\frac{d\xi_{d}}{dt}=k_{iv}\Big{(}v_{\omega q}^{*}-v_{\omega q}\Big{)}, \tag{17}\]  
\[i_{cd}^{*}=k_{ff}i_{od}+k_{pv}(e_{d}^{*}-v_{\omega d})-\omega_{vsm}C_{f}v_{ \omega q}+\xi_{d}, \tag{18}\]  
\[i_{cq}^{*}=k_{ff}i_{\omega q}+k_{pv}\Big{(}e_{q}^{*}-v_{\omega q}\Big{)}+ \omega_{vsm}C_{f}v_{\omega d}+\xi_{q}. \tag{19}\]Finally, the equations for the PI control loop of the converter current through the \(R_{f}\), \(L_{f}\) filter are given as (20)-(23), where (20) and (21) represent the integrator and (22) and (23) create the voltage reference of the DC/AC converter.  
\[\frac{d\sigma_{d}}{dt}=k_{ii}(i_{cd}^{*}-i_{cd}), \tag{20}\]  
\[\frac{d\sigma_{q}}{dt}=k_{ii}\Big{(}i_{cq}^{*}-i_{cq}\Big{)}, \tag{21}\]  
\[v_{cd}^{*}=k_{ffv}v_{od}+k_{pi}(i_{cd}^{*}-i_{cd})-\omega_{vsm}L_{f}i_{cq}+ \sigma_{d}, \tag{22}\]  
\[v_{cq}^{*}=k_{ffv}v_{qq}+k_{pi}\Big{(}i_{cq}^{*}-i_{cq}\Big{)}+\omega_{vsm}L_{ f}i_{cd}+\sigma_{q}. \tag{23}\]