pandapower icon indicating copy to clipboard operation
pandapower copied to clipboard

optimal power flow does not converge

Open angelinasyrri opened this issue 2 years ago • 15 comments

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

angelinasyrri avatar Mar 11 '22 15:03 angelinasyrri

Related to #1486

buddih09 avatar Mar 14 '22 09:03 buddih09

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

angelinasyrri avatar Mar 15 '22 10:03 angelinasyrri

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

AnkurArohi avatar Mar 15 '22 21:03 AnkurArohi

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?

angelinasyrri avatar Mar 16 '22 09:03 angelinasyrri

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

AnkurArohi avatar Mar 16 '22 09:03 AnkurArohi

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?

angelinasyrri avatar Mar 16 '22 10:03 angelinasyrri

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

AnkurArohi avatar Mar 16 '22 18:03 AnkurArohi

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

AnkurArohi avatar Mar 16 '22 18:03 AnkurArohi

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

angelinasyrri avatar Mar 17 '22 10:03 angelinasyrri

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

AnkurArohi avatar Mar 17 '22 17:03 AnkurArohi

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

angelinasyrri avatar Mar 18 '22 13:03 angelinasyrri

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?

JasmineGarland avatar May 12 '22 20:05 JasmineGarland

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?

Yiwen233 avatar Jun 07 '23 11:06 Yiwen233

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

PB-vines avatar Sep 22 '23 15:09 PB-vines

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

keithmoffat avatar Oct 06 '23 06:10 keithmoffat