## 2 AUV Modeling and Simulation
### AUV Modeling  
The AUV design and modeling have been analyzed based on the theoretical six DOFs dynamic model before the GNC algorithms' implementation, whose dynamic model employs nonlinear equations of motion [1]. This study uses a reduced order for the four DOFs' control, involving surge \(u\), sway \(v\), heave \(w\), and yaw \(r\), while neglecting the roll \(p\) and pitch \(q\) motions, as the AUV does not have actuation in all DOFs. Similarly to Equation (1), the reduced order for the four DOFs control uses the following AUV position \(\mathbf{\eta}\) and velocity \(\mathbf{v}\) vectors:  
\[\mathbf{\eta}=[N,E,D,\psi]^{\top},\ \mathbf{v}=[u,v,w,r]^{\top}, \tag{2}\]  
Figure 3: Considered AUV with its five-thruster configuration: (**a**) Thrust forces directions, (**b**) Distances from AUV center of mass to thrusters. Figure 2: Simplified AUV model utilizing the NED local coordinate system. AUV motion is represented by surge \(u\), sway \(v\), heave \(w\), and angular velocity \(r\) around the z-axis. Thus, the dynamic model is simplified for the later parameter estimation of the dynamic coefficients of the AUV, and only the diagonal elements from the theoretical dynamic model are considered in this study. The hydrostatic forces and moments are related to buoyancy and weight, while the hydrodynamic forces and moments in an underwater vehicle refer to added mass and damping. This suggests that  
\[\mathbf{M}\dot{\mathbf{v}}+\mathbf{C}(\mathbf{v})\mathbf{v}+\mathbf{D}(\mathbf{v})+\mathbf{g}(\mathbf{\eta})=\mathbf{ \tau}, \tag{3}\]  
where \(\mathbf{\eta}\) and \(\mathbf{v}\) refers to the previously defined position and velocity vectors, \(\mathbf{g}\) relates to the gravity and buoyancy body-fixed frame vertical forces, and \(\mathbf{M}\), \(\mathbf{D}(\mathbf{v})\), \(\mathbf{C}(\mathbf{v})\) are the mass, damping, and Coriolis matrices, respectively. \(\mathbf{M}\) and \(\mathbf{C}(\mathbf{v})\) involve added and rigid-body terms. The mass matrix \(\mathbf{M}\) is determined as  
\[\mathbf{M} =\mathbf{M}_{\text{RB}}+\mathbf{M}_{\text{A}}\] \[= \begin{bmatrix}m-X_{\dot{u}}&0&0&0\\ 0&m-Y_{\dot{v}}&0&0\\ 0&0&m-Z_{\dot{w}}&0\\ 0&0&0&I_{\text{z}}-N_{t}\end{bmatrix} , \tag{4}\]  
where \(m\) is the mass of the vehicle, \(I_{\text{z}}\) is the moment of inertia about the z-axis, and \(X_{\dot{u}}\), \(Y_{\dot{v}}\), \(Z_{\dot{w}}\), and \(N_{\dot{r}}\) represent the hydrodynamic added mass coefficients. The AUV actuators relate to the control forces and moments by  
\[\mathbf{\tau}=\mathbf{T}\mathbf{f}, \tag{5}\]  
where \(\mathbf{T}\) is the thrust configuration matrix of the AUV, and \(\mathbf{f}\) is the control forces and moments vector. The five-thruster configuration matrix \(\mathbf{T}\) considered in this study is defined by  
\[\mathbf{T}= \begin{bmatrix}-1.0&-1.0&0.0&0.0&0.0\\ 0.0&0.0&0.0&0.0&1.0\\ 0.0&0.0&-1.0&-1.0&0.0\\ +l_{y1}&-l_{y2}&0.0&0.0&0.0\end{bmatrix} , \tag{6}\]  
where \(I_{\mathbf{n}}=[l_{xn},l_{yn},l_{2 xn}]\) denotes the distance from the AUV centre of mass to the thruster \(n\). The considered AUV includes motions in surge and yawing (thrusters one and two), heave (thrusters three and four), and sway (thruster five). The thruster five is installed at the center of mass, not producing any rotational motion, as shown in Figure 3b. \(\mathbf{C}(\mathbf{v})=\mathbf{C}^{\intercal}(\mathbf{v})\) can perform the Coriolis-centripetal matrix \(\mathbf{C}(\mathbf{v})\) parametrization [33]. Nonetheless, the Coriolis and centripetal forces \(\mathbf{C}_{\text{RB}}(\mathbf{v})\) and \(\mathbf{C}_{\text{A}}(\mathbf{v})\) linearization about angular velocity equal to zero (\(p=q=r=0\)) suggests that the Coriolis and centripetal terms can be excluded from the dynamic mathematical model [34]. Moreover, the mathematical model is simplified, considering only surge, sway, heave, and yawing motions, so this study removes the Coriolis and centripetal terms at the four DOFs dynamic model. The gravitational force acts through the center of gravity, while the buoyancy force acts through the center of buoyancy.