-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix zero impedance subgraph #718
Conversation
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
# Conflicts: # src/main/java/com/powsybl/openloadflow/network/GraphVizGraphBuilder.java # src/main/java/com/powsybl/openloadflow/network/LfNetworkListenerTracer.java # src/test/resources/nb.dot # src/test/resources/sim1.dot # src/test/resources/sim1_disconnected.dot
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
@annetill most of the code is here. There is still some failing tests but help would be welcome to finish the work.
|
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Anne Tilloy <[email protected]>
@@ -12,8 +12,10 @@ | |||
*/ | |||
public class ShuntVoltageControl extends DiscreteVoltageControl<LfShunt> { | |||
|
|||
private static final int PRIORITY = 2; |
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.
Indeed we have the hypothesis in main branch that transformers have an highest priority than shunts, but maybe we have to rethink about it. Or make it configurable one day...
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 it should better be configurable
@@ -177,8 +136,8 @@ public void updateSlackBuses() { | |||
} | |||
|
|||
private void invalidateZeroImpedanceNetworks() { |
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.
Your work is really impressive but I think that maybe we have to rethink in a next PR in having just one status for zero impedance line, for DC and for AC calculation. I am not sure it is possible...
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 I see than this badly designed but a better solution is not clear to me. To handle in a next work.
src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystemCreator.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystemCreator.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/network/impl/AbstractLfBranch.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/network/LfZeroImpedanceNetwork.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/network/impl/AbstractLfBranch.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/network/LfZeroImpedanceNetwork.java
Show resolved
Hide resolved
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
# Conflicts: # src/test/java/com/powsybl/openloadflow/ac/NonImpedantBranchDisablingTest.java
Signed-off-by: Anne Tilloy <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Anne Tilloy <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
src/main/java/com/powsybl/openloadflow/network/LfZeroImpedanceNetwork.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/network/LfZeroImpedanceNetwork.java
Outdated
Show resolved
Hide resolved
if (voltageControls.size() > 1) { | ||
// we take the highest target voltage (why not...) and in case of equality the voltage control | ||
// with the first controlled bus ID by alpha sort | ||
voltageControls.sort(Comparator.<VoltageControl<?>>comparingDouble(VoltageControl::getTargetValue) |
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.
you don't need to sort, you can take the min instead (or the max if you revert your comparator, not sure what's clearer!), and then you don't need to check voltageControls size, the loop reducing to something like
voltageControls.stream().max(vcComparator).ifPresent(mainVc -> linkAllVoltageControls(mainVc, voltageControls));
for (VoltageControl<?> vc : zb.getVoltageControls()) { | ||
voltageControlsByType.computeIfAbsent(vc.getType(), k -> new ArrayList<>()) | ||
.add(vc); | ||
vc.getMergedDependentVoltageControls().clear(); |
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.
Rather than giving access to the list we could have VoltageControl::getMergedDependentVoltageControlStream()
and VoltageControl::clearMergedDependentVoltageControls()
src/main/java/com/powsybl/openloadflow/network/LfZeroImpedanceNetwork.java
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/network/LfZeroImpedanceNetwork.java
Outdated
Show resolved
Hide resolved
.setActive(true); | ||
} | ||
|
||
// activate distribution equation and deactivate control equation at all enabled controller buses except one (first) |
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.
The comment does not correspond exactly to what's done (the except one is only for distribution equation)
src/main/java/com/powsybl/openloadflow/network/LfZeroImpedanceNetwork.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
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.
Nice job! 🎉
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restWhat kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)