## 2 AUV Modeling and Simulation
### Model-Validation Using Parameter Estimation  
The Girona500 AUV has an aluminum frame supporting three torpedo-shaped hulls, five thrusters, and all necessary scientific instrumentation. The strip theory [34; 35] cannot be used to calculate the hydrodynamic coefficients of the AUV model, as the Girona500 AUV is not a torpedo-shaped hull with a cylindrical rigid body. Thus, this study requires a more advanced estimation method for this vehicle. Over-parametrization is the main problem when estimating parameters using SI or nonlinear optimization methods. The solution to this problem is to exploit theoretical information and estimate a model of partially known parameters [1]. The model validation includes four different parameter estimation runs. These test runs comprise independent surge, sway, heave, and yawing AUV motions, with different thruster setpoint values in all directions. These values comprise the 0.25, 0.50, 0.75, and 1.00, setting a constant input to the motion controllers. The test runs involve straight trajectories in the sway, and heave while having a zigzag pattern to estimate the hydrodynamic coefficients in the surge and yaw motions. This zigzag pattern is performed by setting constant control inputs to the thrusters for turning while moving forward with steady surge speed. The estimation method uses the MATLAB-Simulink parameter estimation tool [9], employing a time-domain method for the AUV mathematical model. This estimation method minimizes the cost function using a nonlinear least-squares approach, evaluating the model until the estimation converges and terminates. With this parameter estimation tool, the running estimation will vary the selected model parameters--in our case, hydrodynamic coefficients--to reduce the error between the simulation outputs and the experimental data. The nonlinear least-squares method minimizes the squares of the residuals using the following minimization problem [9]  
\[\min_{x}\|F(x)\|_{2}^{2}=min_{x}\Big{(}f_{1}(x)^{2}+f_{2}(x)^{2}+\dots+f_{n_{ \text{s}}}(x)^{2}\Big{)},\text{ }\text{ }\text{s.t.}\text{ }\underline{x}\leq x\leq\bar{x} \tag{12}\]  
where \(f_{1}(x)\), \(f_{1}(x)\),...\(f_{1}(x)\) represent the residuals, and \(n_{\text{s}}\) is the number of samples. Table 1 shows the constant values shared in the experiments since these are computed when constructing the vehicle. Table 2 presents the comparison between the hydrodynamic coefficients used in the previous work [28] and the results acquired from the parameter estimation tool. The previous work coefficients are obtained from the COLA2 simulation  
package [36]. The dynamic coefficients \(X_{u}\), \(X_{u}\), \(X_{|u|u}\) relate to surge, \(Y_{\circ}\), \(Y_{\circ}\), \(Y_{|p|p}\) to sway, \(Z_{w}\), \(Z_{w}\), \(Z_{|w|w}\) to beave, and \(N_{r}\), \(N_{r}\), \(N_{|r|r}\) to yaw motion. Figure 4a,b compare the field tests and the four DOFs mathematical model results with the hydrodynamic coefficients used in the previous work [28] and the coefficients obtained from the parameter estimation in a zigzag pattern. Even though only diagonal coefficients are estimated by neglecting the dynamic matrices' cross-terms, the mathematical model shows an accurate response compared to the field test data. Furthermore, the current parameter estimation improves on the previous work, as the maneuvering of the AUV mathematical model is closer to the field-test data in both surge and yaw motions. Figure 4c illustrates these control inputs as thruster setpoints commands, which are the inputs for the Girona500 AUV and are related to thrust forces by a polynomial function. Additionally, Figures 5 and 6 shows the comparison of field test with the mathematical model for sway and heave motions, using two separate sets of data related to different thruster setpoints.