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

Filter NaN flows from MIP #1014

Merged
merged 13 commits into from
May 24, 2024
Merged

Filter NaN flows from MIP #1014

merged 13 commits into from
May 24, 2024

Conversation

pet-mit
Copy link
Collaborator

@pet-mit pet-mit commented May 17, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

  • When sensitivity computation in PRAO fails for a given contingency, a sensitivity failure over-cost is computed, but the flow CNECs of that contingency are still part of the MIP range-action optimization.
    This leads to NaN values in MIP (when sensi computation fails, output reference flow value is NaN) and can crash the RAO.
  • When the initial sensitivity computation has a failed state, no overcost is reported

What is the new behavior (if this is a feature change)?

  • MIP fillers that use the flow variable now filter flow CNECs first, and only retains those with a succeeded sensitivity computation status
  • Unfortunately, since the status can change between two sensi iterations, we may have to remove or add variables and constraints. Since removing variables and constraints is not possible in OR-Tools, the linear problem's update method now resets the MIP and calls the "fill" method first
  • PR Second preventive RAO: fail if one sensitivity fails #994 has been reverted since it is no longer necessary
  • An extra security has been added in OpenRaoMPSolver in order to prevent the MIP from running when there are NaN values added
  • When the initial sensitivity computation has a failed state, the overcost is now reported. This means the RAO can prefer RAs that remove network divergence.
  • The OpenRaoMPSolver (that uses OR-Tools under the hood) is now used in unit tests, making the tests more representative of real-time execution. However, some numerical tolerances had to be relaxed in consequence
  • Also, because we have to reset MIP and call "fill" then "update" when updating now, we cannot access values used in iteration N-1 when in iteration N. Thus MaxLoopFlowFiller and MaxMinMarginFiller cannot keep values from iteration N-1 anymore (when PTDF should not be updated with PSTs). It is assumed that the updated or not values are handled outside the fillers

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

Other information

  • This patch allows avoiding NaN values while keeping the actual fill / update APIs.
    But it does make updateBetweenSensiIterations almost useless, so we will have to refactor the code to remove all updateBetweenSensi methods and replace them with the creation of all-new problems
  • It seems that overamm performance is not really impacted by the re-creation of the optimisation problem between sensi computations. But we'll have to keep an eye on the metrics.

Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
@pet-mit pet-mit added bug Something isn't working PR: waiting-for-review This PR is waiting to be reviewed next-release This issue or pull request should be resolved before next release labels May 17, 2024
@pet-mit pet-mit marked this pull request as ready for review May 17, 2024 14:39
@pet-mit pet-mit requested a review from phiedw May 17, 2024 14:39
pet-mit and others added 2 commits May 17, 2024 16:43
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
@phiedw phiedw merged commit 1a2ac67 into main May 24, 2024
9 checks passed
MartinBelthle pushed a commit that referenced this pull request May 28, 2024
* Filter out NaN values from CoreProblemFiller for flows, sensitivities, ptdfs

Signed-off-by: Peter Mitri <peter.mitri@rte-france.com>
Signed-off-by: belthlemar <martin.belthle@rte-france.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next-release This issue or pull request should be resolved before next release PR: waiting-for-review This PR is waiting to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants