## 2 Modeling
### Dynamic Modeling  
The nonlinear dynamic equations of the UVMS expressed in the body-fixed frame \(\{B\}\) can be established as [16; 21]:  
\[\mathbf{M}(\mathbf{q},\mathbf{\eta})\dot{\xi}+\mathbf{C}(\mathbf{q},\mathbf{\zeta})\dot{\xi}+\mathbf{D}( \mathbf{q},\mathbf{\zeta})\dot{\xi}+\mathbf{g}(\mathbf{q},\mathbf{R}_{I}^{B})=\mathbf{\tau}+\mathbf{\tau}_{ dis} \tag{3}\]  
where  
\[\mathbf{M}(\mathbf{q},\mathbf{\eta})= \begin{bmatrix}\mathbf{M}_{v}+\mathbf{H}_{1}(\mathbf{q})&\mathbf{H}_ {2}(\mathbf{q})\\ \mathbf{H}_{2}^{T}(\mathbf{q})&\mathbf{M}_{m}(\mathbf{q})\\ \end{bmatrix} ,\ \ \mathbf{C}(\mathbf{q},\mathbf{\zeta})= \begin{bmatrix}\mathbf{C}_{v}(\mathbf{v})+\mathbf{C}_{1}( \mathbf{q},\dot{\mathbf{q}},\mathbf{\
u})&\mathbf{C}_{2}(\mathbf{q},\dot{\mathbf{q}})\\ \mathbf{C}_{3}(\mathbf{q},\dot{\mathbf{q}},\mathbf{\
u})&\mathbf{C}_{m}(\mathbf{q},\dot{\mathbf{q}})\\ \end{bmatrix} \]  
\[\mathbf{D}(\mathbf{q},\mathbf{\zeta})= \begin{bmatrix}\mathbf{D}_{\mathbf{v}}(\mathbf{v})+\mathbf{D}_{1}( \mathbf{q},\dot{\mathbf{q}},\mathbf{\
u})&\mathbf{D}_{2}(\mathbf{q},\dot{\mathbf{q}},\mathbf{\
u})\\ \mathbf{D}_{3}(\mathbf{q},\dot{\mathbf{q}},\mathbf{\
u})&\mathbf{D}_{m}(\mathbf{q})+\mathbf{D}_{4}(\mathbf{q}, \dot{\mathbf{q}},\mathbf{\
u})\\ \end{bmatrix} ,\ \ \mathbf{g}(\mathbf{q},\mathbf{R}_{I}^{B})= \begin{bmatrix}\mathbf{g}_{v}(\mathbf{\eta})+\mathbf{g}_{ 1}(\mathbf{q})\\ \mathbf{g}_{m}(\mathbf{q})\\ \end{bmatrix} ,\ \ \mathbf{\tau}=[\mathbf{\tau}_{\mathbf{v}}^{T},\mathbf{\tau}_{m}^{T}]^{T}\]  
where \(\mathbf{M}(\mathbf{q},\mathbf{\eta})\in\mathbb{R}^{(6+n)\times(6+n)}\) is the inertia matrix including added mass terms, and \(\mathbf{H}_{1}(\mathbf{q})\) and \(\mathbf{H}_{2}(\mathbf{q})\) are matrices of the inertia effects due to the manipulator. \(\mathbf{C}(\mathbf{q},\mathbf{\zeta})\in\mathbb{R}^{(6+n)}\) is the Coriolis and centripetal matrix, and \(\mathbf{C}_{i}(\mathbf{q},\dot{\mathbf{q}},\mathbf{\
u})(\text{i}=1,3)/\mathbf{C}_{2}(\mathbf{q},\dot{ \mathbf{q}})\) is the matrix of Coriolis and centripetal forces due to the coupling effects/due to the manipulator. \(\mathbf{D}(\mathbf{q},\mathbf{\zeta})\mathbf{\zeta}\in\mathbb{R}^{(6+n)}\) is the vector of dissipative effects, and \(\mathbf{D}_{i}(\mathbf{q},\dot{\mathbf{q}},\mathbf{\
u})\ (i=1\cdots 4)\) is the matrix of drag effects due to the coupling effects. \(\mathbf{g}(\mathbf{q},\mathbf{R}_{I}^{B})\in\mathbb{R}^{(6+n)}\) is the vector of gravity and buoyancy effects, \(\mathbf{g}_{v}(\mathbf{\eta})\) is the restoring vector of the vehicle, \(\mathbf{g}_{m}(\mathbf{q})\) is the restoring vector of the manipulator and \(\mathbf{g}_{1}(\mathbf{q})\) is the restoring vector due to the manipulator. \(\mathbf{\tau}\in\mathbb{R}^{(6+n)}\) is the vector of generalized forces. \(\mathbf{\tau}_{dis}\) is the vector of disturbances. Generally, in a deep water environment, \(\mathbf{\tau}_{dis}\) comes from ocean currents, payload, etc. In particular, time-varying ocean currents increase the uncertainty of the UVMS hydrodynamic forces, making accurate control of the UVMS difficult. As for the underwater manipulator, it is assumed that its links are composed of cylindrical elements. The hydrodynamic effects on cylinders can be referred to [16]. For a cylinder, the inertial matrix of added mass and added moment is a diagonal matrix, while the off-diagonal elements are neglected. The drag force can be expressed by a nonlinear function related to the velocity vector of the center of mass of the link. Generally, when calculating the hydrodynamic forces, the linear skin-friction force, quadratic drag force and lift force are considered. The third-order and higher order terms of the drag forces are neglected. In addition, based on the assumption that velocity of the ocean current is constant, the diffraction forces can be neglected. In the real system, the above model parameters are usually difficult to accurately measure or estimate, especially the hydrodynamic forces acting on the UVMS.