# Control for Ship Course-Keeping Using Optimized Support Vector Machines
## 3 Controller Design and Stability Analysis
### Stability Analysis
\begin{array}{ll}\dot{V}_{2}+||z||^{2}-\mu_{1}^{2}w^{2}&\leqslant-2\lambda_{ 0}V_{2}-\lambda_{3}\lambda_{1}\zeta^{2}+\zeta\eta_{1}-\lambda_{3}\lambda_{2} \zeta^{2}+\zeta\eta_{2}\\ &+\frac{\varepsilon_{2}}{\varepsilon_{1}}|\zeta|tr\{\widetilde{\mathbf{H}}_{1 }^{\mathrm{T}}(\mathbf{H}_{1}-\lambda_{3}\widetilde{\mathbf{H}}_{1})\}+\frac{ \varepsilon_{2}}{\varepsilon_{1}}||\zeta||tr\{\widetilde{\mathbf{H}}_{2}^{ \mathrm{T}}(\mathbf{H}_{2}-\lambda_{3}\widetilde{\mathbf{H}}_{2})\}\end{array}  \tag{37}\]  
Without loss of generality, the Lagrangian factor vectors \(\mathbf{H}_{1}\) and \(\mathbf{H}_{2}\) can be assumed bounded by \(||\mathbf{H}_{1}||_{F}\leqslant H_{1M},||\mathbf{H}_{2}||_{F}\leqslant H_{2M}( H_{1M},H_{2M}>0)\) where \(||\cdot||_{F}\) represents the Frobenius norm with the definition \(||\mathbf{A}||_{F}=\sqrt{\sum\limits_{i=1}^{m}\sum\limits_{j=1}^{n}a_{ij}^{2}}, \forall\mathbf{A}=\left(a_{ij}\right)_{m\times n}\). Thus, the inequality (37) evolves to  
\[ \begin{array}{ll}\dot{V}_{2}+||z||^{2}-\mu_{1}^{2}w^{2}&\leqslant-2\lambda_{0 }V_{2}+||\zeta||(\tau_{1}+\frac{\varepsilon_{2}}{4\lambda_{3}\varepsilon_{1}}( H_{1M}^{2}+H_{2M}^{2})\\ &-\tau_{2}||\zeta||-\frac{3\lambda_{0}\varepsilon_{1}}{\varepsilon_{1}}(|| \widetilde{\mathbf{H}}_{1}||_{F}-\frac{1}{2\lambda_{3}}H_{1M})^{2}-\frac{3 \lambda_{0}\varepsilon_{2}}{\varepsilon_{1}}(||\widetilde{\mathbf{H}}_{2}||_{F}- \frac{1}{2\lambda_{3}}H_{2M})^{2}),(\exists\tau_{1,2}>0)\end{array}  \tag{38}\]  
Given a compact set \(U_{\varsigma}=\big{\{}\varsigma\mid||\varsigma||\leqslant b_{\varsigma},\,b_{ \varsigma}\in\mathbb{R}^{+}\big{\}}\), if the tracking error \(\varsigma(t)\) falls within the compact set at any time, the above inequality can be reduced to  
\[\dot{V}_{2}+||z||^{2}-\mu_{1}^{2}w^{2}\leqslant-2\lambda_{0}V_{2}+b_{\varsigma}( \tau_{1}+\frac{\varepsilon_{2}}{4\lambda_{3}\varepsilon_{1}}(H_{1M}^{2}+H_{2M}^{2})) \tag{39}\]Let \(\varepsilon=b_{\varsigma}(\tau_{1}+\frac{\varepsilon_{2}}{\Delta\lambda_{3} \varepsilon_{1}}(W_{1M}^{2}+W_{2M}^{2}))\), in the case when the disturbance \(w=0\), the above inequality can be simplified to  
\[\dot{V}_{2}\leq-2\lambda_{0}V_{2}+\varepsilon \tag{40}\]  
The uniformly ultimately bounded (UUB) stability can be proven [40]. Back to (39), in the case when disturbance exists, i.e., \(w\
eq 0\), one has  
\[\dot{V}_{2}+||z||^{2}-\mu_{1}^{2}w^{2}\leq\varepsilon \tag{41}\]  
Integrating the above inequality yields  
\[\int_{0}^{t}||z||^{2}d\tau\leq\mu_{1}^{2}\int_{0}^{t}w^{2}d\tau+\varepsilon_{0} \tag{42}\]  
where \(\varepsilon_{0}\) is a small positive constant. Compared with the L2-gain performance index given by (21) it can be said that the disturbance \(w\) is suppressed. In other words, the robustness is guaranteed. If the tracking error \(\varsigma(t)\) falls outside the compact set, i.e., \(||\varsigma||>b_{\varsigma}\), the following inequality can be obtained  
\[\dot{V}_{2}+||z||^{2}-\mu_{1}^{2}w^{2}\leq-2\lambda_{0}V_{2} \tag{43}\]  
by appropriately selecting parameters so that  
\[b_{\varsigma}\geq(\tau_{1}+\frac{\varepsilon_{2}}{4\lambda_{3}\varepsilon_{1 }}(H_{1M}^{2}+H_{2M}^{2}))/\tau_{2} \tag{44}\]  
holds. By analogy to the analysis of (39), in cases either \(w=0\) or \(w\
eq 0\), the stability and robustness of (43) can be guaranteed. From the above analysis, it can be concluded that the controller designed by (31) and the SVM algorithms given by (33) can guarantee the stability and robustness of the tracking system. It is noted that although only UUB stability can be guaranteed, the control accuracy can be improved by appropriate selection of the parameters in controller, including the control gains and the parameters in SVM. In the study, PSO is incorporated into SVM to obtain optimal SVM parameters.