Skip to content

Go with the Flow: Leveraging Physics-Informed Gradents to Solve Real-World Problems in Water Distribution Systems.

Notifications You must be signed in to change notification settings

HammerLabML/go_with_the_flow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go with the Flow: Leveraging Physics-Informed Gradents to Solve Real-World Problems in Water Distribution Systems

Official Code for the paper "Go with the Flow: Leveraging Physics-Informed Gradents to Solve Real-World Problems in Water Distribution Systems".
All system and package requirements are listed in the document 'environment.yml'. A corresponding conda environment can be setup via conda env create -f environment.yml.

Simulating scenarios to generate data

Data on heads, pressures, demands and flows for Water Distribution Systems (WDSs) can be generated for longer periods of time (Vrachimis et al. https://github.com/KIOS-Research/BattLeDIM) using:

python dataset_generator.py

The simulation will produce an xlsx and multiple csv files in the folder 'Results-Clean' in the respective directories. The xlsx file will be used for training the models.

Training and Evaluation

Models can be trained using

python run.py

A number of arguments can be passed to specify model types and hyperparameters: We include trained model files for all WDSs. Trained models can be used for evaluation using run.py by specifying the 'evaluate' mode and 'model_path'.

Repository Content

File What it's doing
args_dg.json Default arguments for the data generator (s. dataset_generator.py)
args.json Default arguments for the training script (s. run.py)
dataset_generator.py Code that generates toy data and realistic data by running EPANET (Wntr) on either random or periodic demands
generate_jacobians_dh_dd.py Generate Jacobians of heads w.r.t. demands ($\frac{\partial h}{\partial d}$) using PI-GCN
planning_dia_gad.py Apply a genetic algorithm (NSGA-II) for network rehabilitation (Rehabilitation baseline)
planning_dia.py Apply our physics-informed gradient method for network rehabilitation (our method)
run.py Training script to train PI-GCN and the sparse-to-dense baseline model proposed by Ashraf et al. 2022
sensor_placement_ferreira.py Apply a genetic algorithm (NSGA-II) for sensor placement (Sensor placement baseline)
sparse_to_dense_sensor_placement_eval.py Evaluation of sensor placements via sparse-to-dense method.
train_test.py Train- and Testscript for PI-GCN and the sparse-to-dense baseline model proposed by Ashraf et al. 2022
notebooks/pigcn_results.ipynb Evaluation notebook for PI-GCN on both toy and realistic datasets
notebooks/sensor_placement_spectral_random.ipynb Sensor placement baselines (random and spectral clustering) implementation.
notebooks/SensorPlacement.ipynb Sensor placement algorithm using Jacobians ($\frac{\partial h}{\partial d}$) and mutual information (MI).
notebooks/sparse_to_dense_comparison.ipynb Show evaluation for sparse-to-dense baseline model proposed by Ashraf et al. 2022.
notebooks/sparse_to_dense_comparison ChebNet.ipynb Show evaluation for sparse-to-dense baseline model proposed by Hajgató et al. 2021.
notebooks/sparse_to_dense_sensor_placement.ipynb Show evaluation for sensor placements via sparse-to-dense method.

About

Go with the Flow: Leveraging Physics-Informed Gradents to Solve Real-World Problems in Water Distribution Systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 95.3%
  • Python 4.7%