# Secure On-Off Transmission in UAV Relay-Assisted mmWave Networks
## 2 System Model
### Antenna and Beam Alignment Error Model  
To compensate high path loss of mmWave signals, we assume that the directional antenna arrays are deployed at all nodes. A 3D sectorized antenna model is adopted to approximate the antenna gain pattern [28; 29], and the diagram is given as Figure 2. More specifically, the antenna gain between node \(i\) and \(j\) is expressed as \(G_{ij}\in\left\{G_{M}^{i}G_{M}^{j},G_{M}^{j}C_{m}^{j},G_{m}^{i}G_{M}^{j},G_{m} ^{i}G_{m}^{j}\right\}\) with probability \(\left\{P_{M}^{i}p_{M}^{j},P_{M}^{i}p_{m}^{j},P_{m}^{i}p_{M}^{j},P_{m}^{i}p_{m} ^{i}p_{m}^{j}\right\}\), where \(i,j\in\left\{S,R_{0},D,E_{\epsilon}\right\}\) denote the source, the selected UAV relay, the destination or the eavesdropper at location \(e\), \(G_{M}^{i}\left(G_{m}^{i}\right)\) represents the array gain of the main lobe (side lobe) at node \(i\), and \(P_{M}^{i}\left(P_{m}^{i}\right)\) is the probability that the array gain \(G_{M}^{i}\left(G_{m}^{i}\right)\) occurs. In the scenario without beam alignment error, we assume that the legitimate nodes can adjust their antenna orientations and align to each other. Then, for the selected UAV relay \(R_{0}\), the maximum of beam depression angle is calculated as \(\theta_{\max}=2\arctan\left(Q/H\right)\), and the probability that the ground eavesdroppers fall in the main lobe of UAV relay can be expressed as \(P_{M}^{R_{0}}=\theta_{a}^{R}\theta_{d}^{R}/\pi\theta_{\max}\), where \(\theta_{a}^{R}\) and \(\theta_{d}^{R}\) are the azimuth angle and depression angle of the UAV relay, respectively. Moreover, the probability that the eavesdropper \(E_{\epsilon}\) aligns to the selected UAV relay can be written as \(P_{M}^{E_{\epsilon}}=\theta_{a}^{E}\theta_{d}^{E}/\left(\pi\left(\pi-\theta_{ d}^{E}\right)\right)\), where \(\theta_{a}^{E}\) and \(\theta_{d}^{E}\) are the azimuth and elevation angles of the eavesdropper. Accordingly, we can obtain \(P_{m}^{R_{0}}=1-P_{M}^{R_{0}}\) and \(P_{m}^{E_{\epsilon}}=1-P_{M}^{E_{\epsilon}}\).  
We consider that the legitimate nodes \(S\), \(R_{x}\) and \(D\) will estimate the angles of arrival and departure, and adjust the antenna steering orientations to obtain the maximum directive gains. However, due to the errors in angles estimations, the beam alignment error is inevitable in practical applications. In this paper, the 3D antenna gain is adopted in which the beam alignment occurs when the main lobe of the antenna array aligns the target in both azimuth and elevation. We denote the beam alignment error in the azimuth (elevation) at node \(k\in\left\{S,R_{0},D\right\}\) as \(\varepsilon_{a}^{k}\left(\varepsilon_{d}^{k}\right)\), and the errors are modeled as independent Gaussian-distributed variables with zero mean [23; 30]. For simplicity, we assume that the variances of the beam alignment errors in the azimuth and elevation at node \(k\) are same, denoting as \(\sigma_{k}^{2}\). Thus, the cumulative distribution functions (CDFs) of \(\left|\varepsilon_{a}^{k}\right|\) and \(\left|\varepsilon_{d}^{k}\right|\) are expressed as \(F_{\left|\varepsilon_{a}^{k}\right|}\left(x\right)=F_{\left|\varepsilon_{a}^{k} \right|}\left(x\right)=erf\left(x/\left(\sqrt{2}\sigma_{k}\right)\right)\), where \(erf\left(\cdot\right)\) is the error function.