Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 16 commits into from
Jan 22, 2023

Conversation

tasseff
Copy link
Member

@tasseff tasseff commented Jan 14, 2023

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.

@tasseff tasseff requested review from rb004f and ccoffrin January 14, 2023 15:41
@tasseff tasseff merged commit 8c82dc5 into master Jan 22, 2023
@tasseff tasseff deleted the make_si_units branch January 22, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant