## 5 Pollutant Source Localization
### Likelihood Map for Source Localization  
Following the work presented in Reference [25], a Likelihood Map for the Location of the Source (LMLS) was created. This methodology assumes that the UAV can measure or estimate the pollutant concentration and the wind velocity at its current position.  
The LMLS construction is based on the Bayesian methodology. In this algorithm, the first step is to create the LMLS representation, dividing in cells the targeted environment. Let us denote the \(X\) and \(Z\) axis, according to the environment shown in Figure 5. Splitting the total area of the environment in rectangular cells, with longitudes \(L_{x}\) and \(L_{z}\), in the \(X\) and \(Z\) directions respectively, the \(m\times n\) cellular subdivisions can be obtained. The resulting cells are defined by the vector \(C=[C_{1},...,C_{M}]\), where \(M=m\times n\), and the element \(C_{i}\) represents the position \((x_{i},z_{i})\) of the center of the cell \(i\).  
The goal of this step in the algorithm is to estimate a vector \(\alpha_{i}\) that represents the probability of the source location at cell \(C_{i}\)\(\epsilon\)\(C\). In this work, a unique source is assumed to exist, that is, \(P(\alpha_{i})=1\).  
Let \(A_{i}\) be the event of a source being located in cell \(C_{i}\) when the UAV, which is on cell \(C_{j}\), detects (event \(D_{j}(t_{q})\)) or not (event \(\bar{D}_{j}(t_{q})\)) the pollutant at time \(t_{q}\). Note that the sensor information is binary, which is defined by using a threshold, and with this information define a vector of events, e.g., \(B(t_{q-1})=\{D_{j1}(t_{q-1}),\bar{D}_{j2}(t_{q-2}),\,...,D_{jq}(t_{0})\}\) of detection and non-detection events from \(t_{0}\) to \(t_{q-1}\). Let \(\{\alpha(t_{q-1})=P(A_{i}|B(t_{q-1}))\}_{i=1}^{M}\) represent the LMLS based on detection and non-detection events \(B(t_{q-1})\) between time \(t_{0}\) and \(t_{q-1}\). The aim is to update the probabilities in \(A\) using the events in \(B\). Figure 6 summarizes how to update \(\alpha_{i}\) recursively, including the historical events and the Bayesian methodology.  
Figure 5: Cells representation of the splitted targeted area.  
In Figure 6, to update \(\alpha_{i}\), the detection \(D\) and non-detection \(\tilde{D}\) events are included as follows:  
\[P(A_{i}|B(t_{q-1}),D_{j}(t_{q}))=M\alpha_{i}(t_{q-1})\beta_{ij}(t_{0},t_{q}) \tag{21}\] \[P(A_{i}|B(t_{q-1}),\tilde{D}_{j}(t_{q}))=\frac{\alpha_{i}(t_{q-1} )\gamma_{ij}(t_{0},t_{q})M}{\Sigma_{i=1}^{M}\gamma_{ij}(t_{0},t_{q})} \tag{22}\]  
where  
\[\beta_{ij}(t_{0},t_{q}) = \frac{1}{q}\Sigma_{l=0}^{q-l}S_{ij}(t_{l},t_{q}) \tag{23}\] \[\gamma_{ij}(t_{0},t_{q}) = \Pi_{l=0}^{q-1}[1-\mu S_{ij}(t_{l},t_{q})] \tag{24}\]  
\[S_{ij}(t_{l},t_{q})=\frac{e^{\frac{(t_{j}-x_{i}-x_{j}(t_{j}t_{q}) )^{2}}{2(q_{q}-t_{j})\sigma_{x}^{2}}}e^{\frac{(t_{j}-x_{i}-x_{j}(t_{j}t_{q}))^ {2}}{2(q_{q}-t_{j})\sigma_{x}^{2}}}}{2\pi(t_{q}-t_{l})\sigma_{x}\sigma_{z}}L_{ x}L_{z}\]  
and  
\[V(t_{l},t_{q})=\Sigma_{i=1}^{q-1}U(P_{uav}(t_{i}))dt \tag{26}\]  
where \(U(P_{uav}(t_{i}))\) herein represents the wind velocity measured by the UAV at the time \(t_{i}\) and \(\mu\) is the probability of detecting pollutant in cell \(C_{j}\) given that there is a detectable pollutant in that cell. Further explanations are presented in Reference [25], including the deductions of each equation and the optimization of the numerical processing.