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

Security analysis: support new branch result API #326

Merged
merged 18 commits into from
Sep 16, 2021

Conversation

obrix
Copy link
Member

@obrix obrix commented Jul 1, 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, ...)

Go further in DC mode security analyis : support new branch result elements in analysis result, also maybe support bus and bus results.

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

Branch result are not used and the analysis only support branch contingencies.

What is the new behavior (if this is a feature change)?

TBD

Does this PR introduce a breaking change or deprecate an API? If yes, check the following:

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

obrix added 9 commits June 25, 2021 16:51
…owTransfer.

Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
…c branch.

Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
@obrix obrix requested a review from annetill July 2, 2021 15:02
BranchResult preContBR = preContingencyBranchResults.get(branchId);
double preContingencyFlow = preContBR.getP1();
double postContingencyFlow = v.getFunctionReference();
double flowDelta = preContingencyFlow >= 0.0 ? postContingencyFlow - preContingencyFlow : preContingencyFlow - postContingencyFlow;
Copy link
Member

Choose a reason for hiding this comment

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

My understanding of the definition of a flow transfer on side 1 is that you have:
flow transfer = (postContingencyFlow - preContingencyFlow) / preContRefFlow

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes that's what is computed when preContingencyFlow is positive. @Hadrien-Godard suggested inversing it when it is < 0.0, I am not sure about the convention here. @Hadrien-Godard do you have any idea ?

Copy link
Member

Choose a reason for hiding this comment

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

If preContingencyFlow is negative, for example it equals -100MW, it means, in DC, that on side 2, there is a flow of 100MW.

If the flow on this branch increases after the contingency, then the postContingencyFlow will equal, for example, -110MW. Therefore, postContingencyFlow - preContingencyFlow will equal -10MW.

Hence, if flow transfer = (postContingencyFlow - preContingencyFlow) / preContRefFlow, a negative value of a flow transfer does not mean that the flow on the line descreases after the contingency.

I have proposed a computation that ensures that the flow transfer is positive if and only if more power are flowing throught the line.

However, it may not be the correct definition of a flow transfer on side 1. So I suggest @obrix that you roll back to the previous computation with flow transfer = (postContingencyFlow - preContingencyFlow) / preContRefFlow, waiting further instructions from @annetill , althought results are harder to interpret with this definition.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I understand your point and I was aware of that. I imagine that you way to compute is more user-friendly. Have you found some references of the definition of flow transfers in papers ? @murgeyseb do you have an opinion on that small computation ?

obrix added 3 commits July 12, 2021 11:49
…nalysis. Also remove the Math.abs from the computation formula.

Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
…r the contingency on branch X. For more consistency with AC mode.

Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
@annetill annetill changed the title [WIP] Security analysis DC mode : support new branch result API [WIP] Security analysis: support new branch result API Jul 13, 2021
annetill added 3 commits July 13, 2021 18:59
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>
@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

88.6% 88.6% Coverage
0.0% 0.0% Duplication

@annetill annetill changed the title [WIP] Security analysis: support new branch result API Security analysis: support new branch result API Sep 14, 2021
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>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

85.7% 85.7% Coverage
0.0% 0.0% Duplication

@annetill annetill merged commit 07776a0 into master Sep 16, 2021
@annetill annetill deleted the enrich_dc_security_analysis branch September 16, 2021 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants