e2nIEE / pandapower

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

Problems with piecewise linear cost functions #28

Closed friederikemeier closed 7 years ago

friederikemeier commented 7 years ago

Working with the OPF I discovered, that piecewise linear cost functions do not work for loads (does not converge for cost functions with 2 segments or more) and also not for reactive power (Wrong result for cost functions with 2 segments or more). I added this info to the docs. I am developing test cases for this at the moment. I will check on this with MATPOWER to see how it is handled there.

friederikemeier commented 7 years ago

In MATPOWER 6.0 these cases converge. I will try to fix this in pandapower and will also provide tests for this.

friederikemeier commented 7 years ago

I did some further testing in MATPOWER with the cigre MV and LV network and these cases already have problems in MATPOWER. So I guess that this is not a bug in Pypower / Matpower. It is a general convergence problem due to the formulation of the pwl functions as a basin. The conversion of pandapower to ppc and the conversion of the gencost array is right. I will not look into the pypower / matpower OPF further and will ( for now) not look into other OPF formulations and solvers.

A simple test case and a very dirty workaround (that also does not work in every case) can be found in pandapower/test/test_3point_pwl.py In my specific use case, this helped.