-
Notifications
You must be signed in to change notification settings - Fork 0
Resilient knitro solver implementation #16
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
base: main
Are you sure you want to change the base?
Conversation
…ed with Knitro Signed-off-by: Martin Debouté <[email protected]>
…ilient Solver Signed-off-by: Martin Debouté <[email protected]>
…nt + add a test on real data Signed-off-by: Martin Debouté <[email protected]>
…lver run method Signed-off-by: Martin Debouté <[email protected]>
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]>
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]>
… validate our approach Signed-off-by: Amine Makhen <[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]>
Signed-off-by: Martin Debouté <[email protected]>
…re readable 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]>
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]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
…e objective function Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
…check function Signed-off-by: Amine Makhen <[email protected]>
…LinkedHashSet Signed-off-by: Martin Debouté <[email protected]>
…lback and include PV corrections for load flow checker Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Martin Debouté <[email protected]>
…ss constraints Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
…ient user routine Signed-off-by: Amine Makhen <[email protected]>
…ties Signed-off-by: Amine Makhen <[email protected]>
…e objective Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
p-arvy
left a comment
There was a problem hiding this 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 -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name to be changed.
src/main/java/com/powsybl/openloadflow/knitro/solver/KnitroLoadFlowParameters.java
Outdated
Show resolved
Hide resolved
| 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 |
There was a problem hiding this comment.
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 ?
src/test/java/com/powsybl/openloadflow/knitro/solver/utils/KnitroSolverParametersTest.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/knitro/solver/ResilientKnitroSolver.java
Outdated
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/knitro/solver/ResilientKnitroSolver.java
Outdated
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/knitro/solver/ResilientKnitroSolver.java
Outdated
Show resolved
Hide resolved
| NonLinearExternalSolverUtils solverUtils, | ||
| List<Integer> nonLinearConstraintIds) { | ||
|
|
||
| for (int equationId = 0; equationId < sortedEquationsToSolve.size(); equationId++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same than standard solver ?
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
src/main/java/com/powsybl/openloadflow/knitro/solver/ResilientKnitroSolver.java
Show resolved
Hide resolved
6affc16 to
2748d45
Compare
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Signed-off-by: Amine Makhen <[email protected]>
Please check if the PR fulfills these requirements
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?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information: