As Carlos has said, for historical reasons, the format used by MATPOWER mixes 
fixed system parameters with input data for initializing the problem and output 
data for reporting the problem solution. While the details of which items are 
in which category are probably not summarized explicitly anywhere, the problem 
formulations (for power flow, OPF, etc) should give an indication of what to 
expect. In any case, here’s an attempt to summarize:

Starting point:
- bus(:, VM) and bus(:, VA) provide the initial bus voltages, except for 
generator buses (type REF and PV) where the magnitude is pulled from a 
corresponding gen(:, VG).
- gen(:, PG) and gen(:, QG) provide the initial generator injections
- Note 1 : bus(:, VA) is fixed at the input value for the REF bus.
- Note 2: : The bus voltage magnitudes are fixed at the input value for REF and 
PV buses for the power flow problem, but not for the OPF problem (unless 
requested via opf.use_vg option).
- Note 3 : The active power generation is fixed at the input value for PV buses 
for the power flow problem, but not for the OPF problem.

Output:
- bus(:, VM) and bus(:, VA)  provide the solved bus voltages
- gen(:, PG) and gen(:, QG) provide the solved generator injections

Hope this helps,

   Ray





On Dec 9, 2020, at 6:47 PM, Carlos E Murillo-Sanchez 
<[email protected]<mailto:[email protected]>> wrote:

Russ Patterson wrote:
Hi Carlos,

Thank you.  That makes sense.  Based on that, I would expect to be able to set 
the bus voltage, Vm, and it stick, but it doesn’t.  If I set Vm=2 and run the 
load flow it solves properly with the resulting bus voltage being 1.154pu.

So, in essence, I am specifying the magnitude for the slack bus in the “mpc.gen 
Vg” setting, and then I am specifying the angle for the slack bus in the 
“mpc.bus Va” setting.  You would expect both mag and angle to be specified in 
the same place.

This is counterintuitive, which is why I ask if this level of detail about how 
input is used/overridden is documented anywhere – or if it will just be a 
learn-by-trying approach.

Either way, I’m very happy to have found this fantastic software.  Thank you 
for your help.

Best regards,
Russ
Dear Russ:

You are right;  the data structure for MATPOWER was originally chosen to 
resemble what where then popular industry formats for power flow, with the 
corresponding outstanding assumptions about what is input data and what is 
output data in the power flow problem.  When using this data for other problems 
(such as optimal power flow), it becomes even less clear if you haven't been a 
long-time follower of the development of those data formats.  For example, for 
power flow the generator voltages are input from the VG column of the gen() 
matrix as you discovered. But for optimal power flow, the bus voltage limits 
(which then the generators must also respect) are specified in columns VMAX and 
VMIN in the bus() matrix.

Carlos.



Reply via email to