## 4 Numerical Simulations and Analysis
### Trajectory Tracking Analysis  
Trajectory tracking constitutes a critical component of AUV control systems, enabling precise navigation along predefined paths or trajectories within the challenging underwater environment. Achieving accurate trajectory tracking is vital for mission success, as it ensures the AUV can effectively execute its intended tasks while efficiently adapting to environmental conditions and circumventing obstacles. In this section, our focus is specifically directed towards trajectory tracking within the context of AUV control. Our primary objective is to scrutinize the practicality and control precision of the Gaussian-process-based MPC approach in the realm of trajectory tracking. We endeavor to evaluate the performance of the proposed method concerning the attainment of precise trajectory tracking under varying operational scenarios. The simulation results will provide valuable insights into the effectiveness and robustness of the Gaussian-process-based MPC approach, contributing to the advancement of AUV motion control methodologies and bolstering the overall trajectory tracking capabilities of AUVs. In this trajectory tracking simulation task, the acceleration is utilized as the six-dimensional input \(\mathbf{u}^{\prime}\) to control the motion of the 6-DOF AUV. The sampling period \(T\) is set to 0.1 s, and the prediction step \(p\) is 20. These parameters determine the frequency at which control actions are updated and the number of future steps that factor into trajectory prediction. To maintain a structured and controlled environment during simulations, the constraint space for the input \(\mathbf{u}^{\prime}\) and state \(\mathbf{x}\) of the AUV is defined as follows:  
\[\mathbf{u}^{\prime}_{\text{min}} =\big{[}0,-\tfrac{25\pi}{180},-\tfrac{25\pi}{180},-0.05,-\tfrac{30 \pi}{180},-\tfrac{30\pi}{180}\big{]}^{\text{T}} \tag{55a}\] \[\mathbf{u}^{\prime}_{\text{max}} =\big{[}4.4,\tfrac{25\pi}{180},\tfrac{25\pi}{180},0.05,\tfrac{30 \pi}{180},\tfrac{30\pi}{180},\tfrac{30\pi}{180}\big{]}^{\text{T}}\] (55b) \[\mathbf{x}_{min} =\big{[}0,-0.5,-0.5,-\tfrac{20\pi}{180},-\tfrac{30\pi}{180},- \tfrac{30\pi}{180},-INF,-INF,-INF,-\tfrac{80\pi}{180},-INF\big{]}^{\text{T}}\] \[\mathbf{x}_{max} =\big{[}1.55,0.5,0.5,\tfrac{20\pi}{180},\tfrac{30\pi}{180}, \tfrac{30\pi}{180},INF,INF,INF,\tfrac{80\pi}{180},INF\big{]}^{\text{T}}\] where \[INF\] indicates that no constraints have been applied to this dimension. To initiate the simulation, the weight matrices associated with the cost function are established as follows: \[\mathbf{Q} =diag\big{(}10^{-6},10^{-6},10^{-6},10^{-6},10^{-6},10,10,10,10^{ -2},10^{-2},10\big{)}\] (56) \[R =\text{diag}\big{(}10^{-3},10^{-3},10^{-3},10^{-3},10^{-3},10^{-3 }\big{)}\] \[S =\text{diag}\big{(}10^{-2},10^{-2},10^{-2},10^{-2},10^{-2},10^{-2 }\big{)}\]  
For the target trajectory in this simulation, we opted for a well-established trajectory known as the \"spiral trajectory\". This trajectory that was used is defined as follows:  
\[\mathbf{y}_{\text{ref}}= \begin{bmatrix}10\cos\frac{t}{2}+15\\ 10\sin\frac{t}{2}+15\\ 0.08t+5\end{bmatrix}  \tag{57}\]  
The reference trajectory, denoted as \(\mathbf{y}_{\text{ref}}\), represents the target positions and orientations for an AUV along the \(x\), \(y\), and \(z\) directions. Each component of \(\mathbf{y}_{\text{ref}}\) corresponds to a specific dimension, defining the desired state for the AUV's motion. In cases where no explicit reference value is specified for a particular direction, the default value is assigned as zero, indicating the absence of a specific target in that dimension. Moreover, the initial state of the AUV is defined as \(\mathbf{x}_{0}=[0,0,0,0,0,0,35,0,0,0,\pi/2]^{\text{T}}\) and the input values are set as \(\mathbf{u}_{0}=[0,0,0,0,0,0]^{\text{T}}\). The trajectory tracking task was performed using the proposed algorithm, which leveraged available data and control inputs to guide the AUV's motion, ensuring the precise tracking of the desired trajectory.