1. Introduction
The supply of water faces different problems, ranging from the overexploitation of aquifers, problems in water distribution networks, and pollution, to the lack of control over concessions. These problems affect different sectors of the population and economic activities such as construction or agriculture. In recent years, intensive research has been carried out to improve the monitoring and management of water distribution systems (WDSs) by estimating various parameters that help in the calibration of models with high spatial and temporal resolution [
1,
2]. Accurate knowledge of nodal demands that vary at different times is a prerequisite for predicting a distribution system’s pressure and quality. Consequently, determining these demands helps to improve a distribution system’s performance for the network operators [
3]. Pressures and flows in distribution networks vary according to the nodal demands, which are generally not measurable. Therefore, their estimation is a problem of vital importance in managing WDSs.
Estimation of these demands is carried out from measured states, and it can be seen as an inverse problem whose solution depends on how many state variables are measurable. In this context, in the work performed by [
4], a digital-twin-based solution was proposed to estimate the unsteady flow states in a pumping station. In this approach, the digital twin utilizes a combination of frequency domain analysis and predictive control theory to accurately estimate real-time hydraulic parameters at locations within the pumping station where sensors are not available, even in noisy and uncertain conditions.
Ideally and technologically, it is possible to place sensors in an entire hydraulic network; however, system costs make implementing complete hydraulic instrumentation prohibitive. This problem has been addressed in the literature using optimal sensor placement [
5,
6] or more recently, in work performed in [
7], where a hybrid approach to sensor placement and state estimation applied to water distribution networks was developed, obtaining a mean absolute percentage error of less than 5% in the estimation of the pressure head available in the nodes of the WDS. However, even though this technique significantly reduces instrumentation costs, it does not provide information about the demand at non-instrumented nodes. Therefore, the online estimation of nodal demands is an open problem.
One way to tackle this problem is through vibration signals [
8,
9], acoustic signals [
10], and virtual sensors, such as unknown input observers or extended Kalman filters (EKFs), among others. In particular, the Kalman filter is a commonly used mathematical tool for real-time state estimation [
11]. In this work, a virtual sensor approach is considered. These algorithms allow estimating unknown states, i.e., the demands, based on the measurement of certain available inputs and outputs [
12]. Some reported results can be found in the literature; for instance, in [
3], the authors estimated node demands using particle swarm optimization. The authors in [
13] proposed the Davidon–Fletcher–Powell algorithm, which considers a one-dimensional optimization and scale matrix calculation. Other authors have proposed methodologies based on an extended Kalman filter.
In [
14], an extended Kalman filter approach for adaptative calibration of the nodal demands in water distribution systems was introduced. Twenty-four-hour demand patterns were introduced as prior information for the prediction module and then measurement data were used in the correction module to determine the final estimation of the nodal demand, demonstrating an improved calibration accuracy and robustness against measurement noise. In [
15], a two-objective sampling design method was used for the improvement of the observability of the system and to mitigate the effect of noise in sensor measurements. This was used in the context of nodal demand estimation, since proper sensor sampling is essential for the estimation of nodal demands in a water distribution network, as well as for improving the model accuracy. The work performed in [
16] focused on the estimation of short-term demands in a water distribution network by means of AI techniques, to support sustainable water management. The study reported a comparison between nine machine learning and deep learning methods, demonstrating that Long-Short Term Memory (LSTM) neural networks provided an increased accuracy, even in real-time predictive applications.
In [
17], as in [
18], the authors suggested the design of EKFs based on a hydraulic model to estimate a leak’s magnitude and location. In [
19], a comparison of different short-term water demand forecasting models based on patterns, probability, and moving window techniques was proposed. The EKF stood out from other observers due to its functionality in predicting unknown states under measurement noise and model mismatches, as can be consulted in the survey [
20] and references therein. The authors in [
21] proposed a method based on a dual model that automatically converts slight pressure deviations caused by leaks into signals in the form of virtual leaks. A more in-depth revision of the method for leak localization can be consulted in the recent survey in [
22] and references therein. However, although leakage estimation involves flow estimation, few works have focused on nodal demand estimation.
For instance, in [
23], a calibration method for demands based on an optimization methodology was proposed. In [
24], a probabilistic method for node demand evaluation was analyzed; as a result, the transient response and wave propagation in a pipeline were determined. Based on previous works, the authors in [
25] proposed a transient-based method to skeletonize pipes in series with internal demands. A methodology for node pressure estimations based on artificial neuronal networks was proposed in [
26]. Based on EPANET models and historical data, an optimization-based approach for water consumption was developed in [
27]. Recently, a stochastic approach for analyzing demand in water distribution systems was proposed in [
28]. It is important to note that, despite the different approaches reported in the literature, most works have been based on offline estimations or EPANET models, reducing their applicability.
This work proposes an estimation technique for the demands of a WDS based on extended Kalman filters. The proposed method considers a nonlinear model and the dynamic behavior of the WDS. The method was proved experimentally on a pilot hydraulic network at the Hydroinformatics Laboratory at the Institute of Technology of Tuxtla Gutiérrez. The system’s instrumentation allowed us to validate the algorithms experimentally. Additionally, it was demonstrated that the proposed algorithm presented robustness to measurement noise, which enhances its applicability.
In the literature, approaches such as particle swarm optimization (PSO) and probabilistic estimation have been successfully applied to similar problems. Nonetheless, they often include high computational complexity and become difficult to adapt to real-time scenarios with rapidly changing dynamics. On the other hand, EKFs are a computationally efficient framework for recursively estimating the states of nonlinear systems with complex dynamics and Gaussian noise, which is suitable for online applications where fast convergence and low-latency estimation are needed. Furthermore, EKFs can incorporate system models and online sensor measurements, enabling robust performance estimation, even under uncertain or partially observable conditions. These advantages make EKFs a robust and computationally efficient alternative for online estimation compared to other model-based approaches.
The remainder of this document is organized as follows:
Section 2 presents some key facts about the nonlinear model.
Section 3 presents the node demand algorithm based on the extended Kalman filter.
Section 4 validates the method experimentally in the pilot plant. Finally, conclusions are given in
Section 5.
3. Extension to the Estimation of n Node-Demands
Now consider a system with
n node demands, as illustrated in
Figure 4. In this case, the problem is more complicated, assuming that it is only possible to have sensors in the inlet flow as in many real systems, which means that only
and
are known.
Taking into account the same strategy as discussed above, if the node demands are estimated, then it is possible to estimate the flow after the demand as
Then, by sectioning the all-branched pipeline, where each section represents a node demand, it is possible to estimate all unknown node demands, as shown in
Figure 5. This algorithm must be applied to each section of the pipe sequentially. Thus, after estimating the pressure of the demand node (
), this becomes the new input for the following section.
The reader should note that an EKF estimator must be computed for each section, as given in Algorithm 1. This design of sequential estimators can be used for monitoring WDSs, because it allows the online estimation of all the node demands. Moreover, the method uses the same mathematical model for all pipeline sections, which minimizes the computational cost. Furthermore, by considering the EKF, it is possible to achieve some robustness against model uncertainties and the inherent measurement noise.