Optimization variables - #1844
Open
dallan-keylogic wants to merge 4 commits into
Open
dallan-keylogic wants to merge 4 commits into
dallan-keylogic wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1844 +/- ##
=======================================
Coverage 77.60% 77.60%
=======================================
Files 424 424
Lines 67657 67717 +60
Branches 11437 11452 +15
=======================================
+ Hits 52503 52552 +49
- Misses 12535 12541 +6
- Partials 2619 2624 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary/Motivation:
The Flowsheet Inspector tool displays model diagnostic information after both initialization and optimization. The problem with displaying model diagnostic information is that an optimization model is always going to have positive degrees of freedom. That causes a DOF warning to be emitted, as well as a warning about structural singularity.
The solution I propose is to add the
optimization_variablesconfig option to theDiagnosticToolbox. This is a list of variables that are known to be unfixed in order to optimize the flowsheet. If such a list is passed in, we expect the number of degrees of freedom to equal the number of "optimization variables" (barring the edge case of an "optimization variable" appearing exclusively in inequality constraints or the objective function). The Flowsheet Inspector will be modified in a future PR to have a way for the user to declare "optimization variables" and thereby allow the user to keep track of their degrees of freedom.However, adding this option added a bunch of edge cases: what if an "optimization variable" is fixed? What if it's entirely unused? To solve these problems, additional methods were added to warn the user about these situations.
One idea for a future PR is to also add an option to check for structural singularity when the "optimization variables" are fixed. If the system is indeed structurally singular, then there is an algebraic relationship between the "optimization variables", and their values will be confined to a lower dimensional surface. This would indicate that the user doesn't understand their system well and that there are some other combinations of variables which are really being optimized.
Changes proposed in this PR:
optimization_variablesconfig argument to theDiagnosticsToolboxDiagnosticsToolboxreporting for degrees of freedom and structural singularity to allow for the fast that the system has nonzero DOFdisplay_fixed_optimization_variablesanddisplay_unused_optimization_variablesdiagnostic methods to prevent user error when declaring these variables.variables_in_activated_objectives_setmodel statistics option to keep track of variables in objective functions and modify theunused_variables_setmethod in model statistics so that variables that appear exclusively in objective expressions do not count as "unused".Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: