A hydraulic surrogate model and real-time control methods of urban drainage networks.
The main branch is based on Tensorflow. See here for the PyTorch version.
Please feel free to read or cite our paper below.
GNN-based model: Zhang, Z., Tian, W., Lu, C., Liao, Z. and Yuan, Z. 2024. Graph neural network-based surrogate modelling for real-time hydraulic prediction of urban drainage networks. Water Research, 263, 122142. https://doi.org/10.1016/j.watres.2024.122142
Gradient-based MPC: Zhang, Z., Tian, W., Liao, Z. and Yuan, Z. 2026. Differentiable neural network-based models enable gradient-based optimization for model predictive control of urban drainage networks. Water Research, 291, 125188. https://authors.elsevier.com/a/1mKOH9pi-huFn
-
generate labels
python main.py --simulate --env (env_name) --data_dir (data_name) (--act)Simulations are made to generate training data at
./envs/data/env_name/data_name/. -
training
python main.py --train --env (env_name) --data_dir (data_name) --model_dir (model_name) (--edge_fusion) (--act conti/rand) (--conv GAT) (--recurrent Conv1D) (--batch_size 64) (--epochs 20000) (--if_flood) (--resnet) (--seq_in 60) (--seq_out 60) (--n_sp_layer 5) (--n_tp_layer 5)The model structure is built and trained with data at
data_dirfor epochs. Details of the model and training parameters refer toconfig.yaml. The trained model and training loss logging are saved at./model/(env_name)/(model_name)/. -
testing
python main.py --test --env (env_name) --model_dir (model_name) --rain_dir/rain_num/rain_suffix (rain_name, depends on the source) --result_dir (result_name) (--act conti/rand)The model is loaded to emulate the drainage network in various rainfalls. Details of the model and testing parameters refer to
./utils/config.yamlandparserfunc atmain.py. The testing states, performance (perfs), settings and prediction results of each rainfall are saved at./results/(env_name)/(result_name)/. -
model predictive control
python mpc.py --env (env_name) --act (conti/rand) (--ctrl_step 5) (--horizon 60) (--lag) --rain_dir/rain_num/rain_suffix (rain_name) --result_dir (result_name) (--use_current) (--pop_size 64) (--termination ftol 0.001) (--surrogate) (--model_dir model_name) (--gradient) (--method l-bfgs-b)Implement Model Predictive Control with physics-based/surrogate internal model and genetic algorithm/gradient-based method. Details of the MPC parameters refer to
./utils/mpc.yamlandparserfunc atmpc.py. The states, performance (perfs), settings,and optimization results of each rainfall will be saved at./results/(env_name)/(result_name)/.
-
shunqing
- Stormwater network
- 113 nodes (105 junctions and 8 outfalls)
- 131 conduits and 106 subcatchments (cover 33.02 km2)
- 148 synthetic rainfalls included with duration of 6-24 hrs
- Details refer to ga_ann_for_uds.
-
astlingen
- Combined sewer network
- 30 nodes (23 junctions, 6 tanks and 1 outfall)
- 29 edges (23 conduits and 6 outflow orifices)
- 10-yr rainfall monitoring data of 4 gauges are included
- Details refer to SWMM-Astlingen.
-
chaohu
- Combined sewer network
- 2 pump stations with storage tanks (CC and JK)
- CC has 2 storm pumps and 2 sewage pumps
- JK has 2 storm pumps and 1 sewage pump
- Chicago rainfall pattern.
-
hague
- Stormwater network
- 2 detention ponds with outflow valves
- 10-yr rainfall monitoring data are included
- Details refer to swmm_wq_rl.
- tensorflow == 2.6.0
- keras == 2.6.0
- tensorflow_probability == 0.11.0
- spektral == 1.2.0
- protobuf == 3.20.0
- pyswmm == 1.5.1
- pystorms == 1.0.0
- swmm-api == 0.2.0.18.3
- matplotlib == 3.5.2
- pymoo == 0.6.0