## 2 Mathematical Modeling
### Optimal Super-Twisting Sliding Mode Controller Design
#### 2.2.5 Lyapunov Stability Analysis  
Using the Lyapunov stability analysis theory, we analyzed the stability of the proposed system based on the proposed control input. To say the system is asymptotically stable in the sense of Lyapunov theory, the three conditions defined in Section 2.1.4 should be satisfied. The Lyapunov candidate function has been chosen as  
\[V=\frac{1}{2}s^{2}, \tag{27}\]  
then the time derivative of (27) is computed as  
\[\dot{V}=\dot{s}\dot{s}=s\biggl{(}\biggl{(}\lambda-\frac{1}{\tau}\biggr{)}e_{3} -\frac{1}{\tau}u\biggr{)}\leq 0, \tag{28}\]  
from (18) we have \(u\), after substituting the value to (28), we obtain  
\[\dot{V}=s\biggl{(}\biggl{(}\lambda-\frac{1}{\tau}\biggr{)}e_{3}-\frac{1}{\tau }\biggl{(}c|s|^{\frac{1}{2}}\operatorname{sgn}(s)+b\int\operatorname{sgn}(s) dt\biggr{)}\biggr{)}\leq 0, \tag{29}\]  
from (29) as time increases \(e_{3}\) become zero, as a result, (29) could be rewritten as \[\dot{V} =-\frac{c}{\tau}s\,\text{sgn}(s)\sqrt{|s|}-\frac{b}{\tau}\int s\, \text{sgn}(s)dt\leq 0, \tag{30}\] \[\dot{V} =-\frac{c}{\tau}|s|\sqrt{|s|}-\frac{b}{\tau}\int|s|dt\leq 0.\]  
From _(30)_ we see the proposed system _(1)_ based on the proposed control input described as _(18)_ is asymptotically stable according to the Lyapunov stability theory since it holds the conditions given earlier. However, this proof does not guarantee finite-time stability. Thus, to assure the finite time convergence of the proposed algorithm, the finite time convergency has been analyzed based on the strict Lyapunov function conditions for global exponential stability. Let us express the time derivative of the Lyapunov candidate as shown below,  
\[\dot{V}(s)\leq-\gamma V(s), \tag{31}\]  
thus, if _(31)_ is satisfied, then finite time stability of trajectories with respect to origin is ensured. Now let us introduce the quadratic Lyapunov function for the super-twisting algorithm, and from _(19)_ we have the compensated dynamics of the sliding function and the dynamics could be rewritten in a form that is convenient for quadratic Lyapunov analysis by introducing a new state vector which is \(\xi=\left[\sqrt{|s|}\,\text{sgn}(s)\quad d\right]^{T}\). Since the derivative of the new state vector could be computed as,  
\[\dot{\xi}=\frac{1}{|s|^{\frac{1}{2}}}A\xi,\ A= \begin{bmatrix}-\frac{1}{2}c& \frac{1}{2}\\ -b&0\end{bmatrix} , \tag{32}\]  
then, the quadratic Lyapunov candidate function could be chosen as,  
\[V(s)=\xi^{T}P\xi, \tag{33}\]  
which (33) is known as the quadratic form. And the (33), can further reduce to the form of,  
\[V(s)=p_{11}|s|+2p_{12}|\sqrt{s}|\,\text{sgn}(s)+p_{22}\dot{s}^{2}, \tag{34}\]  
where \(P= \begin{bmatrix}p_{11}&p_{12}\\ p_{12}&p_{22}\end{bmatrix} \), \(P\) is a constant, symmetric, and positive definite matrix. Let's prove the Lyapunov theorem now, the derivative of the Lyapunov function is given as,  
\[\dot{V}(s)=\xi^{T}P\xi+\dot{\xi}^{T}P\xi=-|s|^{\frac{1}{2}}\xi^{T}Q\xi, \tag{35}\]  
then the matrix \(P\) and \(Q\) are related by the algebraic Lyapunov equation, which is given as,  
\[A^{T}P+PA=-Q. \tag{36}\]  
**Remark 5**. : _The matrix \(A\) is Hurwitz if and only if \(c,\ b>0\), then for every \(Q=Q^{T}\), there exists a unique solution \(P=P^{T}>0\) of the Lyapunov Equation (36) and this implies that (33) is a strict Lyapunov function, this analysis ensures the asymptotic stability of trajectories w.r.t origin._  
However, for finite-time stability, more analysis is required. Hence, to show the finite time stability analysis, let us consider the well-known Rayleigh inequality which is given as,\[\lambda_{min}\{P\}||\xi||_{2}^{2} \leq V(s)\leq\lambda_{max}\{P\}||\xi||_{2}^{2},\] \[\lambda_{min}\{Q\}||\xi||_{2}^{2} \leq\xi^{T}Q\xi\leq\lambda_{max}\{Q\}||\xi||_{2}^{2}, \tag{37}\] \[\lambda_{min}\{Q\}||\xi||_{2}^{2} \Rightarrow-\xi^{T}Q\xi\leq-\lambda_{min}Q||\xi||_{2}^{2},\]  
where \(\lambda_{min}\), \(\lambda_{max}\) are the smallest and largest eigenvalues of the matrix \(A\) and \(||\xi||_{2}^{2}=|s|+d\) is the Euclidean norm of \(\xi\).