lanl-ansi / WaterModels.jl

A Julia/JuMP Package for Water Distribution Network Optimization
https://lanl-ansi.github.io/WaterModels.jl/latest/
Other
73 stars 11 forks source link

ADD: Functionality for transforming network and solution data between SI and per-unit systems #152

Closed tasseff closed 1 year ago

tasseff commented 1 year ago

Past versions of WaterModels have assumed (1) the optimization model being solved is represented in some per-unit system and (2) all solution data are also represented in that per-unit system. Unlike other network modeling packages (e.g., GasModels), a make_si_units! function (or equivalent) had not been implemented, and transforming data between per-unit and SI systems was not straightforward. This pull request makes the following additions or corrections:

  1. A make_si_units! function, allowing the user to transform per-unit network and solution data to SI units;
  2. Updates to the documentation to encourage use of make_si_units! when interpreting results;
  3. The ability to formulate problems as expected even when per_unit=false;
  4. Tests to verify the correct behavior of make_si_units! and make_per_unit! for single- and multinetwork data; and
  5. Correction of per-unit transformations that were not previously being made (e.g., diameter for regulator components and scaling of _FLOW_MIN for pumps without a specified active lower bound);
  6. Modification of prior unit tests to call make_si_units! before testing of expected solution values.