# Joint Optimization of Relay Communication Rates in Clustered Drones under Interference Conditions
## 5 Joint Optimization Scheme for Communication Rate
### Optimization of Power Allocation Factor for Cluster Drones
Initialize the optimal value storage space \(\aleph\), the current iteration count \(c=1\), the maximum number of iterations \(c_{\max}\), and the precision \(\mu\). 0: Output:\(U^{*}\), \((P^{R})^{*}\), \(Q^{(c-1)*}\), \(\lambda^{(c-1)*}\). 1: Input the coordinates of the cluster drones, the relay drone, the jammer, the ground station, and constraints such as the BER threshold to calculate the initial feasible solution \(P^{R,(0)}\), \(Q^{(0)}\), \(\lambda^{(0)}\), and \(U^{(0)}\). Initialize the optimal value storage space \(\aleph\), the current iteration count \(c=1\), the maximum number of iterations \(c_{\max}\), and the precision \(\mu\). 2:\(While((c\leq c_{\max})\&\&(\tau\leq\mu))\)
3: Optimize the modulation method of the relay drone:
4: Initial value of input \((P^{R})^{(c-1)*}\), \(Q^{(c-1)*}\), \(\lambda^{(c-1)*}\). 5: Apply the Mosek toolkit to compute problem \(C_{3}\) and obtain a Suboptimal solution for the relay drone modulation method \(U^{(c)*}\). 6: Updating the suboptimal solution for the relay drone modulation method obtained in the \((c-1)\)th round of iterations \(U^{(c)*}\). 7: Optimize the transmission power of the relay drone:
8: Initial value of input \(U^{(c)*}\), \(Q^{(c-1)*}\), \(\lambda^{(c-1)*}\). 9: From Equation (52), the transmission power constraint corresponding to the BER threshold is calculated. 10: Use the CVX toolkit to solve problem \(C_{5}\) and obtain the suboptimal solution \(P^{R,(c)*}\) for the transmission power of the relay drone. 11: Update the suboptimal solution \(P^{R,(c)*}\) for the relay drone's transmission power obtained in the \((c)\)th round of iteration. 12: Optimize the three-dimensional trajectory of the relay drone's transmission:
13: Initial value of input \(U^{(c)*}\), \(P^{R,(c)*}(k)\), and \(\lambda^{(c-1)*}\). 14: Input the two-hop channel gain value obtained by solving in the previous iteration and calculate the value of expressions \(a_{i}\) and \(b_{i}\) according to Equation (60) and Equation (61). 15: Rewriting the objective function from Equation (59) yields \(\varphi_{q}^{(c)}\). 16: Calculate the values of the derivatives of \(\sqrt{H_{i}^{u,(c)}(k)H^{u,(c)}(k)}\) with respect to \(Q(k)\) in three different dimensions to obtain \(Q_{i}^{c},Q_{Y}^{c},Q_{Z}^{c}\), and calculate the first-order Taylor expansion expression to obtain \(\sqrt{H_{i}^{u,(c)}(k)H^{u,(c)}(k)}\). 17: Substituting the first-order Taylor expansion expression into problem \(C_{7}\) collates problem \(C_{8}\). 18: Use the CVX toolbox to solve problem \(C_{8}\) and obtain the suboptimal solution \(Q^{(c)*}\) for the three-dimensional trajectory of the relay drone. 19: Update the suboptimal solution \(Q^{(c)*}\) for the three-dimensional trajectory of the relay drone obtained in the \((c)\)th round of iteration. 20: Optimize the power allocation factor for cluster drones:
21: Initialize value of input \(U^{(c)*}\), \(P^{R,(c)*}(k)\), and \(Q^{(c)*}\). 22: Group the cluster drones to obtain user sets for different subcarriers \(U^{u}\). 23: Calculate and rank the signal-to-noise ratios of the cluster drones within each group reaching the relay drone to determine the order of channel gains \(\left\{A_{i,R}^{R}{


```
0: Referring to the channel gain order, rewriting the objective function according to Equation (67) yields \(\widehat{\varphi}^{(c)}\). 0: Use the CVX toolbox to solve problem \(C_{9}\) and obtain the suboptimal solution \(\lambda^{(c)*}\) for the power allocation factor of cluster drones. 0: Update the suboptimal solution \(\lambda^{(c)*}\) for the power allocation factor of cluster drones obtained in the \((c)\)th round of iteration. 0:\(\aleph^{(c)}=[U^{(c)*},(P^{R})^{(c)*},Q^{(c)*},\lambda^{(c)*}]\). 0: Calculate \(\tau^{(c)}=\big{|}R_{S}^{C,(c)}-R_{S}^{C,(c-1)}\big{|}\). 0:\(c=c+1\), \(\tau=\tau^{(c)}\). 0: End While
```

**Algorithm 2**_Cont._

## 6 Experimental Simulation

To verify the joint optimization effect of the communication rate for cluster drones under interference conditions as proposed in this paper, two comparative experiments were set up.