-
Notifications
You must be signed in to change notification settings - Fork 43
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
CGMES export: improve default ratedS value #2598
Conversation
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
@@ -47,4 +49,9 @@ public static void write(String id, String generatorName, String equipmentContai | |||
|
|||
private SynchronousMachineEq() { | |||
} | |||
|
|||
private static double defaultRatedS(double minP, double maxP, double minQ, double maxQ) { |
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.
We have asked some help at ENTSOE side. We have tried and it works. See below the code we have to do:
List<Double> values = new ArrayList<>();
values.add(Math.abs(g.getMinP()));
values.add(Math.abs(g.getMaxP()));
ReactiveLimits limits = g.getReactiveLimits();
if (limits.getKind() == ReactiveLimitsKind.MIN_MAX) {
values.add(Math.abs(g.getReactiveLimits(MinMaxReactiveLimits.class).getMinQ()));
values.add(Math.abs(g.getReactiveLimits(MinMaxReactiveLimits.class).getMaxQ()));
} else { // reactive capability curve
ReactiveCapabilityCurve curve = g.getReactiveLimits(ReactiveCapabilityCurve.class);
for (ReactiveCapabilityCurve.Point p : curve.getPoints()) {
values.add(Math.abs(p.getP()));
values.add(Math.abs(p.getMinQ()));
values.add(Math.abs(p.getMaxQ()));
}
}
values.sort(Double::compareTo);
double max = values.get(values.size() - 1);
g.setRatedS(max);
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, we prepared the changes taking into account the minP, maxP, minQ, maxQ as described by ENTSO-E in the Quality of CGMES datasets and calculations v3.3 . See the relevant doc for rule SMRatedSunrealistic
:
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.
Actually, I added two conditions in my code:
values.add(Math.sqrt(p.getP() * p.getP() + p.getMinQ() * p.getMinQ()));
values.add(Math.sqrt(p.getP()` * p.getP() + p.getMaxQ() * p.getMaxQ()));
This is to follow the rule RCCXValues4
from QoCDC.
|
||
private static double defaultRatedS(double minP, double maxP, double minQ, double maxQ) { | ||
double[] array = {Math.abs(minP), Math.abs(maxP), Math.abs(minQ), Math.abs(maxQ)}; | ||
return Arrays.stream(array).max().orElseThrow() * 10.0; |
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.
We do not need to apply a factor to obtain a default reasonable value
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.
Done. I removed factor.
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
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.
I tested it on my side and it works good, thanks.
…ybl-core into cgmes_export_ratedS
Kudos, SonarCloud Quality Gate passed! |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
Feature
What is the current behavior?
100 is exported as default ratedS value for synchronous machines.
What is the new behavior (if this is a feature change)?
A more precise value is calculated by using
Pmin
,Pmax
,Qmin
andQmax
.Does this PR introduce a breaking change or deprecate an API?
Other information: