# Trajectory Optimization for UAV-Aided IoT Secure Communication Against Multiple Eavesdroppers +
## 3 Trajectory Optimization
### Change of Variables  
To overcome the non-convexity associated with direct UAV trajectory optimization, we reformulate the problem by discarding the direct treatment of the coordinate \(\mathbf{U}_{q}[n]\) as an independent variable. Instead, we iteratively refine the trajectory through incremental updates, representing each coordinate as a correction to the previous iteration's position \((x_{q}^{i-1}(n),\,y_{q}^{i-1}(n))\). Consequently, in the \(n^{th}\) time slot, the updated trajectory coordinate in the \(i^{th}\) iteration are given by  
\[x_{q}^{i}(n) =x_{q}^{i-1}(n)+\Delta x^{i-1}(n), \tag{13}\] \[y_{q}^{i}(n) =y_{q}^{i-1}(n)+\Delta y^{i-1}(n). \tag{14}\]  
Let \((\Delta x^{i}(n),\,\Delta y^{i}(n))\) denote the trajectory displacement increments at the \(n^{th}\) point during the \(i-1^{th}\) iteration in the positive \(x\) and \(y\) directions. For notational clarity, we define \(x_{q}^{0}=x_{q}^{i-1}(n),\,y_{q}^{0}=y_{q}^{i-1}(n)\), and introduce auxiliary rate variables \(\hat{R}_{g}^{i}(n)\) and \(\hat{R}_{k}^{i}(n)\). By applying a lower bound approximation of the legitimate receiver's rate around \((x_{q}^{0},\,y_{q}^{0})\), the transmission rate is approximated as  
\[\begin{split}\hat{R}_{g}^{i}(n)&\triangleq R_{g}^{i-1}(n)-f_{g}^{i-1}(n)\left[ \left(\Delta x^{i-1}(n)\right)^{2}+\left(\Delta y^{i-1}(n)\right)^{2}\right] \\ &\qquad-2(x_{q}^{0}-x_{g})\,f_{g}^{i-1}(n)\,\Delta x^{i-1}(n)\\ &\qquad-2(y_{q}^{0}-y_{g})\,f_{g}^{i-1}(n)\,\Delta y^{i-1}(n), \end{split}\] (15a) where \[f_{g}^{i-1}(n)=\frac{p}{\ln 2\left(\rho_{0}^{-1}\sigma^{2}d_{ug}^{i-1}(n)^{4 }+p\,d_{ug}^{i-1}(n)^{2}\right)}\geq 0. \tag{15b}\]  
Similarly, the concave lower bound approximation of the \(k^{th}\) eavesdropper's rate can be formulated as follows:  
\[\begin{split}\hat{R}_{k}^{i}(n)&\triangleq R_{k}^{i-1}(n)-f_{k}^{i-1}(n)\left[\left(\Delta x^{i-1}(n) \right)^{2}+\left(\Delta y^{i-1}(n)\right)^{2}\right]\\ &\qquad-2(x_{q}^{0}-x_{k})\,f_{k}^{i-1}(n)\,\Delta x^{i-1}(n)\\ &\qquad-2(y_{q}^{0}-y_{k})\,f_{k}^{i-1}(n)\,\Delta y^{i-1}(n), \end{split}\] (16a) where \[f_{k}^{i-1}(n)=\frac{p}{\ln 2\left(\rho_{0}^{-1}\sigma^{2}d_{uk}^{i-1}(n)^{4 }+p\,d_{uk}^{i-1}(n)^{2}\right)}\geq 0. \tag{16b}\]Furthermore, the UAV's mobility constraints are re-expressed as quadratic norm inequalities, as follows:  
\[\left\|\mathbf{U}_{q}[n]+Q(n)-\mathbf{U}_{q}[n-1]-Q(n-1)\right\|^{2} \leq(L_{max})^{2},\quad n=2,\ldots,N, \tag{17}\] \[\left\|\mathbf{U}_{q}[1]+Q(1)-\mathbf{U}_{q}[I]\right\|^{2} \leq(L_{max})^{2},\] (18) \[\left\|\mathbf{U}_{q}[F]-Q(N)-\mathbf{U}_{q}[N]\right\|^{2} \leq(L_{max})^{2}, \tag{19}\]  
\[\left\|\mathbf{U}_{q}(n+1)+Q(n+1)-2\mathbf{U}_{q}(n)-2Q(n)+ \mathbf{U}_{q}(n-1)\right.\] \[\left.+Q(n-1)\right\|_{2} \leq a_{\max}\cdot\delta_{t}^{2},\quad n=2,\ldots,N-1. \tag{20}\]  
where \(Q(n)=(\Delta x(n),\Delta y(n))\). Accordingly, in the \(i^{\text{th}}\) iteration, the lower bound of problem \(P0\) is reformulated as follows:  
\[\mathbf{P0^{(i)}} \tag{21}\] \[\text{s.t.}\quad R_{\hat{g}}^{i}(n)\leq\hat{R}_{\hat{g}}^{i}(n), \quad n=1,\ldots,N,\] (22) \[R_{k}^{i}(n)\leq\hat{R}_{k}^{i}(n),\quad k=1,\ldots,K,\quad n=1, \ldots,N,\] (23) \[\text{s.t.}\quad\eqref{eq:P0}-\eqref{eq:P0}.\]  
The lower bounds \(R_{g}^{i}(n)\) and \(\hat{R}_{k}^{i}(n)\), derived in Equations (15a) and (16a) are concave quadratic functions of the trajectory increment variables \((\Delta x,\Delta y)\). Consequently, under the increment-variable framework, the reformulated problem \(\mathbf{P0^{(i)}}\) satisfies the convexity requirements. Once expressed in a differentiable form, it can be efficiently solved using standard convex optimization techniques. In the subsequent section, hypograph theory is employed to transform \(\mathbf{P0^{(i)}}\) into a standard convex optimization problem.