# Multi-UAV Area Coverage Based on Relative Localization: Algorithms and Optimal UAV Placement
## 3 Materials and Methods
, \tag{11}\]  
\[\mathbf{K}_{\hat{s}_{k}^{i,j}}=\frac{\mathbf{\Sigma}_{\hat{s}_{k}^{i,j}}^{-}\mathbf{H}_{ \hat{s}_{k}^{i,j}}^{T}}{\mathbf{H}_{\hat{s}_{k}^{i,j}}^{\perp}\mathbf{\Sigma}_{\hat{s }_{k}^{i,j}}^{-}\mathbf{H}_{\hat{s}_{k}^{i,j}}^{T}+\mathbf{R}_{\hat{s}_{k}^{i,j}}}, \tag{12}\]  
\[\mathbf{\Sigma}_{\hat{s}_{k}^{i,j}}^{-}=\mathbf{F}_{\hat{s}_{k-1}^{i,j}}^{\perp}\mathbf{ \Sigma}_{\hat{s}_{k-1}^{i,j}}^{+}\mathbf{F}_{\hat{s}_{k-1}^{i,j}}^{T}+\mathbf{Q}_{\hat {s}_{k-1}^{i,j}}, \tag{13}\]  
\[\mathbf{R}_{\hat{s}_{k}^{i,j}}=E( \begin{bmatrix}\hat{r}_{k}^{i,j}\\ \mathbf{r}_{k}^{i,j}\end{bmatrix}\begin{bmatrix}\hat{r}_{k}^{i,j}\\ \mathbf{r}_{k}^{i,j}\end{bmatrix} ^{T}), \tag{14}\]  
\[\mathbf{Q}_{\hat{s}_{k-1}^{i,j}}=E( \begin{bmatrix}\hat{s}_{k-1}^{i,j}\\ \mathbf{\delta}_{k-1}^{i,j}\end{bmatrix}\begin{bmatrix}\hat{\mathbf{s}}_{k-1}^{i,j}\\ \mathbf{\delta}_{k-1}^{i,j}\end{bmatrix} ^{T}), \tag{15}\]  
\[\mathbf{H}_{\hat{s}_{k}^{i,j}}= \begin{bmatrix}\frac{\hat{\mathbf{\chi}}_{k}^{i,j}}{ \|\mathbf{\chi}_{k}\|_{1\times 2}}&0_{1\times 2}\\ 0_{2\times 2}&\mathbf{I}_{2\times 2}\end{bmatrix} . \tag{16}\]  
where \(\hat{\mathbf{s}}_{k}^{i,j}\) represents the estimation of \(\hat{\mathbf{s}}_{k}^{i,j}\) and the symbols \(-\) and \(+\) represent the predicted state and updated state, respectively. \(\mathbf{F}_{\hat{s}_{k-1}^{i,j}}\) is the state transition matrix of the predicted equation and \(\mathbf{K}_{\hat{s}_{k}^{i,j}}\) is the Kalman gain. \(\mathbf{\Sigma}_{\hat{s}_{k}^{i,j}}\) is the covariance matrix of \(\mathbf{s}_{k}^{i,j}\). \(\mathbf{R}_{\hat{s}_{k}^{i,j}}\) and \(\mathbf{Q}_{\hat{s}_{k-1}^{i,j}}\) are the Gaussian noise matrices of EKF Equations (9) and (10). \(\mathbf{H}_{\hat{s}_{k}^{i,j}}\) is obtained by linearizing the relative range \(r_{k}^{ij}\) and the measurement equation of a UAV's relative displacement. The updated value of state \(\hat{\mathbf{s}}_{k}^{i,j}\) can be obtained after computing Equations (9) and (10). The relative location covariance matrix update equation can be shown as  
\[\mathbf{\Sigma}_{\hat{\mathbf{s}}_{k}^{i,j}}^{+}=(\mathbf{I}-\mathbf{K}_{\hat{\mathbf{s}}_{k}^{i,j}} \mathbf{H}_{\hat{\mathbf{s}}_{k}^{i,j}})\mathbf{\Sigma}_{\hat{\mathbf{s}}_{k}^{i,j}}^{-}. \tag{17}\]  
After obtaining the relative location of every UAV, the global position estimation can be derived by using the KF algorithm. The system model can be described as follows:  
\[ \begin{cases}\mathbf{p}_{i,k}=\mathbf{p}_{i,k-1}+\mathbf{u}_{i}(k-1)+\mathbf{\varphi}_{i,k-1}, \\ \mathbf{z}_{i,k}=\sum\limits_{j\in N_{i}}C_{k}^{i,j}(\hat{\mathbf{p}}_{j,k}+\mathbf{\chi}_ {k}^{i,j})+\mathbf{\psi}_{i,k},\end{cases}  \tag{18}\]  
where \(C_{k}^{i,j}=\frac{\frac{T((\mathbf{\Sigma}_{\hat{\mathbf{\rho}}_{jk}}+\mathbf{\Sigma}_{ \hat{\mathbf{\chi}}_{k}^{i,j}})^{-1})}{\sum\limits_{m\in N_{i}}T((\mathbf{\Sigma}_{ \hat{\mathbf{\rho}}_{mk}}+\mathbf{\Sigma}_{\hat{\mathbf{\chi}}_{k}^{i,j}})^{-1})}}{\sum \limits_{m\in N_{i}}T((\mathbf{\Sigma}_{\hat{\mathbf{\rho}}_{mk}}+\mathbf{\Sigma}_{\hat{ \mathbf{\chi}}_{k}^{i,j}})^{-1})}\) is as belief weight for location estimation. The weight is obtained by calculating the trace of the estimation uncertainty matrix. \(\mathbf{z}_{i,k}\) represents the measurement equation used for global position estimation. \(\mathbf{\psi}_{i,k}\) is the measurement noise of UAV \(i\) and \(E(\mathbf{\psi}_{i,k}\mathbf{\psi}_{i,k}^{T})=\sum_{j\in N_{i}}C_{k}^{i,j}(\mathbf{\Sigma} _{\hat{\mathbf{\rho}}_{j,k}}+\mathbf{\Sigma}_{\hat{\mathbf{\chi}}_{k}^{i,j}})\).