-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add systematic analysis with contingencies to sensitivity analysis #189
Conversation
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
…ted to slack Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
...ain/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis/DcSlowContingencyAnalysis.java
Outdated
Show resolved
Hide resolved
...ain/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis/DcSlowContingencyAnalysis.java
Outdated
Show resolved
Hide resolved
...ain/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis/DcFastContingencyAnalysis.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
…owsybl-open-loadflow into systematic_sensitivity
Injection<?> injection = getInjection(network, injectionFactor.getVariable().getInjectionId(), throwExceptionIfNullInjection()); | ||
if (injection == null) { | ||
LOGGER.debug("Injection {} not found in the network", injectionFactor.getVariable().getInjectionId()); | ||
// FIXME |
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.
I have added here a FIXME
because after the code review I think that we need a decidate analysis of contingencies, factors and injections to avoid treatements all over the code. This analysis will be done before the base case sensitivity analysis and before each N-k analysis. This graph analysis is needed because :
- We only support sensivity analysis on main connected component but the external API exposes the whole network. The list of contingencies provided by the external API is also over the whole network and these lead to a lot of if/else in the code ;
- We will need this kind of analysis on factors and injections involved in the slack distribution when a N-k leads to a separate connected component (connected or off load).
…om scratch Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
…owsybl-open-loadflow into systematic_sensitivity Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
src/main/java/com/powsybl/openloadflow/sensi/DcSlowSensitivityAnalysis.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
src/test/resources/logback-test.xml
Outdated
@@ -16,7 +16,7 @@ | |||
<root level="info"> | |||
<appender-ref ref="STDOUT" /> | |||
</root> | |||
<logger name="com.powsybl.openloadflow" level="DEBUG" additivity="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.
I am going to revert that change, it is a mistake from myself.
src/main/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis.java
Outdated
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/sensi/DcSensitivityAnalysis.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
static class SensitivityFactorWrapped { |
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.
LfSensitivityFactor
is maybe a better name choice.
src/main/java/com/powsybl/openloadflow/sensi/AbstractDcSensitivityAnalysis.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
// initialize right hand side | ||
DenseMatrix rhs = initRhs(lfNetwork, equationSystem, factorsByVarConfig); | ||
// Compute the partipation for every factor |
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.
Improve comment: "// Compute the participation to slack distribution for every factor". I can make some improvements in a dedicated commit if you agree, it will be easier.
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 sure
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
// compute the participation for each injection factor (+1 on the injection, and then -participation on all | ||
// elements participating to load balancing, that are still in the connected component of the factor's variable) | ||
Function<String, Map<String, Double>> getParticipationForBus = busId -> participationPerCc.get(connectivity.getConnectivity().getComponentNumber(lfNetwork.getBusById(busId))); | ||
computeFactorsInjection(getParticipationForBus, factorsGroups); |
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.
Maybe rename it with participationPerBus
as earlier in the code.
List<SensitivityValue> sensitivityValues = calculateSensitivityValues(factorsGroups, | ||
states, Collections.emptyList()); | ||
|
||
Collection<Contingency> straightforwardContingencies = new LinkedList<>(); |
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.
straightforwardContingencies
should be renamed to reflect that these contingencies do not loose connectivity. Maybe the opposite of losingConnectivityContingency
. It would be more readable I think.
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
@@ -0,0 +1,196 @@ | |||
package com.powsybl.openloadflow.network; |
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.
License header
import com.powsybl.iidm.network.Network; | ||
import com.powsybl.iidm.network.TwoWindingsTransformer; | ||
|
||
public class ConnectedComponentNetworkFactory extends AbstractLoadFlowNetworkFactory { |
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.
author
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
…tematic_sensitivity
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
…owsybl-open-loadflow into systematic_sensitivity
Kudos, SonarCloud Quality Gate passed! |
Signed-off-by: Gael Macherel gael.macherel@artelys.com
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 rest#186