## 2 Mathematical Models
### Mathematical Model of Compensation System Output Power  
As shown in Figure 1, a three-phase, three-wire, two-level PWM inverter is constructed to implement the power conversion in the compensation system. Super capacitors and DC-DC converters are used as the DC side power supply of the inverter. Note that this paper assumes that the capacitive voltage on the DC side of the inverter is constant. The state-space equations consist of the output voltage and current of the compensated system, as well as the grid-side bus voltage, are as follows:  
\[\left\{ \begin{array}{l}L_{1}\dfrac{di_{1a}}{dt}=-u_{a}-R_{1}i_{1a}+u_{dc} \Bigg{(}S_{a}-\dfrac{1}{3}\sum\limits_{i=a,b,c}S_{i}\\ L_{1}\dfrac{di_{1b}}{dt}=-u_{b}-R_{1}i_{1b}+u_{dc}\Bigg{(}S_{b}-\dfrac{1}{3} \sum\limits_{i=a,b,c}S_{i}\\ L_{1}\dfrac{di_{1c}}{dt}=-u_{c}-R_{1}i_{1c}+u_{dc}\Bigg{(}S_{c}-\dfrac{1}{3} \sum\limits_{i=a,b,c}S_{i}\end{array} \right) \tag{1}\]  
where abc is subscripts of the ABC coordinate system. \(R_{1}\) and \(L_{1}\) are the resistance and inductance of the \(R_{L}\) filter, respectively. ua, ub, and uc stand for the phase voltage of the grid-side bus. \(i_{1a}\), \(i_{1b}\), and \(i_{1c}\) are line currents of the inverter. \(u_{dc}\) represents the DC bus voltage of the inverter. \(S_{a,b,c}\) is the switching function of the inverter bridge arms. Equation (1) is converted to the \(\alpha\)-\(\beta\) stationary coordinate system as follows:  
\[\left\{\begin{array}{l}L_{1}\dfrac{di_{1a}}{dt}=-u_{a}-R_{1}i_{1a}+u_{1a}\\ L_{1}\dfrac{di_{1b}}{dt}=-u_{\beta}-R  
Conventional power is not only based on the premise that voltage and current are periodically varying quantities but it is also calculated based on the average value of power. Conventional power cannot make a correct description when the voltage and current are distorted. Therefore, this thesis constructs the transient power equation as follows:  
\[\left\{ \begin{array}{l}p_{1}=\overset{\rightarrow}{u}\cdot\overset{\rightarrow }{i}=\frac{3}{2}\big{(}u_{\alpha}i_{1\alpha}+u_{\beta}i_{1\beta}\big{)}\\ \overset{\rightarrow}{q}_{1}=\overset{\rightarrow}{u}\times\overset{ \rightarrow}{i}=\frac{3}{2}\big{(}u_{\beta}i_{1\alpha}-u_{\alpha}i_{1\beta} \big{)}\overset{\rightarrow}{k}\end{array} \right. \tag{4}\]  
where \(u_{\alpha}\) and \(u_{\beta}\) are the phase voltages of the grid-side bus, \(p_{1}\) and \(q_{1}\) stand for active and reactive power of the inverter output, respectively, and the length of q is as follows:  
\[\|q_{1}\|=1.5\big{(}u_{\beta}i_{\alpha}-u_{\alpha}i_{\beta}\big{)}\] (4a) Next, substituting ( 2 ) and ( 3 ) into ( 4 ) and calculating the derivative of real and reactive powers. Finally, the equation obtained as follows [27]: \[\left\{ \begin{array}{l}\frac{dp_{1}}{dt}=\frac{3}{2}\Big{(}i_{1\alpha}\frac{ du_{\alpha}}{dt}+u_{\alpha}\frac{di_{1\alpha}}{dt}+u_{\beta}\frac{di_{1\beta}}{dt}+i_{1 \beta}\frac{du_{\beta}}{dt}\Big{)}=-\frac{R_{1}}{L_{1}}p_{1}-\omega q_{1}- \frac{9}{2L}U_{m}^{2}+\frac{3}{2L_{1}}\big{(}u_{1\alpha}u_{\alpha}+u_{1\beta}u _{\beta}\big{)}\\ \frac{dq_{1}}{dt}=i_{1\alpha}\frac{du_{\beta}}{dt}+u_{\beta}\frac{di_{1\alpha} }{dt}-u_{\alpha}\frac{di_{1\beta}}{dt}-i_{1\beta}\frac{du_{\alpha}}{dt}=\omega p _{1}-\frac{R_{1}}{L_{1}}q_{1}-\frac{3}{2L_{1}}\big{(}u_{1\alpha}u_{\beta}-u_{ 1\beta}u_{\alpha}\big{)}\end{array} \right. \tag{5}\]  
where  
\[\left\{ \begin{array}{l}u_{1\alpha}u_{\alpha}+u_{1\beta}u_{\beta}=u_{1\alpha} \sqrt{\frac{3}{2}}U_{m}\cos\omega t+u_{1\beta}\sqrt{\frac{3}{2}}U_{m}\sin \omega t\triangleq\sqrt{\frac{3}{2}}U_{m}u_{d}\\ u_{1\alpha}u_{\beta}-u_{1\beta}u_{\alpha}=u_{1\alpha}\sqrt{\frac{3}{2}}U_{m} \sin\omega t-u_{1\beta}\sqrt{\frac{3}{2}}U_{m}\cos\omega t\triangleq-\sqrt{ \frac{3}{2}}U_{m}u_{q}\end{array} \right. \tag{6}\]  
Substituting (6) into (4) to obtain the output power equation of the compensation system as follows:  
\[\left\{