# Towards a Digital Twin for Open-Frame Underwater Vehicles Using Evolutionary Algorithms
## 5 Digital Twin Model Validation  
With the digital twin adjusted, a series of tests were performed to evaluate the effectiveness of the proposed solution. Figure 6 shows the position error (E\({}_{\rm P}\)) distribution for the linear validation tests, where the error values represent the difference between the real and simulated positions of the vehicle for each movement. Each group of boxplots corresponds to a specific linear motion: surge, sway, and heave. The tests consisted of six isolated movements along each axis, similar to those used during algorithm training, but with different amplitudes. The amplitude ranges for the surge and sway motions were selected to ensure the robot exhibited representative behavior under typical operational conditions. In the case of heave motion, the range was limited by the depth of the towing tank. The results for the surge motion showed low error magnitudes, with most medians close to zero. This indicates that the simulated vehicle closely followed the trajectory of the real one. A similar trend was observed in the sway maneuvers, where the medians remained centered and the dispersion was moderate. The absence of a consistent trend in error magnitude with increasing amplitude suggests that the simulation accurately reproduced the vehicle's behavior across the range of velocities tested. The heave tests exhibited different behaviors. While the initial tests (Heave 1 to 3) followed a similar trend to the other linear motions, the remaining tests (Heave 4 to 6) showed significantly larger errors and variability. This discrepancy may be attributed to disturbances generated by the interaction between the fluid and the bottom of the towing tank, which appeared more pronounced at faster heave displacements. Figure 7 shows the orientation error (E\({}_{\text{o}}\)) distribution for the rotational validation tests where the error values represent the difference between the real and simulated orientations of the vehicle for each rotational movement. Each group of boxplots corresponds to a specific rotation (roll, pitch, and yaw). For roll and pitch, six tests were carried out up to the stability limit for the robot in these degrees of freedom. Beyond that point, the vehicle became unstable and tended to capsize, making it difficult to obtain reliable or repeatable results. In contrast, yaw rotations were tested over a wider propeller speed range, provided that the motion remained controllable and representative of real operational conditions, as high speeds in these tests did not compromise the robot's stability. The results for roll and pitch were consistent across all amplitudes, with low dispersion and median errors close to zero. This suggests a good match between the real and simulated responses for these two degrees of freedom. For yaw, the error values showed more variability, and the median was not centered around zero. This was expected, since the angular change in yaw was much larger than in roll or pitch, which naturally lead to a wider range of errors. Even so, the results followed a similar trend across the different test cases. Figure 6: Error in the linear validation tests: 6 for surge, 6 for sway, and 6 for heave. A detailed comparison of the angle over time for one of the pitch tests is presented in Figure 8. As can be seen, both the actuated and free motion behavior of the model were very close to the real vehicle. To further quantify the agreement, the root mean square error (RMSE) was computed, yielding a value of 0.015 and a normalized RMSE of 3.5%. These results indicate a strong correlation between the simulated and experimental data, suggesting that the model and the parameter optimization process are effective. To validate the decoupled motion assumption and assess the model's adequacy and generalization capability, a spiral ascent test was conducted. The results are illustrated in Figures 9 and 10, which respectively compare the heave displacement and yaw angle over time, for both the real system and the simulation model.