# Resource Allocation of UAV-Assisted IoT Node Secure Communication System
## 2 System Model and Problem Formulation  
### System Model  
As shown in Figure 1, three IoT nodes (one destination node, \(DN\), and two energy nodes, \(EN_{1}\), \(EN_{2}\)) equipped with SWIPT technology are considered. The UAV flies from the initial position to the final position and transmits confidential information to \(DN\) by the main link \((S-D)\). Meanwhile, all nodes could harvest energy. We maximize the information security transmission capacity by optimizing the trajectory and transmission power of the UAV, the PSR of the nodes. The power of the information and the harvested energy of \(EN_{1}\), \(EN_{2}\) are constrained to improve the information security and balance energy collection. The horizon coordinates of \(DN\) are given by \(\mathbf{w}_{SD}=[x_{SD},y_{SD}]^{T}\in\mathbf{R}^{2\times 1}\), and \(EN\) is located at \(\mathbf{w}_{SEk}=[x_{SEk},y_{SEk}]^{T}\in\mathbf{R}^{2\times 1},\forall k\in K= \{1,2\}\). The UAV is assumed to fly at an allowable relatively fixed height \(H\). Its flight time is \(T\), so its time-varying coordinates are expressed as \(\mathbf{q}[t]=[x(t),y(t)]^{T}\in\mathbf{R}^{2\times 1}\). The take-off time and landing time are neglected. The initial position \(\mathbf{q}_{0}\) and final position \(\mathbf{q}_{F}\) are supposed to be known [4]. The flight time \(T\) is divided into \(N\) time slots; i.e., \(t=n\delta_{t},\quad n=1,\ldots,N\), \(\delta_{t}\) is the duration of each time slot. The maximum flight distance of the UAV in each time slot is \(S_{max}\). Let the PSR be denoted by \(\xi[n]\), where \(0\leq\xi[n]\leq 1\)[14]. The constraints are as follows:  
\[ \begin{split}\mathbf{q}[1]=\mathbf{q}_{0}\quad\mathbf{q}[N+1]= \mathbf{q}_{F}\\ \|\mathbf{q}[n+1]-\mathbf{q}[n]\|^{2}\leq S_{\max}^{2}\,n=\{1, \ldots,N\}\end{split}  \tag{1}\]Motivated by [9, 10], we adopt a channel model in which both line-of-sight (LoS) and non-LoS propagations are considered. By averaging the surrounding environments and small-scale fading, the expected channel power of the UAV-ground (UG) link is [9]  
\[h_{ug}(t)=\bar{\beta}d_{ug}(t)^{-\alpha} \tag{2}\]  
where \(d_{ug}(t)\) denotes the time-varying distance between the UAV and the ground node \(g\). Additionally, \(u\in\{S\},g\in\{D,E\},\alpha\) denotes the path-loss exponent \((2\leq\alpha\leq 4)\). Then \(\bar{\beta}\) is the environmental constants following homogeneity. Let \(p[n]\) denote the UAV transmission power in the \(n\)th time slot, and the transmit power constraint is  
\[\frac{1}{N}\sum_{n=1}^{N}p[n]\leq\bar{P}\quad 0\leq p[n]\leq P_{\max} \tag{3}\]  
where the average power is \(\bar{P}\) and the maximum power is \(P_{\max}\), \(\bar{P}\leq P_{\max}\). The harvested energies of \(ENs\) and \(DN\) are denoted by \(E_{EH,k}[n]\) and \(E_{SD}[n]\), respectively:  
\[ \begin{split} E_{EH,k}[n]&=(1-\xi[n])\eta h_{EH,k} [n]p[n]=\frac{(1-\xi[n])\eta p[n]\bar{\beta}}{\left(\left\|\mathbf{q}[n]- \mathbf{w}_{SE,k}\right\|^{2}+H^{2}\right)^{\frac{\alpha}{2}}},\forall k\\ E_{SD}[n]&=(1-\xi[n])\eta h_{SD}[n]p[n]=\frac{(1- \xi[n])\eta p[n]\bar{\beta}}{\left(\left\|\mathbf{q}[n]-\mathbf{w}_{SD}\right\| ^{2}+H^{2}\right)^{\frac{\alpha}{2}}}\end{split}  \tag{4}\]  
where \(0<\eta\leq 1\) represents the energy conversion efficiency of \(EN\). The harvested information of \(EN_{s}\) is denoted by  
\[E_{IT,k}[n]=\xi[n]\eta h_{EH,k}[n]p[n]=\frac{\xi[n]\eta p[n]\bar{\beta}}{\left( \left\|\mathbf{q}[n]-\mathbf{w}_{SE,k}\right\|^{2}+H^{2}\right)^{\frac{\alpha} {2}}},\forall k \tag{5}\]  
Motivated by [10], the achievable information rates from the UAV to \(ENs\) and from the UAV to \(DN\) in bits/second/Hertz (\(\text{bps}/\text{Hz}\)) are denoted by \(R_{SE,k}[n]\) and \(R_{SD}[n]\), respectively. Additionally, \(\delta^{2}\) represents the noise power. \[