# Secure Beamforming Design for UAV-Empowered Integrated Sensing and Communication
## 3 Joint Optimization Algorithm
### Joint Beamforming and UAV Positioning Optimization  
As detailed in Algorithm 3, the proposed alternating iterative algorithm for the UAV-assisted ISAC system repeatedly optimizes the joint beamforming and UAV positioning until the objective function converges or the prescribed maximum number of iterations is reached.  
```
Input:\(\sigma_{k}^{2},\sigma_{e}^{2},P_{\text{max}},\mathbf{u}_{k},\mathbf{e}_{j},\Gamma_{k}^ {\text{com}},\Gamma_{e}^{\text{sen}},o_{\text{max}}\) Output:\(\mathbf{\omega}_{k}^{\sigma},\forall k,\mathbf{\omega}_{n}^{\tau},\forall n\) and \(\mathbf{q}^{*}\)
1. Initialize iteration count \(o=1,\mathbf{q}^{(0)}\).
2. Repeat.
3. Given the initial UAV position \(\mathbf{q}^{(o-1)}\), update \(\mathbf{\omega}_{k}^{\epsilon\ (o)},\forall k\) and \(\mathbf{\omega}_{n}^{\tau}\ (o),\forall n\) using Algorithm 1.
4. Given the transmitting beamforming \(\mathbf{\omega}_{k}^{\epsilon\ (o)},\forall k\) and \(\mathbf{\omega}_{n}^{\tau\ (o)},\forall n\), update \(\mathbf{q}^{(o)}\) using Algorithm 2.
5.\(o=o+1\).
6. Until: the objective function value of P1 converges or \(o>o_{\text{max}}\).
```  
**Algorithm 3** Joint beamforming and UAV positioning optimization  
Subsequently, we examine the convergence and computational complexity of the iterative optimization algorithm for beamforming and UAV positioning.  
1. Convergence: Define \(\mathbf{\omega}_{k}^{c}\) (\({}^{l}\)), \(\forall k\), \(\mathbf{\omega}_{n}^{r}\) (\({}^{l}\)), \(\forall n\), and \(\mathbf{q}^{(l)}\) as the \(l\)-th iteration solutions of Algorithm 3, and let the objective function of problem P1 be denoted as \(f\Big{(}\mathbf{\omega}_{k}^{c}\ ({}^{l}),\mathbf{\omega}_{n}^{r}\ ({}^{l}),\mathbf{q}^{(l)}\Big{)}\). In Step 3 of Algorithm 3, by fixing \(\mathbf{q}^{(l)}\), we obtain \(\mathbf{\omega}_{k}^{c}\ ({}^{l+1}),\forall k\) and \(\mathbf{\omega}_{n}^{r}\ ({}^{l+1}),\forall n\), thus: \[f\Big{(}\mathbf{\omega}_{k}^{c}\ ({}^{l+1}),\mathbf{\omega}_{n}^{r}\ ({}^{l+1}),\mathbf{q}^{(l)} \Big{)}\leq f\Big{(}\mathbf{\omega}_{k}^{c}\ ({}^{l}),\mathbf{\omega}_{n}^{r}\ ({}^{l}),\mathbf{q}^{(l)} \Big{)}\] (40) Similarly, in Step 4 of Algorithm 3, we obtain: \[f\Big{(}\mathbf{\omega}_{k}^{c}\ ({}^{l+1}),\mathbf{\omega}_{n}^{r}\ ({}^{l+1}),\mathbf{q}^{(l+1)} \Big{)}\leq f\Big{(}\mathbf{\omega}_{k}^{c}\ ({}^{l+1}),\mathbf{\omega}_{n}^{r}\ ({}^{l+1}),\mathbf{q}^{(l)} \Big{)}\] (41) In summary, we can deduce: \[f\Big{(}\mathbf{\omega}_{k}^{c}\ ({}^{l+1}),\mathbf{\omega}_{n}^{r}\ ({}^{l+1}),\mathbf{q}^{(l+1)} \Big{)}\leq f\Big{(}\mathbf{\omega}_{k}^{c}\ ({}^{l}),\mathbf{\omega}_{n}^{r}\ ({}^{l}),\mathbf{q}^{(l)} \Big{)}\] (42) This demonstrates that the value of the objective function remains non-increasing throughout the iterative process, thereby guaranteeing the convergence of the alternating iterative optimization algorithm.
2. Complexity: In Algorithm 3, we solve all subproblems using CVX. The first subproblem is a SDR problem, and the second subproblem is a SCA problem. The algorithmic complexities of the two subproblems are \(\mathcal{O}\Big{(}L\log(1/\epsilon)(2K+N)^{3.5}\Big{)}\) and \(\mathcal{O}\Big{(}L(2K+2)^{3}\Big{)}\), respectively [12], where \(L\) denotes the number of iterations required for the algorithm to achieve convergence, and \(\epsilon\) represents the convergence accuracy of the algorithm. Consequently, the worst-case computational complexity of Algorithm 3 is \(\mathcal{O}\Big{(}L\log(1/\epsilon)(2K+N)^{3.5}+L(2K+2)^{3}\Big{)}\).