Skip to content

Use scaling factors in solve_strongly_connected_components#3995

Open
dallan-keylogic wants to merge 6 commits into
Pyomo:mainfrom
dallan-keylogic:scale_temporary_block
Open

Use scaling factors in solve_strongly_connected_components#3995
dallan-keylogic wants to merge 6 commits into
Pyomo:mainfrom
dallan-keylogic:scale_temporary_block

Conversation

@dallan-keylogic

Copy link
Copy Markdown

Dependent on #3993.

Fixes #3785.

Summary/Motivation:

Projects like PrOMMiS are increasingly relying on IDAES's BlockTriangularizationInitializer, which in turn relies on solve_strongly_connected_components. However, in models that need significant amounts of scaling, the initialization raises an error that the constraint residuals are not small. That's because BlockTriangularizationInitializer takes constraint scaling into account but solve_strongly_connected_components does not.

This PR finishes addressing that problem by adding a function to copy scaling factors from one block to another and adding an option to solve_strongly_connected_components to allow

Changes proposed in this PR:

  • Adds copy_scaling_factors_to_block function.
  • Adds option to use this function to copy scaling factors to temporary blocks in solve_strongly_connected_components

AI-Use Disclosure

  • [ X] AI tools were NOT used during the preparation of this PR

Notes for reviewers (optional): My use of unittest.mock in the testing here was deliberate and not a result of using AI. It allows us to test which options are being passed to subfunctions, the number of times those subfunctions are called, and avoids needing to call IPOPT or another full solver.

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.

@dallan-keylogic dallan-keylogic changed the title Scale temporary block Use scaling factors in solve_strongly_connected_components Jul 14, 2026
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.

solve_strongly_connected_components should take scaling into account

1 participant