## 6 Combined Ray Tracing Method  
The USBL is used in the shallow sea environment where the sound speed varies with depth, so the sound speed can no longer be regarded as a fixed value. Using a straight sound line to track and locate the target directly will lead to inaccurate positioning. The equal gradient ray tracing method can be used to improve the positioning accuracy. However, using the equal gradient ray tracing method throughout the entire propagation, although providing high accuracy, requires a large amount of calculation of iterative processing. In the process of moving underwater targets, the deepening of the underwater depth will cause changes in the sound propagation speed. Each change needs to be recalculated, which is quite time consuming, so it is difficult to meet the demand for rapid real-time positioning of the ultra-short baselines. In Figure 5, the sound speed profile shows a negative gradient trend. The sound velocity is basically constant within 15 m, and the sound velocity gradient changes significantly beyond 15 m. The sound velocity tends to be stable at depth about 100 m, with a slightly negative gradient after the depth of 200 m.  
In areas where the sound speed is stable, the error generated by the ray tracing is relatively small, and tracking with the constant sound speed ray tracing method still achieves good positioning accuracy. The main error in ray tracing is generated in the area where the sound speed changes greatly. In such an area, the equal gradient ray tracing method can better fit the actual situation. Figure 5: Sound speed profile dependence on the depth. In this paper, the constant sound velocity tracking method is combined with the equal gradient ray tracing method, and an improved sound ray tracing method is proposed. The principle of the proposed method is as follows. In the area where the sound speed is constant with depth, the constant sound speed tracking method is used for tracking, and in the area where the sound speed changes rapidly, the equal-gradient sound tracking method is used. By increasing the number of calculation iterations in the local area, the overall tracking accuracy can be improved. The specific process is as follows. The gradient \(g\) of the sound speed profile between the ultra-short baseline system and the transponder is used as a judgment condition, and the gradient change threshold \(\delta\) is set according to the actual situation. When \(g\geq\delta\), the algorithm considers that the sound speed is greatly disturbed, so the equal gradient ray tracing method is used; when \(g<\delta\), the sound speed is considered stable, so the constant sound speed tracking method is used. The steps of the proposed method are as follows:  
1. Acquire the gradient of each layer of the sound speed profile: \(g_{i}\), \(i=1,2,\cdots,n\);
2. If the consecutive levels \(n1_{i}\)\((i=1,2,\cdots,n)\) satisfy that in each layer, \(g_{i}<\delta\), then \(n1_{i}\) layers will be merged into one layer \(n1\), which will be defined as a constant velocity region, and it will be considered that the sound speed value in this region is constant; accordingly, the constant sound speed ray tracing method will be used: \[\overline{c}_{n1}=\frac{1}{n1}\sum_{i=1}^{n1}c_{i}\] (24) In Equation (24), \(n1\) represents the number of consecutive layers in the constant-sound-speed region. Substituting the average sound speed into the constant sound speed ray tracing method, the horizontal displacement and depth of the sound wave are obtained. 3. If consecutive levels \(n2_{i}\)\((i=1,2,\cdots,n)\) satisfy that in each layer, \(g_{i}\geq\delta\), then \(n2_{i}\) layers will be defined as an equal gradient sound-tracking area, and the equal gradient ray tracing method will be used in layer by layer in this area to calculate the horizontal displacement and depth of the sound wave in each layer. The horizontal displacement of the corresponding layer is accumulated to obtain the total horizontal displacement at the corresponding depth, and after that, the slope is calculated.