**4. Modification of Controllers: Stochastic Consumption**

In a real WDS, there is usually significant time-dependent behaviour due to stochastic water consumption. For this situation, the controllers need to be modified, so that a hydraulic quantity evaluated at a specific time is postulated to be replaced by an average. Let *Z*(*ti*−*n*, *ti*) be the average of *Z* in the time interval from *ti*−*<sup>n</sup>* = *ti* − *nTc* to *ti*. Then, it is natural to define the controllers in Equations (3)–(7) to be used with *Hi* and *vi* replaced by *H*(*ti*−1, *ti*) and *v*(*ti*−1, *ti*), respectively, as done in [11,22] for the LCF controller with *Si* = −1. Similarly, *Si* is replaced by *S*(*ti*−1, *ti*).

The future change Δ*vi* can be modelled by estimating it from the past. Since Δ*vi* is a velocity change in an interval *Tc*, it is proposed that it should be replaced in Equation (7) by

$$\frac{\upsilon(t\_{i-n}, t\_i) - \upsilon(t\_{i-2n}, t\_{i-n})}{n} \tag{8}$$

Hence, *n* is an indicator of how far back the past mean values are used to predict the future. For each *n*, the corresponding LVF controller is denoted LVF*n*.
