Next Article in Journal
Monitoring of the Human Body Signal through the Internet of Things (IoT) Based LoRa Wireless Network System
Next Article in Special Issue
Thermal and Mechanical Analysis of a 72/48 Switched Reluctance Motor for Low-Speed Direct-Drive Mining Applications
Previous Article in Journal
Optimization of Processing Parameters for Water-Jet-Assisted Laser Etching of Polycrystalline Silicon
Previous Article in Special Issue
A Way towards Reliable Predictive Methods for the Prediction of Physicochemical Properties of Chemicals Using the Group Contribution and other Methods
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Soft Sensor with Adaptive Algorithm for Filter Gain Correction in the Online Monitoring System of a Polluted River

1
Institute of Technical Engineering, State University of Technology and Economics in Jaroslaw, Czarnieckiego Str. 16, 37-500 Jaroslaw, Poland
2
Department of Computer Engineering, Faculty of Mathematics and Natural Sciences, University of Rzeszow, Pigonia Str. 1, 35-959 Rzeszow, Poland
*
Author to whom correspondence should be addressed.
Appl. Sci. 2019, 9(9), 1883; https://doi.org/10.3390/app9091883
Submission received: 27 March 2019 / Revised: 30 April 2019 / Accepted: 2 May 2019 / Published: 8 May 2019

Abstract

:
This paper proposes the realization of a soft sensor using an adaptive algorithm with proportional correction of the gain coefficient for monitoring river water quality. This algorithm makes it possible to monitor online signals of an object described by nonlinear ordinary differential equations. Simulation studies of a biochemically polluted river, for which the water quality was represented by biochemical oxygen demand (BOD) indices and the dissolved oxygen (DO) deficit, were carried out. The algorithm concept uses only online measurements of the object, and adaptive changes in the gain coefficient are determined based on the adaptation error adopted for this purpose. Simulation results indicated the correct functioning of the soft sensor even for inaccurately identified parameters of the mathematical model and for unknown values and intensity of disturbances affecting the object. The quality of the signals monitored via a soft sensor implemented in this way was determined with the root-mean-squared error (RMSE) and mean percentage error (MPE) indicators and compared with the Kalman filter.

1. Introduction

The problem of monitoring objects via a real-time system is still a topical and important issue for the industry connected with ecological systems. The need to control the quality of surface water is primarily due to the necessity of protecting the natural environment. The increasing level of water pollutants is mainly associated with the rapid increase of social development. As a result of these transformations, the need for functioning wastewater treatment plants with much higher requirements in terms of quality and efficiency of operation has arisen. In addition to the impact of the treatment plant, weather conditions also have a big influence on the quality of water in rivers, which in turn leads to the need for continuous monitoring with a control and management function to ensure the possibility of managing water in a given region [1,2].
Real-time monitoring systems, which are additionally used for monitoring and control functions, also require fast and accurate determination of the desired signal values. This is achieved by applying various methods and techniques related to the necessity of carrying out the key computer calculations. The simplest monitoring solutions only use easily implementable online measurements, which are part of a full monitoring system, as no other signals of the object are taken into consideration [3]. The proposition for the estimation of water quality presented in [4] uses artificial neural networks and canonical correlation analysis to ensure the correctness of water quality assessment. These considerations include numerous water quality parameters but determine only their static parameters. With this approach, we were not able to observe the dynamic changes in water quality resulting from random extortions. A similar approach was presented in [5], in which the authors developed and proposed methods for assessing water quality for management purposes of local governments, with data obtained on a weekly or annual basis. However, this solution did not take into account the impact of anomalous pollution changes, which indicates the need for continuous online measurements.
In [6], the authors proposed real-time monitoring based on online measurements using mobile measurement stations. This type of mobility does not ensure continuous comprehensive monitoring of water quality in a given water catchment. Other solutions concern the monitoring and control system involving interaction with the object. Such hybrid solutions lead to positive results but at the cost of larger computational effort associated with the current “improvements” of the characteristics of stochastic signals [7,8,9,10].
In monitoring systems, soft sensors are often used to obtain information about certain parameters, which are produced on the basis of measurements of other signals. The principle of soft sensing technology is to build a mathematical model to estimate signals which are difficult to measure, based on the relationship between these signals and certain online signals measured directly. An approach implementing such a soft sensor was presented, among others, in [11,12,13].
The first study previously mentioned used genetic algorithms to control the value of dissolved oxygen (DO) in a wastewater treatment plant. The authors obtained the right quality of sewage and minimized the energy demand, which is a valuable achievement for an integrated global monitoring system with the control function. The second and third mentioned works considered a control system for which the controller’s parameters were selected using an artificial neural network or extreme learning machine (ELM). Satisfactory results were obtained in the form of good real-time performance and high accuracy of soft sensor prediction.
Solutions which are not based on artificial neural networks can also give positive results, even for nonlinear objects [14]. There has been research done on a soft sensor based on locally weighted regression which estimates the regression surface by multivariate smoothing. The implementation of a soft sensor generating a biochemical oxygen demand (BOD) signal for water in an open system based on measurements of many signals and the use of a self-organizing neural network with random weights was presented in [15]. An additional requirement of this application is the preprocessing of data.
Soft sensors can also be implemented using Kalman filter algorithms [16]. This approach used measurements from two different sources to obtain the estimated signal sought, and in the Kalman algorithm, the stages of prediction and updating of the signal estimation were separated. The final results of the soft sensor were based on measurements of online signals and signals developed in laboratory tests, which imposed an additional load on the proposed method.
An extended Kalman filter was used in [17] to obtain better results. The methods used there, in the form of Monte Carlo or polynomial chaos theory, give hope for improvement of the computational efficiency of methods for estimating current parameters but at the cost of greater computational complexity.
The studies discussed above present different approaches for achieving appropriate improvements in the quality of final results, however, they are burdened with significant computational inputs.
This article proposes an adaptive approach to the implementation of the soft sensor, enabling generation of desired signals describing the object, obtained on the basis of possible online measurements and signals generated from a mathematical model. This approach is characterized by lower computational complexity and greater accuracy of the solution compared with algorithms using Kalman filters mechanisms. The essence of the proposed adaptation mechanism consists of changing the gain coefficient in time in the soft sensor’s filtration equation used for online monitoring of river water quality.

2. Concept of a Monitoring System Using a Mathematical Model

BOD and DO are considered to be important indicators of water pollution [1,2,18]. The values of these indicators in river waters change despite properly functioning wastewater treatment plants. This is a result of laterally distracted and point tributaries and weather conditions such as rainfall. For the purposes of monitoring, control, or simulation tests, a mathematical model is usually used, which represents the description of these impurities in the form of ordinary or partial differential equations representing the kinetics of first-order physicochemical reactions [19].
The BOD indicator can be described by an equation in the following form:
d d t x 1 ( t ) = k 1 x 1 ( t ) + w 1
while the DO deficit indicator can be expressed by dependence:
d d t x 2 ( t ) = k 2 x 1 ( t ) k 3 x 2 ( t ) + w 2
where x 1 ,   x 2 are, respectively, indicators of water quality BOD and DO;
  • k 1 —coefficient rate of BOD reaction;
  • k 2 —coefficient influence of BOD to DO;
  • k 3 —coefficient of change of oxygen deficit in water;
  • w 1 —intensity of inflow of BOD pollutants;
  • w 2 —intensity of oxygen uptake/delivery from/to water.
Equations (1) and (2) transformed into a vector form can be expressed by the following equation:
d d t x ( t ) = A x ( t ) + B w ( t )
where:
  • x = [ x 1 x 2 ] —vector representing water quality indicators;
  • A = [ k 1 k 2 0 k 3 ] —dynamics matrix of vector changes x ;
  • w = [ w 1 w 2 ] —disturbance vector of system;
  • B = [ 1 0 0 1 ] —interactions matrix of disturbance signals.
The existing BOD pollution in a river causes an increase in the DO deficit due to biochemical processes which use the oxygen contained in the water. After a certain period, the pollution in the form of BOD and deficit of oxygen in the form of DO decrease as a consequence of the river’s natural self-purification process. Coefficients contained in matrix A describe the dynamics of a river’s self-purification process and depend on temperature (the seasons of the year) and, therefore, they are not constant values but are subject to change in certain ranges [20]:
k 1   =   0.2204   ÷   0.3347   [ mg / L ] , k 2   =   0.1636   ÷   0.2049   [ mg / L ] , k 3   =   0.71   ÷   0.81   [ mg / L ] .
Accepting such assumptions causes the mathematical model defined by Equation (3) to ultimately become a nonlinear model, although in certain temperature ranges, it can be assumed as linear. Equation (3) of the presented model was applied in the soft sensor for the monitoring system that generated real object signals. The idea of this approach is presented in Figure 1.
The monitoring system based on a soft sensor uses a preaccepted mathematical model of the object and the proposed adaptive algorithm which generates signals based on object signals measurable online.
As mentioned above, there are two signals which can be considered as part of the water quality issue (i.e., BOD and DO deficits). Measurements of the DO deficit can be obtained online with the help of an oxygen probe, whereas BOD measurements require laboratory service. In practice, the time required to obtain such results is 5–20 days. In the case of online monitoring, such measurement becomes useless and, therefore, it has been withdrawn from in favor of constructing an algorithm that recreates its values. This approach was used in the presented studies.
Therefore, it is only necessary to measure the DO deficit, which is described by the equation in the following form:
y ( t ) = C x ( t ) + v ( t )
where:
  • C = [ 0   1 ] —measurement matrix;
  • v —measurement error matrix.
Configuration of measurement matrix C indicates the selection of measurement DO, which will be the only information regarding the quality of water. On the other hand, the task of the monitoring algorithm will be to generate a substitute signal representing the BOD value using an adaptive approach in soft sensor implementation.

3. Concept of an Adaptive Algorithm of Proportional Gain Change

The proposed adaptive P-type gain change algorithm for the soft sensor generates all object signals, including those for which no measurements can be made due to the difficulties of online measurement. The concept of the algorithm consists of applying a filtration equation with a structure used that is similar to the Kalman filter. However, the value of the gain will be determined adaptively. In particular, modification of the gain coefficient is made in each step of the calculation based on the current adaptation error ε i (7), defined for the needs of this algorithm.
The equation generating the signals of the object in the monitoring system takes the form
d d t x ^ i = A x ^ i + K i [ y i C x ^ i ]
where:
  • x ^ —signal generated by soft sensor adaptive algorithm;
  • y —measurements from Equation (5);
  • A —matrix from the model (3);
  • K —adaptively determined values of the gain coefficient;
  • C —measurement matrix;
  • i—index of the current calculation step.
The adaptation error is a real, measurable signal, expressed by the equation
ε i = y i C x ^ i
where ε i is the adaptation error in the ith step.
Based on the adaptation error defined in this way, the algorithm determines the proportional correction value of the gain coefficient dependent on the adaptation error value according to the equation
Δ K i = k p ε i ,
in which:
  • Δ K —correction of the gain coefficient;
  • k p —proportionality parameter of changes in the gain coefficient.
At the present stage of research, expert knowledge is required to determine the value of parameter k p contained in Equation (8).
After determining the correction, the current value of the K gain coefficient is determined incrementally in each calculation step according to the dependence:
K i + 1 = K i + Δ K i ,    K 0 = 0 .
Assumption of the initial value of the gain coefficient is zero. This causes greater universality of applications of the proposed adaptive algorithm.
The gain thus obtained is used in Equation (6) to generate all the approximated signals of the object, even signals for which no measurements are made. In Equation (8), the error value ε i represents the current information about the discrepancy between the signals of the x i object and the value generated in the soft sensor x ^ i   (see Figure 1). Thus, the current value of the gain correction Δ K i results from the value of the adaptive error, which indicates the need to change the gain K i to reduce the error ε i . The general concept of the algorithm used in the soft sensor is shown in the block diagram in Figure 2.
The algorithm generates x ^ i signals representing all signals of the object based on measurements y i made only in online mode. The left part of the algorithm diagram determines the current values of gain coefficient K i affecting the quality of the generated signals.
The proposed algorithm requires knowledge of the mathematical model, but parameters of the object do not need to be determined precisely. An important advantage of the presented algorithm is the stability of operation for any values of interference generated on the basis of their intensity (lack of information about statistics characteristics for these signals). The soft sensor based on the proposed algorithm works in online mode and can generate signals with satisfactory accuracy, even for such signals for which no measurements are made.

Computational Complexity of the Adaptive Algorithm

Computational complexity of the soft sensor was determined in accordance with the diagram shown in Figure 2. Table 1 and Table 2 provide details on signal calculation and the complexity of these calculations. Detailed computational complexity of the algorithms results from the following parameters and operations: dimension of system vector—n; matrix multiplication—O( n 3 ); matrix transpose—O( n 2 ); matrix inversion—O( n 3 ); additions, subtractions, and assignments—O(n); and multiplication of matrix and vector—O( n 2 ).
The largest complexity in the adaptive algorithm comes from the multiplication of the matrix and the vector, and this is the complexity of order O( n 2 ).
For special algorithms, the computational complexity of matrix multiplication is O ( n 2.373 ) [21].
In the Kalman filter algorithm, the greatest complexity results from the multiplication and inversion of the matrix, which in effect gives the complexity of the order O( n 3 ). The adaptive approach used only simple calculations; hence, a lower order of computational complexity was obtained compared with the Kalman filter algorithm.
The algorithm presented in this article is characterized by lower computational complexity in relation to the classical approach (i.e., the Kalman filter) because there is no need to determine the gain coefficient by solving the Riccati nonlinear differential equation [7,9,16,22,23].
The approach to generating signals realized with artificial neural networks has been shown in [10]. In this case, there is comparable computational complexity, but it does not guarantee obtaining the correct signal quality. It results from the necessity of carrying out the learning process for cases representing the most characteristic extortion, which is a difficult issue. In addition, the computational complexity of the network learning process is greater than the normal network operation, although it is done offline.

4. Simulation Research Results

The presented simulation studies concern the time courses of BOD and DO signals obtained from the mathematical model and signals generated by the proposed adaptive algorithm, as well as the Kalman filter. The results also apply to cases in which the parameters of the real object and the mathematical model which was used to generate signals were different. The results of the tests also include time courses of errors of the abovementioned algorithms. The final part of the research presents averaged indicators of monitoring quality (10, 11) and the results of comparing the computational complexity of the adaptive algorithm and the Kalman filter algorithm.

4.1. Measures of Soft Sensor Quality

In order to determine the quantitative quality of the soft sensor results, two quality indicators for the final results were used. They include measures of errors generated for BOD and DO signals.
The first indicator of the quality of monitoring is the root-mean-squared error (RMSE):
R M S E j = 1 n i = 1 n e j , i 2 .
The second indicator is the mean percentage error (MPE):
M P E j = 1 n i = 1 n ( | x j , i x ^ j , i x j , i | ) · 100 %
where:
  • e j , i = x j , i x ^ j , i —estimation error of the jth signal in the ith calculations step;
  • n—number of calculations steps.
The RMSE indicator represents the absolute error, while the MPE indicator is a measure of the relative error percentage.

4.2. Simulation of the Model

In all simulation tests, it was assumed that the object and the measurements were distorted by Gaussian disturbances with known parameters.
Figure 3 presents cases in which changes in the value of matrix A elements caused the most varying distributions. Change in k 1 and k 3 from the smallest to the largest possible (see value of parameter 4) caused the largest differences in the waveform of BOD and DO.
Assuming different parameters of the model, differences in the waveforms of the generated signals were examined; the results of these experiments are shown in Figure 4.
Selected changes in the parameter values of the model causing the most different distributions were used to generate monitoring signals.
Figure 4 shows courses of prototype signals and those generated using the Kalman filter and the adaptive algorithm. Figure 4a demonstrates courses for which parameters k 1 ,   k 2 , and k 3 were identical for algorithms and prototype courses. Figure 4b presents a situation in which the algorithms included changes of only parameter k 2 whereas Figure 4c shows changes in parameters k 1 and k 3 . The summary of all cases is shown in Figure 4d.
Research was also carried out in which the values of the object model parameters were changed over time. The experiments were carried out with the adaptive algorithm and the Kalman filter. The biggest differences in distributions were obtained for the BOD signal. The algorithm for DO exhibited slight discrepancies, which resulted from the signal’s online measurements.

4.3. Simulation Experiments of the Monitoring System

In other studies, particular attention has been paid to cases in which the most divergent distributions of signals are generated due to changes in model parameters. For such cases, correct functioning of the adaptive algorithm was received. The tests were carried out in accordance with the presented scheme (Figure 5), in which a model with preaccepted model parameters ( A p m ) was used in the monitoring system signal generator.
The mark “real object” with real parameters ( A R ) in Figure 5 means different parameters in relation to the model used in the monitoring signal generator. For the approach thus constructed, errors (as the difference between x ^ and x p m and x R ) were investigated for BOD and DO, respectively. In addition, cases of the same as well as various disturbances in the model and real object were assumed.
The functional meaning of Figure 5 can be described with a logical set of rules presented below:
IF ( A R = A p m ) THEN (generated object signals) = CORECT
IF ( A R A p m ) THEN (generated object signals) = CORECT too.
Figure 6 presents the distribution of errors generated with the participation of the same disturbances.
The generated disturbances of the error signal for BOD and DO in both cases oscillated around the zero value, which means that the monitoring system functioned correctly despite inaccurate values of the model parameters.
Simulation tests also included cases where nonidentical disturbances were applied to the preaccepted model and real object, as shown in Figure 7.
For such cases, proper functioning of the monitoring system was also obtained. The presented cases indicate the algorithm’s robustness to inaccuracy in identification of the model parameters’ values. For the abovementioned case, the quantitative measure of quality of received signals measured with the MPE indicator (11) is presented in Table 3.
The values of qualitative indicators for MPE monitoring in cases of identical and different extortion values affecting both the model and the real object for BOD and DO were comparable. It should be emphasized that the lower values of MPE obtained for DO resulted from the fact that the measurements referred to this signal specifically.
Figure 8, Figure 9, Figure 10 and Figure 11 show signal distribution generated by the soft sensor adaptive algorithm (index AA) and the Kalman filter algorithm (index KF) for different values of covariance matrices of the system (W) and measurement (V) disturbances as well as the changes in gain coefficients generated by the adaptive algorithm with these disturbances.
Figure 8 and Figure 9 present the BOD and DO distributions and changes in the gain coefficient for various cases of disturbance intensity which were characterized by different values of covariance matrices for system disturbances. In Figure 8a and Figure 9a, the time waveforms of signals generated by the soft sensor BODAA more accurately reflect the signals of the disturbed object as compared with the Kalman filter BODKF. In the case of DO, DOAA and DOKF signal distributions were very similar. Figure 8b and Figure 9b show the gain coefficient distributions for BOD and DO, respectively. Changes in the value of these gains for BOD were several times higher than for DO.
Figure 10 and Figure 11 apply to cases similar to those shown in Figure 8 and Figure 9, but in this situation, the measurement disturbances characterized by the covariance matrices of measurement disturbances were increased. Deterioration in the quality of measurements influenced the reduction in the quality of results.

4.4. Quality of Monitoring and Computational Complexity of Adaptive Algorithm

Generalization of the obtained simulation effects was carried out by averaging the results from 10 experiments with the same intensity of extortions’ values. The research also includes cases of the influence of various disturbance intensities on the quality of the results. These results were compared with the results obtained with other algorithms (i.e., the Kalman filter), where two quality indicators were also used (10, 11). The obtained results are presented in diagrams in Figure 12, Figure 13 and Figure 14.
Based on the conducted simulations, tests results were obtained showing the advantage of the adaptive algorithm over the Kalman filter algorithm, mainly referring to the unmeasured signal of the object that is BOD. Regardless of the intensity of disturbance, better results were obtained with an adaptive algorithm. It should also be emphasized that the RMSE monitoring quality index for the DO deficit was an order of magnitude smaller in comparison with the BOD signal (see Figure 12). Better monitoring quality results from measurements of the DO deficit signal. An unexpected advantage of the Kalman filter measured by the RMSE indicator for the DO deficit results mainly from the assumption of zero initial values of coefficient gains in the adaptive algorithm. This setup of values results in a slightly lower quality of monitoring, especially in the initial period of simulation, on the one hand, and on the other, great versatility of the adaptive algorithm.
Assuming that the initial value of the gain coefficients in the adaptive algorithm was nonzero, this resulted in a significant improvement in the quality of the monitored DO signal, as shown in Figure 13.
The MPE quality indicator used for BOD and deficit DO signals also indicated more successful results obtained with the adaptive algorithm in relation to the Kalman filter (see Figure 14). As previously mentioned, for the BOD signal, the quality of monitoring was almost twice as good. For the DO deficit signal, the MPE quality indicators did not differ as much as in the case of RMSE indicators and the values more clearly indicated a qualitative advantage for the adaptive algorithm.
The results obtained in the conducted simulation experiments generally indicated a better quality of signal monitoring with an adaptive algorithm in comparison with the Kalman filter.
Simulation experiments aimed at comparing the computational complexity of algorithms were carried out in the Matlab environment. Results of the tested algorithms expressed in the form of duration of calculations confirmed the lower complexity of the adaptive algorithm, as presented in Table 4.
The results shown in Table 4 are mean values from 10 numerical experiments. The need of averaging calculation times resulted from the occurrence of random disturbances for the assumed parameters. These disturbances generated various extortions, and as a consequence, created various errors which resulted in different calculation times. The calculation times in the Kalman algorithm did not differ much, but in the adaptive algorithm, the values of these times showed larger differences. However, in each case, the adaptive algorithm showed better results by an order of magnitude.

5. Conclusions

The article presented an adaptive algorithm generating signals which monitor objects in online mode and described by nonlinear ordinary differential equations for the implementation of a soft sensor. A representative of this class of objects, for which such a soft sensor may be used, was a biochemically polluted river, the water quality of which was represented by the BOD water quality index and DO deficit. The soft sensor for BOD reproduced this signal in online mode only on the basis of DO measurements and the mathematical model of the object This soft sensor was implemented based on the adaptive algorithm of change in the proportional gain coefficient in the filtration equation.
Adaptive changes in the gain coefficient in the differential equation generating monitoring signals were determined on the basis of a real measurable signal of adaptation error defined specifically for this purpose. The proposed P type gain factor change algorithm reproduced all object signals despite the preaccepted parameters of the object’s mathematical model, and the algorithm functioned correctly. In addition, the algorithm generated correct results at any intensity of disturbances affecting the object.
The quality of the monitored signals was determined by RMSE and MPE indicators. Values of the RMSE index were on average seven times higher for BOD in relation to DO because only direct DO measurements were used. For the MPE quality indicator, there was a similar differentiation for BOD and DO, but for BOD, the adaptive algorithm obtained twice as good quality as the Kalman filter. The presented concept of a soft sensor used for monitoring an object described by a mathematical model representing only two indicators of water quality (i.e., BOD and DO) works correctly.
One should also expect satisfactory results in further extension of the mathematical model with other water quality indicators. The proposed algorithm for implementing a soft sensor is characterized by low computational complexity, lesser than that in Kalman’s algorithms, and can also be used for other objects (e.g., in chemical reactors). There also exist other methods that allow the generation of the desired signals on the basis of measurements which include, among others, extended Kalman filter, partial filter, or artificial neural networks. The results of the research currently carried out by the authors, comparing the proposed algorithm and taking into account the abovementioned methods, will be presented in subsequent publications.
The results of simulation tests correspond to the value of BOD and DO deficits obtained on the basis of measurements made by the Regional Inspectorate for Environmental Protection in Rzeszow for the Wislok River near Rzeszow [24]. Table 5 shows results of measurements in DO deficit, temperature, and average velocity of flow for a 70-km river at specific measurements points.
The obtained results have confirmed that the use of a soft sensor based on the proposed algorithm in a river water quality monitoring system will provide good-quality generated signals with low computational complexity with the possibility of use in real-time systems.

Author Contributions

Concept of online monitoring system using a soft sensor P.H., T.K., B.T.; development of a mathematical model P.H., T.K., R.P.; design and implementation of an adaptive algorithm P.H., T.K.; conducting numerical experiments P.H., T.K; computational complexity of algorithms P.H., T.K.; measures of soft sensor functioning quality P.H., R.P.; data analyze and write the paper P.H., T.K., R.P., B.T.

Funding

This research was carried out without external financing.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Adams, N.; Bealing, D. Organic Pollution: Biochemical Oxygen Demand and Ammonia. In Handbook of Ecotoxicology; Calow, P., Ed.; Blackwell Publishing Ltd.: Oxford, UK, 1997; pp. 728–749. [Google Scholar]
  2. Penn, M.R.; Pauer, J.J.; Mihelcic, J.R. Biochemical Oxygen Demand. In Enviromental and Ecological Chemistry; Sabljic, A., Ed.; EOLSS: Oxford, UK, 2009; Volume 2, pp. 278–297. ISBN 978-1-84826-206-5. [Google Scholar]
  3. Sulistyowati, R.; Suryowinoto, A.; Fahruzi, A.; Faisal, M. Prototype of the Monitoring System and Prevention of River Water Pollution Based on Android. IOP Conf. Ser. Mater. Sci. Eng. 2019, 462, 012028. [Google Scholar] [CrossRef]
  4. Khalil, B.; Ouarda, T.B.M.J.; St-Hilaire, A. Estimation of water quality characteristics at ungauged sites using artificial neural networks and canonical correlation analysis. J. Hydrol. 2011, 405, 277–287. [Google Scholar] [CrossRef]
  5. Di, Z.; Chang, M.; Guo, P. Water Quality Evaluation of the Yangtze River in China Using Machine Learning Techniques and Data Monitoring on Different Time Scales. Water 2019, 11, 339. [Google Scholar] [CrossRef]
  6. Meyer, A.M.; Klein, C.; Fünfrocken, E.; Kautenburger, R.; Beck, H.P. Real-time monitoring of water quality to identify pollution pathways in small and middle scale rivers. Sci. Total Environ. 2019, 651, 2323–2333. [Google Scholar] [CrossRef] [PubMed]
  7. Akhlaghi, S.; Zhou, N.; Huang, Z. Adaptive adjustment of noise covariance in Kalman filter for dynamic state estimation. In Proceedings of the 2017 IEEE Power & Energy Society General Meeting, Chicago, IL, USA, 16–20 July 2017; Volume 2018, pp. 1–5. [Google Scholar]
  8. Akhlaghi, S.; Zhou, N.; Huang, Z. Hybrid approach for estimating dynamic states of synchronous generators. IET Gener. Transm. Distrib. 2019, 13, 669–678. [Google Scholar] [CrossRef]
  9. Welch, G.; Bishop, G. An Introduction to the Kalman Filter; The University of North Carolina at Chapel Hill: Chapel Hill, NC, USA, 1995; Volume 7, pp. 1–16. [Google Scholar]
  10. Gomolka, Z.; Twarog, B.; Zeslawska, E.; Lewicki, A.; Kwater, T. Using Artificial Neural Networks to Solve the Problem Represented by BOD and DO Indicators. Water 2017, 10, 4. [Google Scholar] [CrossRef]
  11. Ruan, J.; Zhang, C.; Li, Y.; Li, P.; Yang, Z.; Chen, X.; Huang, M.; Zhang, T. Improving the efficiency of dissolved oxygen control using an on-line control system based on a genetic algorithm evolving FWNN software sensor. J. Environ. Manag. 2017, 187, 550–559. [Google Scholar] [CrossRef] [PubMed]
  12. Yu, P.; Cao, J.; Jegatheesan, V.; Du, X. A Real-time BOD Estimation Method in Wastewater Treatment Process Based on an Optimized Extreme Learning Machine. Appl. Sci. 2019, 9, 523. [Google Scholar] [CrossRef]
  13. Du, X.; Wang, J.; Jegatheesan, V.; Shi, G. Dissolved Oxygen Control in Activated Sludge Process Using a Neural Network-Based Adaptive PID Algorithm. Appl. Sci. 2018, 8, 261. [Google Scholar] [CrossRef]
  14. Park, S.; Han, C. A nonlinear soft sensor based on multivariate smoothing procedure for quality estimation in distillation columns. Comput. Chem. Eng. 2000, 24, 871–877. [Google Scholar] [CrossRef]
  15. Qiao, J.; Ju, Y.; Han, H. BOD Soft-sensing Based on SONNRW. J. Beijing Univ. Technol. 2016, 42, 1451–1460. [Google Scholar]
  16. Xie, L.; Zhu, Y.; Huang, B.; Zheng, Y. Kalman filtering approach to multirate information fusion for soft sensor development. In Proceedings of the 15th International Conference on Information Fusion, Singapore, 9–12 July 2012; pp. 641–648. [Google Scholar]
  17. Blanchard, E. Parameter Estimation Method using an Extended Kalman Filter. In Proceedings of the Joint North America, Asia-Pacific ISTVS Conference and Annual Meeting of Japanese Society for Terramechanics, Fairbanks, AK, USA, 23–26 June 2007. [Google Scholar]
  18. Kannel, P.R.; Lee, S.; Lee, Y.-S.; Kanel, S.R.; Khan, S.P. Application of Water Quality Indices and Dissolved Oxygen as Indicators for River Water Classification and Urban Impact Assessment. Environ. Monit. Assess. 2007, 132, 93–110. [Google Scholar] [CrossRef] [PubMed]
  19. Kwater, T.; Pękala, R.; Krutys, P. The mathematical models of water pollution and interpretation of theire distribution. Tech. News 2009, 95–97. [Google Scholar]
  20. Gourishankar, V.; Lawal, M.A. A digital water quality controller for polluted streams. Int. J. Syst. Sci. 1978, 9, 899–919. [Google Scholar] [CrossRef]
  21. Davie, A.M.; Stothers, A.J. Improved bound for complexity of matrix multiplication. Proc. R. Soc. Edinb. Sect. A Math. 2013, 143, 351–369. [Google Scholar] [CrossRef]
  22. Michalski, J.; Kozierski, P.; Ziętkiewicz, J. Comparison of state estimation methods of dynamical systems. Pomiary Autom. Robot. 2017, 21, 41–47. [Google Scholar] [CrossRef]
  23. Cheng, J.; Chen, D.; Landry, R.J.; Zhao, L.; Guan, D. An adaptive unscented kalman filtering algorithm for MEMS/GPS integrated navigation systems. J. Appl. Math. 2014, 2014, 8. [Google Scholar] [CrossRef]
  24. Pękala, R.; Krutys, P.; Żesławska, E. Analysis and visualization of the Wislok river hydrological measurements. Tech. News 2012, 16–19. [Google Scholar]
Figure 1. Idea scheme of a biochemical oxygen demand (BOD) soft sensor for a water quality monitoring system.
Figure 1. Idea scheme of a biochemical oxygen demand (BOD) soft sensor for a water quality monitoring system.
Applsci 09 01883 g001
Figure 2. Scheme of the soft sensor algorithm.
Figure 2. Scheme of the soft sensor algorithm.
Applsci 09 01883 g002
Figure 3. Distributions of waveform BOD and dissolved oxygen (DO) for different values of model parameters.
Figure 3. Distributions of waveform BOD and dissolved oxygen (DO) for different values of model parameters.
Applsci 09 01883 g003
Figure 4. Distributions of generated signals for different parameters of the model: (a) k 1 ,   k 2 , k 3 identical for algorithms and model, (b) k 2   different for algorithms and model, (c) k 1 , k 3 different for algorithms and model, (d) comparison of all cases.
Figure 4. Distributions of generated signals for different parameters of the model: (a) k 1 ,   k 2 , k 3 identical for algorithms and model, (b) k 2   different for algorithms and model, (c) k 1 , k 3 different for algorithms and model, (d) comparison of all cases.
Applsci 09 01883 g004
Figure 5. Schematic diagram of generating object signals with inaccurate model parameters.
Figure 5. Schematic diagram of generating object signals with inaccurate model parameters.
Applsci 09 01883 g005
Figure 6. Distribution of errors of BOD (a) and DO (b) signals resulting from inaccurately selected model parameters (the same extortions).
Figure 6. Distribution of errors of BOD (a) and DO (b) signals resulting from inaccurately selected model parameters (the same extortions).
Applsci 09 01883 g006
Figure 7. Distribution of BOD (a) and DO (b) signals errors resulting from inaccurately selected model parameters (different extortions).
Figure 7. Distribution of BOD (a) and DO (b) signals errors resulting from inaccurately selected model parameters (different extortions).
Applsci 09 01883 g007
Figure 8. Distribution of BOD and DO signals (a) and adaptive algorithm gain coefficients (b) for matrices W = [3, −2; −2, 1] and V = [0.1].
Figure 8. Distribution of BOD and DO signals (a) and adaptive algorithm gain coefficients (b) for matrices W = [3, −2; −2, 1] and V = [0.1].
Applsci 09 01883 g008
Figure 9. Distribution of BOD and DO signals (a) and adaptive algorithm gain coefficients (b) for matrices W = [6, −4; −4, 2] and V = [0.1].
Figure 9. Distribution of BOD and DO signals (a) and adaptive algorithm gain coefficients (b) for matrices W = [6, −4; −4, 2] and V = [0.1].
Applsci 09 01883 g009
Figure 10. Distribution of BOD and DO signals (a) and adaptive algorithm gain coefficients (b) for matrices W = [3, −2; −2, 1] and V = [0.9].
Figure 10. Distribution of BOD and DO signals (a) and adaptive algorithm gain coefficients (b) for matrices W = [3, −2; −2, 1] and V = [0.9].
Applsci 09 01883 g010
Figure 11. Distribution of BOD and DO signals (a) and adaptive algorithm gain coefficients (b) for matrices W = [6, −4; −4, 2] and V = [0.9].
Figure 11. Distribution of BOD and DO signals (a) and adaptive algorithm gain coefficients (b) for matrices W = [6, −4; −4, 2] and V = [0.9].
Applsci 09 01883 g011
Figure 12. Root-mean-squared error (RMSE) quality indicators BOD (a) and DO (b) signals generated.
Figure 12. Root-mean-squared error (RMSE) quality indicators BOD (a) and DO (b) signals generated.
Applsci 09 01883 g012
Figure 13. Values of quality indicators for DO signal at different initial gain values.
Figure 13. Values of quality indicators for DO signal at different initial gain values.
Applsci 09 01883 g013
Figure 14. Mean percentage error (MPE) quality indicators for BOD (a) and DO (b) signals generated.
Figure 14. Mean percentage error (MPE) quality indicators for BOD (a) and DO (b) signals generated.
Applsci 09 01883 g014
Table 1. Computational complexity of the adaptive algorithm.
Table 1. Computational complexity of the adaptive algorithm.
CalculationSpecificity of CalculationsComplexity
1Equation solution d d t x ^ = A x ^ + K A [ y C x ^ ] 2 n 2 + 4 n
2Adaptation error ε = y C x ^ n 2 + 2 n
3Gain correction Δ K = k p ε   2 n
4Gain value K A = K S + Δ K 2 n
Total: 3 n 2   +   10 n     O ( n 2 )
Table 2. Computational complexity of the Kalman filter algorithm.
Table 2. Computational complexity of the Kalman filter algorithm.
CalculationSpecificity of CalculationsComplexity
1The Riccati equation 1 solution d d t P = A P + P A T P C T V 1 C P + D W D T 8 n 3 + 3 n 2 + 4 n
2Gain value K F = P C T V 1 3 n 3 + n 2 + n
3Equation solution x ^ = A x ^ + K F [ y C x ^ ] 2 n 2 + 4 n
Total: 11 n 3 + 6 n 2 + 9 n   O ( n 3 )
1P—estimation error covariance matrix, V—measurement error covariance matrix, W—system disturbances covariance matrix, D—disturbances interaction matrix.
Table 3. Mean percentage error (MPE) indicators of BOD and DO signals errors resulting from inaccurately selected model parameters.
Table 3. Mean percentage error (MPE) indicators of BOD and DO signals errors resulting from inaccurately selected model parameters.
W 1 = W 2 (Figure 5)BODDO
MPE e p m 70.201267.6716
MPE e R 20.95458.6493
W 1 W 2 (Figure 5)BODDO
MPE e p m 95.483369.0614
M P E   e R 17.62487.9677
e R = x ^ x R   ,   e p m = x ^ x p m
Table 4. Average computing times for different algorithms.
Table 4. Average computing times for different algorithms.
Algorithm AdaptiveAlgorithm Kalman
Computing time (s)0.0014690.025784
Table 5. Real results for Wislok River at section Strzyzow–Bialobrzegi [24].
Table 5. Real results for Wislok River at section Strzyzow–Bialobrzegi [24].
Measuring PointDeficit DO (mg/L)Temperature (°C)Velocity of the Flow (km/day)
Strzyzow—0 km−2.019.635.08
Zarzecze—20 km−1.721.528.67
Rzeszow—33 km−2.723.531.78
Bialobrzegi—70 km−0.124.030.15

Share and Cite

MDPI and ACS Style

Hawro, P.; Kwater, T.; Pękala, R.; Twaróg, B. Soft Sensor with Adaptive Algorithm for Filter Gain Correction in the Online Monitoring System of a Polluted River. Appl. Sci. 2019, 9, 1883. https://doi.org/10.3390/app9091883

AMA Style

Hawro P, Kwater T, Pękala R, Twaróg B. Soft Sensor with Adaptive Algorithm for Filter Gain Correction in the Online Monitoring System of a Polluted River. Applied Sciences. 2019; 9(9):1883. https://doi.org/10.3390/app9091883

Chicago/Turabian Style

Hawro, Przemysław, Tadeusz Kwater, Robert Pękala, and Bogusław Twaróg. 2019. "Soft Sensor with Adaptive Algorithm for Filter Gain Correction in the Online Monitoring System of a Polluted River" Applied Sciences 9, no. 9: 1883. https://doi.org/10.3390/app9091883

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop