Development of an AI system for optimizing water supply and sanitation
Water supply is a critical infrastructure with minimal digitalization in most cities. AI optimizes pumping stations, detects leaks, and manages water quality in real time.
Pumping station control
Optimization of pump scheduling:
Pumps are the largest consumer of electricity in water supply systems. Their goal is to maintain reservoir pressure and levels while minimizing energy costs.
import numpy as np
from scipy.optimize import minimize
import pandas as pd
class PumpScheduleOptimizer:
"""Оптимизация расписания насосов с учётом тарифной сетки"""
def __init__(self, n_pumps, reservoir_capacity_m3):
self.n_pumps = n_pumps
self.V_max = reservoir_capacity_m3
self.V_min = reservoir_capacity_m3 * 0.2 # мин. 20% объёма
def optimize_24h(self, demand_forecast, tariff_schedule, pump_specs, V_init):
"""
demand_forecast: потребление по часам [м³/ч]
tariff_schedule: тариф электроэнергии по часам [руб/кВтч]
pump_specs: [{flow_m3h, power_kw, min_run_time_h}]
V_init: начальный уровень резервуара [м³]
"""
T = 24 # горизонт 24 часа
# Решение задачи LP: [on/off] каждого насоса в каждый час
from pulp import LpProblem, LpMinimize, LpVariable, lpSum, LpBinary
prob = LpProblem("pump_schedule", LpMinimize)
# Бинарные переменные: насос i включён в час t
pump_on = [[LpVariable(f"pump_{i}_{t}", cat='Binary')
for t in range(T)] for i in range(self.n_pumps)]
# Переменная уровня резервуара
V = [LpVariable(f"V_{t}", lowBound=self.V_min, upBound=self.V_max)
for t in range(T+1)]
V[0].setInitialValue(V_init)
# Цель: минимизировать стоимость электроэнергии
prob += lpSum(
pump_specs[i]['power_kw'] * pump_on[i][t] * tariff_schedule[t]
for i in range(self.n_pumps) for t in range(T)
)
# Баланс резервуара
for t in range(T):
inflow = lpSum(pump_specs[i]['flow_m3h'] * pump_on[i][t]
for i in range(self.n_pumps))
prob += V[t+1] == V[t] + inflow - demand_forecast[t]
prob.solve()
return [[pump_on[i][t].value() for t in range(T)] for i in range(self.n_pumps)]
Optimization effect:
By shifting pump operation to night hours (cheap tariff): savings of 15–25% on electricity costs with the same volume of water supplied.
Leak detection
Balance sheet method:
Material balance: supply volume (meters at pump stations) - consumption volume (meters at subscribers) = losses. Non-Revenue Water (NRW) in Russia: 20–40% is a typical level.
Pressure transient analysis:
Leaks create characteristic pressure changes in the network: - Sudden pressure drops: a pipe break - Gradual trend: a slow leak through a defect - LSTM on pressure time series → anomaly detection
Spatial localization of the leak:
- Correlation method: two acoustic sensors → sound delay → distance to leak - ML on a network of pressure sensors: from which node the anomalies radiate → search zone
Localization accuracy: 50–100 m without soil excavation.
Water quality
Online monitoring of parameters:
IoT sensors on the distribution network and at consumers: - Residual chlorine: should be >0.05 mg/l throughout the network (SanPiN 2.1.3684) - Turbidity, pH, temperature - Nitrates, ammonium (water intake points)
Chlorine Spread Model:
Hydraulic model + chlorine consumption kinetics (EPANET2): - Prediction of chlorine concentration at any point in the network - Optimization of chlorine dosing: minimum dose → ensure standard throughout the network
Pollution detection:
Atypical profile of several parameters simultaneously → ML classifier → alert: - Turbidity + pH deviation + organics - Geolocation: in which area of the network did it occur → probable source
Wastewater network management
Forecast of consumption in collectors:
During heavy rainfall, the volume of surface runoff + wastewater = risk of overflow: - LSTM based on rain gauge data + levels in collectors - Forecast for 1–2 hours → pre-emptive control of valves
Optimization of sewer pumping stations:
Similar to water supply: smooth out peaks in supply → avoid overloading the wastewater treatment plant (WWTP), use the storage capacity of collectors.
Development time: 4–7 months for an AI water supply system with pump optimization, loss monitoring, and water quality.







