Skip to content

Conversation

@YoannAnezin
Copy link

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:

@YoannAnezin YoannAnezin requested a review from p-arvy August 21, 2025 15:10
@p-arvy p-arvy changed the base branch from main to feat/resilient-lf August 21, 2025 16:23


/**
* @author Martin Debouté {@literal <martin.deboute at artelys.com>}
Copy link
Member

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.


// Add complementarity constraints' variables
varVSupIndices.add(compVarBaseIndex + 1); // V_sup
varVSupIndices.add(compVarBaseIndex + 4); // sigma
Copy link
Member

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 {
Copy link
Member

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

@@ -0,0 +1,530 @@
package com.powsybl.openloadflow.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.

Please add Artelys copyrights. You can take them in any other file already in main and duplicate them (see last comment).

YoannAnezin and others added 14 commits August 26, 2025 17:34
…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]>
@YoannAnezin YoannAnezin force-pushed the feat/direct_integration_of_reactive_limits branch from c012a93 to 12f74c1 Compare August 28, 2025 16:36
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]>
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. 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>
Copy link
Member

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");
Copy link
Member

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.

@Test
void test() {
parameters.setUseReactiveLimits(false);

Copy link
Member

Choose a reason for hiding this comment

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

Previous comment still applies

<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é -->
Copy link
Member

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;
Copy link
Member

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

Copy link
Member

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 ->
Copy link
Member

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()
Copy link
Member

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) {
Copy link
Member

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]>
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.

3 participants