## 2 Modeling of AUV
### Dynamic Model Development  
Expanding upon the preceding kinematic modeling, the dynamic modeling of the AUV emerges as paramount for comprehensively capturing its motion characteristics. This includes the intricate interplay of external forces and allows for the formulation of effective control strategies. By considering the interplay between external generalized forces and AUV motion, the dynamic equations of the AUV can be derived using the Newton-Euler method, as demonstrated by [PERSON] ([PERSON], 2011 [33]):  
\[\mathbf{M}\dot{\mathbf{v}}+\mathbf{C}(\mathbf{v})\mathbf{v}+\mathbf{D}(\mathbf{v})\mathbf{v}+\mathbf{g}(\mathbf{\eta}) =\mathbf{\tau} \tag{7}\]  
In Equation (7), matrix \(\mathbf{M}\) represents a positive definite matrix comprising the inertial properties resulting from the rigid body and additional mass. Matrix \(\mathbf{C}(\mathbf{v})\) accounts for the Coriolis and centripetal matrix. \(\mathbf{g}(\mathbf{\eta})\) represents the vector of the restoring force, arising from both gravity and buoyancy. \(\mathbf{D}(\mathbf{v})\) represents the hydrodynamic damping matrix, encompassing the linear and quadratic drag effects. \(\mathbf{\tau}\) denotes the generalized external thrust forces and moments. In the pursuit of three-dimensional trajectory tracking, the AUV is assumed to be of the fully driven type to facilitate subsequent simulations. However, when executing the obstacle avoidance task in the horizontal plane, the underactuated model is chosen. To accomplish this, the AUV's six-degree-of-freedom model, as derived from the RUMUS mathematical model ([PERSON] et al., 2001 [34]), will be utilized in the following simulation experiments. By decoupling the model, the primary focus is on obtaining the horizontal plane model. To streamline computations in subsequent analyses, a transformation is applied to represent the horizontal plane in a more succinct format:  
\[(m-X_{\dot{u}})\dot{u} =X_{u|u}|u|+(X_{\
u\tau}+m)\
u r+X_{rr}r^{2}+T_{prop} \tag{8}\] \[=f_{11}u+f_{12}v+f_{13}r+T_{prop}\]  
\[(m-Y_{\dot{v}})\ddot{v}-Y_{\dot{r}}\dot{r} =Y_{v|v}|v|+Y_{r|r}|r|+(Y_{\
u\tau}-m)\
u r+Y_{uv}uv+Y_{\dot{g}} \mu^{2}\delta \tag{9}\] \[=f_{21}u+f_{22}v+f_{23}r+Y_{\dot{g}}u^{2}\delta\]\[(I_{zz}-N_{i})\dot{r}-N_{i}\dot{v} =N_{v|v|}v|v|+N_{r|r|}r|r|+N_{ur}ur+N_{uv}uv+N_{\delta}u^{2}\delta \tag{10}\] \[=f_{31}u+f_{32}v+f_{33}r+N_{\delta}u^{2}\delta\]  
where \(T_{prop}\) represents the thrust along the \(x_{0}\)-axis, and \(\delta\) represents the rudder angle. \(X_{(\cdot)}\), \(Y_{(\cdot)}\), and \(N_{(\cdot)}\) in the above formulas are the hydrodynamic coefficients of AUV. By consolidating these three equations into a compact matrix form, as follows:  
\[M\dot{\mathbf{v}}_{h}=\mathbf{f}\dot{\mathbf{v}}_{h}+\mathbf{L}\mathbf{u} \tag{11}\]  
With  
\[M^{3\times 3}= \begin{bmatrix}(m-X_{i})&0&0\\ 0&(m-Y_{\dot{v}})&-Y_{\dot{r}}\\ 0&-N_{v}&(I_{zz}-N_{\dot{r}})\end{bmatrix}  \tag{12}\]  
\[\mathbf{v}_{h}^{3\times 1}=[u,v,r]^{\mathrm{T}} \tag{13}\]  
\[\mathbf{\hat{f}}^{\times 3}= \begin{bmatrix}f_{11}&f_{12}&f_{13}\\ f_{21}&f_{22}&f_{23}\\ f_{31}&f_{32}&f_{33}\end{bmatrix}  \tag{14}\]  
\[\mathbf{L}^{3\times 2}= \begin{bmatrix}1&0\\ 0&Y_{\dot{\delta}}u^{2}\\ 0&N_{\dot{\delta}}u^{2}\end{bmatrix}  \tag{15}\]  
\[\mathbf{u}^{2\times 1}= \begin{bmatrix}T_{prop},\delta\end{bmatrix} ^{\mathrm{T}} \tag{16}\]  
And the kinematics equation of the horizontal plane model can be expressed as follows:  
\[\dot{\mathbf{\eta}}_{h}=\mathbf{R}(\psi)\dot{\mathbf{v}}_{h} \tag{17}\]  
where  
\[\mathbf{R}^{3\times 3}(\psi)= \begin{bmatrix}\cos\psi&-\sin\psi&0\\ \sin\psi&\cos\psi&0\\ 0&0&1\end{bmatrix}  \tag{18}\]  
\[\mathbf{\eta}_{h}^{3\times 1}=[x,y,\psi]^{\mathrm{T}} \tag{19}\]  
In summary, the 'Modeling of AUV' section presents a comprehensive foundation for understanding and controlling AUVs in underwater environments. The establishment of coordinate systems, the formulation of kinematic models, and the development of dynamic models collectively constitute the backbone of our pursuit of precise AUV control.