# Robust Controller Decorated by Nonlinear S Function and Its Application to Water Tank
## 3 Controller Design  
In this study, the Lyapunov stability theory was applied to launch the stability analysis of the water tank feedback controller, which is designed based on the closed-loop-gain algorithm. First, the state variable of the control system is interpreted as \(\mathbf{X}=\left[ \begin{array}{cc}x_{1}&x_{2}\end{array} \right]^{\mathsf{T}}\),  
\[\left\{ \begin{array}{l}x_{1}=e\\ x_{2}=\dot{x}_{1}=-\dot{H}\end{array} \right. \tag{11}\]  
Based on Formula (11), the inlet ratio of the water tank control system can be expressed as (12). At the same time, the parameters' values are \(a_{1}=1,\ a_{0}=0,\ a_{2}=2,\ b=0.8\). Combine with (2). \[Q_{i}=Ke=\frac{1}{K_{0}T_{1}}e+\frac{T_{0}}{K_{0}T_{1}}\dot{e} \tag{12}\]  
By combining Formulas (8) and (12), we obtain:  
\[T_{0}\ddot{H}+\dot{H}=K_{0}\bigg{(}\frac{1}{K_{0}T_{1}}e+\frac{T_{0}}{K_{0}T_{ 1}}\dot{e}\bigg{)}+w \tag{13}\]  
Then, by rearranging Formulas (11) and (13), the state equation of the controlled system can be written as  
\[\dot{\mathbf{X}}=\mathbf{A}\mathbf{X}+\mathbf{b}w \tag{14}\]  
For Formula (14), the Lyapunov function of the system is interpreted as  
\[V(x)=\mathbf{X}^{\mathsf{T}}\mathbf{P}\mathbf{X} \tag{15}\]  
where \(\mathbf{P}\) represents a positive definite real symmetric matrix, and \(\mathbf{P}=\mathbf{P}^{\mathsf{T}}\). Ignoring the external disturbance term \(w\), then  
\[\dot{V}(x)=\mathbf{X}^{\mathsf{T}}\mathbf{P}\mathbf{A}\mathbf{X}+(\mathbf{A} \mathbf{X})^{\mathsf{T}}\mathbf{P}\mathbf{X}=\mathbf{X}^{\mathsf{T}}(\mathbf{ P}\mathbf{A}+\mathbf{A}^{\mathsf{T}}\mathbf{P})\mathbf{X} \tag{16}\]  
According to the Lyapunov stability theory, the following function is needed to ensure the stability of the system at origin, for any interpreted positive definite real symmetric matrix. \[\mathbf{A}^{\mathsf{T}}\mathbf{P}+\mathbf{P}\mathbf{A}=-\mathbf{Q} \tag{17}\]  
Define positive definite real symmetric matrix, and make positive definite real symmetric matrix \(\mathbf{P}\) as  
\[\mathbf{P}=\left[ \begin{array}{cc}P_{11}&P_{12}\\ P_{12}&P_{22}\end{array} \right] \tag{18}\]  
Figure 4: Standard feedback control system. Putting Formulas (14) and (18) into Formula (17), to obtain  
\[\left[ \begin{array}{cc}0&-\frac{1}{T_{0}T_{1}}\\ 1&-\frac{T_{1}+T_{0}}{T_{0}T_{1}}\end{array} \right]\left[ \begin{array}{cc}P_{1 1}&P_{12}\\ P_{12}&P_{22}\end{array} \right]+\left[ \begin{array}{cc}P_{11}&P_{12}\\ P_{12}&P_{22}\end{array} \right]\left[ \begin{array}{cc}0&1\\ -\frac{1}{T_{0}T_{1}}&-\frac{T_{1}+T_{0}}{T_{0}T_{1}}\end{array} \right]=- \left[ \begin{array}{cc}1&0\\ 0&1\end{array} \right] \tag{19}\]  
To expand Formula (19) and obtain the solutions as  
\[\left\{ \begin{array}{c}P_{11}=\frac{\left(T_{1}+T_{0}\right)^{2}+\left(1+T_ {0}T_{1}\right)}{2\left(T_{0}+T_{1}\right)}\\ P_{12}=\frac{T_{0}T_{1}}{2}\\ P_{22}=\frac{T_{0}T_{1}\left(1+T_{0}T_{1}\right)}{2\left(T_{0}+T_{1}\right)} \end{array} \right. \tag{20}\]  
The following functions have to be met for maintaining the positive definiteness of matrix **P**  
\[\left\{ \begin{array}{c}P_{11}>0\\ P_{11}P_{22}-P_{12}{}^{2}>0\end{array} \right. \tag{21}\]  
By solving Function (21), we obtain  
\[\left\{ \begin{array}{c}T_{1}>\frac{-3T_{0}+\sqrt{5T_{0}{}^{2}-4}}{2}\\ T_{0}T_{1}>0\end{array} \right. \tag{22}\]  
Thus, in the case of \(T_{0}>\sqrt{0.8}=0.9\), if \(T_{1}>0\) is ensured, then the controller will keep the balanced state at the origin. For the purpose of verifying the robustness of the controller proposed by this study against external distraction, the external distraction term \(w\) is considered in Formula (9), and then the formula of Lyapunov function as shown in Formula (10), is [14]  
\[\dot{V}(x)=-{x_{1}}^{2}-{x_{2}}^{2}-T_{1}wx_{1}-kwx_{2} \tag{23}\]  
where \(k=T_{1}(1+T_{0}T_{1})/\left(T_{1}+T_{0}\right)\). According to [PERSON]'s inequality, we can obtain  
\[\left\{ \begin{array}{c}-wTx_{1}\leq{T_{1}}^{2}{x_{1}}^{2}+\frac{w^{2}}{4}\\ -kwx_{2}\leq k^{2}{x_{2}}^{2}+\frac{w^{2}}{4}\end{array} \right.