-
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
Generator contingency for DC sensitivities #318
Conversation
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
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.
It could be better to do test driven development, but it is up to you.
@@ -87,4 +87,9 @@ public void updateState(boolean reactiveLimits, boolean writeSlackBus, boolean d | |||
public boolean isParticipating() { | |||
return participating; | |||
} | |||
|
|||
public void setIsParticipating(boolean b) { |
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.
Change for setParticipating
and if you change that attribute, do not forget to store it and to restore it after contingency.
generatorsToSave.add(generator); | ||
} | ||
Map<Generator, GeneratorState> generatorStates = GeneratorState.createGeneratorStates(generatorsToSave); | ||
for (String generatorId : contingency.getGeneratorIdsToLose()) { |
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.
You have to do that on the LfGenerator
object directly and in the same time you have to remove it from slack distribution if in the parameters slack is distributed and the distribution is made on generators.
return generatorStates; | ||
} | ||
|
||
private List<ParticipatingElement> removeGeneratorParticipation(Network network, LfNetwork lfNetwork, PropagatedContingency contingency, List<ParticipatingElement> participatingElements) { |
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 think you don't need a dedicated function for that. It could be done with the other attributes of the generator.
/** | ||
* @author Hadrien Godard <hadrien.godard at artelys.com> | ||
*/ | ||
public class GeneratorState { |
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.
You don't need that class, I think that all of this can be done inside BusState
. with some adaptions in order not to save all the generators of a bus maybe.
…ed in next commit Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
…ybl/powsybl-open-loadflow into sensiDCGeneratorContingency
if (shouldChangeRhs) { | ||
setBaseCaseSensitivityValues(factorGroups, factorStates); | ||
} | ||
List<ParticipatingElement> saveParticipatingElements = new ArrayList<>(participatingElements); |
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 suspect a serious performance regression, we should have something like before:
if (contingency.getHvdcIdsToOpen().isEmpty() || contingency.getGeneratorIdsToLose().isEmpty()) {
calculateSensitivityValues(factors, factorStates, contingenciesStates, flowStates, contingencyElements,
contingency, valueWriter);
} else { // if we have a contingency including the loss of a DC line or a generator loss
}
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
if (shouldChangeRhs) { | ||
if (changeParticipatingElements) { | ||
participatingElements.clear(); | ||
participatingElements.addAll(saveParticipatingElements); |
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.
Is it on purpose the fact that you change the participatingElements method input?
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.
These three lines here are very important yes. What do you mean?
} | ||
} | ||
|
||
private Map<LfBus, BusState> applyContingencyOnNetwork(Network network, LfNetwork lfNetwork, PropagatedContingency contingency, |
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.
The name is confusing as we only apply injection part of the contingency
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 have changed in applyInjectionContingencies
, what do you think?
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
…ybl/powsybl-open-loadflow into sensiDCGeneratorContingency
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
Signed-off-by: Hadrien hadrien.godard@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)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restWhat kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)