## 4 Proposed Efficient Design for Transmit Waveform and UAV Altitude
Similar to the procedure in Algorithm 1 in Section 3.2, by finding the optimal UAV altitude (\(h\)) based on the PSO algorithm for the one-dimensional problem, we developed a method to optimize the proposed waveform, detailed as follows: In the PSO algorithm, the \(m\)-th particle has altitude \(p_{m}^{(j)}\) and velocity \(v_{m}^{(j)}\) at the \(j\)-th iteration. For a given altitude \(p_{m}^{(j)}\), the optimal weighting factor vector \(\mathbf{w}^{\star}(p_{m}^{(j)})\) and scaling factor \(\gamma^{\star}(p_{m}^{(j)})\) can be obtained either by applying (55) and (56) or by numerically solving problem \(P_{7}^{y_{th}}\). If the obtained \(\mathbf{w}^{\star}(p_{m}^{(j)})\) from (55) satisfies constraints (57) and (58), then we use \(\mathbf{w}^{\star}(p_{m}^{(j)})\) and \(\gamma^{\star}(p_{m}^{(j)})\) obtained from (55) and (56) in order to further reduce the computational complexity. Otherwise, we must obtain \(\mathbf{w}^{\star}(p_{m}^{(j)})\) and \(\gamma^{\star}(p_{m}^{(j)})\) by solving problem \(\mathbf{P}_{7}^{y_{h}}\). Here, the fitness function, denoted by \(f_{\text{Fit}}(p_{m}^{(j)})\), is given by  
\[\quad-\big{(}2\frac{\rho}{L}\sum_{l=1}^{L}\chi(\theta_{l}) \mathbf{c}_{\text{Rad},l}^{T}\big{)}\gamma+2\frac{\rho}{L}\sum_{l=1}^{L}b_{ \text{Rad},l}\mathbf{c}_{\text{Rad},l}^{T}\big{)}\]3  
Then, the altitude \(p_{m}^{(j)}\) and velocity \(v_{m}^{(j)}\) are updated by minimizing \(f_{\text{Fit}}^{\text{Prop}}(p_{m}^{(j)})\). Accordingly, we can obtain the optimal altitude, \(h_{\text{Prop}}^{\star}=g^{best}\), based on the PSO algorithm. Finally, we obtain the optimal weighting factor vector (\(\mathbf{w}^{\star}(h_{\text{Prop}}^{\star})\)) and scaling factor (\(\gamma^{\star}(h_{\text{Prop}}^{\star})\)) and then determine the proposed waveform, \(\mathbf{X}_{\text{Prop}}^{\star}\), using (37). The detailed procedure of the proposed method is described in Algorithm 2. ```
1:Input: A sampled angle grid \([\theta_{l}]_{l=1}^{L}\) and a desired transmit beam pattern \(\chi(\theta_{l})\), parameters on the channel statistics (\(a_{1},b_{1},a_{2},b_{2},a_{3},b_{3}\)), minimum and maximum altitude of \(H_{\text{min}}\) and \(H_{\text{max}}\), sum power constraint \(P_{T}\), all EHDs' horizontal distance, LoS component, and desired power, i.e., \(\big{[}r_{u},\mathbf{a}_{u},P_{u}^{\text{Des}}>0\big{]}_{u=1}^{U}\), coefficients for PSO algorithm (\(\sigma,z_{1},z_{2}\))
2:Obtain \(\mathbf{X}_{\text{Rad}}\) by solving problem \(\mathbf{P}_{5}\)
3:Compute \(b_{\text{Rad},l}\) and \(\mathbf{c}_{\text{Rad},l}\) (\(\forall l\in\mathcal{L}\)) from (42) and (43), respectively
4:for Particles \(m=1,2,\ldots,M\)do
5: Initialize \(p_{m}^{(0)}=H_{\text{min}}+r_{m}^{(0)}(H_{\text{max}}-H_{\text{min}})\) and \(v_{m}^{(0)}=0\)
6: Initialize \(p_{m}^{best}\gets p_{m}^{(0)}\)
7: Compute \(b_{\text{WPT},u}(p_{m}^{best})\) and \(\mathbf{c}_{\text{WPT},u}(p_{m}^{best})\) (\(\forall u\in\mathcal{U}\)) from (45) and (46), respectively
8: Compute \(\mathbf{w}^{\star}(p_{m}^{best})\) from (55)
9:if\(\mathbf{w}^{\star}(p_{m}^{best})\) satisfies (57) and (58) then
10: Compute \(\mathbf{\gamma}^{\star}(p_{m}^{best})\) from (56)
11:else
12: Solve problem \(\mathbf{P}_{7}^{y_{h}}\) with a given \(h=p_{m}^{best}\) and obtain \(\mathbf{w}^{\star}(p_{m}^{best})\) and \(\gamma^{\star}(p_{m}^{best})\)
13:endif
14: Compute the fitness function value \(f_{\text{Fit}}^{\text{Prop}}(p_{m}^{best})\) from (59)
15:endfor
16:Initialize \(g^{best}\leftarrow\arg\min\limits_{[p_{m}^{best}]_{M}}f_{\text{Fit}}^{\text{Prop }}(p_{m}^{best})\)
17:for Iterations \(j=1,2,\ldots,J\)do
18:for Particles \(m=1,2,\ldots,M\)do
19: Update \(v_{m}^{(j)}\) and \(p_{m}^{(j)}\) from (27) and (26), respectively.