1 Introduction

In the chemical, petrochemical, and other similar industries, many accidents may lead to leakage and diffusion of hazardous and harmful gases. Leaks in confined or isolated spaces will raise the concentration of gases, which causes poisoning, fire, or explosion. Thus, it is significant to monitor the distribution and diffusion states of gas pollutants in a confined space (Wang et al. 2017a; Saidi et al. 2011; Hou et al. 2017). Effective means of pollutant monitoring will provide reliable information for the elimination of accidents.

Gaussian model, Sutton model, and some other calculation models have been used to simulate the pollutant diffusion (Lushi and Stockie 2010; Arystanbekova 2004; Sportisse 2007; Shih et al. 2007; Ma and Zhang 2016). The establishment of these models can provide computational bases for gas diffusion and concentration distribution. The simulation with these models need reliable information of the pollutant source. However, it is usually unknown in the practice. The inversion problem is an effective numerical method to obtain the intensity of the source term (Haas Laursen et al. 1996; Shankar Rao 2007; Thomson et al. 2007). In general, the information measured in the diffusion section is provided to monitor the pollutant diffusion field, which is an ill-posed problem. There have been some inverse analysis methods to be adopted to treat with it.

Yang et al. (2008) proposed a global optimization method named chaos gray-coded genetic algorithm and used it to estimate the pollution source. Khlaifi et al. (2009) developed a method coupled the Gaussian model with genetic algorithm to obtain the inverse results of the pollution source, in which the genetic algorithm was used to optimize the errors between measurement information and the model outputs. Also, the Gaussian model coupled with genetic algorithm was used to identify the source intensity and location by Allen et al. (2007). Zhang and You (2014) proposed a CFD-based inverse design method combining the genetic algorithm and artificial neural network to design the aircraft cabin environment, which could reduce 57% of the computational costs. However, it needs a lot of computational costs for the inverse analysis of the indoor environment using genetic algorithm (Zhang and You 2014; Lu et al. 2016). Considering reducing the computational costs, Liu et al. (Liu et al. 2015) proposed an order-reduced CFD-based genetic algorithm method; however, it would lead to the decline of accuracy. Ristic et al. (2017) introduced the Rao-Blackwell dimension reduction technique into the estimation of the hazardous source’s posterior probability distribution function. It had generality to be applied in the source parameter identification. But the obstacle was that the proposed method cannot be used in the real-time estimation. Tikhonov regularization is a mature method for ill-posed problem (Pazos and Bhaya 2015; Mach et al. 2016). Ma et al. (2017) used the particle swarm optimization algorithm to optimize the Tikhonov regularization method. Then, combining the hybrid method and Gaussian model, the parameters of a continuous point pollutant source were estimated. Experimental results showed that this Tikhonov-PSO regularization method had good performance to realize the estimation of hazardous source. Wei et al. (2017) combined the Tikhonov-based matrix inversion and Bayesian model to realize the inverse estimation of the gaseous pollutant source. However, the key problem is that whether solving the inverse problem with the Tikhonov regularization method quickly and effectively or not depends on the selected regularization parameters. Usually, the regularization parameter is unknown (Chen et al. 2016; Yang et al. 2017).

As a real-time state estimation technique, Kalman filter has been widely used in many fields, such as thermal states estimation, charge states of battery, pollution states, vehicle motion states, and so on (Tran et al. 2014; Richardson and Howey 2015; Gao et al. 2016; Pan et al. 2017). However, it has been demonstrated that the Kalman filter is unstable even divergent in the state estimation. A hybrid method coupled Kalman filter and weighted recursive least squares algorithm could be used to simultaneously estimate the input source and system states with the initial estimation period of fluctuations (Chen and Hsu 2007).

In order to realize the real-time monitoring of the pollution states and pollutant source stably, the diffusion state equation is established based on the diffusion mechanism. Then, a coupled method based on fuzzy adaptive Kalman filter and weighted recursive least squares algorithm is adopted to realize the simultaneously monitoring process for pollution field and source in this paper. Besides, some simulations are completed to verify the effectiveness and the robustness to resist the ill-posedness of this technique.

2 Diffusion Model

2.1 Diffusion Equation of Pollution

In order to monitor the leak of gas pollutant in the confined space, some assumptions are made as follows:

(1) If the height of the space is much higher than the length and width, or the pollutant source is a uniform line type along the height direction, the diffusion in the limited space can be simplified as a two-dimensional problem and the leak source can be simplified as a point-like pollutant in the two-dimensional space. (2) Usually, in a confined space, it is static and windless. (3) The temperature field is uniform in the confined space, so the diffusion coefficient can be assumed as a constant. (4) There is no diffusion at the peripheral walls.

The assumptions were made to simplify the diffusion model. In many literatures, the pollutant transport is assumed to be governed by the atmospheric advection-diffusion equation (Liu and Zhai 2007). In a confined room, there is no wind and the advection term is zero. Thus, we adopted the diffusion equation as the model of this work. Combining the simplified assumptions, the coordinate system is established as Fig. 1a. The governing equation, initial and boundary conditions are listed as follows:

Fig. 1
figure 1

Simplified diffusion model and mesh division

$$ \frac{\partial C\left(x,y,\tau \right)}{\partial \tau }={D}_x\frac{\partial^2C\left(x,y,\tau \right)}{\partial {x}^2}+{D}_y\frac{\partial^2C\left(x,y,\tau \right)}{\partial {y}^2}+{S}_o\left(\tau \right)\delta \left(x-A,y-B\right) $$
(1)
$$ -{D}_x\frac{\partial C\left(x,y,\tau \right)}{\partial x}=0\kern0.5em x=0\kern0.5em \mathrm{and}\kern0.5em x= Lx $$
(2)
$$ -{D}_y\frac{\partial C\left(x,y,\tau \right)}{\partial y}=0\kern0.5em y=0\kern0.5em \mathrm{and}\kern0.5em y= Ly $$
(3)
$$ C\left(x,y,0\right)=0 $$
(4)

where C is the pollutant concentration; Dx and Dy are the diffusion coefficients of gas pollutant along x direction and y direction respectively; S is the source strength of the pollutant; (A, B) are the co-ordinates of the source.

2.2 Diffusion State Equation and Observation Equation

The diffusion section is meshed into m-1 and n-1 equal parts along the x and y directions respectively as shown in Fig. 1b. Each node at four corner represents a body whose length is Δx/2 with the width of Δy/2. Each node at the wall long x direction represents a body whose length is Δx with the width of Δy/2 while the node at the wall long y direction represents a body whose length is Δx/2 with the width of Δy. Any other node represents a body whose length is Δx with the width of Δy.

The intervals along x and y directions are as follows respectively:

$$ \Delta x=\frac{Lx}{m-1} $$
(5)
$$ \Delta y=\frac{Ly}{n-1} $$
(6)

The forward difference for the time derivative is taken to establish the discrete unsteady state equation of the diffusion process. The pollutant concentrations at all the nodes are adopted to be the state variables, which are listed as a column vector to consist the state vector. The result is shown as Eq. (7).

$$ {\boldsymbol{C}}^{k+1}=\boldsymbol{\varPhi} {\boldsymbol{C}}^k+\boldsymbol{\varPsi} {{\boldsymbol{S}}_{\boldsymbol{o}}}^k $$
(7)

where Ck is concentration column vector at kth time step; Sok is the strength of leaked pollutant at kth time step; Φ ∈ Rmn × mn is the state transition matrix; Ψ ∈ Rmn × n is the input matrix. The specific forms are as follows:

$$ {\displaystyle \begin{array}{l}{\boldsymbol{C}}^k={\left[{C}_{1,1}^k,{C}_{1,2}^k,\cdots, {C}_{1,n}^k,{C}_{2,1}^k,{C}_{2,2}^k,\cdots, {C}_{2,n}^k,\cdots, {C}_{m,1}^k,{C}_{m,2}^k,\cdots, {C}_{m,n}^k\right]}^T\\ {}\boldsymbol{\varPhi} ={\left[\begin{array}{lllllll}{\boldsymbol{\phi}}_1& {\boldsymbol{\phi}}_2& \mathbf{0}& \mathbf{0}& \cdots & \cdots & \mathbf{0}\\ {}{\boldsymbol{\phi}}_3& {\boldsymbol{\phi}}_1& {\boldsymbol{\phi}}_3& \mathbf{0}& \ddots & \vdots & \vdots \\ {}\mathbf{0}& {\boldsymbol{\phi}}_3& {\boldsymbol{\phi}}_1& \ddots & \ddots & \ddots & \vdots \\ {}\mathbf{0}& \mathbf{0}& {\boldsymbol{\phi}}_3& \ddots & \ddots & \ddots & \mathbf{0}\\ {}\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \mathbf{0}\\ {}\vdots & \vdots & \ddots & \mathbf{0}& {\boldsymbol{\phi}}_3& {\boldsymbol{\phi}}_1& {\boldsymbol{\phi}}_3\\ {}\mathbf{0}& \cdots & \cdots & \mathbf{0}& \mathbf{0}& {\boldsymbol{\phi}}_2& {\boldsymbol{\phi}}_1\end{array}\right]}_{mn\times mn}\kern0.5em \Psi ={\left[\begin{array}{c}0\\ {}\vdots \\ {}\frac{\varDelta \tau}{\varDelta x\varDelta y}\\ {}\vdots \\ {}0\end{array}\right]}_{mn\times 1}\\ {}{\boldsymbol{\phi}}_1={\left[\begin{array}{ccccccc}1-2a-2b& 2a& 0& 0& \cdots & \cdots & 0\\ {}a& 1-2a-2b& a& \ddots & \ddots & \vdots & \vdots \\ {}0& a& \ddots & \ddots & \ddots & \ddots & \vdots \\ {}0& 0& \ddots & \ddots & \ddots & \ddots & 0\\ {}\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & 0\\ {}\vdots & \vdots & \ddots & \ddots & a& \ddots & a\\ {}0& \cdots & \cdots & 0& 0& 2a& 1-2a-2b\end{array}\right]}_{n\times n}\\ {}{\boldsymbol{\phi}}_2={\left[\begin{array}{cccc}2b& 0& \cdots & 0\\ {}0& \ddots & \ddots & \vdots \\ {}\vdots & \ddots & \ddots & 0\\ {}0& \cdots & 0& 2b\end{array}\right]}_{n\times n},\kern0.5em {\boldsymbol{\phi}}_3={\left[\begin{array}{cccc}b& 0& \cdots & 0\\ {}0& \ddots & \ddots & \vdots \\ {}\vdots & \ddots & \ddots & 0\\ {}0& \cdots & 0& b\end{array}\right]}_{n\times n},\kern0.5em a=\frac{D_x\Delta \tau }{{\left(\Delta x\right)}^2},\kern0.62em b=\frac{D_y\Delta \tau }{{\left(\Delta y\right)}^2}\end{array}} $$

In the equations above, Δτ is the time interval; \( {C}_{i,j}^k \) is the pollutant concentration at node (i, j) at kth time step; the superscript T denotes the transpose of a vector.

Putting f sensors in the diffusion section, the observation vector is composed of measured pollution information by sensors at kth time step. The discrete-time observation equation is as follows:

$$ {\boldsymbol{Z}}^{\mathrm{k}}={\boldsymbol{HC}}^{\mathrm{k}} $$
(8)

where H ∈ Rf × mn is the measurement matrix.

If there are system process noises and measurement noises, the state equation and the observation equation change into Eq. (9).

$$ {\boldsymbol{C}}^{\mathrm{k}+1}=\boldsymbol{\varPhi} {\boldsymbol{C}}^{\mathrm{k}}+\boldsymbol{\varPsi} \left({{\boldsymbol{S}}_{\boldsymbol{o}}}^{\mathrm{k}}+{\boldsymbol{w}}^{\mathrm{k}}\right) $$
(9a)
$$ {Z}^{\mathrm{k}}={HC}^{\mathrm{k}}+{v}^{\mathrm{k}} $$
(9b)

where \( {\boldsymbol{w}}^k={\left[{w}_1^k,{w}_2^k,\cdots, {w}_n^k\right]}^T \) and \( {\boldsymbol{v}}^k={\left[{v}_1^k,{v}_2^k,\cdots, {v}_f^k\right]}^T \) are the process noises and measurement noises vectors respectively. Both of the noises are considered as Gauss white noises with zero mean, which means that the noise is a sequence of serially uncorrelated random variables with zero mean and finite variance. The covariance of these noises are Q and R respectively, namely,

$$ {\displaystyle \begin{array}{c}{\boldsymbol{w}}^{\mathrm{k}}=\boldsymbol{Q}{\boldsymbol{\omega}}^{\mathrm{k}}=\left[\begin{array}{cccc}{\sigma}_q^2& 0& \cdots & 0\\ {}0& {\sigma}_q^2& \ddots & \vdots \\ {}\vdots & \ddots & \ddots & 0\\ {}0& \cdots & 0& {\sigma}_q^2\end{array}\right]\left[\begin{array}{c}{\omega}_1\\ {}{\omega}_2\\ {}\vdots \\ {}{\omega}_n\end{array}\right]\\ {}{\boldsymbol{v}}^{\mathrm{k}}=\boldsymbol{R}{\boldsymbol{\omega}}^{\mathrm{k}}=\left[\begin{array}{cccc}{\sigma}_r^2& 0& \cdots & 0\\ {}0& {\sigma}_r^2& \ddots & \vdots \\ {}\vdots & \ddots & \ddots & 0\\ {}0& \cdots & 0& {\sigma}_r^2\end{array}\right]\left[\begin{array}{c}{\omega}_1\\ {}{\omega}_2\\ {}\vdots \\ {}{\omega}_f\end{array}\right]\end{array}} $$

where, σq and σr are the standard deviations of process and measurement noises respectively; \( {\omega}_i\left(i=1,2,\cdots, f\mathrm{or}n\right) \) is the random number within the interval [− 2.576, 2.576] obeying the standard normal distribution.

3 The Real-time Monitoring Technique

It has been demonstrated that Kalman filter is unstable even divergent (Alifanov et al. 1981; Wang et al. 2017b). With respect to the instability of Kalman filter, fuzzy inference is introduced to adjust the covariance of process noises adaptively using the residual renewal array. Using the measurement information, the pollution states can be monitored using fuzzy adaptive Kalman filter while the pollutant source strength can be simultaneously acquired by WRLSA. The flowchart of the real-time monitoring technique is shown as Fig. 2.

Fig. 2
figure 2

Flowchart of the real-time monitoring technique based on FAKF

The details of fuzzy adaptive Kalman filter are shown as follows.

$$ {\overline{\boldsymbol{P}}}^{\mathrm{k}+1}=\boldsymbol{\varPhi} {\boldsymbol{P}}^{\mathrm{k}}{\boldsymbol{\varPhi}}^T+\boldsymbol{\varGamma} {\boldsymbol{Q}}^{k+1}{\boldsymbol{\varGamma}}^T $$
(10)
$$ {\boldsymbol{S}}^{\mathrm{k}+1}=\boldsymbol{H}{\overline{\boldsymbol{P}}}^{\mathrm{k}+1}{\boldsymbol{H}}^T+\boldsymbol{R} $$
(11)
$$ {\boldsymbol{K}}^{\mathrm{k}+1}={\overline{\boldsymbol{P}}}^{\mathrm{k}+1}{\boldsymbol{H}}^T{\left({\boldsymbol{S}}^{\mathrm{k}+1}\right)}^{-1} $$
(12)
$$ {\boldsymbol{P}}^{\mathrm{k}+1}=\left(\boldsymbol{I}-{\boldsymbol{K}}^{\mathrm{k}+1}\boldsymbol{H}\right){\overline{\boldsymbol{P}}}^{\mathrm{k}+1} $$
(13)
$$ {\hat{\boldsymbol{C}}}^{\mathrm{k}+1}=\left(\boldsymbol{I}-{\boldsymbol{K}}^{\mathrm{k}+1}\boldsymbol{H}\right)\left(\boldsymbol{\varPhi} {\hat{\boldsymbol{C}}}^k+\boldsymbol{\varPsi} {\hat{\boldsymbol{S}}}_o^k\right)+{\boldsymbol{K}}^{\mathrm{k}+1}{\boldsymbol{Z}}^{\mathrm{k}+1} $$
(14)
$$ {e}^{k+1}={\overline{\boldsymbol{Z}}}^{\mathrm{k}+1}{\left({\overline{\boldsymbol{Z}}}^{\mathrm{k}+1}\right)}^{\mathrm{T}} $$
(15)
$$ {e}_c^{k+1}={e}^{k+1}-{e}^k $$
(16)
$$ {\boldsymbol{Q}}^{k+1}=\mathrm{FIU}\left({e}^{k+1},{e}_c^{k+1}\right) $$
(17)

where \( \overline{P} \) and P are the covariance matrixes of the priori states estimation error and the posteriori states estimation error respectively; Qk + 1 is the updated estimation of process noise covariance. K is the Kalman gain; I is a unit matrix; S is the residual variance; \( {\widehat{S}}_o \) is the estimation of unknown input So; \( \widehat{C} \) denotes the monitored pollution states; FIU(va1,va2) means the fuzzy inference unit (FIU) with the input variables of va1 and va2.

The detailed process of fuzzy inference unit is shown as Fig. 3 (Wang et al. 2017b, 2018).

Fig. 3
figure 3

The fuzzy inference unit of process noise covariance

From the above process, the pollution states can be reconstructed. The detail process of WRLSA is as follows:

$$ {\boldsymbol{B}}^{\mathrm{k}+1}=\boldsymbol{H}\left(\boldsymbol{\varPhi} {\boldsymbol{M}}^{\mathrm{k}}+\boldsymbol{I}\right)\boldsymbol{\varPsi} $$
(18)
$$ {\overline{\boldsymbol{Z}}}^{k+1}={\boldsymbol{Z}}^{k+1}-\boldsymbol{H}\left(\boldsymbol{\varPhi} {\hat{\boldsymbol{C}}}^k+\boldsymbol{\varPsi} {\hat{\boldsymbol{S}}}_o^k\right)+{\boldsymbol{B}}^{k+1}{\hat{\boldsymbol{S}}}_o^k $$
(19)
$$ {\boldsymbol{M}}^{\mathrm{k}+1}=\left(\boldsymbol{I}-{\boldsymbol{K}}^{\mathrm{k}+1}\boldsymbol{H}\right)\left(\boldsymbol{\varPhi} {\boldsymbol{M}}^{\mathrm{k}}+\boldsymbol{I}\right) $$
(20)
$$ {\boldsymbol{K}}_{\mathrm{b}}^{\mathrm{k}+1}={\gamma}^{-1}{\boldsymbol{P}}_{\mathrm{b}}^{\mathrm{k}}{\left({\boldsymbol{B}}^{\mathrm{k}+1}\right)}^{\mathrm{T}}{\left[{\boldsymbol{B}}^{\mathrm{k}+1}{\gamma}^{-1}{\boldsymbol{P}}_{\mathrm{b}}^{\mathrm{k}}{\left({\boldsymbol{B}}^{\mathrm{k}+1}\right)}^{\mathrm{T}}+{\boldsymbol{S}}^{\mathrm{k}+1}\right]}^{-1} $$
(21)
$$ {\boldsymbol{P}}_{\mathrm{b}}^{\mathrm{k}+1}=\left(\boldsymbol{I}-{\boldsymbol{K}}_{\mathrm{b}}^{\mathrm{k}+1}{\boldsymbol{B}}^{\mathrm{k}+1}\right){\gamma}^{-1}{\boldsymbol{P}}_{\mathrm{b}}^{\mathrm{k}} $$
(22)
$$ {\hat{\boldsymbol{S}}}_o^{k+1}={\hat{\boldsymbol{S}}}_o^k+{\boldsymbol{K}}_{\mathrm{b}}^{\mathrm{k}+1}\left({\overline{\boldsymbol{Z}}}^{\mathrm{k}+1}-{\boldsymbol{B}}^{\mathrm{k}+1}{\hat{\boldsymbol{S}}}_o^k\right) $$
(23)

where B and M are sensitivity matrices; Pbis the error covariance of the input estimation;Kb is the correction gain; γ is the weighting factor in WRLSA, which varies from 0 to 1. Coupled with fuzzy adaptive Kalman filter, the WRLSA process can be used to obtain the inverse analysis of pollutant source.

4 Numerical Simulation and Discussion

4.1 Calculation of Pollution Diffusion Process

A 2.4 × 3m2 two-dimensional section is taken as the example. The diffusion coefficients Dx and Dy are assumed as the same, which are 0.12 × 10‐3m2/s. Taking the position of the pollutant source as (1.12 m, 1.50 m) with the source strength of 15 g/s lasting for 1500s. Five pollutant sensors ss1-ss5 are placed as shown in Fig. 1a, which are on the midpoints of the trisections and the geometric center respectively. To verify the effectiveness of the diffusion state equation, different numbers of meshes are adopted to calculate the diffusion states. A proper mesh number is chosen with the consideration of both mesh independent verification and computer time. Under this condition, the measured pollution information using these sensors are shown as Fig. 4.

Fig. 4
figure 4

Measured pollutant concentrations at the sensors

It is shown in Fig. 4 that the pollutant concentrations at the sensors grow up with the increase of diffusion time. For the different distances between the pollutant source and each sensor, the sensitivities of the sensors are diverse. It is common that there is little delay and inertia when the distance from the sensor to the source is short. The sensor ss3 is the closest to the pollutant source. Once the pollutant source released, the pollutant diffused in the confined room. The ss3 could monitor the pollution quickly. In this case, the response time is almost simultaneous with the source. When the pollutant diffused to the places of the sensors, the sensors could response to the pollution. It is obvious that the ss2 is the fastest in the other sensors. For the quantitative expression, the response time of ss2 is about 50 s while the response time of ss4 is about 120 s. The response times of ss1 and ss5 are following with the ss4. Due to the same distances from ss1 and ss5 to the source, the measured pollution states at ss1 and ss5 are equal. The longer the distance from a sensor to the source is, the less the pollution concentration is and the longer the response time is.

Figure 5 shows the pollution states distribution in the diffusion section at different times. It can be found that the polluted part is become wider with the increase of time. And the maximum concentration is at the place of the pollutant source. The maximum pollutant concentrations are 98.33, 107.56, and 112.95 g/m3 at 500, 1000, and 1500 s separately. However, the pollutant concentration drops rapidly along the radial direction and the descent rate is becoming lower. When the time is 500 s, the pollutant hardly spreads to the walls around. When the time is 1000 and 1500 s, Fig. 5b, c show that the concentrations at the walls around are becoming higher.

Fig. 5
figure 5

The pollution diffusion state at different times

4.2 Pollution States and Source Monitoring

In a real accident, the leakage source might be different types and complex. However, the complex source term could be regarded as the combinations of different kinds of simple sources. Two typical kinds of the pollutant sources are assumed to simulate the pollution diffusion, which are shown as Eq. (24).

$$ {S}_{o1}=\left\{\begin{array}{l}0.05\tau \kern6em \left(0\mathrm{s}\le \tau <500\mathrm{s}\right)\\ {}25-0.05\left(\tau -500\right)\kern1.1em \left(500\mathrm{s}\le \tau <1000\mathrm{s}\right)\\ {}0\kern8.1em \left(1000\mathrm{s}\le \tau \le 1500\mathrm{s}\right)\end{array}\right. $$
(24a)
$$ {S}_{o2}=\left\{\begin{array}{l}25\sin \left(2\pi \tau /2000\right)\kern1em \left(0\mathrm{s}\le \tau <1000\mathrm{s}\right)\\ {}0\kern8em \left(1000\mathrm{s}\le \tau \le 1500\mathrm{s}\right)\end{array}\right. $$
(24b)

In the simulation, the triangle source is used to simulate the source with constant change rate while the sinusoidal source is adopted to simulate the source with variable change rate. The measured pollution information is assumed to be acquired by Eq. (25), which contains the measurement noises.

$$ {\boldsymbol{Z}}^{\mathrm{k}}={\boldsymbol{HC}}^{\mathrm{k}}+{\boldsymbol{v}}^{\mathrm{k}}={\boldsymbol{Z}}_{exa}^{\mathrm{k}}+{\boldsymbol{v}}^{\mathrm{k}} $$
(25)

where the exact pollution values \( {\boldsymbol{Z}}_{exa}^{\mathrm{k}} \) are calculated by the Eq. (8).

In order to evaluate the monitoring performance, the relative root mean square error of the monitored pollutant source η is defined as Eq. (26).

$$ \eta =\sqrt{\sum \limits_{k=1}^L{\left({ES}_o^k\right)}^2}/\sqrt{\sum \limits_{k=1}^L{\left({S}_o^k\right)}^2}=\sqrt{\sum \limits_{k=1}^L{\left({S}_o^k-{\widehat{S}}_o^k\right)}^2}/\sqrt{\sum \limits_{k=1}^L{\left({S}_o^k\right)}^2} $$
(26)

where, the L is the length of time steps, \( {ES}_o^k \) is the monitoring error of the pollutant source at kth step.

Using the above technique, the pollutant source and pollution states can be monitored in real time. For simulations, the initial values of these parameters are set as follows:P0 =  diag [100], \( {\boldsymbol{P}}_b^0=\mathit{\operatorname{diag}}\left[{10}^7\right] \), M0 = [0], and γ = 0.875. The standard deviation of measurement noises is adopted as σr=0.01. The monitoring results of the pollutant sources are shown as Fig. 6.

Fig. 6
figure 6

Pollutant leak source monitoring results

Figure 6 shows that both kinds of pollutant leak source can be well monitored in real time. For triangle source, there are little fluctuations when the pollutant source changes sharply at 500 and 1000 s. The same phenomenon occurs when the sinusoidal source changes suddenly at 1000 s. However, the fluctuations disappear in a short time and the monitoring results agree well with the exact ones. The relative root mean square errors of these monitoring results are 2.89 and 2.49% when the sources are triangle and sinusoidal respectively.

In order to present the performance of the monitoring method, the pollutant monitoring errors of different kinds of sources and their probability density functions (pdf) are shown as Fig. 7. The probability density functions of the errors are acquired by kernel smoothing density estimation.

Fig. 7
figure 7

Pollutant source monitoring performance analysis

It can be found that the monitoring errors’ range of triangle source is larger than that of sinusoidal source.

The errors are positive and stable when the pollutant source is becoming larger of triangle source. They change suddenly with the revulsion of the source and then become negative. In the last period when the leakage is stopped, the errors are nearly zero. The monitoring errors of sinusoidal source decrease from position to negative continuously with the variation of the source. When the source drops to zero, the monitoring errors suddenly vibrates and goes quiet later.

The Fig. 7b shows that distribution interval of monitoring errors of sinusoidal source is broader than that of triangle source neglecting a small part. However, the probability density function of the errors near zero of sinusoidal source is much larger than that of triangle source, which means that a substantial part of the errors is close to zero. For the error away from zero, the values of the probability density function for triangle source are greater than those of sinusoidal source.

To evaluate the monitoring performance further, the monitored pollutant concentrations at the origin and the geometric center under different source terms are exhibited in Figs. 8 and 9.

Fig. 8
figure 8

Monitoring results at the origin and geometric center with the triangle source

Fig. 9
figure 9

Monitoring results at the origin and geometric center with the sinusoidal source

Figures 8 and 9 present the exact and monitored pollution states at the points (0, 0) and (Lx/2, Ly/2) with different kinds of sources. The EC in the figure means the monitoring error, which is the difference between the exact and monitored ones, defined as follows:

$$ \mathrm{EC}={C}^{\mathrm{exa}}-{C}^{\mathrm{mon}} $$
(27)

Figure 8a shows that the monitored results at the origin and the geometric center agree well with the exact ones. Three variation periods of the pollutant source are presented on the change of the concentration at geometric center. For the reason that there is a long distance between the origin and source point, the concentration at the origin is very light. States monitoring errors are shown in Fig. 8b. The monitoring errors at the geometric center fluctuate frequently while the monitoring errors at the origin change smoothly. This is due to the different distances. A longer diffusion distance results in a greater inertia which acts as a filter to the noises of the pollutant source. Almost all the pollution concentration monitoring errors are in the interval [− 0.025, 0.025]. However, this range is small enough to guarantee the precise monitoring of the pollution states. The same phenomenon occurs when the pollutant source is sinusoidal. The integral of sinusoidal source in time domain is greater than that of triangle source, which results in the higher pollution concentration under sinusoidal source. The same with triangle source, the monitoring results are accurate enough for the applications in practice. The results show that no matter which kind of the pollutant source is, the proposed technique can exhibit wonderful performance to realize the real-time monitoring of the pollution states.

4.3 Effect of Measurement Noises on Monitored Results

Noises are inevitable in measurement system. To investigate the effects of measurement noises on monitored results, the standard deviations of measurement noises of the sensors are taken as σr = 0.05, 0.10, and 0.50 separately. The pollutant source monitoring results are shown in Fig. 10.

Fig. 10
figure 10

Pollutant source monitoring results with different measurement noises

It can be demonstrated form Fig. 10 that the source monitoring results keep accurate correspondence with the exact source. There are some deviations of the monitoring results with the growth of the measurement noises. The larger the noises are, the greater the deviations are. However, the monitoring results can reflect the pollutant source variation with a high accuracy. Table 1 lists the relative root mean square errors of the monitoring results of the pollutant source under different measurement noises. It shows that the errors are becoming larger with the increase of the noises. However, the increase rate of the relative root mean square error is much less than that of the measurement noise. The standard deviation of measurement noises σr is 0.01 with the η of 2.89% while the σr is 0.50 with the η of 5.91%, which demonstrates that this monitoring technique has strong robustness.

Table 1 The relative root mean square error under different measurement noises

To analyze the distribution of monitoring errors, the values of the pollutant source monitoring errors are calculated and shown in Fig. 11a. Figure 11b shows the statistical results of the probability density function for source monitoring errors under different measurement noises.

Fig. 11
figure 11

Analysis of pollutant source monitoring errors

Figure 11a shows that the monitoring errors symmetrically distribute around zero. The amplitudes of the errors increase with the growth of measurement noises. The probability density functions also show the same trend. The distribution interval of the monitoring errors has the positive relationship with the measurement noises. When the measurement noise is 0.05, the probability density function of errors which are near the zero is the greatest. With σr of 0.50, the probability density function of the monitoring errors which are near the zero is the smallest. The bandwidth of the probability density function with σr of 0.50 almost reaches to [− 3.3]. However, the most parts are in the range [− 1.1], where the errors intervals with σr of 0.05 and 0.10 are.

Figure 12 shows the field of pollutant concentration monitoring errors at different times when the measurement noise increases.

Fig. 12
figure 12

States monitoring errors at different times with variable measurement noises

It can be found form Fig. 12 that the main state monitoring errors go through the time-domain process “positive errors-negative errors near zero errors,” which the pollutant source monitoring errors also develop along with. The reason for this phenomena is that in the first 500 s, the pollutant source is continuously going up, and the inertia makes the real-time monitoring results less than the exact ones. In the following 500 s, the pollutant source drops and the source and states monitoring errors are almost negative. In the last 500 s, the source strength is zero and the pollutant diffuses to uniform in the field.

When it is at the same time, the states monitoring errors increase with the growth of measurement noise, which is correspondence with pollutant source monitoring results. The state monitoring error at the source is the greatest in the error field. The farther the distance to the source is, the closer to zero the error is. When it is 1500 s, the state monitoring error is the least in the time domain.

5 Conclusions

A real-time monitoring technique for pollutant source and its diffusion states is developed using fuzzy adaptive Kalman filter. The simulations show that this technique can be used to deal with the monitoring of different kinds of pollutant sources. It shows high accuracy in the monitoring process. When the measurement noises increase, the monitoring results deviate from the exact ones. However, the monitoring errors are small enough, which demonstrates that this monitoring technique has strong robustness to resist the noises.