Dear Prof. Zimmerman, thank you very much for answering.

Please find the attached files to follow my explanation.

I did a runopf('case2Q_PosTotalCost') and later runopf('case2Q_NegTotalCost')

If you compare both case files the only difference is at Gen 3 which it is 10 
times more expensive.

Why do I get negative prices? Shouldn't I get higher OPF costs for having a 
more expensive system?

I would expect that the system with more expensive MVAR prices to have higher 
total OPF costs but it gives negative OPF costs.

I use the Matpower 3.2 and I have updated all the toolboxes

I appreciate your help and thank you for sharing this excellent tool

Kindest regards

Gabriel



From: [email protected]
To: [email protected]
Subject: Re: Reactive Power Bug
Date: Thu, 4 Jun 2009 15:42:36 -0400

Negative prices could be correct depending on the costs. Could you please send 
me an example case file that exhibits the issue along with an explanation of 
what you expected to be different from the output MATPOWER gives?
-- Ray ZimmermanSenior Research Associate428-B Phillips Hall, Cornell 
University, Ithaca, NY 14853phone: (607) 255-9645 
On Jun 4, 2009, at 3:27 PM, Gabox . wrote:Dear Sirs, 

I use the OPF tools of matpower to test the effect of Reactive Power prices.

I build a case file similar to case30Q.m and I considered the reactive power 
prices.

A generator dispatched with negative MVAR caused to get a wrong total cost of 
the OPF

In the case of dispatching only negative MVAR, the OPF will get negative total 
costs.

Is this a bug or there is another way to introduce reactive power prices in the 
case files?

Could there be a missing abs() in the MVAR pricing?

I would appreciate your comments and help

Kind regards

¡Es hora que descubras quién sos! Alguien puede conocerte mejor que vos mismo.

_________________________________________________________________
Probá los mejores juegos online en MSN
http://juegos.ar.msn.com/
>> runopf('case2Q_PosTotalCost')

Converged in 0.01 seconds
Objective Function Value = 42.32 $/hr
================================================================================
|     System Summary                                                           |
================================================================================

How many?                How much?              P (MW)            Q (MVAr)
---------------------    -------------------  -------------  -----------------
Buses              3     Total Gen Capacity     210.0         -55.0 to 272.5
Generators         3     On-line Capacity       210.0         -55.0 to 272.5
Committed Gens     3     Generation (actual)     24.2               8.6
Loads              2     Load                    24.1              13.9
  Fixed            2       Fixed                 24.1              13.9
  Dispatchable     0       Dispatchable          -0.0 of -0.0      -0.0
Shunts             0     Shunt (inj)             -0.0               0.0
Branches           2     Losses (I^2 * Z)         0.05              0.18
Transformers       0     Branch Charging (inj)     -                5.5
Inter-ties         0     Total Inter-tie Flow     0.0               0.0
Areas              1

                          Minimum                      Maximum
                 -------------------------  --------------------------------
Voltage Magnitude   1.037 p.u. @ bus 3          1.050 p.u. @ bus 1   
Voltage Angle      -0.03 deg   @ bus 2          0.79 deg   @ bus 3   
P Losses (I^2*R)             -                  0.04 MW    @ line 2-3
Q Losses (I^2*X)             -                  0.14 MVAr  @ line 2-3
Lambda P            2.13 $/MWh @ bus 3          2.15 $/MWh @ bus 2   
Lambda Q            0.26 $/MWh @ bus 1          0.29 $/MWh @ bus 3   

================================================================================
|     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.050    0.000      3.66      6.54       -         -       2.146   0.262
    2  1.045   -0.029     11.45      7.76     21.70     12.70     2.151   0.272
    3  1.037    0.793      9.05     -5.68      2.40      1.20     2.131   0.290
                        --------  --------  --------  --------
               Total:     24.15      8.62     24.10     13.90

================================================================================
|     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      2      3.66      6.54     -3.64     -9.79     0.015      0.04
   2      2      3     -6.61      4.85      6.65     -6.88     0.036      0.14
                                                             --------  --------
                                                    Total:     0.051      0.18

================================================================================
|     Voltage Constraints                                                      |
================================================================================
Bus #  Vmin mu    Vmin    |V|   Vmax    Vmax mu
-----  --------   -----  -----  -----   --------
    1      -      0.950  1.050  1.050     3.168


>> runopf('case2Q_NegTotalCost')

Converged in 0.05 seconds
Objective Function Value = -86.20 $/hr
================================================================================
|     System Summary                                                           |
================================================================================

How many?                How much?              P (MW)            Q (MVAr)
---------------------    -------------------  -------------  -----------------
Buses              3     Total Gen Capacity     210.0         -55.0 to 272.5
Generators         3     On-line Capacity       210.0         -55.0 to 272.5
Committed Gens     3     Generation (actual)     24.3               9.1
Loads              2     Load                    24.1              13.9
  Fixed            2       Fixed                 24.1              13.9
  Dispatchable     0       Dispatchable          -0.0 of -0.0      -0.0
Shunts             0     Shunt (inj)             -0.0               0.0
Branches           2     Losses (I^2 * Z)         0.16              0.60
Transformers       0     Branch Charging (inj)     -                5.4
Inter-ties         0     Total Inter-tie Flow     0.0               0.0
Areas              1

                          Minimum                      Maximum
                 -------------------------  --------------------------------
Voltage Magnitude   1.017 p.u. @ bus 3          1.050 p.u. @ bus 1   
Voltage Angle       0.00 deg   @ bus 1          1.11 deg   @ bus 3   
P Losses (I^2*R)             -                  0.13 MW    @ line 2-3
Q Losses (I^2*X)             -                  0.50 MVAr  @ line 2-3
Lambda P            2.13 $/MWh @ bus 3          2.15 $/MWh @ bus 2   
Lambda Q            0.44 $/MWh @ bus 1          0.52 $/MWh @ bus 3   

================================================================================
|     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.050    0.000      3.70     10.99       -         -       2.148   0.440
    2  1.042    0.016     11.53     13.10     21.70     12.70     2.154   0.459
    3  1.017    1.108      9.04    -15.00      2.40      1.20     2.129   0.520
                        --------  --------  --------  --------
               Total:     24.26      9.10     24.10     13.90

================================================================================
|     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      2      3.70     10.99     -3.67    -14.18     0.032      0.09
   2      2      3     -6.50     14.58      6.64    -16.20     0.133      0.50
                                                             --------  --------
                                                    Total:     0.164      0.60

================================================================================
|     Voltage Constraints                                                      |
================================================================================
Bus #  Vmin mu    Vmin    |V|   Vmax    Vmax mu
-----  --------   -----  -----  -----   --------
    1      -      0.950  1.050  1.050     6.146

================================================================================
|     Generation Constraints                                                   |
================================================================================
Gen  Bus              Reactive Power Limits
 #    #   Qmin mu    Qmin       Qg       Qmax    Qmax mu
---  ---  -------  --------  --------  --------  -------
  3    3   7.605    -15.00    -15.00     62.50      -  





function [baseMVA, bus, gen, branch, areas, gencost] = case30Q
%CASE30Q    Case 30 with costs for reactive generation.
%   Please see 'help caseformat' for details on the case file format.
%
%   Identical to case30.m, with the addition of non-zero costs for
%   reactive power.

%   MATPOWER
%   $Id: case30Q.m,v 1.7 2007/09/17 16:07:48 ray Exp $

%%-----  Power Flow Data  -----%%
%% system MVA base
baseMVA = 100;

%% bus data
%bus_i	type Pd	Qd	Gs	Bs	area	Vm	Va	baseKV	zone	Vmax	Vmin
bus = [
1	3	0       0       0   0	1	1	0	135	1	1.05	0.95;
2	2	21.7	12.7	0   0	1	1	0	135	1	1.1     0.95;
3	1	2.4     1.2     0	0   1	1	0	135	1	1.05	0.95;
];
%               PQ bus          = 1
%               PV bus          = 2
%               reference bus   = 3
%               isolated bus    = 4
%% generator data
%bus	Pg Qg	Qmax	Qmin	Vg	mBase	status	Pmax	Pmin
gen = [
 1  	0	0	150     -20     1	100     1       80	0;
 2  	0	0	60      -20     1	100     1       80	0;
 3  	0	0	62.5	-15     1	100     1       50	0;
];

%% branch data
%	fbus	tbus	r	x	b	rateA	rateB	rateC	ratio	angle	status
branch = [
	1	2	0.02	0.06	0.03	130	130	130	0	0	1;
	2	3	0.05	0.19	0.02	130	130	130	0	0	1;
];

%%-----  OPF Data  -----%%
%% area data
areas = [
	1	1;
];

%% generator cost data
%	1	startup	shutdown	n	x1	y1	...	xn	yn
%	2	startup	shutdown	n	c(n-1)	...	c0
gencost = [
	2	0	0	3	0.02	2       0;
	2	0	0	3	0.0175	1.75	0;
	2	0	0	3	0.0625	1       0;
    %Reactive Power Cost from here on
	2	0	0	3	0.02	0       0;
	2	0	0	3	0.0175	0       0;
	2	0	0	3	0.0625	1       0;

];

return;
function [baseMVA, bus, gen, branch, areas, gencost] = case30Q
%CASE30Q    Case 30 with costs for reactive generation.
%   Please see 'help caseformat' for details on the case file format.
%
%   Identical to case30.m, with the addition of non-zero costs for
%   reactive power.

%   MATPOWER
%   $Id: case30Q.m,v 1.7 2007/09/17 16:07:48 ray Exp $

%%-----  Power Flow Data  -----%%
%% system MVA base
baseMVA = 100;

%% bus data
%bus_i	type Pd	Qd	Gs	Bs	area	Vm	Va	baseKV	zone	Vmax	Vmin
bus = [
1	3	0       0       0   0	1	1	0	135	1	1.05	0.95;
2	2	21.7	12.7	0   0	1	1	0	135	1	1.1     0.95;
3	1	2.4     1.2     0	0   1	1	0	135	1	1.05	0.95;
];
%               PQ bus          = 1
%               PV bus          = 2
%               reference bus   = 3
%               isolated bus    = 4
%% generator data
%bus	Pg Qg	Qmax	Qmin	Vg	mBase	status	Pmax	Pmin
gen = [
 1  	0	0	150     -20     1	100     1       80	0;
 2  	0	0	60      -20     1	100     1       80	0;
 3  	0	0	62.5	-15     1	100     1       50	0;
];

%% branch data
%	fbus	tbus	r	x	b	rateA	rateB	rateC	ratio	angle	status
branch = [
	1	2	0.02	0.06	0.03	130	130	130	0	0	1;
	2	3	0.05	0.19	0.02	130	130	130	0	0	1;
];

%%-----  OPF Data  -----%%
%% area data
areas = [
	1	1;
];

%% generator cost data
%	1	startup	shutdown	n	x1	y1	...	xn	yn
%	2	startup	shutdown	n	c(n-1)	...	c0
gencost = [
	2	0	0	3	0.02	2       0;
	2	0	0	3	0.0175	1.75	0;
	2	0	0	3	0.0625	1       0;
    %Reactive Power Cost from here on
	2	0	0	3	0.02	0       0;
	2	0	0	3	0.0175	0       0;
	2	0	0	3	0.0625	10       0;

];

return;

Reply via email to