Skip to content

[Draft] Improve fast DC AS performances #1169

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

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

annetill
Copy link
Member

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)

No, because this PR should never be merged but separated in small PRs.

Does this PR already have an issue describing the problem?

No, but the fast DC AS is not as fast as expected. For 3000 branch contingencies in the 400-225 kV french network, it is only 50% faster than the classical DC AS.

image

What kind of change does this PR introduce?

Many trials, to be discussed with @geofjamg and @p-arvy. We stopped the PR because our first goal was to delete totally network saving and restoration. Because of slack distribution, it could lead to a complex duplication of some existing code (see the update of DC target vector). So we think now that a first quick win could be to create a DC network save/restore with as less as possible fields.

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:

geofjamg and others added 18 commits December 31, 2024 11:06
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@annetill annetill requested review from geofjamg and p-arvy January 15, 2025 07:20
@@ -83,6 +81,7 @@ public static double[] runDcLoadFlowWithModifiedTargetVector(DcLoadFlowContext l

DcLoadFlowParameters parameters = loadFlowContext.getParameters();
if (parameters.isDistributedSlack()) {
// FIXME, distribution keys has changed...
Copy link
Member Author

Choose a reason for hiding this comment

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

@p-arvy here is why we stop, as slack distribution keys have changed, the trajet vector has to be updated. Doing it by hand is really complex and in a way a code duplication, so it could be nice if you test a DC network save/restore with the less possible number of fields (only buses, some branches, all branches, which attributes inside).

Copy link
Member

Choose a reason for hiding this comment

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

Okay thank you for the feedback @annetill. I will take a look.

Copy link
Member

Choose a reason for hiding this comment

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

Hello @annetill, @geofjamg, my understanding is that we want to return to applying the LfContingency, but this time saving/modifying/restoring the least possible number of fields.

In doing so, I have the impression that it is sufficient to apply the generators/loads/hvdcs changes due to the LfContingency, and save/restore the BusDcState of the LfNetwork, as the impact of changes on other elements (lost buses/PSTs) is already accounted for in the RHS override by directly modifying the target vector array (in method WoodburyEngine.runDcLoadFlowWithModifiedTargetVector). What do you think ?

I have pushed a commit in this regard (note that the code is not yet clean). Please feel free to comment.

Copy link
Member

Choose a reason for hiding this comment

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

I also rolled back to have the case distinction when the contingency causes generator/load losses or not (to avoid having to save/apply/restore the modifications). This reduces significantly execution time in case of branch contingencies.

p-arvy added 15 commits January 31, 2025 11:56
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
# Conflicts:
#	src/main/java/com/powsybl/openloadflow/sa/WoodburyDcSecurityAnalysis.java
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
# Conflicts:
#	src/main/java/com/powsybl/openloadflow/sa/WoodburyDcSecurityAnalysis.java
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Copy link

@vidaldid-rte
Copy link
Collaborator

@p-arvy @geofjamg @annetill I think that Pierre has integrated most of it in OLF. Can this PR be closed or is there something left to intergate in OLF to improve the fast DC perf and design ?

@p-arvy
Copy link
Member

p-arvy commented May 16, 2025

@p-arvy @geofjamg @annetill I think that Pierre has integrated most of it in OLF. Can this PR be closed or is there something left to intergate in OLF to improve the fast DC perf and design ?

@vidaldid-rte only the state vectorization remains to be integrated (see class NetworkDcVectorState, which had a noticeable impact on performance), but we agreed to wait for its inclusion in OLF before implementing it in fast DC SA.

Another improvement that had been explored in the PR was determining the most restrictive limits on the branches, in order to more quickly check for violations (~10% time improvement). However, the code is incomplete / not well tested.

The PR can either be kept open to continue exploring this development, or closed and replaced with an issue listing both improvements for future follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants