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

Refactor dc sensivity analysis #217

Merged
merged 12 commits into from
Mar 8, 2021
Merged

Refactor dc sensivity analysis #217

merged 12 commits into from
Mar 8, 2021

Conversation

flo-dup
Copy link
Contributor

@flo-dup flo-dup commented Feb 8, 2021

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
No

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Refactor

What is the current behavior? (You can also link to an open issue here)

  1. Common code in DcLoadFlowEngine and DcSensitivityAnalysis
  2. Redundant calls to connectivity to compute the list of disconnected LfBuses or its complement (and therefore maniplulating the GraphDecrementalConnectivity interface in many methods).

Does this PR introduce a breaking change or deprecate an API?
No

@flo-dup flo-dup changed the title Refactor dc sensivity analysis [WIP] Refactor dc sensivity analysis Feb 8, 2021
@flo-dup flo-dup requested a review from annetill February 8, 2021 10:39
@flo-dup flo-dup force-pushed the refactor_dcsa branch 2 times, most recently from 1808991 to 6159cae Compare February 23, 2021 21:27
@flo-dup flo-dup changed the base branch from master to sensi_ac February 23, 2021 21:27
Copy link
Contributor

@Djazouli Djazouli left a comment

Choose a reason for hiding this comment

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

I haven't checked the implementation of the new methods in the connectivity API, but I trust you
The refactoring looks really great ! I hope that at some point, we may have another way of computing "predefinedResults" than using component numbers within the Sensitivity Analysis, but this would be for another time.

activePowerDistribution.run(buses, mismatch);
}

public static double getActivePowerMismatch(Collection<LfBus> buses) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the idea of having as argument a list of buses because before it was a network that represents a unique synchronous component and now you hide that. Do you have to protect/private the functions that use this list as argument.

@flo-dup flo-dup changed the title [WIP] Refactor dc sensivity analysis Refactor dc sensivity analysis Feb 25, 2021
@flo-dup
Copy link
Contributor Author

flo-dup commented Feb 25, 2021

I hope that at some point, we may have another way of computing "predefinedResults" than using component numbers within the Sensitivity Analysis, but this would be for another time.

Thanks, I just forgot that point! I think I can improve this a bit at least.

Base automatically changed from sensi_ac to master February 28, 2021 13:36
bus.setV(Double.NaN);
}
if (!removedBuses.isEmpty()) {
// set buses injections and transformers to 0
Copy link
Contributor

@Djazouli Djazouli Mar 3, 2021

Choose a reason for hiding this comment

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

Losing a transformer in a contingency requires us to do
equationSystem.getEquation(transformer.getNum(), EquationType.BRANCH_ALPHA1).get().getColumn() and set the value for this column to 0.
So we may also need to pass a list of removedTransformers

Copy link
Contributor

Choose a reason for hiding this comment

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

(see #237 )

flo-dup and others added 8 commits March 4, 2021 16:59
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Gael Macherel <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Gael Macherel <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Gael Macherel <[email protected]>
Signed-off-by: Gael Macherel <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 8, 2021

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

98.1% 98.1% Coverage
0.0% 0.0% Duplication

@annetill annetill merged commit eb5e548 into master Mar 8, 2021
@annetill annetill deleted the refactor_dcsa branch March 8, 2021 12:10
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.

4 participants