# State Residualisation and Kron Reduction for Model Order Reduction of Energy Systems
## 3 Model Order Reduction by Combination of the State Residualisation and Kron Reduction Technique
### State Residualisation Technique
#### 3.1.3 Modal State Residualisation  
The developed state residualisation in [25] is based on finding \(E\), which minimises an error criterion while respecting the state categorisation deduced in the previous subsection. It is a modal state residualisation, as the residualisation preserves some poles of the linearised system.  
The error criterion to minimise is chosen to be \(\parallel y_{i}-y_{ri}\parallel^{2}\), the square of the norm of the difference between the \(i\)th output of the full model and the reduced model, excited by the \(j\)th input with a Dirac function for a chosen norm. This choice is motivated by the objective of tracking the transient of some sensitive variables, such as the output current of some converters, for a specific simulated event, modelled here by input \(j\).  
Since it can be complicated to calculate this error criterion for nonlinear models, both systems are linearised. For the full model, (43) is obtained, and for the reduced model, (46) is obtained.  
\[\begin{cases}E\frac{dx_{r}}{dt}=Ax_{r}+Bu\\ y_{r}=Cx_{r}+D\end{cases},\ x_{r}\in\mathbb{R}^{N_{d}},u\in\mathbb{R}^{p},y\in \mathbb{R}^{q}. \tag{46}\]  
It is also difficult to calculate the error criterion in the time domain. Hence, the error is calculated in the frequency domain. Based on (43)-(46), the transfer functions from the chosen input to output can be obtained as (47) and (48).  
\[Y(\omega)=C\big{(}j\omega I_{N_{d}}-A\big{)}^{-1}BU+DU, \tag{47}\]  
\[Y_{r}(\omega)=C\big{(}j\omega E-A\big{)}^{-1}BU+DU \tag{48}\]  
The difference between the two transfer functions gives (49).  
\[\begin{cases}\begin{array}{c}Y(\omega)-Y_{r}(\omega)=e(\omega)U\\ e(\omega)=C\Big{[}\big{(}j\omega I_{N_{d}}-A\big{)}^{-1}-\big{(}j\omega E-A \big{)}^{-1}\Big{]}B\\ e(\omega)\in\mathbb{C}^{q\times p}\end{array}\end{cases}\end{cases} \tag{49}\]  
The difference in the Fourier domain between the \(i\)th output of the full model and of the reduced model when simulating a Dirac function for input \(j\) is given by \(e_{i,j}(\omega)\), where \(e(\omega)\) represents the element in the \(i\)th row and \(j\)th column. The energy of the error, \(e_{i,j}\), is defined in (50).  
\[e_{i\bar{j}}=\int_{-\infty}^{\infty}\Big{|}e_{i,j}(\omega)\big{|}^{2}d\omega= \int_{-\infty}^{\infty}\Big{|}Y(\omega)-Y_{r}(\omega)\big{|}^{2}d\omega. \tag{50}\]  
By minimising the energy, \(e_{i\bar{j}}\), the optimisation problem can be presented as in (51).  
\[E=arg\begin{cases}\begin{array}{c}\text{min}e_{i\bar{j}}=\int_{-\infty}^{ \infty}\Big{|}Y(\omega)-Y_{r}(\omega)\big{|}^{2}d\omega\approx\sum_{i=1}^{m} \Big{|}Y(\omega_{i})-Y_{r}(\omega_{i})\big{|}^{2}\\ \text{subject to}:\ \ \begin{cases}E\in\mathbb{E}_{e_{part}}\\ tr(E)\leq n\end{cases}.\end{array}\end{cases}\end{cases} \tag{51}\]  
where \(\mathbb{E}_{e_{part}}\) represents that the states in the same group must be residualised (or not) together to discard (or keep), and \(n\) is the desired size of the reduced model. In reference [25], \(n\) is chosen arbitrarily, but here a systematic way is applied for choosing the order, so it is the same as the phasor approximation. The results in Section 4 will demonstrate that the reduced model leads to improved model accuracy.  
A genetic algorithm [32]-based approach is used here to solve the optimisation problem (51), which allows a low computation time compared to bruteforce methods [33] (which involves listing all possible \(E\) matrices, calculating the error \(e_{i\bar{j}}\), and choosing \(E\), which minimises all \(e_{i\bar{j}}\)).  
The modal state residualisation process is summarised in Figure 2(b), where it is seen that the obtained \(E\) is specific to the chosen output-input couple \((i,j)\). In other words, the obtained reduced models can be different for each considered test case: observed variables-output/simulated event-input. It follows that the method is flexible and can be adapted to any considered events and concerned variables (e.g., converter current).