-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Add integration of Reactiv Limits Outerloop #12
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: feat/resilient-lf
Are you sure you want to change the base?
[WIP] Add integration of Reactiv Limits Outerloop #12
Conversation
src/main/java/com/powsybl/openloadflow/knitro/solver/KnitroSolverParameters.java
Outdated
Show resolved
Hide resolved
|
|
||
|
|
||
| /** | ||
| * @author Martin Debouté {@literal <martin.deboute at artelys.com>} |
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.
Just precising that we will have to avoid such duplication. Instead, we will try to mutualize as much as possible the code. This will come later, but will need to be done before merge in main.
src/main/java/com/powsybl/openloadflow/knitro/solver/KnitroSolverReacLim.java
Outdated
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/knitro/solver/KnitroSolverReacLim.java
Outdated
Show resolved
Hide resolved
|
|
||
| // Add complementarity constraints' variables | ||
| varVSupIndices.add(compVarBaseIndex + 1); // V_sup | ||
| varVSupIndices.add(compVarBaseIndex + 4); // sigma |
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
| * @author Pierre Arvy {@literal <pierre.arvy at artelys.com>} | ||
| * @author Yoann Anezin {@literal <yoann.anezin at artelys.com>} | ||
| */ | ||
| public class ReactiveWithJacobienneTest { |
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.
Is there any real difference with ReactiveNoJacobienneTest file (only, of course, the usage or not of the jacobian matrix computed directly in your solver) ? If no, I think we can mutualize the file, and only change the setup function. This will avoid modifications in one file, that should be applied on both. Better for maintenance/limite the errors
src/test/java/com/powsybl/openloadflow/knitro/solver/ReactiveWithJacobienneTest.java
Show resolved
Hide resolved
| @@ -0,0 +1,530 @@ | |||
| package com.powsybl.openloadflow.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.
Please add Artelys copyrights. You can take them in any other file already in main and duplicate them (see last comment).
src/main/java/com/powsybl/openloadflow/knitro/solver/KnitroSolverReacLim.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/knitro/solver/KnitroSolverReacLim.java
Outdated
Show resolved
Hide resolved
…mits Constraints Model implemented with Knitro Signed-off-by: Yoann Anezin <[email protected]>
…Constraints Model's, last commit before debugging Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
…Constraints Model's, and first tests Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
…Solver Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
c012a93 to
12f74c1
Compare
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
…ith Q limits settled' writter and pertubation tests Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[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. Just some remarks on syntax/form.
| <java.version>17</java.version> | ||
| <powsybl-core.version>6.6.0</powsybl-core.version> | ||
| <powsybl-open-loadflow.version>1.14.1</powsybl-open-loadflow.version> | ||
| <powsybl-open-loadflow.version>1.14.1-SNAPSHOTYA</powsybl-open-loadflow.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.
For testing this is ok. We'll have to change this before merging.
| } | ||
|
|
||
| public KnitroLoadFlowParameters() { | ||
| this.knitroWritter = new KnitroWritter("Logs.txt"); |
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, this will be removed before merging.
src/main/java/com/powsybl/openloadflow/knitro/solver/ReacLimitsTestsUtils.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/knitro/solver/ReacLimitsTestsUtils.java
Show resolved
Hide resolved
| @Test | ||
| void test() { | ||
| parameters.setUseReactiveLimits(false); | ||
|
|
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.
Previous comment still applies
src/test/resources/logback-test.xml
Outdated
| <root level="DEBUG"> | ||
|
|
||
| <appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| <file>D:/Documents/La_Doc/logrte1888.log</file> <!-- Chemin sans espace recommandé --> |
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.
Please remove the ChatGPT comment hehehe
| this.numVEquations = (int) (sortedEquations.stream().filter(e -> e.getType() == AcEquationType.BUS_TARGET_V).count()); | ||
|
|
||
| int numSlackVariables = 2 * (numPEquations + numQEquations + numVEquations); | ||
| int complConstVariables = 5 * numVEquations; |
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.
explain in one line why please
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 this number of complConstVariables
| List<Integer> jacobianRowIndices, | ||
| List<Integer> jacobianColumnIndices) { | ||
|
|
||
| int numberVEq = sortedEquationsToSolve.stream().filter(e -> |
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.
Don't think you need to convert as a list here. You can directly get the number you want from stream
| // Case of inactive Q equations | ||
| if (equationType == BUS_TARGET_Q && !equation.isActive()) { | ||
| compVarStart = vEquationLocalIds.getOrDefault(equationSystem.getIndex().getSortedEquationsToSolve() | ||
| .indexOf(equationSystem.getEquations(ElementType.BUS, equation.getElementNum()).stream() |
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.
No way to get the BUS_TARGET_V equation with a simpler code here ?
| } | ||
|
|
||
| // @Override | ||
| // public void evaluateGA(final List<Double> x, final List<Double> objGrad, final List<Double> jac) { |
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.
Please remove this
…ith Q limits settled' + maven correc Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[email protected]>
Signed-off-by: Yoann Anezin <[email protected]> Signed-off-by: Yoann Anezin <[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: