rwl / PYPOWER

Port of MATPOWER to Python
http://rwl.github.io/PYPOWER/api/
Other
329 stars 110 forks source link

PF and OPF results conflicting #27

Open DGeorgiadis opened 8 years ago

DGeorgiadis commented 8 years ago

Dear all,

I run an OPF and pass the solved case over to a PF solver. Then, the PF solver iterates. This should not be happening (I have established that after a discussion with Zimmerman), since the OPF solution is also a PF solution.

In older versions of MATPOWER this would happen because the OPF solver would not update the generator voltage setpoints. I did some checking and this does not seem to be the case in PYPOWER.

Minimal example:

from pypower.api import case14, runopf , runpf , ppoption opt = ppoption(VERBOSE=2) mpc = runpf(runopf(case14(), opt), opt)

nickpowersys commented 8 years ago

Do you (or does anybody) know what the generator voltage setpoints are for OPF under a version of MATPOWER that updates the generator voltage setpoints?

DGeorgiadis commented 8 years ago

So, I experimented a little bit. This post will have two (small) sections. One answering your question and one summarising what I found.

Section A: I am not certain about how MATPOWER does it. I know what it says in the manual and what it should be doing according to theory, but I have not gone through the code line by line.

Here is what should be happening (I will be very explicit just in case someone does not know electrical power system stuff): The voltage get points of the generator should control the voltage amplitude at the bus the generator is connected at. This quantity could be given either in Volts or per units. The MATPOWER manual says that they are using per units, which makes much more sense.

In other words, the optimum vector of voltage amplitudes produced by the OPF should be used to fill in the voltage set points of the generators. Specifically, the bus ID to which the generator is connected should have the same voltage amplitude as the generator setpoint.

Section B: I found a way to NOT have the PF solver iterate. I do not know if it is the proper solution but it seems to be closer. Right now it is very late where I am and I do not have the time, but tomorrow I will edit this post and include a minimal ingredients solution (this is the first time I am using a platform like this, I do not know what I am saying is good etiquette). To give a small peak, I addressed the voltage stepping issue, just to be sure, and made sure that the voltage angles and power generation (VA in bus and PG QG in gen) are in degrees and MVW, MVar respectively.

Some of the three steps might be redundant. I will check tomorrow.