# Nonlinear Optimal Control Law of Autonomous Unmanned Surface Vessels
## 2 Mathematical Model and Design Objective
### Problem Formulation  
In this investigation, the convergence property of tracking errors between the controlled AUSVs and continuous trajectories or waypoints was proven. \(\mathbf{n}_{d}\) are the desired trajectories or waypoints that were assumed to be twice continuously differentiable functions \(\mathbf{n}_{d}\in C^{2}\). On the basis of this definition, the desired velocity and acceleration vectors with respect to \(\mathbf{n}_{d}\) are expressed as \(\dot{\mathbf{n}}_{d}\) and \(\ddot{\mathbf{n}}_{d}\), respectively.  
Define the tracking-error vector between the controlled AUSVs and continuous trajectories or waypoints as follows:  
\[\mathbf{e}=\left[\begin{array}{c}\dot{\overline{\mathbf{n}}}\\ \overline{\mathbf{n}}\end{array}\right]=\left[\begin{array}{c}\dot{\mathbf{n }}-\dot{\mathbf{n}}_{d}\\ \eta-\mathbf{n}_{d}\end{array}\right]. \tag{4}\]  
From Equation (3) and the tracking error described in Equation (4), tracking-error dynamics can be expressed systematically as:  
\[\dot{\mathbf{e}}=\left[\begin{array}{cc}-\mathbf{M}_{\eta}{}^{-1}(\mathbf{n })\mathbf{N}_{\eta}(\beta,\mathbf{n})&0_{3\times 3}\\ \mathbf{I}_{3\times 3}&0_{3\times 3}\end{array}\right]\mathbf{e}+\left[ \begin{array}{cc}-\ddot{\mathbf{n}}_{d}-\mathbf{M}_{\eta}{}^{-1}(\mathbf{n })\mathbf{N}_{\eta}(\beta,\mathbf{n})\dot{\mathbf{n}}_{d}\\ 0_{3\times 1}\end{array}\right]+\left[\begin{array}{cc}\mathbf{M}_{\eta}{} ^{-1}(\mathbf{n})\mathbf{\tau}_{\eta 2}\\ 0_{3\times 1}\end{array}\right]. \tag{5}\]  
The tracking-error dynamics in Equation (5) is generally difficult to analyze because of their complex structure. Therefore, proportional derivative filtered link \(\delta_{2}(t)\) and state-space transformation matrix \(\mathbf{V}_{2}\), featured below, were adopted to transform the tracking-error dynamics in Equation (5) into a more analyzable form.  
\[\delta_{2}(t)=\rho_{2}\dot{\overline{\mathbf{n}}}+\mathbf{\Gamma}_{2}\overline {\mathbf{n}} \tag{6}\]  
\[\mathbf{V}_{2}=\left[\begin{array}{c}\mathbf{V}_{21}\\ \mathbf{V}_{22}\end{array}\right]=\left[\begin{array}{cc}\mathbf{V}_{211}& \mathbf{V}_{212}\\ 0_{3\times 3}&\mathbf{I}_{3\times 3}\end{array}\right]=\left[\begin{array}{cc} \rho_{2}\mathbf{I}_{3\times 3}&\mathbf{\Gamma}_{2}\\ 0_{3\times 3}&\mathbf{I}_{3\times 3}\end{array}\right], \tag{7}\]  
where \(\rho_{2}\) and \(\mathbf{\Gamma}_{2}\in R^{3\times 3}\) are a designable positive scale and a positive definite matrix that can be chosen mathematically. By this arrangement, Equation (5) can be formulated as:  
\[\dot{\mathbf{e}}=\mathbf{V}_{2}{}^{-1}\!\!\left[\begin{array}{c}\dot{\delta }_{2}(t)\\ \dot{\overline{\mathbf{n}}}(t)\end{array}\right]=\mathbf{R}_{2V}(\mathbf{e},t) \mathbf{e}+\mathbf{S}_{2V}(\mathbf{e},t)\Big{[}\rho_{2}(-\mathbf{T}_{2}( \mathbf{e},t)+\mathbf{\tau}_{\eta 2})\Big{]}, \tag{8}\]  
where \(\mathbf{R}_{2V}(\mathbf{e},t)=\mathbf{V}_{2}{}^{-1}\!\!\left[\begin{array}{ cc}-\mathbf{M}_{\eta}{}^{-1}(\mathbf{n})\mathbf{N}_{\eta}(\beta,\mathbf{n})&0_{3 \times 3}\\ \rho_{2}^{-1}\mathbf{I}_{3\times 3}&-\rho_{2}{}^{-1}\mathbf{\Gamma}_{2} \end{array}\right]\mathbf{V}_{2}\), \(\mathbf{S}_{2V}(\mathbf{e},t)=\mathbf{V}_{2}{}^{-1}\mathbf{S}\mathbf{M}_{\eta} {}^{-1}(\mathbf{n})\), \(\mathbf{T}_{2}(\mathbf{e},t)=\mathbf{M}_{\eta}(\mathbf{n})(\ddot{\mathbf{n}}_{d}- \rho_{2}^{-1}\mathbf{\Gamma}_{2}\dot{\overline{\mathbf{n}}})+\mathbf{N}_{\eta }(\beta,\mathbf{n})(\dot{\mathbf{n}}_{d}-\rho_{2}^{-1}\mathbf{\Gamma}_{2} \overline{\mathbf{n}})\) with \(\mathbf{S}=\left[\begin{array}{c}\mathbf{I}_{3\times 3}\\ 0_{3\times 3}\end{array}\right]\).  
Choosing closed-form nonlinear optimal control law for the tracking problem of AUSVs was as follows:  
\[\mathbf{\tau}_{\eta 2}=\mathbf{T}_{2}(\mathbf{e},t)+\rho_{2}^{-1}\mathbf{u}_{2}. \tag{9}\]  
Substituting the nonlinear optimal control law in Equation (9) into Equation (8), modified nonlinear tracking-error dynamics is presented as:  
\[\dot{\mathbf{e}}=\mathbf{R}_{2V}(\mathbf{e},t)\mathbf{e}+\mathbf{S}_{2V}( \mathbf{e},t)\mathbf{u}_{2}. \tag{10}\]