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

Add systematic analysis with contingencies to sensitivity analysis #189

Merged
merged 50 commits into from
Jan 12, 2021

Conversation

Djazouli
Copy link
Contributor

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)

  • 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 ? If so, link to this issue using '#XXX' and skip the rest

#186

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>
Djazouli and others added 4 commits December 22, 2020 09:21
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>
@annetill annetill self-requested a review December 22, 2020 11:47
Injection<?> injection = getInjection(network, injectionFactor.getVariable().getInjectionId(), throwExceptionIfNullInjection());
if (injection == null) {
LOGGER.debug("Injection {} not found in the network", injectionFactor.getVariable().getInjectionId());
// FIXME
Copy link
Member

@annetill annetill Dec 22, 2020

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

Djazouli and others added 9 commits December 22, 2020 14:48
…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: 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>
@annetill annetill requested a review from geofjamg December 24, 2020 12:54
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>
@@ -16,7 +16,7 @@
<root level="info">
<appender-ref ref="STDOUT" />
</root>
<logger name="com.powsybl.openloadflow" level="DEBUG" additivity="false">
Copy link
Member

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.

}
}

static class SensitivityFactorWrapped {
Copy link
Member

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.

}

// initialize right hand side
DenseMatrix rhs = initRhs(lfNetwork, equationSystem, factorsByVarConfig);
// Compute the partipation for every factor
Copy link
Member

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.

Copy link
Contributor Author

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

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

@annetill annetill Jan 8, 2021

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.

Djazouli and others added 6 commits January 8, 2021 10:50
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>
@annetill annetill marked this pull request as ready for review January 11, 2021 08:29
@@ -0,0 +1,196 @@
package com.powsybl.openloadflow.network;
Copy link
Member

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

Choose a reason for hiding this comment

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

author

geofjamg and others added 4 commits January 11, 2021 13:27
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 20 Code Smells

93.2% 93.2% Coverage
0.0% 0.0% Duplication

@annetill annetill changed the title [WIP] Add systematic analysis with contingencies to sensitivity analysis Add systematic analysis with contingencies to sensitivity analysis Jan 11, 2021
@annetill annetill requested a review from geofjamg January 11, 2021 15:14
@annetill annetill self-requested a review January 12, 2021 12:52
@geofjamg geofjamg merged commit dcb4d25 into master Jan 12, 2021
@geofjamg geofjamg deleted the systematic_sensitivity branch January 12, 2021 13:14
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