## 4 UAV-TPUA: UAV Trajectory Progress Updating Algorithm
### Updating Trajectory Progress
```
1 Perform the same precise positioning technique using DL-SSB+PRS as in Stage 2;
2 Calculate \(d_{xy}=\sqrt{(x_{uav}-x_{j})^{2}+(y_{uav}-y_{j})^{2}}\), \(d_{z}=z_{uav}-z_{j}\);
3 if\(d_{z}-d_{xy}<\Delta s\)then
4 if\(d_{z}-d_{xy}>0\)then
5\(s_{xy}=\sqrt{\Delta s^{2}-(d_{z}-d_{xy})^{2}}\), \(tmp=1\);
6
7 end if
8 else
9\(s_{xy}=\Delta s\), \(tmp=0\);
10
11 end if
12\(x^{next}_{uav}=x_{uav}-s_{xy}f_{1}(\theta)\) where \(\theta\) is the rotation angle of the UAV;
13\(y^{next}_{uav}=y_{uav}-s_{xy}f_{2}(\theta)\);
14\(z^{next}_{uav}=z_{uav}-(d_{z}-d_{xy})\times tmp\);
15
16 end if
17
18 else
19\(x^{next}_{uav}=x_{uav}\), \(y^{next}_{uav}=y_{uav}\), \(z^{next}_{uav}=z_{uav}-\frac{\Delta s}{10}\);



114
115 end for
114
1150 end if
116
117 end for
118
119
121 end for
122
123 end if
124
125
126 end for
127
128 end if
129
130 end if
131
140 end for
129
141 end for
150
151 end for
163
164 end for
175
186
187 end if
188
199
198 end for
189
199
200 end if
201
219
22 end for
219
231
242 end for
243
254 end if
267



398
400 end if
301
302



78
780
781
7908

79090

71091

72092
7209
7309

74211
7434
7445
7581

76921

75822
7693

78465

79547

79586

79587

79588

79589

89696

89697

89798

969999

99999

100000

100000

100000

10000

10000

100000

100000

100000

100000

100000

100000

100000

100000

1000000

1000000

1000000

1000000

100000

1000000

1000000

1000000

10000000

1000000

10000000 This paper encapsulates the aforementioned strategy into the Algorithm 2, facilitating its deployment onto UAVs for prediction of search and rescue trajectories. ```
1 Initialize \(v\), \(\Delta T\), \(H_{0}\), \(t\gets 0\), \(P_{uav}^{(0)}\leftarrow(0,0,0)\), \(e\leftarrow\epsilon_{0}\), \(\hat{C}_{EA}\leftarrow(+\infty,+\infty)\), \(\hat{H}_{EA}\leftarrow+\infty\), \(\text{URA}\gets M\times N\) antennas;
2 Initialize UEs' location as \(\{P_{u{i}}|i=0,1,2,\ldots,|U|\}\) randomly in an emergency area;
3 whileconvergence condition ccdo
4 if\(z_{uav}>\gamma_{1}\)then
5 Perform DL-SSB rough angle measurement operation;
6 Get SSB measurements information \(rsrp_{i,j}^{psb}\) from all UEs;
7 The UAV flies towards \((\theta_{i_{\text{c}u}}^{ssb},\theta_{i_{\text{c}u},j}^{ssb})\) and the position coordinate is updated according to Equation (8);
8
9 end while
10 elseif\(\gamma_{1}>z_{uav}>\gamma_{2}\)then
11 Perform DL-SSB+PRS fine angle measurement operation;
12 Get \(prs_{i,j}\) measurements information \(rsrp_{i,j}^{prs}\) from all UEs;
13 Estimate \([\theta_{i,j}^{prs},\theta_{i,j}^{prs},\tau_{i,j}^{prs}]\) and obtain the corresponding position coordinates \(\hat{P}_{ue_{i,j+1}}\) according to Equation (9);
14 Calculate \(\hat{C}_{EA}^{j+1}\), \(\hat{H}_{EA}^{j+1}\) and \(\hat{\rho}_{EA}^{j+1}\) according to Equation (10);
15 Update the UAV's position coordinates according to Equation (11);
16
17 end if
18
19 else
20 Perform the Algorithm 1;
21
22 end if
23\(t\gets t+\Delta T\), \(P_{uav}^{(t)}\gets P_{uav}^{next}\);
24
25 end while
```

**Algorithm 2**UAV-TPUA

## 5 BWSAR Simulation

In this section, we simulate the entire process of the drone flying from outside the disaster area to the victim, and analyze the relationship between localization accuracy and distance, the differences in trajectory caused by flight strategies, and the circling method after approaching the victim. We present the variation of positioning error over time. ### PRS Setting

In the process of beam refinement, the PRS is propagated through beamforming technology, with each PRS beam corresponding to a PRS resource. In this example, the PRS slot offset (\(T_{\text{PRS offset}}\)) is configured as a \(1\times 12\) array, with incremental values ranging from 0 to 11, assigning a unique timeslot offset to each beam and thus avoiding temporal overlap of PRS signals from different beams. The RE offset (\(T_{\text{PRS offset, RE}}\)) is also a \(1\times 12\) array, with values incrementing from 0 to 11, ensuring a unique RE offset for each beam, which enhances the channel estimation capability of the signals.