-
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
Security analysis: support new branch result API #326
Conversation
…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>
BranchResult preContBR = preContingencyBranchResults.get(branchId); | ||
double preContingencyFlow = preContBR.getP1(); | ||
double postContingencyFlow = v.getFunctionReference(); | ||
double flowDelta = preContingencyFlow >= 0.0 ? postContingencyFlow - preContingencyFlow : preContingencyFlow - postContingencyFlow; |
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.
My understanding of the definition of a flow transfer on side 1 is that you have:
flow transfer = (postContingencyFlow - preContingencyFlow) / preContRefFlow
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 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 ?
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.
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.
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 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 ?
…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>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
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 restNo
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: