## 3 Materials
### Objective Function Formulation  
In the MATC system, stable straight-line sailing is essential for the successful completion of the mission. To ensure stable operation in complex underwater environments, precise control over the motion of each AUV unit is necessary. During the control process, the formulation of the objective function plays a crucial role. The objective function not only quantifies the system's performance but also provides a basis for solving optimization problems. In the formulation of the objective function, quadratic objective functions are widely used for such problems due to their excellent mathematical properties, simplicity in solving, and extensive practical applications [22; 23]. The core requirement for stable straight-line sailing is that the MATC system must maintain a constant speed while the AUV units uphold the ideal distance between them. To achieve this, it is necessary to allocate the thrust of each AUV appropriately and optimize the system to ensure that the overall speed and inter-unit distances meet the preset requirements. The design of the objective function should be closely aligned with these two key factors. An important goal of the MATC system is to ensure that the distance between each unit remains within the ideal range at all times. This not only ensures the stability of the multi-body AUV system during sailing but also prevents collisions or inefficiencies caused by the units being too close or too far apart. To achieve this goal, the objective function must include a control term for the distance between units. Specifically, the objective function should have a distance deviation term, which represents the difference between the actual distance and the ideal distance. To prevent excessive distance deviations, the objective function applies a weighted penalty to the distance difference using a weighting factor. The magnitude of the weighting factor can be adjusted according to the system's tolerance, ensuring that the distance control precision meets the desired requirements during the optimization process. Another goal of the MATC system is to achieve uniform motion of the entire system, avoiding fluctuations in speed during operation. To accomplish this, the objective function must include a term for the overall speed deviation, which measures the difference between the actual speed and the target speed during each optimization cycle. Specifically, if there is a large deviation between the actual overall speed and the target speed within a given cycle, it indicates that the thrust allocation for that cycle is not suitable and needs to be adjusted by the optimization algorithm to achieve the target speed. Therefore, the objective function should include an overall speed deviation term. To prevent excessive fluctuations in speed control, the objective function applies a penalty to the overall speed deviation, encouraging the optimization process to minimize this difference. Hence, the objective function is defined as follows:  
\[J_{a}=\kappa\sum_{i=1}^{n-1}\left[\widetilde{x}_{i(i+1)}-L_{b}\right]^{2}+ \beta\left(\widetilde{v}_{p}-v_{\circ}\right)^{2} \tag{3}\]where \(\widetilde{x}_{i(i+1)}\) and \(L_{b}\) represent the actual inter-unit distance and the ideal inter-unit distance after one cycle of thrust allocation, respectively; \(\widetilde{v}_{p}\) and \(v_{0}\) represent the actual overall speed and the target overall speed after one cycle of thrust allocation, respectively; \(\alpha\) and \(\beta\) are the weighting factors for the distance deviation and the overall speed deviation, respectively. By carefully designing the weighting factors, the priorities of these two key factors can be balanced. In practical applications, the selection of the inter-unit distance deviation weighting factor and the overall speed deviation weighting factor will directly affect the optimization results.