-
Notifications
You must be signed in to change notification settings - Fork 292
Block Triangularization fixes #1704
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
Block Triangularization fixes #1704
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1704 +/- ##
==========================================
- Coverage 77.44% 77.43% -0.01%
==========================================
Files 395 395
Lines 64785 64792 +7
Branches 10900 10902 +2
==========================================
Hits 50173 50173
- Misses 12098 12105 +7
Partials 2514 2514 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| """ | ||
| Call solve_strongly_connected_components on a given BlockData. | ||
| """ | ||
| if number_activated_constraints(block_data) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here? Should there be some kind of warning or error thrown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is here because Pyomo throws an error when solve is called on a block with no constraints. We need to support initialization for blocks with no constraints because block triangularization is the default initializer for state blocks. Certain state blocks end up having no constraints (typically when defined_state == True). It's easier to put this check in the block triangularization rather than building out infrastructure for every property package to handle this circumstance.
Summary/Motivation:
Until Pyomo/pyomo#3785 is addressed,
solve_strongly_connected_componentsdoes not take scaling into account. However, the initialization postcheck does, so constraints may have too large of a scaled residual to past the postcheck. Here we fix that issue by performing a block solve aftersolve_strongly_connected_componentsreturns.Additionally, I've switched block triangularization from using the Pyomo
SolverFactorytoget_solverso it uses IDAES's default solver settings. Usingget_solverhad caused issues in the past, but hopefully scaling has addressed them.Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: