# Design and Motion Simulation of an Underwater Glider in the Vertical Plane
## 3 Mathematical Model
\begin{array}{ c}\mathbf{v}\\ \omega\\ \dot{\mathbf{r}}_{m}\\ \dot{\mathbf{r}}_{p}\end{array} \right) \tag{50}\]  
Here, the inertia of the total system is expressed as  
\[\mathbf{I}=\left( \begin{array}{ccc}m_{s}\mathbf{I}_{3\times 3}+\overline{m} \mathbf{I}_{3\times 3}+m_{p}\mathbf{I}_{3\times 3}+\mathbf{M}_{f}&-\overline{m} \mathbf{\dot{r}}_{m}-m\dot{\mathbf{r}}_{m_{p}}+\mathbf{D}_{f}^{T}&\overline{m} \mathbf{I}_{3\times 3}&m_{p}\mathbf{I}_{3\times 3}\\ \overline{m}\mathbf{\dot{r}}_{m}+m_{p}\mathbf{\dot{r}}_{m_{p}}+\mathbf{D}_{f}& \mathbf{J}_{s}-\overline{m}\mathbf{\dot{r}}_{m}\mathbf{\dot{r}}_{m}-m_{p} \mathbf{\dot{r}}_{m_{p}}\mathbf{\dot{r}}_{m_{p}}+\mathbf{J}_{f}&\overline{m} \mathbf{\dot{r}}_{m}&m_{p}\mathbf{\dot{r}}_{m_{p}}\\ \overline{m}\mathbf{\dot{r}}_{3\times 3}&-\overline{m}\mathbf{\dot{r}}_{m}& \overline{m}\mathbf{\dot{r}}_{3\times 3}&\mathbf{0}\\ m_{p}\mathbf{I}_{3\times 3}&-m_{p}\mathbf{\dot{r}}_{m_{p}}&\mathbf{0}&m_{p} \mathbf{I}_{3\times 3}\end{array} \right) \tag{51}\]  
Subsequently, \(\mathbf{P}\), \(\mathbf{\Pi}\), \(\mathbf{P}_{\overline{m}}\), and \(\mathbf{P}_{p}\) can be calculated as follows:  
\[\mathbf{P}=\frac{\partial T}{\partial\mathbf{v}}=\left(m_{s} \mathbf{I}_{3\times 3}+\mathbf{M}_{f}\right)\mathbf{v}+\mathbf{D}^{T} _{f}\mathbf{\omega}+\overline{m}\big{(}\mathbf{v}+\mathbf{\omega}\times \mathbf{r}_{\overline{m}}+\dot{\mathbf{r}}_{\overline{m}}\big{)} \tag{52}\] \[+m_{p}\big{(}\mathbf{v}+\mathbf{\omega}\times\mathbf{r}_{p}+\dot{ \mathbf{r}}_{p}\big{)}\] \[\mathbf{\Pi}=\frac{\partial T}{\partial\mathbf{\omega}}= \mathbf{D}^{T}\mathbf{v}+\left(\mathbf{J}_{s}+\mathbf{J}_{f}\right)\mathbf{ \omega}+\overline{m}\mathbf{\dot{r}}_{m}\big{(}\mathbf{v}+\mathbf{\omega} \times\mathbf{r}_{\overline{m}}+\dot{\mathbf{r}}_{\overline{m}}\big{)}\] (53) \[+m_{p}\mathbf{\dot{r}}_{p}\big{(}\mathbf{v}+\mathbf{\omega} \times\mathbf{r}_{p}+\dot{\mathbf{r}}_{p}\big{)}\] (54) \[\mathbf{P}_{p}=m_{p}\big{(}\mathbf{v}+\mathbf{\omega}\times \mathbf{r}_{p}+\dot{\mathbf{r}}_{p}\big{)} \tag{55}\]  
The design of this glider can be regarded as symmetric about three planes for calculation convenience, where \(\mathbf{M}_{f}\) and \(\mathbf{J}_{f}\) are diagonal matrices and \(\mathbf{D}_{f}=\mathbf{0}\). Let \(\mathbf{M}_{f}=\mathrm{diag}\)\(\left( \begin{array}{ccc}m_{f1}&m_{f2}&m_{f3}\end{array} \right)\) and \(\mathbf{J}_{f}=\mathrm{diag}\big{(} \begin{array}{ccc}\mathbf{\dot{\mathit{f }}}_{f1}&\mathbf{\dot{\mathit{f}}}_{f2}&\mathbf{\dot{\mathit{f}}}_{f3}\end{array} \right)\). \[\mathbf{M}=m_{s}\mathbf{I}_{3\times 3}+\mathbf{M}_{f}=\left( \begin{array}{ ccc}m_{1}&0&0\\ 0&m_{2}&0\\ 0&0&m_{3}\end{array} \right) \tag{56}\]  
\[\mathbf{J}=\mathbf{J}_{s}+\mathbf{J}_{f}=\left( \begin{array}{ ccc}\mathbf{\dot{\mathit{f}}}_{1}&0&0\\ 0&\mathbf{\dot{\mathit{f}}}_{2}&0\\ 0&0&\mathbf{\dot{\mathit{f}}}_{3}\end{array} \right) \tag{57}\]  
The linear and angular momentum can be expressed as  
\[\left( \begin{array}{c}\mathbf{P}\\ \mathbf{\Pi}\\ \mathbf{P}_{\overline{m}}\\ \mathbf{P}_{p}\end{array} \right)=\mathbf{I}\left( \begin{array}{c}\mathbf{v} \\ \mathbf{\omega}\\ \dot{\mathbf{r}}_{\overline{m}}\\ \dot{\mathbf{r}}_{p}\end{array} \right) \tag{58}\]  
Here, the inertia matrix \(\mathbf{I}\) is expressed as  
\[\mathbf{I}=\left( \begin{array}{ccc}\mathbf{I}_{3\times 3}+m_{p}\mathbf{I}_{3 \times 3}+\mathbf{M}&-\overline{m}\mathbf{\dot{r}}_{\overline{m}}-m_{p}\mathbf{ \dot{r}}_{p}&\overline{m}\mathbf{I}_{3\times 3}&m_{p}\mathbf{I}_{3\times 3}\\ \overline{m}\mathbf{\dot{r}}_{\overline{m}}+m\dot{\mathbf{r}}_{p}&\mathbf{J}- \overline{m}\mathbf{\dot{r}}_{\overline{m}}\overline{\dot{r}}_{m}-m_{p} \mathbf{\dot{r}}_{p}\mathbf{\dot{r}}_{p}&\overline{m}\overline{\dot{r}}_{ \overline{m}}&m_{p}\mathbf{\dot{r}}_{p}\\ \overline{m}\mathbf{I}_{3\times 3}&-\overline{m}\mathbf{\dot{r}}_{\overline{m}}&\overline{m} \mathbf{\dot{r}}_{3\times 3}&0\\ m_{p}\mathbf{I}_{3\times 3}&-m_{p}\mathbf{\dot{r}}_{p}&\mathbf{0}&m_{p}\mathbf{I}_{3\times 3}\end{array} \right) \tag{59}\]From Equation (58), we obtain  
\[\left(