Skip to content

Conversation

@YoannAnezin
Copy link

@YoannAnezin YoannAnezin commented Oct 20, 2025

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)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

What kind of change does this PR introduce?

What is the current behavior?

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

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

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

mdeboute and others added 30 commits April 8, 2025 16:34
…nt + add a test on real data

Signed-off-by: Martin Debouté <[email protected]>
…lver & remove println in tests + refactor some function's name in order to respect the coding convention

Signed-off-by: Martin Debouté <[email protected]>
… change of weights in the objective function (also update some bounds in the parameters to better fit to our model) + per-unit the quantities in the tests & add a parameterized test for real data

Signed-off-by: Martin Debouté <[email protected]>
…lation in ResilientAcLoadFlowTest

Signed-off-by: Martin Debouté <[email protected]>
…silientKnitroSolver and improve logging for Jacobian entry not found

Signed-off-by: Martin Debouté <[email protected]>
…sI3ENetworks to account for multiple generators on bus

Signed-off-by: Amine Makhen <[email protected]>
…handling for confidential data

Signed-off-by: Martin Debouté <[email protected]>
…cify dense Jacobian context

Signed-off-by: Martin Debouté <[email protected]>
…ance line on IEEE networks and refactor data handling for low impedance line test

Signed-off-by: Amine Makhen <[email protected]>
…refactor ThreeBusConfig test into voltage perturbation test

Signed-off-by: Amine Makhen <[email protected]>
… refactor methods that provide real network data for tests

Signed-off-by: Amine Makhen <[email protected]>
…d improve solver parameter settings

Signed-off-by: Martin Debouté <[email protected]>
…d (s⁻ - s⁺) in constraint evaluation for nonlinear equations (P, Q, V) + passed ResilientKnitroProblem instance to callback for slack indexing + fix ensures slack variables are properly linked to constraint violations

Signed-off-by: Martin Debouté <[email protected]>
…educed penalty weights for P and Q, and improved slack diagnostics with threshold-based logging for significant values

Signed-off-by: Martin Debouté <[email protected]>
…e slack terms to improved optimization precision

Signed-off-by: Martin Debouté <[email protected]>
…2 separate files, add a PerturbationFactory class where all methods to create perturbations are stored and add method to map slack variable index to bus name for visualisation

Signed-off-by: Amine Makhen <[email protected]>
Amine Makhen and others added 14 commits June 26, 2025 18:11
…lback and include PV corrections for load flow checker

Signed-off-by: Amine Makhen <[email protected]>
@YoannAnezin YoannAnezin changed the title Feat/resilient lf New and more resilient knitro solver implementation Oct 21, 2025
@YoannAnezin YoannAnezin changed the title New and more resilient knitro solver implementation Resilient knitro solver implementation Oct 21, 2025
Copy link
Member

@p-arvy p-arvy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work @amakhen @mdeboute @YoannAnezin.
Some changes need to be made to meet the code cleanliness requirement.
The CI also needs to be fixed. It shouldn’t be failing, given that the daily check (see here
) is passing.

return switch (knitroSolverType) {
case STANDARD ->
new KnitroSolver(network, knitroSolverParameters, equationSystem, j, targetVector, equationVector, parameters.isDetailedReport());
case RESILIENT ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name to be changed.

g8.setTargetV(19.5);

// This scenario works if the slack distribution fails and an injection is added at the slack bus
parametersExt.setPlausibleActivePowerLimit(5000); // Remove large generators from slack distribution
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these changes here ? Are they really necessary ?

NonLinearExternalSolverUtils solverUtils,
List<Integer> nonLinearConstraintIds) {

for (int equationId = 0; equationId < sortedEquationsToSolve.size(); equationId++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same than standard solver ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they are the same, but it will be trickier to unify this code snippet because inside addConstraint() we used internal methods of the class KNProblem from which the classes ResilientKnitroProblem and KnitroProblem inherit from.

@@ -1,7 +1,7 @@
# PowSyBl Open Load Flow - Knitro Solver
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README has to be updated after you finished your work

<groupId>com.powsybl</groupId>
<artifactId>powsybl-open-loadflow</artifactId>
<version>1.16.0</version>
<version>2.0.0</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not appear as a modification as it is on main. Please fix this.

@p-arvy p-arvy force-pushed the feat/resilient-lf branch from 6affc16 to 2748d45 Compare October 29, 2025 16:17
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.

5 participants