Skip to content
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

Slack bus relocation #923

Merged
merged 73 commits into from
May 24, 2024
Merged

Slack bus relocation #923

merged 73 commits into from
May 24, 2024

Conversation

geofjamg
Copy link
Member

@geofjamg geofjamg commented Dec 5, 2023

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)

Does this PR already have an issue describing the problem?

No

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

When a contingency lost the slack bus we skip the contingency.

What is the new behavior (if this is a feature change)?
We now relocate the slack bus to another valid bus for the contingency and then restore the original slack bus for the next contingency.

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 30 commits October 26, 2023 11:40
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
# Conflicts:
#	src/main/java/com/powsybl/openloadflow/network/impl/HvdcConverterStations.java
#	src/main/java/com/powsybl/openloadflow/network/impl/LfLoadImpl.java
#	src/main/java/com/powsybl/openloadflow/network/impl/LfVscConverterStationImpl.java
#	src/main/java/com/powsybl/openloadflow/network/impl/PropagatedContingency.java
#	src/main/java/com/powsybl/openloadflow/sa/AcSecurityAnalysis.java
#	src/main/java/com/powsybl/openloadflow/sa/DcSecurityAnalysis.java
#	src/main/java/com/powsybl/openloadflow/sensi/OpenSensitivityAnalysisProvider.java
#	src/test/java/com/powsybl/openloadflow/sa/LfActionTest.java
#	src/test/java/com/powsybl/openloadflow/sa/LfContingencyTest.java
#	src/test/java/com/powsybl/openloadflow/sa/OpenSecurityAnalysisGraphTest.java
#	src/test/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysisTest.java
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.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@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
annetill and others added 5 commits May 13, 2024 09:55
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>
geofjamg added 2 commits May 14, 2024 16:54
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
@geofjamg geofjamg changed the title [WIP] Slack bus relocation Slack bus relocation May 14, 2024
@@ -390,7 +397,8 @@ private Map<LfBranch, DisabledBranchStatus> findBranchToOpenDirectlyImpactedByCo
record ContingencyConnectivityLossImpact(boolean ok, int createdSynchronousComponents, Set<LfBus> busesToLost, Set<LfHvdc> hvdcsWithoutPower) {
}

private ContingencyConnectivityLossImpact findBusesAndBranchesImpactedBecauseOfConnectivityLoss(LfNetwork network, Map<LfBranch, DisabledBranchStatus> branchesToOpen) {
private ContingencyConnectivityLossImpact findBusesAndBranchesImpactedBecauseOfConnectivityLoss(LfNetwork network, Map<LfBranch, DisabledBranchStatus> branchesToOpen,
Set<LfBus> initialBusIdsToLose) {
Copy link
Member

Choose a reason for hiding this comment

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

You can remove initialBusIdsToLose from attributes

annetill and others added 2 commits May 15, 2024 09:44
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@jeandemanged jeandemanged self-requested a review May 15, 2024 09:33
// In that case, we have an issue with a different number of variables and equations.
LOGGER.error("Contingency '{}' leads to an isolated slack bus: not supported", contingency.getId());
return new ContingencyConnectivityLossImpact(false, 0, Collections.emptySet(), Collections.emptySet());
if (isSlackBusIsolated(connectivity, network.getSlackBus())) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (isSlackBusIsolated(connectivity, network.getSlackBus())) {
if (network.getSlackBuses().stream().anyMatch(slackBus -> isSlackBusIsolated(connectivity, slackBus))) {

fixes a modified version of testBusBarSectionContingencyWithSlackBusRelocation() with following parameters:

lfParameters.getExtension(OpenLoadFlowParameters.class).setSlackBusesIds(List.of("VL1_1", "VL1_0")).setMaxSlackBusCount(2);

but remains an issue to solve, i am getting Expected to have same number of equations (9) and variables (10) with

lfParameters.getExtension(OpenLoadFlowParameters.class).setSlackBusesIds(List.of("VL1_0")).setMaxSlackBusCount(2);

for N situ:

INFO  14:26:59.050 c.p.o.n.LfNetwork    | Network {CC0 SC0}, slack buses are [VL1_0] (method='Parameter bus')
INFO  14:26:59.051 c.p.o.n.LfNetwork    | Network {CC0 SC0}, reference bus is VL1_0 (method='First slack')

and CTG situation:

INFO  14:26:59.216 c.p.o.n.LfNetwork    | Network {CC0 SC0}, slack buses are [VL1_1, VL2_0] (method='Most meshed bus')
TRACE 14:26:59.217 c.p.o.n.LfNetworkListenerTracer | onSlackBusChange(bus=VL1_1, slack=true)
TRACE 14:26:59.217 c.p.o.n.LfNetworkListenerTracer | onSlackBusChange(bus=VL2_0, slack=true)
INFO  14:26:59.217 c.p.o.n.LfNetwork    | Network {CC0 SC0}, reference bus is VL1_1 (method='First slack')
TRACE 14:26:59.217 c.p.o.n.LfNetworkListenerTracer | onReferenceBusChange(bus=VL1_1, reference=true)
...

java.util.concurrent.CompletionException: com.powsybl.commons.PowsyblException: Expected to have same number of equations (9) and variables (10)

Copy link
Member

Choose a reason for hiding this comment

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

probably a weird edge case where with provided settings we get more slack buses in N-1 situation compared to N situation

Copy link
Member

@jeandemanged jeandemanged left a comment

Choose a reason for hiding this comment

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

support of multiple slack buses will be revisited in other PRs

@annetill
Copy link
Member

support of multiple slack buses will be revisited in other PRs

And the possibility to have for a security analysis a slack bus different that the reference bus. And of course the support of the lose of the reference bus or the slack bus.

@jeandemanged jeandemanged linked an issue May 17, 2024 that may be closed by this pull request
geofjamg added 2 commits May 23, 2024 14:26
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
@geofjamg
Copy link
Member Author

geofjamg commented May 24, 2024

@jeandemanged we decided to just no support AS with multiple slack buses and write a log to warm that we have forced the slack bus count to 1. It would need a lot a dev to support it as it would require to correctly update the active power distribution equation between slack each time a slack bus is disabled or enabled. It probably does not worth to do it as mutliple slacks is very rarely useful.

Copy link

@geofjamg geofjamg merged commit f302b2e into main May 24, 2024
6 checks passed
@geofjamg geofjamg deleted the slack_bus_relocation branch May 24, 2024 11:31
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.

Slack bus relocation
5 participants