I am not sure if I am understanding you correctly here. What I figured you were
doing was to compare the solution of another optimization tool with MATPOWER's
OPF. To do this you are taking the generation output (Pg, Qg) from the
optimization tool and using it as "fixed" input for MATPOWER's OPF. Hence I
suggested that you set the
Pmax=Pmin=Pg and Qmax=Qmin=Qg so that Pg and Qg remain fixed in MATPOWER's OPF
solution.
Shri
***** Note that your assumption of the optimization tool and MATPOWER's
solutions "matching" also implicitly assumes that the optimization tool uses
the same objective function, constraints as used in MATPOWER.
On May 20, 2013, at 10:31 AM, spyros gian wrote:
> Dear Shri,
>
> I am running an ACOPF not a simple power flow. When I set in the mpc.gen
> matrix that
> Pg= Pmax=Pmin and Qg=Qman=Qmin (ie the corresponding columns having the same
> value)
> and then runopf ('caseExample') then , matpower ignores this constraint, ie
> that pmax=pmin=pg.
> Are you sure it works for you?
Yes, for MATPOWER's case9 system, I constrained Pg and Qg for generators 2 and
3 to fixed values by setting Pmax=Pmin=Pg and
Qmax=Qmin=Qg and this is what runopf() produces. I don't know why, and its
strange that, the constraints are being ignored in your case.
Perhaps you are not setting something correctly? or the solution has not
converged?
MATPOWER Version 4.1, 14-Dec-2011 -- AC Optimal Power Flow
MATLAB Interior Point Solver -- MIPS, Version 1.0, 07-Feb-2011
Converged!
Converged in 0.07 seconds
Objective Function Value = 5334.26 $/hr
================================================================================
| System Summary |
================================================================================
How many? How much? P (MW) Q (MVAr)
--------------------- ------------------- ------------- -----------------
Buses 9 Total Gen Capacity 490.0 -320.3 to 279.7
Generators 3 On-line Capacity 490.0 -320.3 to 279.7
Committed Gens 3 Generation (actual) 318.7 -6.8
Loads 3 Load 315.0 115.0
Fixed 3 Fixed 315.0 115.0
Dispatchable 0 Dispatchable -0.0 of -0.0 -0.0
Shunts 0 Shunt (inj) -0.0 0.0
Branches 9 Losses (I^2 * Z) 3.69 39.16
Transformers 0 Branch Charging (inj) - 160.9
Inter-ties 0 Total Inter-tie Flow 0.0 0.0
Areas 1
Minimum Maximum
------------------------- --------------------------------
Voltage Magnitude 1.070 p.u. @ bus 9 1.100 p.u. @ bus 8
Voltage Angle -3.98 deg @ bus 9 6.66 deg @ bus 2
P Losses (I^2*R) - 1.73 MW @ line 8-9
Q Losses (I^2*X) - 11.67 MVAr @ line 8-2
Lambda P 21.53 $/MWh @ bus 8 22.51 $/MWh @ bus 5
Lambda Q -0.02 $/MWh @ bus 2 0.10 $/MWh @ bus 9
================================================================================
| Bus Data |
================================================================================
Bus Voltage Generation Load Lambda($/MVA-hr)
# Mag(pu) Ang(deg) P (MW) Q (MVAr) P (MW) Q (MVAr) P Q
----- ------- -------- -------- -------- -------- -------- ------- -------
1 1.100 0.000* 78.69 13.54 - - 22.311 -
2 1.098 6.662 150.00 1.93 - - 21.536 -0.018
3 1.087 3.825 90.00 -22.25 - - 21.630 0.011
4 1.093 -2.161 - - - - 22.311 0.001
5 1.084 -3.545 - - 90.00 30.00 22.510 0.028
6 1.100 1.296 - - - - 21.631 0.011
7 1.089 -0.147 - - 100.00 35.00 21.755 0.026
8 1.100 2.209 - - - - 21.533 -0.018
9 1.070 -3.976 - - 125.00 50.00 22.499 0.095
-------- -------- -------- --------
Total: 318.69 -6.78 315.00 115.00
================================================================================
| Branch Data |
================================================================================
Brnch From To From Bus Injection To Bus Injection Loss (I^2 * Z)
# Bus Bus P (MW) Q (MVAr) P (MW) Q (MVAr) P (MW) Q (MVAr)
----- ----- ----- -------- -------- -------- -------- -------- --------
1 1 4 78.69 13.54 -78.69 -10.50 0.000 3.04
2 4 5 32.20 -3.57 -32.05 -14.33 0.152 0.82
3 5 6 -57.95 -15.67 59.08 -22.10 1.125 4.90
4 3 6 90.00 -22.25 -90.00 26.51 0.000 4.26
5 6 7 30.92 -4.41 -30.82 -19.78 0.101 0.85
6 7 8 -69.18 -15.22 69.53 0.29 0.346 2.93
7 8 2 -150.00 9.74 150.00 1.93 0.000 11.67
8 8 9 80.47 -10.03 -78.74 -17.30 1.732 8.71
9 9 4 -46.26 -32.70 46.49 14.07 0.231 1.97
-------- --------
Total: 3.687 39.16
================================================================================
| Voltage Constraints |
================================================================================
Bus # Vmin mu Vmin |V| Vmax Vmax mu
----- -------- ----- ----- ----- --------
1 - 0.900 1.100 1.100 0.977
6 - 0.900 1.100 1.100 44.627
8 - 0.900 1.100 1.100 113.932
================================================================================
| Generation Constraints |
================================================================================
Gen Bus Active Power Limits
# # Pmin mu Pmin Pg Pmax Pmax mu
---- ----- ------- -------- -------- -------- -------
2 2 5.164 150.00 150.00 150.00 0.000
3 3 1.420 90.00 90.00 90.00 0.000
Gen Bus Reactive Power Limits
# # Qmin mu Qmin Qg Qmax Qmax mu
--- --- ------- -------- -------- -------- -------
2 2 0.018 1.93 1.93 1.93 0.000
3 3 0.000 -22.25 -22.25 -22.25 0.011
>
> IS there a way for this Dr Zimmerman?
>
> Thank you
>
> Subject: Re: Constraining matpower
> From: [email protected]
> Date: Mon, 20 May 2013 08:47:09 -0500
> To: [email protected]
>
> Setting Pgmax=Pgmin=Pg (similarly for Qg) should constrain the generator
> output to a fixed value.
>
> Shri
>
> On May 20, 2013, at 8:01 AM, spyros gian <[email protected]> wrote:
>
> Dear Dr Zimmerman,
>
> I have solved an ACOPF in an optimisation tool.
> I would like to get the solutions from this tool, and plug them to the
> matpower.
> In particular, I want to get the solutions for the Pgeneration and
> Qgeneration for each generator that the optimisation tool gave me,
> and plug them into matpower.
>
> This will allow me to see whether the matpower gives the same values for
> voltage magnitudes that I got.
>
> Should I program some code in matlab so that i constrain matpower's mpc.gen
> matrix to have these values?
>
> I guess that if i put these values to the columns Pg,Qg of the matpower
> mpc.gen matrix, this will not constrain matpower.
>
>
> Thank you for your insight
>
> Syros Giannakos