## 2 Dynamic Modeling
### Attitude Dynamics Modeling Based on Unit Quaternion  
According to the control logic of a coaxial twin-rotor UAV, the coaxial HAUV dynamic system is divided into two subsystems, position and attitude, and the controllers are designed for the two systems, respectively, to form a cascade control system. In this section, the modeling scheme of the attitude loop subsystem B in Equation (25) is abandoned, and quaternion-based modeling analysis is carried out for the coaxial HAUV attitude subsystem. The attitude vector form of the quaternion is defined as \(Q= \begin{bmatrix}q_{0}&q_{v}^{\mathrm{T}}\end{bmatrix} ^{\mathrm{T}}\), \(q_{v}= \begin{bmatrix}q_{1}&q_{2}&q_{3}\end{bmatrix} ^{\mathrm{T}}\). Quaternion satisfies the relation \(q_{0}^{2}+q_{v}^{\mathrm{T}}q_{v}=1\); \(q_{0}\) is the real number part, and \(q_{1}\), \(q_{2}\), \(q_{3}\) represent the imaginary number part. The attitude dynamics equation in quaternion form can be defined as  
\[\left\{ \begin{array}{l}\dot{q}_{0}=-\frac{1}{2}q_{v}^{\mathrm{T}}\omega\\ \dot{q}_{v}=\frac{1}{2}(q_{4}I_{3}+q_{v}^{\times})\omega\end{array} \right. \tag{26}\]  
where \(\omega=v_{2}= \begin{bmatrix}p&q&r\end{bmatrix} ^{\mathrm{T}}\) is the angular velocity of the HAUV in the body-fixed coordinate system, \(I_{3}\in R^{3\times 3}\) is the identity matrix, and \(q_{v}^{\times}\) in the above equation is defined as  
\[q_{v}^{\times}=\left[ \begin{array}{ccc}0&-q_{3}&q_{2}\\ q_{2}&0&-q_{1}\\ -q_{2}&q_{1}&0\end{array} \right] \tag{27}\]  
Since the three attitude angles and quaternions correspond to each other, the tracking and convergence of attitude angles can be realized if the unit quaternions are stably tracked by an appropriate control law. The Euler angle and quaternion unit can be transformedinto each other when describing the attitude motion, and their transformation mapping relationship is shown as follows:  
\[\begin{array}{l}Q=\left[ \begin{array}{c}\cos\frac{\phi}{2}\cos\frac{\theta}{2} \cos\frac{\psi}{2}+\sin\frac{\phi}{2}\sin\frac{\theta}{2}\sin\frac{\psi}{2}\\ \sin\frac{\phi}{2}\cos\frac{\theta}{2}\cos\frac{\theta}{2}-\cos\frac{\theta}{2} \sin\frac{\theta}{2}\sin\frac{\theta}{2}\\ \cos\frac{\theta}{2}\sin\frac{\theta}{2}\cos\frac{\theta}{2}+\sin\frac{\theta}{ 2}\cos\frac{\theta}{2}\sin\frac{\theta}{2}\\ \cos\frac{\theta}{2}\cos\frac{\theta}{2}\sin\frac{\theta}{2}-\sin\frac{\theta}{ 2}\sin\frac{\theta}{2}\cos\frac{\theta}{2}\end{array} \right]\\ \left[ \begin{array}{c}\phi\\ \theta\\ \psi\end{array} \right]=\left[ \begin{array}{c}\mathrm{atan2}\big{(}2\big{(} \mathrm{(}q_{0}q_{1}+q_{2}q_{3}\big{)},1-2\big{(}q_{1}^{2}+q_{2}^{2}\big{)} \big{)}\\ \mathrm{arc}\sin(2\big{(}q_{0}q_{2}-q_{1}q_{3}\big{)}\\ \mathrm{atan2}\big{(}2\big{(}q_{0}q_{3}+q_{1}q_{2}\big{)},1-2\big{(}q_{2}^{2}+ q_{3}^{2}\big{)}\big{)}\end{array} \right] \tag{28}\]  
Considering the external disturbance and the uncertainty of the system parameters, the attitude rigid body dynamics equation of the coaxial HAUV can be expressed as  
\[I_{w}\dot{\omega}=f_{\Theta}+\tau_{v\Theta}+d_{\Theta} \tag{29}\]  
where \(I_{w}\in R^{3\times 3}\) represents the inertia matrix (its properties are given in the added mass matrix), \(\tau_{v\Theta}\in R^{3}\) represents the control moment, \(f_{\Theta}=-\omega^{\times}I_{w}\omega+\tau_{b}+\tau_{d}+M_{wind}+M_{wave}+M_ {c}\) represents the relative torque generated by hydrodynamic forces, and \(d_{\Theta}= \begin{bmatrix}d_{\phi}&d_{\theta}&d_{\psi}\end{bmatrix} ^{\mathrm{ T}}\) represents the lumped uncertainty. **Assumption 2** ([25]): _The lumped uncertainty of the system \(\tau_{d}= \begin{bmatrix}d_{P}^{\mathrm{T}}&d_{\Theta}\end{bmatrix}