# Design and Motion Simulation of an Underwater Glider in the Vertical Plane
## 3 Mathematical Model
\begin{array}{c}\mathbf{v}\\ \boldsymbol{\omega}\\ \dot{\boldsymbol{r}}_{\overline{m}}\\ \dot{\boldsymbol{r}}_{p}\end{array} \right)=\mathbf{I}^{-1}\left( \begin{array}[] {c}\mathbf{P}\\ \mathbf{\Pi}\\ \mathbf{P}_{\overline{m}}\\ \mathbf{P}_{p}\end{array} \right) \tag{60}\]  
The inverse of the inertia matrix is expressed as  
\[\mathbf{I}^{-1}=\left( \begin{array}{cccc}\boldsymbol{M}^{-1}&\boldsymbol{0} &-M^{-1}&-M^{-1}\\ \boldsymbol{0}&J^{-1}&-J^{-1}\dot{\boldsymbol{r}}_{m}&-J^{-1}\dot{\boldsymbol{ r}}_{p}\\ -\boldsymbol{M}^{-1}&\dot{\boldsymbol{r}}_{\overline{m}}J^{-1}&\boldsymbol{M}^{ -1}\dot{\boldsymbol{r}}_{\overline{m}}J^{-1}\dot{\boldsymbol{r}}_{\overline{m }}&\boldsymbol{M}^{-1}-\dot{\boldsymbol{r}}_{p}M^{-1}\dot{\boldsymbol{r}}_{p} +\frac{1}{m_{p}}\mathbf{I}_{3\times 3}\end{array} \right) \tag{61}\]  
From Equations (14) and (15), we obtain  
\[\dot{\boldsymbol{r}}_{\overline{m}}=\dot{\boldsymbol{d}}_{\overline{m}} \tag{62}\]  
\[\dot{\boldsymbol{r}}_{p}=\dot{\boldsymbol{d}}_{p} \tag{63}\]  
Combining the equations above, the equations of motion governing a UG propagating in a three-dimensional space are expressed as follows:  
\[\left( \begin{array}{c}\dot{\mathbf{R}}\\ \dot{\mathbf{b}}\\ \dot{\boldsymbol{\omega}}\\ \dot{\boldsymbol{r}}_{\overline{m}}\\ \dot{\boldsymbol{r}}_{\overline{m}}\\ \dot{\boldsymbol{r}}_{\overline{m}}\\ \mathbf{P}_{\overline{m}}\\ \dot{\boldsymbol{r}}_{p}\\ \dot{\boldsymbol{r}}_{\overline{m}}\\ \dot{\boldsymbol{r}}_{p}\\ \dot{\boldsymbol{r}}_{p}\\ \dot{\boldsymbol{m}}_{0}\end{array} \right)=\left( \begin{array}{c}\mathbf{ R}\dot{\boldsymbol{\omega}}\\ \mathbf{R}\mathbf{v}\\ \mathbf{J}^{-1}\boldsymbol{\tau}\\ \boldsymbol{M}^{-1}\boldsymbol{F}\\ \dot{\boldsymbol{d}}_{\overline{m}}\\ \dot{\boldsymbol{d}}_{p}\\ \overline{m}\big{(}\mathbf{v}+\boldsymbol{\omega}\times\boldsymbol{r}_{ \overline{m}}+\dot{\boldsymbol{r}}_{\overline{m}}\big{)}\\ m_{p}\big{(}\mathbf{v}+\boldsymbol{\omega}\times r_{p}+\dot{\boldsymbol{r}}_{ p}\big{)}\\ \mathbf{u}_{\overline{m}}\\ \mathbf{u}_{p}\\ \mathbf{u}_{0}\dot{\boldsymbol{d}}_{p}\end{array} \right) \tag{64}\]  
The total moment and force are expressed as follows:  
\[\boldsymbol{\tau}=\big{(}\boldsymbol{I}\boldsymbol{\omega}+\dot{\boldsymbol{ r}}_{\overline{m}}\mathbf{P}_{\overline{m}}+\dot{\boldsymbol{r}}_{p} \mathbf{P}_{p}\big{)}\times\boldsymbol{\omega}+\boldsymbol{M}\mathbf{v}\times \mathbf{v}+\boldsymbol{\omega}\times\boldsymbol{r}_{\overline{m}}\times \mathbf{P}_{\overline{m}}+\boldsymbol{\omega}\times r_{p}\times\mathbf{P}_{p}+ \big{(}\overline{m}\dot{\boldsymbol{r}}_{\overline{m}}+m_{p}\dot{\boldsymbol{r} }_{p}\big{)}\mathbf{g}\mathbf{R}^{T}\boldsymbol{k}+\boldsymbol{\tau}_{ext} \tag{65}\]  
\[\boldsymbol{F}=\big{(}\boldsymbol{M}\mathbf{v}+\mathbf{P}_{\overline{m}}+ \mathbf{P}_{p}\big{)}\times\boldsymbol{\omega}+m_{0}\mathbf{g}\mathbf{R}^{T} \boldsymbol{k}+\boldsymbol{F}_{ext}-\mathbf{u}_{\overline{m}}-\mathbf{u}_{p} \tag{66}\]  
Here, \(\boldsymbol{\tau}_{ext}\) and \(\boldsymbol{F}_{ext}\) are the hydrodynamic moment, lift, and drag forces exerting on the glider, respectively. According to parallel axis theorem and the Pythagorean theorem, the moment of inertia of the stationary mass can be expressed as  
\[J_{s2}=J_{ms2}+m_{s}\big{[}\big{(}r_{s1}-x_{CB}\big{)}^{2}+\big{(}r_{s3}-z_{CB }\big{)}^{2}\big{]} \tag{67}\]  
Here, \(J_{ms2}\) is the moment of inertia at the center of the stationary mass about the \(y\)-axis. Considering the complexity of the actual underwater environment, the effects of currents and waves on the underwater glider were disregarded [14]. Owing to the symmetry of the underwater glider configuration, only its dive and uplift in the vertical direction were considered in this study. The underwater forces on the glider and the distribution of each mass point can be explained as follows: When the glider dives or floats underwater,it is subjected to hydrodynamic forces from the water, in addition to its own gravity and buoyancy.