-
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
Voltage magnitude initialization #392
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]>
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]>
# Conflicts: # src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java # src/test/resources/debug-parameters.json
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]>
@@ -43,6 +43,14 @@ | |||
|
|||
public static final boolean VOLTAGE_PER_REACTIVE_POWER_CONTROL_DEFAULT_VALUE = false; | |||
|
|||
public enum VoltageInitMode { |
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 understand now that it is an extension of VoltageInitMode
of LoadFlowParameters
, but it was not obvious the first time. So, the usage was not clear, especially with NONE
. And what is happening if on LoadFlowParameters
with choose PREVIOUS_VALUES
and on OLFParameters
we choose FULL_VOLTAGE
. I think that the best solution is to put everything on LoadFlowParameters
side. What do you think ?
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.
As far as mode is not NONE
, it overrides the LoadFlowParameters
one.
Maybe we should rename the enum and parameter name to be more clear?
I would not add it to LoadFlowParameters
as it is something that probably won't be in any other LF. Maybe also I would prefer to remove DC_VALUE and move it to LF specific parameters.
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.
What you be the better names? For DC_VALUE, indeed as it is shared by at least two implementations, we can keep it as it is, no?
double r = 0; | ||
for (LfBranch neighborBranch : neighborBranches) { | ||
PiModel piModel = neighborBranch.getPiModel(); | ||
b += Math.abs(1 / piModel.getX()); // to void issue with negative reactances |
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 neglect B1
and B2
here, right? It could be worst righting it here.
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 to mix it with 1/x ? there is no real branch model in that system. It is just a very raw and approximative proportionality law which is I think good enough to find a decent starting point.
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.
Ok, I get that.
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.
Be careful, we have some non impedant lines with an X equal to zero. I have met an issue on test testWith3GeneratorsAndNonImpedantBranch
.
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 am not sure that the good condition is piModel.getX() equals to zero. Maybe, but not sure here, we have to rely also on branch.isSpanningTreeEdge()
. But it means that we can have zero impedance line that are not in the spanning tree, so another fix is needed for that branches.
// | ||
// there are 2 types of equations: | ||
// for PV buses: target_v = v_i where i is the bus number | ||
// for other buses: 0 = sum_j(b_j * v_j) / sum_j(b_j) - v_i where j are buses neighbors of bus i and b is 1 / x |
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 miss to take into account ratios in our 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.
Fixed
equationSystem.createEquation(bus.getNum(), InitVmEquationType.BUS_TARGET_V) | ||
.addTerm(v); | ||
} else { | ||
equationSystem.createEquation(bus.getNum(), InitVmEquationType.BUS_ZERO) |
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 don't understand here why we don't have any susceptance and any ratio. It seems that you use them only to compute the derivative. Why?
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 InitVmBusEquationTerm
equation term represents the sum at a given bus (I didn't use multiple equation term). So you will find the susceptance and ratio in the derivative calculation in this class.
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]>
Is it better now? |
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
private static boolean isZeroImpedanceBranch(LfBranch branch) { | ||
return branch.getBus1() != null | ||
&& branch.getBus2() != null | ||
&& branch.getPiModel().getX() == 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.
My first think here is to use better branch.isSpanningTreeEdge()
to avoid cycle. It is what we have done for the AC equation system.
variables.add(variableSet.getVariable(neighborBus.getNum(), InitVmVariableType.BUS_V)); | ||
} | ||
} | ||
if (bs == 0) { // should never happen |
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 fall in that with Energinet D10 network.
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]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
|
||
private final TDoubleArrayList der; | ||
|
||
private static boolean isConnected(LfBranch branch) { |
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.
Could it be interested to move this method as a method of LfBranch
?
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
&& branch.getBus2() != null; | ||
} | ||
|
||
private static Map<LfBus, List<LfBranch>> findNeighbors(LfBus bus) { |
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.
Same remark with this method ?
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
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
SonarCloud Quality Gate failed. |
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, ...)
feature
What is the current behavior? (You can also link to an open issue here)
In some cases where we have a large grid and many transformers with a voltage ratio far from 1pu, the starting point (1pu, 0°) is not able to make the Newton Raphson converge.
What is the new behavior (if this is a feature change)?
We added a new algorithm to find a better voltage magnitude starting point.
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)