# Nonlinear Trajectory Tracking Controller for Underwater Vehicles with Shifted Center of Mass Model
## 4 Numerical Simulations  
### Model of the Tested Vehicle and Assumptions  
The underwater vehicle ROPOS described in [37; 40] was assumed for testing. Its parameters are given in Table 1. It is a vehicle with a length, width, and height of 1.75 m, 2.6 m,and 1.45 m, respectively. The achievable velocities can be assumed to be \(u_{max}=1.25\) m/s and \(v_{max}=0.5\div 0.6\) m/s. Limitations on forces and torques due to propulsion forces were taken into account for the tests so as to guarantee a realistic tracking task: \(|\tau_{u}|\leq 1400\) N, \(|\tau_{q}|\leq 1768\), and \(|\tau_{r}|\leq 350\) Nm. Given a symmetric \(M\) matrix, as shown in Appendix A, the values \(m_{14}=m_{41}=226.8\) kgm and \(m_{25}=m_{52}=113.4\) kgm were assumed (for the original vehicle, they are omitted, but are needed for the simulation to assess the effect of the displacement of the center of mass). These values correspond to shifts in the center of mass of \(z_{g}=0.1\) m and \(x_{g}=0.05\) m.  
Numerical calculations were made in the Matlab/Simulink environment assuming the duration of motion \(t=200\) s (linear), \(t=300\) s (complex), and time step size \(\Delta t=0.05\) s applying the Bogacki-Shampine (ODE3) method. The desired trajectories are taken to be  
\[p_{d1} =[0.3\,t,\ \ 0.1\,\ t,\ \ 0.15\,t,\ \ \theta_{d1},\ \ \psi_{d1}]^{T}, \tag{23}\] \[p_{d2} =[0.5\,t+5\sin(0.025\,t),\ \ -5\cos(0.025\,t),\ \ -0.1\,t,\ \ \theta_{d2},\ \ \psi_{d2}]^{T}, \tag{24}\]  
with initial points \(p_{d1}=[-4,\,2,\,0,\,0,\,0]^{T}\) (\(\psi_{0d1}=0\)) and \(p_{0d2}=[-2,\,1,\,-0.2,\,0,\,0]^{T}\). The following disturbance functions were selected:  
\[\left[ \begin{array}{c}f_{u}(t)\\ f_{v}(t)\\ f_{w}(t)\\ f_{q}(t)\\ f_{r}(t)\end{array} \right]=\left[ \begin{array}{c}12+\sin(0.05\,t)+0.5\sin(0. 02\,t)\ \mathrm{N},\\ 1+0.2\sin(0.02\,t)-0.3\cos(0.03\,t)\ \mathrm{N},\\ 3+0.4\sin(0.05\,t)-0.3\cos(0.01\,t)\ \mathrm{N}\\ 0.7+0.4\sin(0.01\,t)-0.7\cos(0.05\,t)\ \mathrm{N}\mathrm{m}\\ 1.2+0.4\sin(0.03\,t)-0.2\cos(0.02\,t)\ \mathrm{N}\mathrm{m}\end{array} \right] \tag{25}\]  
The designed algorithm allows for any assumptions of inaccuracy in the parameters of the dynamic model. For testing, it was assumed to be a factor of \(W=0.2\), which means a 20% parameter error. The performance evaluation is based on the desired and realized trajectory graph and the time history of important signals and indexes. The time history presented on graphs concern linear position errors, angular position errors, linear velocities, angular velocities, applied force and torque, kinetic energy time history, quasi-velocity errors (difference between the quasi-velocities) and velocity, i.e., \(\Delta\zeta_{i}=\zeta_{i}-v_{i}\) (\(i=1,2,3\)). The following quantities were used to evaluate the numerical results concerning the controller performance: \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Value** & **Parameter** & **Value** \\ \hline \(L\) & 1.75 m & \(X_{u}\) & 725 Ns/m \\ \(b\) & 2.6 m & \(Y_{v}\) & 1240 Ns/m \\ \(h\) & 1.45 m & \(Z_{v}\) & 825 Ns/m \\ \(m\) & 2268 kg & \(K_{p}\) & 3000 Ns/m \\ \(J_{x}\) & 1937 Nms\({}^{2}\) & \(M_{q}\) & 3000 Ns/m \\ \(J_{y}\) & 2883 Nms\({}^{2}\) & \(N_{r}\) & 1804 Nms \\ \(j_{z}\) & 2457 Nms\({}^{2}\) & \(X_{|u|x}\) & 1000 Ns\({}^{2}\)/m\({}^{2}\) \\ \(X_{a}\) & \(-4380\) kg & \(\gamma_{|v|v}\) & 525 Ns\({}^{2}\)/m\({}^{2}\) \\ \(Y_{g}\) & \(-9518\) kg & \(Z_{|u|x}\) & 400 Ns\({}^{2}\)/m\({}^{2}\) \\ \(Z_{u}\) & \(-4268\) kg & \(K_{|p|y}\) & 100 Ns\({}^{2}\) \\ \(K_{p}\) & \(-5000\) kg\({}^{2}\) & \(M_{|q|y}\) & 100 Ns\({}^{2}\) \\ \(M_{\dot{q}}\) & \(-5000\) kg\({}^{2}\) & \(N_{|r|r}\) & 72 Ns\({}^{2}\) \\ \(N_{\dot{r}}\) & \(-5000\) kg\({}^{2}\) & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: ROPOS ROV parameters [37; 40]. 1. Mean integrated absolute error (MIAE) for \(a=x_{e},y_{e},z_{e},\theta_{e},\psi_{e}\);
2. Mean integrated absolute control (MIAC) for \(\tau_{u},\tau_{q},\tau_{t}\);
3.