Role

First Author

Team

Yeji Kim, Matthew Bartos

Platforms

Python, pipedream, EPANET / WNTR, Population Monte Carlo, Bayesian inference, AWS data pipeline

Date

Jan 2024 – Present

Model-based leak detection and localization compares measured pressure with model-predicted pressure. Parametric error in roughness, base demand, pump curve, and minor losses typically exceeds the leak-induced head change, so the residual is dominated by model error rather than by the leak. Conventional practice is to calibrate a few coefficients by hand. This framework replaces that step with ensemble calibration and marginalization.

Detection, size estimation, and localization are not stages of a workflow. They are the same pipeline instantiated on a different inference target: the prior, the calibrated ensemble, and the marginalization step are shared, and only the likelihood and the decision rule change.

Five stages: priors on the uncertain parameters, an ensemble refined by population Monte Carlo, a likelihood under each draw, marginalization over the ensemble, and a decision rule. The two rows are the two analyses, sharing every stage but the likelihood and the decision.

The shared pipeline

Prior. θ collects roughness, base demand, pump curve, and minor losses, plus the leak parameters of whichever analysis is running. Priors are broad and independent.

Ensemble. N draws θd from the prior. Each draw simulates the baseline and every leak scenario under the same θd, so a leak signature and its baseline carry a common model error that differencing removes.

Population Monte Carlo. Importance weights against pressure sensors and the metered system inflow, followed by resampling and jitter, with the posterior serving as the next proposal:

wd ∝ p(D | θd) p(θd) / q(θd)

Leak flow meters are never read; the leak flow enters as a parameter to be estimated.

Marginalization. The target is averaged over the calibrated ensemble rather than evaluated at a point estimate:

p(x | y) = (1/N) Σd p(x | y, θd)

Hydraulics are solved with pipedream, which integrates the Saint-Venant equations with a Preissmann slot for pressurized flow.

The two instantiations

  Detection and size Localization
Target x leak area a candidate junction c
Observations pump flow and pressure, as a time series tap pressures and the metered system inflow
Likelihood kernel density estimate over the ensemble samples of leak area, pressure, and flow, conditioned on the observation at each time step and accumulated across the series
f̂(a,H,Q) = (1/N) Σi Kh( · − (ai,Hi,Qi) )
a fingerprint catalogue per draw, the head change at the taps for a leak at each candidate; common mode removed and a leak scale fitted per candidate, so only shape is compared, leaving a residual rc in units of sensor noise
p(c | y, θ) ∝ exp( −rc / 2σ2 )
Decision Bayes factor on the Kass-Raftery scale, a leak declared at BF10 > 10; size as the MAP or median with a credible interval
BF10 = p(y | M1) / p(y | M0)
every candidate above a cost-ratio threshold is reported, with C the cost of a crew visit and W the cost of a missed leak; the posterior also yields a credible set over junctions
τ = C / (W + C)
PMC schedule five trials after marginalization; real-time detection skips the loop and runs on the prior ensemble once on a design period, before the catalogue is built; parameters, thresholds, and ensemble are then fixed

References

Supported by the National Science Foundation under Grant 2220516.