-
Notifications
You must be signed in to change notification settings - Fork 12
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
case9241 yields weird behavior: rated_u1 == 0, #919
Comments
Hi @nicow-elia, Interesting... As you found out, there are issues about PSTs: 15 branches are defined with a non-zero phase-shift (
This will set ratio to 1.0 for branches with a non-zero phase shift and zero ratio. Then in PyPowSyBl it works: import pypowsybl as pp
net = pp.network.load('case9241pegase.mat')
t2wt = net.get_2_windings_transformers()
t2wt[t2wt['rated_u1'] == 0] # Empty DataFrame
pp.loadflow.run_ac(net)
# [ComponentResult(connected_component_num=0, synchronous_component_num=0, status=CONVERGED, status_text=Converged, iteration_count=12, reference_bus_id='VL-4231_0', slack_bus_results=[SlackBusResult(id='VL-4231_0', active_power_mismatch=-0.21574531038126565)], distributed_active_power=-184.18714631784448)] Let us know if this works for you. At first glance this looks like a data quality issue (?), although we could do something on powsybl-core MATPOWER importer: either reject or try to repair the file... No strong opinion here, I am not a matpower format expert... |
edit: my understanding of matpower code was wrong, see further below. |
This indeed fixes the AC convergence problem and the rated_u1 == 0 problem. Now the only problem remaining is the fact that all voltage level ids on both ends of the trafos are the same, but I guess that could also be a problem of this particular test-case. |
We have an issue with the way we decide if the Matpower branch is a transformer or a line private static boolean isLine(MatpowerModel model, MBranch branch) {
if (branch.getPhaseShiftAngle() != 0) {
return false;
}
if (branch.getRatio() == 0) {
return true;
}
MBus from = model.getBusByNum(branch.getFrom());
MBus to = model.getBusByNum(branch.getTo());
return branch.getRatio() == 1 && from.getBaseVoltage() == to.getBaseVoltage();
}
private static boolean isTransformer(MatpowerModel model, MBranch branch) {
return !isLine(model, branch);
} For the mentioned branches, we have a phase shift != 0 but a voltage ratio of 0 and we consider it as a transformer (in IIDM a phase shifter is necessarly a transformer) and put the 0 voltage ratio without any check in the IIDM model. Thanks @nicow-elia for reporting this issue. |
Fixed by powsybl/powsybl-core#3254 in the next release. |
I fixed using the inverse strategy, often 0 means undefined in matpower, so we can consider a phase shift != 0 and a ratio == 0 to be just a pure phase shifter with a voltage ratio of 1. |
@jeandemanged, from my understading, it just means that a zero ratio is just set to 1?
|
Sorry indeed i was wrong... I am not so fluent in matlab ... |
Describe the current behavior
I tried loading the case9241 pegase network - for this I first converted the matpower file using the steps described here to a .mat file and loaded it into pypowsybl. I performed some checks and found multiple problems:
Describe the expected behavior
Matpower file loads correctly
Describe the steps
No response
Environment
Relevant Log Output
In the 9241 network, there are 15 transformers who have 0 as one of their voltages:
In general there seems to be something fishy with that example:
Extra Information
case9241pegase.mat.zip
The text was updated successfully, but these errors were encountered: