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

Current limiter implementation #340

Merged
merged 15 commits into from
Sep 7, 2021
Merged

Current limiter implementation #340

merged 15 commits into from
Sep 7, 2021

Conversation

Hadrien-Godard
Copy link
Member

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

What 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:

  • 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?)

Other information:

(if any of the questions/checkboxes don't apply, please delete them entirely)

Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
@Hadrien-Godard Hadrien-Godard requested a review from annetill July 23, 2021 11:54
@Hadrien-Godard Hadrien-Godard self-assigned this Jul 23, 2021
Hadrien-Godard and others added 7 commits July 23, 2021 14:03
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Add new tests

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: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@@ -130,4 +127,16 @@ public void onVoltageControlModeChange(DiscreteVoltageControl voltageControl, Di
}
}
}

@Override
public void onPhaseControlTapChange(DiscretePhaseControl phaseControl) {
Copy link
Member

Choose a reason for hiding this comment

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

This should be handled in the TargetVector to just update the alpha1 target value. There is no need to change the equation system. => performance will also be better by just updating the target (no need to rebuild the jacobian matrix)

Copy link
Member

@annetill annetill Aug 17, 2021

Choose a reason for hiding this comment

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

I have made a fix and I think it is correct. I knew that it was not the good solution when updating the equation system. So I have used the listeners you have implemented and I just want to say that I am impress by your work. It is really clever !

@@ -146,4 +146,32 @@ public void roundR1ToClosestTap() {
}
r1 = Double.NaN;
}

@Override
public boolean getNewTapPosition(Direction direction) {
Copy link
Member

Choose a reason for hiding this comment

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

This should be updateTapPosition. A getter is not suppose to change internal state.
This is here that the network notification should be fired regading tap position change.
=> so it means that PiModel should be part of Network listenable data.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed.

success = isSensibilityPositive ? piModel.getNewTapPosition(PiModel.Direction.DECREASE) : piModel.getNewTapPosition(PiModel.Direction.INCREASE);
}
if (success) {
for (LfNetworkListener listener : controllerBranch.getNetwork().getListeners()) {
Copy link
Member

Choose a reason for hiding this comment

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

Once notification will be managed inside PiModel we won't need this hack anymore because the call to getNewTapPosition will trigger the notif.

Copy link
Member

Choose a reason for hiding this comment

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

Done.

annetill and others added 4 commits August 17, 2021 15:26
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>
Copy link
Member

@annetill annetill left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for your work @Hadrien-Godard, I have changed many lines of code, because it was not the perfect way to implement the current limiter, but functionally it was correct. Many we have now to go deeper into the details and increase tests. Thanks for the current derivatives ! I am going to test this feature on real case.

Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
@geofjamg geofjamg changed the title [WIP] Current limiter implementation Current limiter implementation Sep 7, 2021
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 7, 2021

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

81.4% 81.4% Coverage
0.0% 0.0% Duplication

@geofjamg geofjamg merged commit f11733c into master Sep 7, 2021
@geofjamg geofjamg deleted the current_limiter_imp branch September 7, 2021 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants