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 option to skip fixing inputs in sequential decomposition #3442

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alma-walmsley
Copy link
Contributor

@alma-walmsley alma-walmsley commented Dec 5, 2024

Summary/Motivation:

I am working on a problem (within IDAES) where pyomo network's sequential decomposition is used to initialize the model. For tear ports, I want to either:

  • Fix the variables on that port directly, or
  • Remove a degree of freedom by adding a constraint for an expression at that port.

For example, if the port has the variables [flow_mol, pressure, enth_mol], and temperature is an expression of pressure and enth_mol, then I want the ability to unfix enth_mol and constrain temperature to some value to determine the enthalpy.

In pyomo network's case, when running sequential decomposition, all the variables at the port get fixed if they are currently unfixed. I assume this is to prevent user error from too many degrees of freedom.

However, in my case, my model gets over-defined, since a constraint is added to remove a degree of freedom when a variable is unfixed, but those variables get fixed anyway when sequential decomposition is run.

Changes proposed in this PR:

  • Add an option in sequential decomposition to skip fixing all the variables at the tear ports. Defaults to False. Variables can be fixed manually or through the set_guesses_for method.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.71%. Comparing base (eb8a6b5) to head (6b1ebce).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3442      +/-   ##
==========================================
- Coverage   88.71%   88.71%   -0.01%     
==========================================
  Files         882      882              
  Lines      100622   100625       +3     
==========================================
+ Hits        89271    89272       +1     
- Misses      11351    11353       +2     
Flag Coverage Δ
linux 86.18% <100.00%> (-0.01%) ⬇️
osx 76.20% <100.00%> (+<0.01%) ⬆️
other 86.67% <100.00%> (-0.01%) ⬇️
win 84.64% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

3 participants