## 2 Mathematical Modeling of DER System
### State Space Modelling of DER System
\[V_{DER}=v_{Lf}+v_{R_{Lf}}+v_{Cf}+v_{R_{Cf}} \tag{11}\]  
Using the study already carried out, the manipulation of the equation begins by substituting (3), and (4), leading expression (12). \[V_{DER}=L_{f}\frac{di_{Lf}}{dt}+R_{Lf}i_{Lf}+v_{Cf}+R_{Cf}i_{Cf} \tag{12}\]  
Replacing (12) in (2), it takes the following expression:  
\[V_{DER}=L_{f}\frac{di_{Lf}}{dt}+R_{Lf}i_{Lf}+v_{Cf}+C_{f}R_{Cf}\frac{dv_{Cf}}{ dt} \tag{13}\]  
From the replacement of Equation (10) in Equation (13) we have the expression in (14). \[V_{DER}=L_{f}\frac{di_{Lf}}{dt}+R_{Lf}i_{Lf}+v_{Cf}+C_{f}R_{Cf}\left[\frac{ \frac{1}{Y_{\text{load}}}i_{Lf}}{C_{f}\left(\frac{1}{Y_{\text{load}}}+R_{Cf} \right)}-\frac{v_{Cf}}{C_{f}\left(\frac{1}{Y_{\text{load}}}+R_{Cf}\right)}- \frac{\frac{1}{Y_{\text{load}}}i_{d}}{C_{f}\left(\frac{1}{Y_{\text{load}}}+R_ {Cf}\right)}\right] \tag{14}\]  
Factoring and manipulating algebraically (14) we obtain (15). \[V_{DER}=L_{f}\frac{di_{Lf}}{dt}+i_{L_{f}}\left[R_{Lf}+\frac{\frac{1}{Y_{\text {load}}}R_{Cf}}{\left(\frac{1}{Y_{\text{load}}}+R_{Cf}\right)}\right]+v_{Cf} \left[1-\frac{R_{Cf}}{\left(\frac{1}{Y_{\text{load}}}+R_{Cf}\right)}\right]- i_{d}\frac{\frac{1}{Y_{\text{load}}}R_{Cf}}{\left(\frac{1}{Y_{\text{load}}}+R_ {Cf}\right)} \tag{15}\]Finally, Equation (16) comes from the state of the inductor current, which is extracted through the algebraic manipulation made in Equation (15). \[i_{Lf}=C_{f}\frac{dv_{Cf}}{dt}+v_{load}\cdot Y_{load}+i_{d} \tag{7}\]0  
Defining the current in the inductor as state and the voltage in the capacitor as another state, we obtain the following representation by the state variables:  
\[ \begin{array}{l}\dot{x}(t)=Ax(t)+Bu(t)+B_{w}w(t)\\ z(t)=Cx(t)\end{array}  \tag{17}\]  
where \(x(t)=\left[ \begin{array}{cc}x_{1}&x_{2}\\ \end{array} \right]^{T}=\left[ \begin{array}{cc}i_{Lf}&v_{Cf}\\ \end{array} \right]^{T}\) is the state vector, \(w(t)=i_{d}\) is the external disturbance signal, \(u(t)=V_{DER}\) is the control signal (PWM output), \(z(t)=v_{Cf}\) is the output of the system, \(C=\left[ \begin{array}{cc}0&1\\ \end{array} \right]\), and it is observed in the model, that the current \(i_{d}\) is not a variable of known characteristic and is modeled as a disturbance external to the model. \[A=\left[ \begin{array}{cc}-\left(\frac{R_{Lf}}{L_{f}}+\frac{\frac{1}{V_{ \text{load}}}R_{Cf}}{L_{f}\left(\frac{1}{V_{\text{load}}}+R_{Cf}\right)}\right)& \frac{-\frac{1}{V_{\text{load}}}}{L_{f}\left(\frac{1}{V_{\text{load}}}+R_{Cf }\right)}\\ \frac{1}{C_{f}\left(\frac{1}{V_{\text{load}}}+R_{Cf}\right)}&\frac{-1}{C_{f} \left(\frac{1}{V_{\text{load}}}+R_{Cf}\right)}\end{array} \right]B=\left[ \begin{array}{c}\frac{1}{Lf}\\ 0\\ \end{array} \right],\ B_{w}=\left[ \begin{array}{c}\frac{\frac{1}{V_{\text{load }}}R_{Cf}}{L_{f}\left(\frac{1}{V_{\text{load}}}+R_{Cf}\right)}\\ \frac{-\frac{1}{V_{\text{load}}}}{C_{f}\left(\frac{1}{V_{\text{load}}}+R_{Cf} \right)}\end{array} \right] \tag{18}\]  
The DER system considered in this paper uses capacitors with low resistance RCF. Thus, in order to simplify the model obtained in (17) and (18), it is considered that \(R_{Cf}=0\). Thus, starting from (18), the following state matrices are obtained for the system defined in (17):  
\[ \begin{array}{l}A\left(Y_{\text{load}}\right)=\left[\begin{array}{cc}- \left(\frac{R_{Lf}}{Lf}\right)&\frac{-1}{Lf}\\ \frac{1}{Cf}&\frac{-V_{\text{load}}}{Cf}\end{array}\right],B=\left[\begin{array} []{c}\frac{1}{Lf}\\ 0\\ \end{array}\right]\\ B_{w}=\left[\begin{array}{c}0\\ \frac{-1}{C_{f}}\end{array}\right],\quad C=\left[\begin{array}{cc}0&1\\ \end{array}\right]\end{array}  \tag{19}\]