## 3 Numerical Simulations
### Path Planning with Ocean Currents
#### 3.4.1 Path Planning with a Steady Ocean Current  
We first superimpose a steady ocean current to seek the optimal paths of the three cases discussed in Section 2. Instead of the path length, the total travel time is used to evaluate the optimal path output by the MDP algorithm. The modeled currents at 17:00:00  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Algorithm**} & \multirow{2}{*}{**Nodes**} & \multicolumn{2}{c}{**Case 1**} & \multicolumn{2}{c}{**Case 2**} & \multicolumn{2}{c}{**Case 3**} \\ \cline{3-8}  & & **CPU Time (s)** & **Path Length (m)** & **CPU Time (s)** & **Path Length (m)** & **CPU Time (s)** & **Path Length (m)** \\ \hline MDP & 386 & 4.5156 & 3.4000 \(\times\) 10\({}^{4}\) & 3.5781 & 4.8770 \(\times\) 10\({}^{4}\) & 3.5000 & 4.7314 \(\times\) 10\({}^{4}\) \\ A* & 271 & 0.2785 & 3.4000 \(\times\) 10\({}^{4}\) & 0.2313 & 5.3452 \(\times\) 10\({}^{4}\) & 0.2348 & 5.2968 \(\times\) 10\({}^{4}\) \\ \hline \hline \end{tabular}
\end{table}
Table 4: The performance comparison between MDP and A* algorithms.  
Figure 6: The comparison using the MDP (**top**) and the A* (**bottom**) algorithms for Cases 1 (**left**), 2 (**middle**), and 3 (**right**). The triangle is the starting point, and the square is the target.  
6 October 2013 (UTC) are used to represent the steady current (Figure 4). It is during an ebb tidal course and the seawater flows out of the bay. Generally, the AUV moves along the ocean current if it moves offshore, and against the ocean current when inshorc.  
The optimal paths between with and without consideration of ocean currents are shown in Figures 7 and 8, and the comparisons of the cruising times are shown in Tables 5 and 6, respectively. When the AUV moves along the ocean current, the travel time predicted by the MDP algorithm, with consideration of ocean current, is 1.81% shorter than without the ocean current for Case 2, and 7.52% for Case 3. When the AUV moves against the ocean current, the AUV cannot even arrive at the target, as predicted by the MDP algorithm. It stops at locations marked by crosses, shown in Figure 7, where the counter-current is stronger than the AUV's cruising speed.  
If the ocean current is not included in the path planning algorithm, the AUV may move very slowly in some grids in order to overcome the counter-currents. This problem will not occur if we incorporate the ocean current information in the MDP algorithm, because the reward function becomes a large number when a large counter-current appears. In addition, the more complex the spatial structure and the larger magnitude of ocean currents, the greater impact of ocean currents on the optimal path.  
Without the ocean current, the optimal path changes if the starting and target positions are switched in either Case 2 or 3. This may be different from our intuition. The goal of the MDP algorithm is to find the shortest path, but the shortest paths in a discretized map may be more than one. In fact, the optimal paths are both 4.88 \(\times\) 10\({}^{4}\) m long for switching the starting and target points in Case 2, and so it is in Case 3. The optimal paths are not exactly the same due to the value iteration of the MDP algorithm, which is a radial iteration centered from the target. When the target changes, the iteration center is also different. As a result, the output path may be different.