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

DC sensitivity analysis: bug fix in case of contingency losing a participating element #272

Merged
merged 2 commits into from
Apr 13, 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)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This is a bugfix

What is the current behavior? (You can also link to an open issue here)
Currently, while running a DC sensitivity analysis, the following bug can occur:
If there are several contingencies, and one of them changes the slack distribution (by losing generators, for example), then it will change the factorStates, and the basecase sensitivity, for all following contingencies. The one that does not change the participation will then be wrong

What is the new behavior (if this is a feature change)?
We do not overwrite the factorStates matrix, but create a new one.

Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
@Djazouli Djazouli requested a review from annetill April 12, 2021 16:03
@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 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@@ -730,8 +730,7 @@ public void analyse(Network network, List<PropagatedContingency> contingencies,
slackParticipationByBusForThisConnectivity = Collections.singletonMap(lfNetwork.getBusById(lfNetwork.getSlackBus().getId()), -1d);
}

factorsStates.reset(); // avoid creating a new matrix to avoid buffer allocation time
fillRhsSensitivityVariable(equationSystem, factorGroups, factorStateForThisConnectivity, slackParticipationByBusForThisConnectivity);
factorStateForThisConnectivity = initFactorsRhs(equationSystem, factorGroups, slackParticipationByBusForThisConnectivity);
Copy link
Member

Choose a reason for hiding this comment

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

I understand you fix. I wonder if there is a way to class the contingencies treatment in order to have in one side contingencies that don't affect the slack participation and in the other side contingencies that affect it.

@annetill annetill changed the title fix side effects from slack distribution change DC sensitivity analysis: bug fix in case of contingency losing a participating element Apr 13, 2021
@geofjamg geofjamg merged commit b094eec into master Apr 13, 2021
@geofjamg geofjamg deleted the bug_sensi_loss_of_connectivity branch April 13, 2021 13:24
flo-dup pushed a commit that referenced this pull request Apr 13, 2021
Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
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