## 3 Optimal Design of Transmit Waveform and UAV Altitude
### Method for Obtaining the Optimal Solution Based on the PSO Algorithm  
Particle Swarm Optimization (PSO) is a meta-heuristic global optimization algorithm inspired by swarm intelligence [31; 32; 33]. It is easy to implement, making it widely applicable to various optimization problems. It is known for its faster convergence compared to other complex global optimization algorithms, and it can be effectively applied to non-linear or complex functions. Additionally, PSO requires relatively few parameters to be tuned and has simple settings, allowing it to be flexibly applied to different problems [34; 35; 36]. In a PSO algorithm, a swarm of particles interacts within a given space to find the optimal solution. Each particle has a position and velocity within the solution space and adjusts its movement based on both the best solution it has found and the best solution found by the entire swarm. The algorithm iteratively updates each particle's position and speed, improves the quality of the path with the fitness function, and achieves the optimal solution with the best fitness value. Thanks to its advantages, the PSO algorithm has been widely adopted to optimize trajectory and path planning for UAVs [31; 32; 33]. More specifically, for a general \(D\)-dimensional optimization problem, a swarm of \(M\) particles explores the \(D\)-dimensional variable space. The \(m\)-th particle has position \(\mathbf{p}_{m}^{j}=\left[p_{m,1}^{(j)},p_{m,2}^{(j)},\ldots,p_{m,D}^{(j)} \right]\in\mathbb{R}^{D}\) and velocity \(\mathbf{v}_{m}^{(j)}=\left[v_{m,1}^{(j)},v_{m,2}^{(j)},\ldots,v_{m,D}^{(j)} \right]\in\mathbb{R}^{D}\) at the \(j\)-th iteration \(j=1,2,\ldots,J\), where \(J\) represents the total number of iterations [31; 32; 33]. The PSO algorithm updates the position of the \(m\)-th particle as follows:  
\[\mathbf{p}_{m}^{(j)}=\mathbf{p}_{m}^{(j-1)}+\mathbf{v}_{m}^{(j)}\,, \tag{26}\]  
where \(\mathbf{v}_{m}^{(j+1)}\) is the rate of the next movement used to obtain its new position and is updated as follows:  
\[v_{m,d}^{(j)}=\sigma\cdot v_{m,d}^{(j-1)}+z_{1}\cdot r_{m,d,1}^{(j)}\cdot \left(p_{m,d}^{best}-p_{m,d}^{(j-1)}\right)+z_{2}\cdot r_{m,d,2}^{(j)}\cdot \left(\delta_{d}^{best}-p_{m,d}^{(j-1)}\right),\;d=1,2,\ldots,D, \tag{27}\]where \(\mathbf{p}_{m}^{best}=\big{[}p_{m,1}^{best},p_{m,2}^{best},\ldots,p_{m,D}^{best} \big{]}\in\mathbb{R}^{D}\) is the position corresponding to the best solution that has been found by the \(m\)-th particle and \(\mathbf{g}^{best}=\big{[}g_{1}^{best},g_{2}^{best},\ldots,g_{SD}^{best}\big{]} \in\mathbb{D}^{N}\) is the position of the best particle in the whole swarm [31; 32; 33]. In addition, \(\sigma\in(0,1)\) denotes the inertia weight controlling the momentum effect for preserving the velocity, and \(z_{1}\) and \(z_{2}\) are the coefficients controlling the ability to learn from the local components and the whole swarm, respectively. \(r_{m,d,1}^{(j+1)}\) and \(r_{m,d,2}^{(j+1)}\) are random numbers that are uniformly distributed in the range of \([0,1]\). Next, we devised a method to obtain the optimal solution to problem \(\mathbf{P}_{1}\), which consists of finding the optimal UAV altitude (\(h\)) based on the PSO algorithm for the one-dimensional problem, i.e., \(D=1\), detailed as follows: At the \(j\)-th iteration, the \(m\)-th particle has altitude \(p_{m}^{(j)}\) and velocity \(v_{m}^{(j)}\), where \(p_{m}^{(j)}\) must satisfy \(p_{m}^{(j)}\in[H_{\min},H_{\max}]\). For a given altitude \(p_{m}^{(j)}\), the optimal waveform \(\mathbf{X}^{\star}(p_{m}^{(j)})\) and scaling factor \(\gamma^{\star}(p_{m}^{(j)})\) can be obtained by solving problem \(\mathbf{P}_{2}^{\forall h}\) with \(h=p_{m}^{(j)}\).