## 3 Vehicle Model
### Dynamic Model of AUV  
Assuming that the origin of the body-fixed coordinate system coincides with the center of gravity of AUV, the rigid body dynamics theory is analyzed. The six degrees of freedom of AUV are described as Equation (1) [33]:  
\[\left\{ \begin{array}{l}m[(\dot{u}-vr+wq)-x_{G}(q^{2}+r^{2})+y_{G}(pq-\dot{r}) +z_{G}(pr+\dot{q})]=X,\\ m[(\dot{v}-wp+ur)-y_{G}(r^{2}+p^{2})+z_{G}(qr-\dot{p})+x_{G}(qp+\dot{r})]=Y,\\ m[(\dot{w}-uq+vp)-z_{G}(p^{2}+q^{2})+x_{G}(rp-\dot{q})+y_{G}(rq+\dot{p})]=Z, \\ I_{x}\dot{p}+(I_{z}-I_{y})qr+m[y_{G}(\dot{w}+pv-qu)-z_{G}(\dot{v}+ru-pv)]=K,\\ I_{y}\dot{q}+(I_{x}-I_{z})rp+m[z_{G}(\dot{u}+wq-vr)-x_{G}(\dot{w}+pv-uq)]=M,\\ I_{z}\dot{r}+(I_{y}-I_{z})pq+m[x_{G}(\dot{v}+ur-pw)-y_{G}(\dot{u}+qw-vr)]=N, \end{array} \right. \tag{1}\]  
where:  
\(m\) = Mass of AUV;  
\(\mathrm{I}_{x}\),\(\mathrm{I}_{y}\),\(\mathrm{I}_{z}\) = Rotational inertia of AUV mass;  
\(\mathrm{\dot{u}}\),\(\mathrm{\ddot{v}}\),\(\mathrm{\ddot{w}}\),\(\mathrm{\ddot{p}}\),\(\mathrm{\dot{\rho}}\),\(\mathrm{\dot{\rho}}\) = Acceleration and angular acceleration. The equations can be written in matrix form as Equation (2), if moving the inertial hydrodynamic forces to the left side of Equation (1), and the rest to the right side. \(F_{vis}\) is the hydrodynamic force (or the resistance force) generated by the vehicle movement in the fluid. \(F_{else}\) is the external force, such as the rudder force, propulsion force, gravity and buoyancy, etc. \[E\dot{V}=F_{vis}+F_{else}, \tag{2}\]  
where  
\[E=\left[ \begin{array}{cccc}m-X_{ii}&0&0&0&mz_{G}&0\\ 0&m-Y_{\dot{v}}&0&-mz_{G}-Y_{\dot{p}}&0&mx_{G}-Y_{\dot{r}}\\ 0&0&m-Z_{\dot{w}}&0&-mx_{G}-Z_{\dot{q}}&0\\ 0&-mz_{G}-K_{\dot{v}}&0&I_{x}-K_{\dot{p}}&0&-K_{\dot{r}}\\ mz_{G}&0&-mx_{G}-M_{\dot{w}}&0&I_{y}-M_{\dot{q}}&0\\ 0&mx_{G}-N_{\dot{v}}&0&-N_{\dot{p}}&0&I_{z}-N_{\dot{r}}\end{array} \right], \tag{3}\]  
\[F_{vis}=[X_{vis},Y_{vis},Z_{vis},K_{vis},M_{vis},N_{vis}]^{\mathrm{T}}, \tag{4}\]  
where  
\(X_{\dot{u}}\), \(Y_{\dot{v}}\), \(Y_{\dot{p}}\), \(Y_{r}\), \(Y_{\dot{p}}\), \(K_{\dot{p}}\), \(K_{\dot{p}}\), \(K_{\dot{p}}\), \(M_{\dot{q}}\), \(K_{\dot{r}}\), \(N_{\dot{r}}\) - hydrodynamic coefficients;  
\begin{table} \begin\(X=[u,v,w,p,q,r]^{\mathrm{T}}\). AUV operates in three dimensions. However, it is quite common to assume that altitude/depth is controlled independently such that the path-following objective is limited to motion control in the horizontal plane [21]. Hence, the horizontal equation of motion is generalized in Equation (5):  
\[\left\{ \begin{array}{l}m[(\dot{u}-vr)-x_{G}r^{2}-y_{G}\dot{r}]=X,\\ m[(\dot{v}+ur)-y_{G}r^{2}+x_{G}\dot{r}]=Y,\\ I_{z}\dot{r}+m[x_{G}(\dot{v}+ur)-y_{G}(\dot{u}-vr)]=N.\end{array} \right. \tag{5}\]  
In the consideration of unknown disturbances, the dynamics of AUV will be affected by the ambient environment, such as ocean current, temperature, salinity and density of sea water, etc. However, in the area of 0-100 m below sea level, the seawater is approximately a homogeneous mixing layer [34]. The influence of temperature, salinity and density of sea water on the heading of AUV can be neglected, while only the ocean current should be taken into consideration. Suppose that ocean currents are parallel to the horizontal plane of the earth-fixed coordinate system [31], \(U_{c}\) is the current velocity of irrotational fluid, and \(\delta\) is the angle of current. The velocity vector of AUV is notified in Equation (6). After time derivation, the corresponding acceleration can be written in Equation (7):  
\[\left\{ \begin{array}{l}u_{r}=u-U_{c}\cos\theta\cos(\delta-\psi),\\ v_{r}=v-U_{c}\sin\theta,\\ w_{r}=w-U_{c}\sin\theta\cos(\delta-\psi),\end{array} \right. \tag{6}\]  
\[\left\{ \begin{array}{l}\dot{u}_{r}=\dot{u}-U_{c}q\sin\theta\cos(\delta-\psi )-U_{c}r\cos\theta\sin(\delta-\psi),\\ \dot{v}_{r}=\dot{v}-U_{c}\sin(\delta-\psi),\\ \dot{w}_{r}=\dot{w}-U_{c}q\cos\theta\cos(\delta-\psi)-U_{c}r\sin\theta\sin( \delta-\psi).\end{array} \right.