e2nIEE / pandapower

Convenient Power System Modelling and Analysis based on PYPOWER and pandas
https://www.pandapower.org
Other
848 stars 478 forks source link

[bug] Wrong algorithm "id" for fdbx and fdxb (pypower fast decoupled) #2142

Closed BDonnot closed 9 months ago

BDonnot commented 1 year ago

Bug report checklis

Reproducible Example

# I had to dive deep in the code to find this error, it's not reproducible "as is" as it is a mixed up between fdxb and fdbx somewhere in a file.

Issue Description and Traceback

In pandapower/pf/runpf_pypower.py line81 there is:

algorithm_pypower_dict = {'nr': 1, 'fdbx': 2, 'fdxb': 3, 'gs': 4} see https://github.com/e2nIEE/pandapower/blob/80ca87dbb991c682f56e48ea90ea4035be3dff6c/pandapower/pf/runpf_pypower.py#L81

This would imply that fdbx is the algorithm id 2.

But I think "fdxb" and "fdbx" are mixed up. Indeed:

In pypower (module pandapower/pypower), it is written that alg==2 is XB method, see for example: https://github.com/e2nIEE/pandapower/blob/80ca87dbb991c682f56e48ea90ea4035be3dff6c/pandapower/pypower/makeB.py#L36C7-L36C8

We can also see that the XB method is alg 2 here: https://github.com/e2nIEE/pandapower/blob/80ca87dbb991c682f56e48ea90ea4035be3dff6c/pandapower/pypower/ppoption.py#L14C1-L14C1

Expected Behavior

I think the code should be replaced by:

algorithm_pypower_dict = {'nr': 1, 'fdbx': 3, 'fdxb': 2, 'gs': 4}

Installed Versions

I just look at the code in the repo, so all version with current code are concerned (and this bug probably originates a long time ago)

Label

rbolgaryn commented 11 months ago

Hi @Bdonnot, thank you! I will adjust it.

Best regards, Roman