# Smooth 3D Dubins Curves Based Mobile Data Gathering in Sparse Underwater Sensor Networks
## 3 Smooth 3D Dubins Curves Planning-Based Mobile Data Gathering Algorithm
### 3D Smooth Dubins Based Trajectory Construction  
Although each Bezier curve between sequential underwater sensors is smooth, how can all the Bezier curves connecting all sensor nodes be smooth? The smooth property of the curves' junction can be checked and designed by geometric continuity. This subsection presents how to maintain global smoothness for a sequence of Bezier curves. For the purpose of making explanations simpler, some variables, such as \(M_{i}\) and \(S_{j}\), in formulas are also considered to represent their coordinates of control nodes \(M_{i}\) and sensor nodes \(S_{j}\), respectively.  
Each designed underwater node sequence can be mapped to a continuous Bezier curve:  
\[\left\{\begin{array}{l}C_{12}(u)=(1-u)^{2}S_{1}+2u(1-u)M_{1}+u^{2}S_{2},\\ C_{23}(u)=(1-u)^{2}S_{2}+2u(1-u)M_{2}+u^{2}S_{3},\\ \cdots\ \ \cdots\ \ \ \cdots,\\ C_{n-1}n(u)=(1-u)^{2}S_{n-1}+2u(1-u)M_{n-1}+u^{2}S_{n},\\ C_{n1}(u)=(1-u)^{2}S_{n}+2u(1-u)M_{n}+u^{2}S_{1}.\end{array}\right. \tag{13}\]  
To satisfy the continuous first-order derivative at junction node \(S_{j}\) in Figure 4, that is, \(\dot{C}_{i}(u)|_{u=1}=\dot{C}_{j}(u)|_{u=0}\), where \(\dot{C}_{i}(u)|_{u=1}=2\times(S_{j}-M_{i})\), \(\dot{C}_{j}(u)|_{u=0}=2\times(M_{i+1}-S_{j})\), therefore  
\[M_{i}+M_{i+1}=2\times S_{j}, \tag{14}\]  
where \(M_{i}\) denotes the control point between sensor nodes \(S_{i}\) and \(S_{j}\).  
Specific to smooth-trajectory-based mobile data collection of USNs, the expected control points \(M_{i}\ (i=1,2,...,n)\) must satisfy such equation set to guarantee that the whole trajectory is smooth, which is done using multiple Bezier curves.  
\[\left\{\begin{array}{l}M_{1}+M_{2}=2\times S_{2},\\ M_{2}+M_{3}=2\times S_{3},\\ \cdots\ \ \ \cdots,\\ M_{n-1}+M_{n}=2\times S_{n},\\ M_{n}+M_{1}=2\times S_{1}.\end{array}\right. \tag{15}\]As a result, these equations can be rewritten more clearly and concisely with a matrix equation, \(\mathcal{AM}=\mathcal{S}\), where \(\mathcal{M}=[M_{1},M_{2},\ldots,M_{n-1},M_{n}]^{T}\), \(\mathcal{S}=[2S_{2},2S_{3},\ldots,2S_{n},2S_{1}]^{T}\), and  
\[\mathcal{A}=\left[\begin{array}{ccccc}1&1&\ldots&0&0\\ 0&1&\ldots&0&0\\ \ldots&\ldots&\ldots&\ldots&\ldots\\ 0&0&\ldots&1&1\\ 1&0&\ldots&0&1\end{array}\right]_{n\times n}. \tag{16}\]  
The determinant and rank of matrix \(\mathcal{A}\) can be calculated as follows:  
\[|\mathcal{A}|=\begin{cases}0,&\text{if $n$ is even,}\\ 2,&\text{if $n$ is odd.}\end{cases} \tag{17}\]  
\[Rank(\mathcal{A})=\begin{cases}n-1,&\text{if $n$ is even,}\\ n,&\text{if $n$ is odd.}\end{cases} \tag{18}\]  
Clearly, \(\mathcal{M}=\mathcal{A}^{-1}\mathcal{S}\) if \(n\) is odd. Otherwise, \(\mathcal{M}\) is unsolvable if \(n\) is even. Therefore, Bezier interpolation curves in the \(Z\)-axis can be determined with such a solution set. In the case of an even number of underwater sensors, we can add one virtual sensor node to the original network topology. That is to say, only the final Bezier curve in the trajectory sequence has to be designed specifically. Consequently, the interpolated 3D Dubins paths will be continuous and smooth at each sensor node and meet the requirements of kinematic constrains.