## 2 Hybrid Active Power Filter Concept
\begin{array}{c}\frac{d}{dt}V=S\Big{\{}\!-m_{1}S-m_{2}sign(S)+(\gamma k_{1} A_{L}+\gamma k_{2}+\gamma k_{1})(\Delta H+\Delta h)+k_{1}\frac{d}{dt}(\Delta H +\Delta h)\\ -(\gamma k_{1}+k_{2})\frac{d}{dt}X_{d}-\frac{d^{2}}{dt^{2}}X_{d}\Big{\}}=-m_{ 1}S^{2}+m_{2}|S|+T.S.\end{array}  \tag{20}\]  
To ensure that the equation investigated in Equation (20) is negative, we should have:  
\[m_{1}>0 \tag{21}\]  
\[ \begin{array}{c}m_{2}>(\gamma k_{1}A_{L}+\gamma k_{2}+\gamma k_{1})(\Delta H +\Delta h)+k_{1}\frac{d}{dt}(\Delta H+\Delta h)-(\gamma k_{1}+k_{2})\frac{d}{ dt}X_{d}\\ -\frac{d^{2}}{dt^{2}}X_{d}-m_{1}S=T.sign(S)-m_{1}|S|.\end{array}  \tag{22}\]  
Finally, using integral operator applied to Equation (19) will obtain the control rule as below:  
\[ \begin{array}{c}u=-(k_{1}B_{L})^{-1}\ \int_{0}^{t}\!\Big{(}\!\Big{(}k_{1}A_{L}^{2} +k_{2}A_{L}+\gamma k_{1}A_{L}+\gamma k_{2}\Big{)}E+(k_{1}A_{L}B_{L}+k_{2}B_{L} +\\ \gamma k_{1}B_{L})u+\Big{(}k_{1}A_{L}^{2}+k_{2}A_{L}+\gamma k_{1}A_{L}\Big{)} X_{d}+m_{1}S+m_{2}sign(S)\Big{)}\ dt^{\prime}\end{array}  \tag{23}\]  
Since in some systems, there are no available approaches to obtain the upper limitation, the adaptive method is very useful in these conditions whether it is known or not. Therefore, the adaptive rule is hired to obtain the \(m_{2}\) coefficient according to Equation (23). Thus, Equation (23) will be updated as shown in Equation (24). \[ \begin{array}{c}u=-(k_{1}B_{L})^{-1}\ \int\limits_{0}^{t}\!\Big{\{}\Big{(}k_{1}A_{L}^{2 }+k_{2}A_{L}+\gamma k_{1}A_{L}+\gamma k_{2}\Big{)}E+(k_{1}A_{L}B_{L}+k_{2}B_{L }+\gamma k_{1}B_{L})u\\ +\Big{(}k_{1}A_{L}^{2}+k_{2}A_{L}+\gamma k_{1}A_{L}\Big{)}X_{d}+m_{1}S+m_{2} sign(S)\Big{\}}\ dt^{\prime}\end{array}  \tag{24}\]  
where \(\hat{m_{2}}\) represents the uncertainties upper limitation. To adopt it with an adaptive rule, we should have:  
\[ \begin{array}{c}\widetilde{m_{2}}=\hat{m_{2}}-m_{2}\end{array}  \tag{25}\]where \(m_{2}\) is the real gain and \(\hat{m_{2}}\) represents the error estimation. According to [31], it can be mathematically stated with Equation (26). \[\hat{m_{2}}=\frac{1}{\alpha}|S| \tag{26}\]  
where \(\alpha\) is a positive constant and \(m_{2}(0)\) represents the initial condition. Since the sliding surface (S) at an infinite time of \(\vartheta\) must reach zero, the adaptive estimation of error of \(\hat{m_{2}}\) is limited. Therefore, to analyze the stability of the adaptive rule, a new Lyapunov function is defined as shown in Equation (27). \[V=\frac{1}{2}S^{2}+\frac{1}{2}\alpha\,\overline{m_{2}}^{2} \tag{27}\]  
Using the first-order derivative for Equation (27) results in:  
\[\frac{d}{dt}V=S\times\frac{d}{dt}S+\alpha\,\hat{m_{2}}\,\hat{m_{2}}<S(T-m_{1}S- \hat{m_{2}}\,sign(S))+\alpha(\hat{m_{2}}-m_{2})+\hat{m_{2}}\,<T.S-m_{1}S^{2}-m _{2}|S|<0. \tag{28}\]  
The un-equality written in Equation (28) is valid for \(m_{2}>T.sign(S)-m_{1}|S|\) and then, since at an infinite time, the \(\vartheta\) may not be completely zero, then the adaptive parameter \(\hat{m_{2}}\) can increase as time goes on. Therefore, to solve this problem is to define the \(\hat{m_{2}}\) in the dead area as shown in Equation (29). \[\hat{m_{2}}=\left\{ \begin{array}{ll}\frac{1}{\alpha}|S|&|S|>\varepsilon\\ 0&|S|<\varepsilon\end{array} \right. \tag{29}\]  
where \(\varepsilon\) is a real positive constant coefficient. By the way, the adaptive gain \(\alpha\) is designed lower than the undefined system limitation to achieve the best results. Thus, the injected current of the APF and the load voltage are ready to achieved as follows using Fourier transform in Equation (30). \[ \begin{array}{ll}I(t)=\frac{A_{00}}{2}+\sum\limits_{n=1}^{\infty}\left[A_{0 n}\cos(n\omega_{0}t)+B_{0n}\sin(n\omega_{0}t)\right]\\ \hskip 28.452756 pt+\sum\limits_{m=1}^{\infty}\left[A_{m0}\cos(m\omega_{c}t)+B _{m0}\sin(m\omega_{c}t)\right]\\ \hskip 28.452756 pt+\sum\limits_{m=1}^{\infty}\ \sum\limits_{n=-\infty,n \
eq 0}^{\infty}\left[A_{mm}\cos(n\omega_{0}t+m\omega_{c}t)+B_{mm}\sin(n \omega_{0}t+m\omega_{c}t)\right]\end{array}