ADD: Functionality for transforming network and solution data between SI and per-unit systems #152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:make_si_units!
function, allowing the user to transform per-unit network and solution data to SI units;make_si_units!
when interpreting results;per_unit=false
;make_si_units!
andmake_per_unit!
for single- and multinetwork data; anddiameter
for regulator components and scaling of_FLOW_MIN
for pumps without a specified active lower bound);make_si_units!
before testing of expected solution values.