## 2 Modeling of AUV
### Kinematic Model Formulation  
Building upon the previously established coordinate systems, the development of a kinematic model is crucial to comprehensively understand the motion characteristics of the AUV. According to the coordinate systems relationship outlined in Section 2.1, the [B] system can also be derived by sequentially rotating the \(z_{n}\), \(y_{n}\), and \(x_{n}\) axes of the [NED] system in turn. By calculating the three corresponding rotation angles, which represent the yaw \(\psi\), pitch \(\theta\), and roll \(\phi\), respectively, the transformation relationship between the [B] system and the [NED] system can be established.  
For the sake of simplicity and to facilitate the development of the model in the subsequent sections, let \(\mathbf{\eta}_{1}=[x,y,z]^{\mathrm{T}}\) represent the position vector of the AUV in the [G] system, and \(\mathbf{\eta}_{2}=[\phi,\theta,\psi]^{\mathrm{T}}\) represent the orientation vector of the AUV in the [G] system. Here, \(x\), \(y\), and \(z\) represent the three Cartesian coordinates, while \(\phi\), \(\theta\), and \(\psi\) represent the three components of the AUV's attitude, respectively. Furthermore, let \(\mathbf{v}_{1}=[u,v,w]^{\mathrm{T}}\) and \(\mathbf{v}_{2}=[p,q,r]^{\mathrm{T}}\) describe the linear velocity vector and angular velocity vector of the AUV in the [B] system. Specifically, \(u\), \(v\), and \(w\) correspond to the translational velocity components along the \(x_{b}\),\(y_{b}\), and \(z_{b}\) axis, while \(p\), \(q\), and \(r\) represent the three rotational velocity components, respectively. Using these notations, the AUV kinematic equations can be expressed as follows:  
\[\dot{\mathbf{\eta}}=\mathbf{J}(\mathbf{\eta}_{2})\mathbf{v} \tag{1}\]  
\[\mathbf{J}(\mathbf{\eta}_{2})=\begin{bmatrix}\mathbf{R}^{3\times 3}&\mathbf{O}\\ \mathbf{O}&\mathbf{T}^{3\times 3}\end{bmatrix} \tag{2}\]  
where \(\mathbf{\eta}\) and \(\mathbf{v}\) represent the compact form of the AUV state and velocity, which can be expressed as follows:  
\[\mathbf{\eta} =\begin{bmatrix}\mathbf{\eta}_{1}^{\mathrm{T}},\mathbf{\eta}_{2}^{\mathrm{ T}}\end{bmatrix}^{\mathrm{T}} \tag{3}\] \[\mathbf{v} =\begin{bmatrix}\mathbf{v}_{1}^{\mathrm{T}},\mathbf{v}_{2}^{\mathrm{T}} \end{bmatrix}^{\mathrm{T}} \tag{4}\]  
Figure 1: Coordinate system of AUV in six degrees of freedom.  
In Equation (2), matrix \(\mathbf{R}^{3\times 3}\) represents the translational velocity rotation matrix from the [B] system to the [G] system, while matrix \(\mathbf{T}^{3\times 3}\) denotes the rotational velocity rotation matrix from system [B] to system [G]. In addition, \(\mathbf{O}\) represents the zero matrix. These two matrices, \(\mathbf{R}^{3\times 3}\) and \(\mathbf{T}^{3\times 3}\), can be defined as follows:  
\[\mathbf{R}^{3\times 3}=\begin{bmatrix}\cos\psi\!\cos\theta&-\sin\psi\!\cos \phi+\cos\psi\!\sin\theta\!\sin\phi\\ \sin\psi\!\cos\theta&\cos\psi\!\cos\phi+\sin\phi\!\sin\theta\!\sin\psi\\ -\sin\theta&\cos\theta\!\sin\phi\\ \sin\psi\!\sin\phi+\cos\psi\\ -\cos\psi\!\sin\phi+\sin\theta\!\sin\psi\!\cos\phi\\ \cos\theta\!\cos\phi\end{bmatrix} \tag{5}\]  
\[\mathbf{T}^{3\times 3}=\begin{bmatrix}1&\sin\phi\!\tan\theta&\cos\phi\!\tan\theta \\ 0&\cos\phi&-\sin\phi\\ 0&\frac{\sin\phi}{\cos\theta}&\frac{\cos\phi}{\cos\theta}\end{bmatrix} \tag{6}\]  
According to Equation (6), when angle \(\theta=\pm\pi/2\), using Euler angles to describe the AUV's attitude results in singularity in matrix \(\mathbf{T}^{3\times 3}\)([PERSON], 2009 [32]). This singularity situation can render the kinematic equations unsolvable. Therefore, when formulating the control strategy, it becomes crucial to impose constraints on the AUV's state to ensure that the pitch angle does not reach these critical values. Based on the preceding discussion, the development of the kinematic model plays a pivotal role in accurately characterizing the motion dynamics of the AUV. This provides us with a detailed understanding of how the AUV's position and attitude change over time, offering critical insights into its behavior and capabilities.