The monitoring system based on lookup algorithm for objects described by ordinary differential equations

. The article presents a new approach to monitoring systems of a certain class using the lookup algorithm. The main task is to generate object signals based on measured but only some selected signals. This idea is based on the Kalman filter approach, but the calculation method of the gain coefficients is different. Its values are determined in a similar way as weights in neural networks during learning (incremental method). The proposed lookup algorithm uses expert knowledge a priori for determining gain corrections, and its functioning is presented for the case of two monitoring error zones. The presented results clearly indicate the advantage of the lookup algorithm over the Kalman filter. Two RMSE and MPE indicators were used for the quality of monitoring..


Introduction
In the present conditions of society development to ensure required the quality and speed action of diagnostic for dynamic systems monitoring, the latest solutions based on adaptive approaches and more are used. Studies related to this concern most of the linear dynamical systems in a discrete version, and the analysis uses different types of recursive algorithms resulting from the methodology of solving differential equations [1].
The matter of monitoring technological processes or the state of the environment is of key importance for the operational management of this process. Information obtained as a result of monitoring, after their proper analysis, enables a more complete and efficient production process, as well as a more complete picture of environments in which may be signals warning against threats such situations as high concentrations of pollutants [2].
One solution is to use an approach that uses the Kalman filter algorithm and its variations characterized by certain limitations [1,[3][4][5][6][7][8]. These constraints may concern requirements such as linearity of objects and knowledge of covariance of disturbances signals [9,10], which in practice is sometimes difficult to determine.
The use of the extended Kalman filter algorithm or the Luenberger observer may improve the quality of observed signals and give a greater generalization in relation to the basic Kalman filter, but there are still requirements in the form of the need to know the covariance of disturbances signals [11,12].
In other approaches, statistical methods are proposed that use certain sets of data collected over a longer period of time, which is inconvenient by the need to collect these data and these calculation are not able to determine dynamic changes in current monitoring signals [6].
Very often for support the process monitoring systems use the capabilities of artificial intelligence to [13,14]. Signal waveforms with dynamic changes are obtained there, but it is necessary to knowlege the mathematical model of the object and to collect and storage of data sets necessary in the process of teaching artificial intelligence.

Kalman filter
The Kalman filter is used for dynamic systems described by linear differential equations. It determines the estimate of the state vector, using the knowledge of input and measurement signals. It should also be assumed that the disturbances affecting system signals and measuring noise have a normal distribution with known covariances [1,9]. The Kalman filter algorithm uses the following relationships: in which KF is the filter gain coefficient to determine which one needs to know the estimation error covariance matrix P. This matrix is determined by solving the Riccati nonlinear differential equation:: where: V -measurement error covariance matrix, W -system disturbances covariance matrix, A -matrix of system dynamics, C -measurement matrix, D -disturbances interaction matrix. The optimum of the Kalman filter depends mainly on the determine the statistics accuracy of the disturbances interacting on system and measuring which are characterized by their covariances W and V. However, if the covariance of these signals is insufficiently defined, the accuracy of the estimation will deteriorate, leading to the lack of optimality of the solution. Accurate specification of disturbance characteristics is a difficult task, especially when these signals result from changing environmental conditions. This article proposes a solution using an adaptive approach that does not require knowledge of disturbance signals and high accuracy of the mathematical model of the monitored system.

The monitoring system using lookup algorithm
In the article, the studies are aimed at determining on-line the desired object signals. An interesting situation is when no signal measurements are made, and it is expected monitoring these signals is required. One of such solutions may be the use of the certain idea Kalman filter algorithm in which the final results are obtained from calculations carried out in a different way.
The monitoring system consists in generating signals when their an immediate measurement is not possible. It uses only easy and quick to implement measurements. The system, which monitoring only measurable signals, gives an incomplete picture of the object (see Fig. 1). The estimators or state observers are often used to determine the immeasurable signals of object's [11].   1 presents the idea of an monitoring system that generates all the interesting signals even without knowing the characteristics of measurement or system disturbances affecting the object. The idea of this monitoring system is based on clever lookup algorithm of gain coefficient value.
The proposed algorithm consists in determining the current gain values in equation (1) for each measurement step. Determination of this gain does not depend on the knowledge of the parameters of the extortion signals statistics, which we assume as an undefined disturbances. The authors assumed gain will be incrementally modified by determined gain corrections ∆K. The values of these corrections depend on the value measurable signal ε(t) defined for the needs of the algorithm, called in future considerations as current measurement monitoring error. Its value was defined as the difference between the current measurement y(t) and the corresponding coordinate of the monitored signal vector ̂ defined by the dependence: where ( )current measurement monitoring error in a given step, Cmeasurement matrix.
The current value of the gain coefficient is determined in accordance with the following expression: in which: -the gain coefficient in a given time step, −1 -the gain coefficient in the previous step, ∆ 2 -correction of the gain coefficient resulting from the accepted assignments ( ) to the zone.
The general block diagram of the proposed algorithm for object monitoring is shown in Fig. 2.

Fig. 2. Block diagram of an clever lookup algorithm
The presented algorithm selects the appropriate correction of the gain coefficient ∆ depending on the current value of the current measurement monitoring error ε. In the case when the value of the error ε is lower than the assumed error limit (first zone) then the correction of the gain coefficient is zero (see Fig. 3). This means that an actual monitoring error is at most equal acceptable error . If the current measurement monitoring error is greater than restriction of error , the correction of the gain coefficient is different to zero and taken from table (see Fig. 3 again). The general pattern of gain coefficient modification is carried out in accordance with the rule (5). It is worth emphasizing that the gain is updated for each measurement step.
In the proposed solution, only two values of gain corrections are determined. This means that the ranges of current measurement monitoring error values obtained during the process of approximating the monitored signals have been divided into only 2 zones. For each zone a fixed value of the correction of the gain coefficient ∆ (i = 1,2) was adopted. The value of the correction ∆ in the proposed algorithm depends on the specificity of the given object and is selected experimentally on the basis of expert knowledge. This correction may take different values depending on the adopted assumptions.
The gain update is incremental in a similar way as is the case with weights in the neural network learning process [15]. The algorithm is able to correctly execute the process for unknown initial conditions and even for the initial gain coefficient of zero.

Object -biochemically polluted river
The mathematical model of the biochemically polluted river usually describes partial differential equations of the hyperbolic type [16]. To simplify the model, without losing the accuracy of description of phenomena, considerations along the so-called characteristics, which results in a set of ordinary differential equations. This interpretation concerns changes in time of water quality indicators, i.e. biochemical oxygen demand (BOD) and dissolved oxygen (DO) deficiency in a free flowing volume of water moving at a certain speed [17]. The values of these indicators is determined by the differential equations presenting the kinetics of the physico-chemical properties of the form: in which: 1  The measurement equation for our considerations takes the form: where: = [0 1] -measurement matrix, -measuring disturbance. The main disadvantage in the commonly measurement BOD methods is that we get the results with some delay (5-20 days), because they require laboratory service. Other features have DO measurements, they can be easily carried up to date. Therefore, for the purpose of water quality monitoring, an algorithm using only the DO measurement will be used.

The inaccuracy of the model parameters
A very important issue in estimating the state using the Kalman filter is knowing the characteristics of disturbances affecting the object and the exact determination of the mathematical model of the object.
In the case of the river model, the coefficients contained in the matrix A depend in general on the temperature. The research shows that these coefficients can take values from the range:    lookup algorithm is comparable with the Kalman filter in the first day, and in the following days, the predominance of the lookup algorithm is visible. It should be noted that the DO indicator is measured, therefore it contains current system information and hence its monitoring errors should be lower in relation to BOD.

Monitoring quality indicators
The quality of monitoring implemented by the proposed algorithm was compared with the Kalman filter. Two indicators were used to assess the quality of the proposed solution. The calculations these indicators were carried out separately for BOD and DO deficit.
The first indicator of monitoring quality is the Root Mean Squared Error (RMSE): The RMSE indicator represents the absolute error, while the MPE indicator represents the relative error.

Simulation of the monitoring system
Simulation experiments were carried out for a hypothetical three-section river with side tributaries, where each section of the river has tributary and is described by the equation (8). Fig. 6 shows the waveforms of signals for one section of the river for 20 and 8 days of observation. It turns out that after a period of 8 days, the BOD water quality indicator from the initial value of 60 [mg/l] drops to about 8 [mg/l]. These are average values of BOD pollutants indicator that occur in rivers. Longer observations of impurities they lead to better water quality so way are hypothetical considerations.  The obtained research results show that better monitoring quality in both 20 days and 8 day observations is obtained using the lookup algorithm. The values of quality indicators (10,11) are presented in Fig. 7. Left side Fig. 7 presented RMSE indicator and the right side of Fig. 7 show the MPE indicator. From conducted observations carried out it follows, that for DO deficit the indicators (10, 11) always received lower values. This is due to the lack of measurements for BOD. In the case of the MPE indicator for 20 days of observation, we obtain slightly worse results in relation to the 8 observation days. This is due to the small values of variables xi and as measurements yi and if there are small values in the denominator of the indicator(11), its value of MPE will significantly increase ( Fig.7 on the right). Figure 8 shows the waveforms of the generated signals of compared solutions for monitoring and the changes in the gain coefficient of the lookup algorithm for the threesection river. The lookup algorithm gives always much better results, especially for the immeasured signal of BOD, as indicated by both waveforms of generated signals and monitoring quality indicators (Fig. 9). It can also be seen that the values of the gain coefficients change significantly over time. In addition, when the estimation errors decrease, the value of the gain coefficients decreases. This indicates a greater dynamics of signal changes for the lookup algorithm compared to the Kalman filter. The conducted observations indicate that for the BOD signal, the MPE index takes almost twice smaller values (better quality) for the lookup algorithm in relation to the Kalman filter. However, for the RMSE indicator, the differences are smaller. For the DO signal, differences between the quality indicators are much smaller, as the examined signal is measured (contains current information about the object).
In Fig. 9 (right side) showing the absolute percentage error, there are sudden changes in errors waveforms due to the inflow of lateral impurities. For these situations better results are generated by the lookup algorithm (continuous line), cause the errors waveforms reaches small values much faster than in case Kalman filter.
Simulation experiments were also carried out for various intensity of system and measurement disturbances (see Fig. 10). The intensity of generated disturbances of signals for BOD and DO was determined on the basis of covariances accepted in the research. It turned out that the intensity of disturbances is not important for the quality of monitoring in the case of the lookup algorithm. This is a very important superiority of proposed algorithm over the Kalman filter.
The value of the MPE monitoring quality indicator for BOD at various system and measurement disturbances covariances varies between 27-30% for the Kalman filter, while for the lookup algorithm the values are much lower and amount to 13-15%. For DO deficit, this indicator is 7-13% for the Kalman filter and for the lookup algorithm 7-8.5%. In all data cases tested, a better quality of monitoring was always obtained, measured by indicators (10,11) for the lookup algorithm for both BOD and DO.

Summary
In the paper the concept of monitoring system is presented, the idea of which uses the Kalman filter certain idea in which the gain coefficients is updated using the clever lookup algorithm. Was proposed two-zone division of errors (4) which was defined for the needs of the algorithm, which allows gain coefficients on-line update . Usually, the zone values are determined based on expert knowledge. The algorithm works stably and is not sensitive to a change in the intensity of disturbances acting on the object, as well as various initial constraints and initial gains coefficient (various disturbances do not destabilize its functioning). Through a universal and clever approach, it can be used for a certain class of objects representing various technological processes in the industrial fields and ecology. The proposed monitoring system can be included in non-invasive diagnostic systems. It can also be used as an estimators in optimal control process.
It is anticipated that further work will concern applications of this application for chemical facilities in which easy measurements will be used to determine immeasurable signals, e.g. concentrations and also in the field of environmental protection where it seems to be natural to apply this approach, e.g. for water treatment plants, sewage treatment plants or for continuous monitoring of water quality in rivers.