e2nIEE / pandapower

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

optimal power flow does not converge #1526

Open angelinasyrri opened 2 years ago

angelinasyrri commented 2 years ago

Hi! I am trying to run an opf on the network attached. It does not converge! I have run diagnostics and I have changed certain impedance values, also I have rescaled the load but still it does not converge! Could you provide any idea on what could be the issue?

Simple power flow runs just fine!

net_flex_not_converge.xlsx

buddih09 commented 2 years ago

Related to #1486

angelinasyrri commented 2 years ago

Also, I receive the following warning when I am trying to run the opf:

C:\Users...l\anaconda3\envs\work_env2\lib\site-packages\pandapower\pypower\pipsopf_solver.py:167: ComplexWarning:

Casting complex values to real discards the imaginary part

C:\Users...\anaconda3\envs\work_env2\lib\site-packages\pandapower\pypower\pipsopf_solver.py:168: ComplexWarning:

Casting complex values to real discards the imaginary part

C:\Users...\anaconda3\envs\work_env2\lib\site-packages\pandapower\pypower\pipsopf_solver.py:179: ComplexWarning:

Casting complex values to real discards the imaginary part

C:\Users...\anaconda3\envs\work_env2\lib\site-packages\pandapower\pypower\pipsopf_solver.py:181: ComplexWarning:

Casting complex values to real discards the imaginary part

AnkurArohi commented 2 years ago

Try to use generator which is not slack in the poly cost function, let me know if it works

angelinasyrri commented 2 years ago

Hi! Thanks for coming back. I don't have a slack generator. I have an external grid in the topology, which is the slack bus. Do you mean I should remove the poly cost from the external grid?

AnkurArohi commented 2 years ago

yes remove it from external grid pls, and try with real PV nodes/generators in the network

angelinasyrri commented 2 years ago

I have removed the ext grid from the poly cost table. But I still do not get the opf to converge. Are you saying that I should remove the external grid from the grid topology in general and assign another slack generator? I only have 5 PVs spread across the topology, should I add a new generator to the topology and use it as a slack generator?

AnkurArohi commented 2 years ago

No keep the external grid , just don't use in your obj func

AnkurArohi commented 2 years ago

Can you share the network details, I mean you need enough degrees of freedom/choices for optimizer

angelinasyrri commented 2 years ago

Ok, I have tried this, but it does not work (No keep the external grid , just don't use in your obj func).

I have shared the network details in my first post, this xlsx file attached on my 1st post. Can you see it?

In the meantime I have tried with PandaModels.jl and it seems to work, although I get warning 'WARNING: replacing module PP2PM', possibly because I use anaconda with spyder and I have seen in other posts that anaconda does not work well with PandaModels.jl

AnkurArohi commented 2 years ago

There I cannot see the network connection, can you use my graph from top package of pandapower and build the network as a svg Then I can see connections

angelinasyrri commented 2 years ago

The network connection is in the tab 'ext_grid' of the xlsx file 'net_flex_not_converge.xlsx'. Which script are you referring to from top package of pandapower? I cannot see a file called my graph in pandapower package. With simple_plotly I can build the network attached: network

JasmineGarland commented 2 years ago

I am also having an issue with opf and the 'Casting complex values to real discards the imaginary part' warning. I also use an external grid but do not have it included in the obj func. Have you come to any conclusions as to why this is occurring?

Yiwen233 commented 1 year ago

I am facing the almost the same problem, runopp() did not converge whatever I change the net structure or load, but runpp() works well. So have you addressed this problem and how you do that?

PB-vines commented 11 months ago

I am having the same problem. Any advice on how to fix it? @angelinasyrri @AnkurArohi @JasmineGarland @Yiwen233

keithmoffat commented 11 months ago

Is there any resolution to this?

I am finding that pandapower.runopp() converges for a network which has two lines in parallel between the same buses, but not for a network with a single line with twice the admittance connecting the same two buses (the two networks have the exact same admittance matrix and appropriately-adjusted power flow limits).

Optimal power flow/OPP malfunctions should be a top priority imo.

https://pandapower.readthedocs.io/en/develop/opf/known_problems.html