Open SimonUlm opened 1 month ago
Hi, interesting error. I'll discuss it with some people. I am wondering that this problem hasn't surfaced earlier, since pandapower is basically built around the matpower architecture. And I am confused why the tests don't capture it...
Discussed this a little, seems to be a really weird setup, since normally you would connect the HV-Side of a transformer to the higher voltage in a grid model and the LV-Side of the transformer to the lower voltage. Your suggest that this was flipped in your example and therefore errors occured. I'd suggest repairing your examples / test cases. But still this should be at least communicated to the user.
Hi, thank you very much for your reply and sorry for my very late response. I agree that this setting is rather unusual. However, this wasn't just any test case, but a pglib-opf (former NESTA) test case which are considered state-of-the-art benachmarking test cases by many. (Especially when it comes to convex relaxation, which is admittedly not the focus of pandapower, yet). Also, this wasn't the only test case having this issue. Therefore, I think this issue should be addressed. Either by communicating it to the user (as you already suggested) or recalculate the tap ratio. Personally, I would prefer the latter.
Bug report checklis
[X] Searched the issues page for similar reports
[X] Read the relevant sections of the documentation
[ ] Browse the tutorials and tests for usefull code snippets and examples of use
[X] Reproduced the issue after updating with
pip install --upgrade pandapower
(orgit pull
)[X] Tried basic troubleshooting (if a bug/error) like restarting the interpreter and checking the pythonpath
Reproducible Example
Issue Description and Traceback
Note
The file mentioned above is from the pglib-opf library.
Issue
When comparing
ppc_before['branch']
andppc_after['branch']
, you will notice that the from and to buses of all transformers have been swapped. However, the tap ratios remain the same, which will result in wrong results in pf and opf calculations. Afaik this is due to _fromppc.py (lines 241 to 245) wherehv_bus
andlv_bus
are swapped in case the base voltage of the from bus is less than the base voltage if the to bus, but the tap ratio and phase shift remain the same.Expected Behavior
The pandapower case structure should contain the correct direction of the transformer or at least contain information to restore the original direction.
Installed Versions
Label