## 4 Numerical Simulations and Analysis
### Avoidance of Dynamic Obstacles on Horizontal Plane  
While static obstacle avoidance remains a pivotal aspect of AUV control, it is imperative to recognize the equal significance of dynamic obstacle avoidance in real-world applications. In the previous sections, we delved into our approach for static obstacle avoidance. Now, we shift our focus to dynamic obstacle scenarios, building upon our prior insights. To investigate the obstacle avoidance capabilities of the proposed method in an environment containing dynamic obstacles, a new series of simulation tests has been formulated, extending from the insights gained through the previous examination of static obstacles. To further bolster the maneuverability of the AUV, an expansion was made to the range of controllable rudder angles. It is imperative to underscore that the constraints governing the state space remain unaltered, preserving the experimental setup's consistency. However, certain adjustments were introduced to the input constraints, which are delineated as follows:  
\[ \begin{array}{l}\mathbf{u}_{min}=\left[0,-\frac{35\pi}{180}\right]^{\mathrm{T}} \\ \mathbf{u}_{max}=\left[4.4,\frac{35\pi}{180}\right]^{\mathrm{T}}\end{array}  \tag{61}\]  
In the context of dynamic obstacle avoidance, the obstacles selected for simulation in Section 4.2 are denoted as Obs. 3, Obs. 4, and Obs. 5. The coordinate and size parameters of these obstacles remain consistent with the previous simulations, with the introduction of velocity parameters as an additional factor, as outlined in Table 3. The incorporation of dynamic obstacles serves the purpose of simulating real-world scenarios more faithfully, where obstacles are not stationary but in motion. To simulate the movement of dynamic obstacles, a criterion is established whereby an observed obstacle initiates its motion when the distance between the AUV and the obstacle falls below a prescribed threshold, referred to as \(esp\). The motion of the obstacle ceases once the AUV successfully navigates past it. By implementing this approach, a dynamic and interactive environment is created, wherein the obstacles respond dynamically to the presence and actions of the AUV. For subsequent simulation tests, the values of \(esp=7\) m and \(dir=3.1\) m are chosen as parameter settings. These values are thoughtfully chosen to establish a suitable distance threshold for initiating and terminating obstacle motion, while maintaining a safe distance during the avoidance process. The primary objective of these simulations is to evaluate the effectiveness and adaptability of the proposed method in addressing real-world scenarios where obstacles are in motion. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Obstacles** & \
\begin{tabular}{c} **Speed/(u, v)** \\ **Situation 1** \\ \end{tabular} &
\begin{tabular}{c} **Situation 2** \\ \end{tabular} \\ \hline Obs. 3 & (\(-\)0.5, 0.5) & (\(0\), \(-\)0.5) \\ Obs. 4 & (\(0\), 0.5) & (\(0\), 0.5) \\ Obs. 5 & (\(-\)0.5, 0.5) & (\(-\)0.5, 0.5) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Speed parameters of obstacles. The trajectories of AUV obstacle avoidance under the influence of two types of dynamic obstacles are depicted in Figure 9. In this figure, the red solid ellipses represent the initial position of each dynamic obstacle, while the dashed ellipses denote its position after the movement has ceased. The green dotted curves and cyan dashed curve illustrate the AUV's avoidance of the three static obstacles discussed in Section 4.2. Furthermore, the magenta dash-dotted curves and blue dashed curves represent the AUV's avoidance trajectories when confronted with dynamic obstacles in their respective situations. Figure 10 provides a comprehensive visualization of the translational velocities \(u\) and \(v\), rotational velocity \(r\), Euler angle \(\psi\), and input \(\mathbf{u}=[T,\delta]^{\mathrm{T}}\) for each obstacle avoidance result. An analysis of the motion trajectories in both situations reveals that the AUV follows a similar trajectory while avoiding the first two obstacles.