# Nonlinear Optimal Control Law of Autonomous Unmanned Surface Vessels
## 3 Results  
In this section, nonlinear closed-form optimal control law is delivered theoretically. The control objective was to find a nonlinear optimal control law to guide a controlled AUSV that could precisely track a designed trajectory or a set of waypoints with minimal power consumption. After mathematical derivations, one main result based on the nonlinear optimal control concept could be derived as the following. Closed-form nonlinear optimal control law that could optimally and precisely guide a controlled AUSV to track desired trajectories and waypoints was obtained as  
\[\mathbf{\tau}_{\eta 2}=\mathbf{T}_{2}(\mathbf{e},t)+\rho_{2}^{-1}\mathbf{u}_{2}^ {*}, \tag{12}\]  
where \(\mathbf{u}_{2}^{*}(\mathbf{e},t)=-\mathbf{W}_{2}^{-1}\mathbf{S}_{2V}{}^{T}( \mathbf{e},t)\mathbf{P}_{2}(\mathbf{e},t)\mathbf{e}(t)\) can analytically solve the nonlinear optimal tracking problem in Equation (11) if \(\mathbf{P}_{2}(\mathbf{e},t)\) of \(\mathbf{u}_{2}^{*}(\mathbf{e},t)\) satisfies the following nonlinear time-varying differential equation. \[\dot{\mathbf{P}}_{2}(\mathbf{e},t)+\mathbf{P}_{2}(\mathbf{e},t)\mathbf{R}_{2V }(\mathbf{e},t)+\mathbf{R}_{2V}{}^{T}(\mathbf{e},t)\mathbf{P}_{2}(\mathbf{e},t)+\mathbf{Q}_{2}-\mathbf{P}_{2}(\mathbf{e},t)\mathbf{S}_{2V}(\mathbf{e},t) \mathbf{W}_{2}^{-1}\mathbf{S}_{2V}{}^{T}(\mathbf{e},t)\mathbf{P}_{2}(\mathbf{e },t)=0 \tag{13}\]  
with \(\mathbf{P}_{2}(\mathbf{e},t)=\mathbf{P}_{2}{}^{T}(\mathbf{e},t)\geq 0\) and \(\mathbf{Q}_{2f}=\mathbf{P}_{2}(\mathbf{e}(t_{f}),t_{f})\). Proof. : See Appendix A. **Remark 1**. : _Suppose closed-form solution \(\mathbf{P}_{2}(\mathbf{e},t)\) can be found from the above nonlinear time-varying differential Equation (13). Then, nonlinear optimal control law \(\mathbf{\tau}_{\eta 2}\) can be easily built up with a simple form. In general, the highly complex nonlinear time-varying differential equation, as shown in Equation (13), is difficult to use to mathematically find a closed-form solution. Hence, it would be an important contribution if a closed-form \(\mathbf{P}_{2}(\mathbf{e},t)\) was analytically derived._  
Closed-form Solution \(\mathbf{P}_{2}(\mathbf{e},t)\) of Nonlinear Time-Varying Differential Equation (13)  
Without loss of generality, solution \(\mathbf{P}_{2}(\mathbf{e},t)\) is represented as the following structure:  
\[\mathbf{P}_{2}(\mathbf{e},t)=\mathbf{V}_{2}{}^{T}\!\!\left[ \begin{array}{cc} \mathbf{M}_{\eta}(\mathbf{e},t)&0_{3\times 3}\\ 0_{3\times 3}&\mathbf{K}_{2}\end{array} \right]\!\mathbf{V}_{2}, \tag{14}\]  
where \(\mathbf{K}_{2}\) is some positive definite symmetric constant matrix. In the following section, conditions for the existences of matrices \(\mathbf{V}_{2}\) and \(\mathbf{K}_{2}\) for the closed-form solution are detailed. Closed-Form Solution \(\mathbf{P}_{2}(\mathbf{e},t)\) of the Optimal Tracking Problem of AUSVs  
Consider the second and third terms on the left-hand side of nonlinear differential Equation (13). Using the system property in Equations (8) and (14), the following result can be derived:  
\[\mathbf{P}_{2}(\mathbf{e},t)\mathbf{R}_{2V}(\mathbf{e},t)+\mathbf{R}_{2V}{}^ {T}(\mathbf{e},t)\mathbf{P}_{2}(\mathbf{e},t)=\left[ \begin{array}{cc}0_{3 \times 3}&\mathbf{K}_{2}\\ \mathbf{K}_{2}&0_{3\times 3}\end{array} \right]+\mathbf{V}_{2}^{T}\!\!\left[ \begin{array}{cc}-\dot{\mathbf{M}}_{\eta}(\mathbf{e},t)&0_{3\times 3}\\ 0_{3\times 3}&0_{3\times 3}\end{array} \right]\!\mathbf{V}_{2}. \tag{15}\]  
The following result can be derived:  
\[\mathbf{S}_{2V}{}^{T}(\mathbf{e},t)\mathbf{P}_{2}(\mathbf{e},t)=\mathbf{S}^{T} \mathbf{V}_{2}. \tag{16}\]Equation (13) can be simplified by using the results of Equations (15) and (16) in the following equation:  
\[\left[ \begin{array}{cc}0_{3\times 3}&\mathbf{K}_{2}\\ \mathbf{K}_{2}&0_{3\times 3}\end{array} \right]+\mathbf{Q}_{2}-\mathbf{V}_{2}{}^{T} \mathbf{S}\mathbf{W}_{2}^{-1}\mathbf{S}^{T}\mathbf{V}_{2}=0_{6\times 6}.