## 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 [PERSON]'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  
\begin{table}
\begin{tabular}{c c c} \hline  & **Algorithm Adaptive** & **Algorithm Kalman** \\ \hline Computing time (s) & 0.001469 & 0.025784 \\ \hline \end{tabular}
\end{table}
Table 4: Average computing times for different algorithms.  
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.