WaterModels.jl Documentation
Overview
WaterModels.jl is a Julia/JuMP package for steady state water network optimization. It is designed to enable computational evaluation of historical and emerging water network formulations and algorithms using a common platform. The code is engineered to decouple Problem Specifications (e.g., water flow, optimal water flow, network design) from Network Formulations (e.g., mixed-integer linear, mixed-integer nonlinear). This decoupling enables the definition of a wide variety of water network optimization formulations and their comparison on common problem specifications.
Installation
The latest stable release of WaterModels can be installed using the Julia package manager with
] add WaterModels
For the current development version, install the package using
] add WaterModels#master
Test that the package works by executing
] test WaterModels
Usage at a Glance
At least one optimization solver is required to run WaterModels. The solver selected typically depends on the type of problem formulation being employed. As an example, to solve a mixed-integer linear programming (MILP) formulation of the water flow feasibility problem, the open-source mixed-integer programming solver CBC can be used. Installation of the JuMP interface to CBC can be performed via the Julia package manager, i.e.,
] add Cbc
Then, as one example, an approximation of water flow physics for the well-known shamir network, using ten breakpoints to model each potential (or head) loss curve, can be obtained by executing
using Cbc
using WaterModels
ext = Dict(:pipe_breakpoints=>10)
result = run_wf("shamir.inp", MILPWaterModel, Cbc.Optimizer, ext=ext)