NLv2: fix 0 operands in pow expressions #2726
Merged
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.
Fixes IDAES/idaes-pse#1084.
Summary/Motivation:
IDAES noted an error in the NLv2 writer for the case of
pow
expressions where the second operand was a constant 0. This resolves that error (adding a test). In addition, this PR adds logic to simplify expressions that are**0
and**1
(also adding tests).Changes proposed in this PR:
0
operands**0
and**1
expressionsLegal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: