-
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
Refactor shared voltage control modelling #408
Conversation
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
@@ -72,8 +65,7 @@ private static void createGeneratorControlEquations(LfBus bus, LfNetworkParamete | |||
if (voltageControl.isVoltageControlLocal()) { | |||
createLocalVoltageControlEquation(bus, networkParameters, equationSystem, creationParameters); | |||
} else if (bus.isVoltageControlled()) { | |||
// remote controlled: set voltage equation on this controlled bus | |||
createVoltageControlledBusEquations(voltageControl, networkParameters, equationSystem, creationParameters); | |||
createRemoteVoltageControlEquations(voltageControl, networkParameters, equationSystem, creationParameters); |
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 I remember well we have also a case where we create distribution equations for remote and local controllers. We fall in that second case. You can keep remote
in the name of the method, but maybe I can add it in the comment.
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.
Looking at the code there is nothing specific to local controller even if it works with hybride remote/local controller. The only local mode is handled in the previous if.
@@ -152,4 +152,8 @@ default boolean isParticipating() { | |||
* Find bus + parallel branches neighbors. | |||
*/ | |||
Map<LfBus, List<LfBranch>> findNeighbors(); | |||
|
|||
double getRemoteControlReactivePercent(); |
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.
Can you add voltage
in the name of the method because we also have shunt remote voltage control and reactive remote control.
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
|
||
// update bus reactive keys | ||
double reactiveKeysSum = Arrays.stream(reactiveKeys).sum(); | ||
for (int i = 0; i < controllerBuses.size(); i++) { |
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.
How do you know here that the sum is never equal to zero after updating the keys?
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 it might happen, when all generators of the control, go PQ.
=> I added a check
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.
Maybe just some changes/comments, but the idea is good and looks right. I have run the LF on all my real test cases (IOP, RGCE, matpower cases) and all is okay. But during my test on a TYNDP file, I fall in an exception Caused by: com.powsybl.commons.PowsyblException: Generators [_9064117a-2da4-46db-b1ee-f60810974a76, _ee520ab7-786a-499b-a3ae-d96fb5b12596] connected to bus '_55207717-1417-458c-9b5f-e67a3eedc46a_0' must control the voltage of the same bus
. Can we do something for that and just log a warn or do we assume the exception? I don't remember this issue with this file indeed.
Do you also have it on main branch? |
Yes. I have planned to work on stand by automaton of SVC tonight and tomorrow. And I think it will be better to have this PR merged before... even if it means a new rebase for the PR of shunt voltage control ! Do you think it is possible? |
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
This is manageable but we have probably to rethink our controller modeling. A controller bus is supposed in our design, to be part of only one voltage control (only one voltageController attribute in What I do not understand is how we didn't had this case before. Is it something new in our test cases? Or do we just not skip it before? |
I'm not 100% confident with this PR. Is it really linked to SVC devs? Maybe you could just start from this branch to easily rebase when merged. |
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
Looks good in fact. |
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 looks good indeed. Do you want me to run all the tests again?
If you already did it, no. |
Signed-off-by: Geoffroy Jamgotchian [email protected]
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, ...)
Refactoring
What is the current behavior? (You can also link to an open issue here)
Shared voltage control is modeled using one PQV bus at controlled bus and (Ngen - 1) reactive distribution equations at all controller buses except one. These equations allows to define reactive power distribution across all voltage controller buses.
The problem with such a modeling is that when one controller bus of the shared control switch PQ (reactive limit bound reached), as reactive power equations have been defined 2 by 2 using an arbitrary reference controller bus we have to remove all reactive power distribution equations and re-create all of them using potentially a new reference controller bus.
This is a heavy operation and it should be simpler if we can just active/deactivate some predefined equations. Furthermore for later performance optimization we will try to define alternative equations (i.e couple of equation that when one is activate the other is deactivate automatically and vice versa) so that we only have to update Jacobian matrix when a bus is switched PV/PQ ou PQ/PV and not fully rebuild it.
TODO: same for transformer voltage control has to be done in this PR
What is the new behavior (if this is a feature change)?
We only need to deactivate/activate right predefined equations when switch a PV to PQ or PQ to PV bus. There is no more equation removal.
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)