# A Collaborative UAV-WSN Network for Monitoring Large Areas
## 2 Materials and Methods
### Trajectory Design for Data Gathering
Then, inclusion (11):  
\[\widetilde{\Theta}(\mathsf{B}_{\mathsf{d}}(\mathsf{t}),\mathsf{P})\in\{w_{ \mathsf{k}}\}\oplus\mathsf{S}_{\mathsf{k}},\ \forall\mathsf{t}\in\left[\mathsf{t}_{k}^{-},t_{k}^{+}\right],\forall\mathsf{k }=0\ldots\mathrm{N}, \tag{11}\]  
denotes the fact the trajectory spends enough time (in the interval \(\left[t_{k}^{-},t_{k}^{+}\right]\), such that \(t_{k}^{+}-t_{k}^{-}\geq t_{min}\) with \(t_{min}\) an a priori fixed minimal time interval) near each of its cluster heads (characterized by position \(w_{k}\) and communication region \(S_{k}\)). Condition (11) is impractical since it requires the trajectory validation along a continuous time interval (i.e., \(t\in\left[t_{k}^{-},t_{k}^{+}\right]\)). To alleviate this issue we consider a sampling of the time interval by choosing \(\{t_{0}\leq\widetilde{t}_{0},\ldots\widetilde{t}_{\widetilde{N}}\}\subset[t_ {0},t_{N}]\). **Remark 1**. : _Choosing the sampling time interval (\(\widetilde{t}_{k+1}-\widetilde{t}_{k}\)) is an important prerequisite: taking the step too large makes the problem formulation too rigid and taking it too small needlessly increases the computational complexity. For an appropriate choice, both the dimension of the sensing regions \(S_{k}\) and the bounds on the UAV's velocity need to be taken into account._  
The inclusion constraint (8) is discretized along the sampling instants and becomes:  
\[\widetilde{\Theta}\big{(}\mathsf{B}_{\mathsf{d}}\big{(}\widetilde{\mathsf{t }}\big{)},\mathsf{P}\big{)}\in\{w_{\mathsf{k}}\}\oplus\mathsf{S}_{\mathsf{k} }\oplus\ \{\mathrm{M}\widetilde{\alpha}_{\mathsf{k}j}\},\forall\mathsf{k}=0\ldots \mathrm{N}, \tag{12}\]  
where \(\widetilde{\alpha}_{k,j}\in\{0,1\}\) are binary variables associated to the k-th sensing region \(S_{k}\) and the j-th sampling time \(\widetilde{t}_{j}\) and \(\mathrm{M}\) is a diagonal matrix of appropriate size whose diagonal entries are sufficiently large. Variables \(\widetilde{\alpha}_{k,j}\) can be either \"0\" or \"1\": whenever it is \"0\" we have that the constraint is verified and whenever is '1' the constraint is ignored (due to the presence of the \"big-M\" term). **Remark 2**. : _Note that we do not specify when should the constraint be validated (we do not fix \(t_{k}^{-}\) and \(t_{k}^{+}\)). (11) holds (or not), depending on the value taken by the associated binary variable \(\widetilde{\alpha}_{k,j}\)._  
**Proposition 1** [5]. : _For the given way-point and time-stamps collections (7), condition (8) is validated if:_  
\[\sum_{\mathsf{j}=0}^{\widetilde{\mathrm{N}}}(1-\widetilde{\alpha}_{\mathsf{k },j})\cdot(\widetilde{\mathsf{t}}_{\mathsf{j}+1}-\widetilde{\mathsf{t}}_{ \mathsf{j}})>\mathsf{t}_{\mathsf{min}},\forall\mathsf{k}=0\ldots\mathrm{N}, \tag{13}\]  
_where \(\widetilde{t}_{j}\) and \(\widetilde{\alpha}_{k,j}\) are taken as in (12)._  
Proposition 1 does not ensure that the time instants selected through the binary variables \(\alpha_{k,j}\) are contiguous. To solve this issue, we impose additional constraints on the binary variables. **Corollary 1**. : _To ensure that a contiguous time interval of \(\tau\) time instants is selected by (13) we consider the following inequalities (14)-(17):_  
\[\alpha_{k,j} =\beta_{k,j}-\gamma_{k,j}, \tag{14}\] \[\beta_{k,1} \leq\ldots\leq\beta_{k,\widetilde{N}}, \tag{15}\]\[\gamma_{k,1}\leq\ldots\leq\gamma_{k,\widetilde{N}}, \tag{16}\] \[\gamma_{k,j-\tau}\leq\beta_{k,j}, \tag{17}\]  
_for all \(k=0,\ldots,N\) and for all \(j=0,\ldots,\widetilde{N}\)._  
Proof. : (15) and (16) ensure that the binary variables are ordered along the time samples. That is, for each sequence \((\{\beta_{k,1}\ldots\beta_{k,\widetilde{N}}\})\) and \(\{\gamma_{k,1}\ldots\gamma_{k,\widetilde{N}}\})\), once there is a switch from \"0\" to \"1\", the value can no longer be changed. (17) ensures that the switch from \"0\" to \"1\" happens at latter time for \(\gamma\): if the sequence of variables \(\beta\) becomes \"1\" at index \(k\) then \(\gamma\) can become \"1\" no earlier than index \(k+\tau\).