Skip to content

Modify PyROS DR Order Efficiency #3562

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

Merged

Conversation

shermanjasonaf
Copy link
Contributor

Summary/Motivation:

The PyROS solver currently institutes, as an algorithmic efficiency, the following heuristic for the polynomial decision rule (DR) coefficients of a problem with $n_q$ uncertain parameters:

  • In iteration 0: fix coefficients of all nonstatic DR terms to 0
  • In iterations 1, 2, ..., $n_q$: fix coefficients of only the quadratic DR terms to 0
  • In iterations $n_q + 1, n_q + 2, \dots$: unfix all coefficients

In light of #3533, we have found that:

  • When there are first-stage equality constraints involving the DR variables, instituting the efficiency above may cause PyROS to return suboptimal solutions or terminate prematurely with a(n inaccurate) robust infeasibility status. Such constraints may arise from reformulation (through, for example, coefficient matching) of second-stage equalities that are independent of the state variables
  • Since, as of Add PyROS Uncertain Parameter Reduction #3503, DR variables are not declared for polynomial terms involving only uncertain parameters that are constrained to unique values (i.e., effectively certain parameters), all coefficients should be unfixed by iteration $\tilde{n}_{q} + 1$, rather than $n_q + 1$, where $\tilde{n}_q$ is the number of effective uncertain parameters, such that $\tilde{n}_q \leq n_q$.

Thus, in this PR, the heuristic is modified to the following:

  • If there are DR variable-dependent first-stage equalities, then unfix all DR coefficients in all iterations
  • Else, fix all nonstatic term coefficients in iteration 0, fix only the quadratic term coefficients in iteration 1, 2, ..., $\tilde{n}_q$, and unfix all coefficients in all subsequent iterations

Changes proposed in this PR:

  • Distinguish between DR variable-dependent and DR variable-independent equality constraints in the first-stage block of the preprocessed working model
  • Modify the polynomial DR order heuristic
  • Add tests based on problems that are sensitive to the DR order heuristic

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 Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.73%. Comparing base (0b58294) to head (bb610f5).
Report is 46 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3562      +/-   ##
==========================================
- Coverage   88.73%   88.73%   -0.01%     
==========================================
  Files         890      890              
  Lines      102194   102208      +14     
==========================================
+ Hits        90682    90694      +12     
- Misses      11512    11514       +2     
Flag Coverage Δ
builders 26.61% <4.34%> (+<0.01%) ⬆️
default 84.85% <100.00%> (?)
expensive 34.00% <4.34%> (?)
linux 86.24% <100.00%> (-2.24%) ⬇️
linux_other 86.24% <100.00%> (+<0.01%) ⬆️
osx 76.19% <100.00%> (+<0.01%) ⬆️
win 84.74% <100.00%> (-0.01%) ⬇️
win_other 84.74% <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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-project-automation github-project-automation bot moved this from Todo to Reviewer Approved in Pyomo Release April 2025 Apr 15, 2025
@jsiirola jsiirola merged commit ae2750e into Pyomo:main Apr 16, 2025
35 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in Pyomo Release April 2025 Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants