Hi,
I am using MATPOWER 5.1.
I am trying to run opf for a 5 bus system mentioned in a book by "Stagg and
El-Abiad".
Following is my input system data:
function mpc = case5Stagg
%CASE5Stagg This represents the 5 bus system in Stagg El-Abiad book
%% MATPOWER Case Format : Version 2
mpc.version = '2';
%%----- Power Flow Data -----%%
%% system MVA base
mpc.baseMVA = 100;
%% bus data
% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
mpc.bus = [
1 3 0 0 0 0 1 1.05 0 230 1 1.05 0.95;
2 2 20 9.7 0 0 1 1 0 230 1 1.05 0.95;
3 1 45 22 0 0 1 1 0 230 1 1.05 0.95;
4 2 40 19 0 0 1 1 0 230 1 1.05 0.95;
5 1 60 29 0 0 1 1 0 230 1 1.05 0.95;
];
%% generator data
% bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin Pc1 Pc2 Qc1min Qc1max Qc2min
Qc2max ramp_agc ramp_10 ramp_30 ramp_q apf
mpc.gen = [
1 100 20 100 -100 1 100 1 125 20 0 0 0 0 0 0 0 0 0 0 0;
2 80 20 100 -100 1 100 1 125 20 0 0 0 0 0 0 0 0 0 0 0;
4 0 50 50 0 1 100 1 0 0 0 0 0 0 0 0 0 0 0 0 0;
];
%% branch data
% fbus tbus r x b rateA rateB rateC ratio angle status angmin angmax
mpc.branch = [
1 2 0.02 0.06 0.03 180 180 180 0 0 1 -360 360;
1 3 0.08 0.24 0.025 180 180 180 0 0 1 -360 360;
2 3 0.06 0.18 0.02 180 180 180 0 0 1 -360 360;
2 4 0.06 0.18 0.02 180 180 180 0 0 1 -360 360;
2 5 0.04 0.12 0.01 180 180 180 0 0 1 -360 360;
3 4 0.01 0.03 0.01 180 180 180 0 0 1 -360 360;
4 5 0.08 0.24 0.025 180 180 180 0 0 1 -360 360;
];
%%----- OPF Data -----%%
%% generator cost data
% 1 startup shutdown n x1 y1 ... xn yn
% 2 startup shutdown n c(n-1) ... c0
mpc.gencost = [
2 0 0 3 0.0420 7.50 75;
2 0 0 3 0.0420 7.50 75;
2 0 0 3 0 0 0;
2 0 0 3 0.0043 -0.0383 0.2992;
2 0 0 3 0.0043 -0.0383 0.2992;
2 0 0 3 0 0.1324 0;
];
This system has 2 generators at bus 1 and 2 and a capacitor at bus 4.
I am also including cost of generation of reactive power from the
generators as well as the capacitors(refer mpc.gencost).
But after I 'runopf' , the opf results are the same with/without reactive
power generation cost.
results=
version: '2'
baseMVA: 100
bus: [5x17 double]
gen: [2x25 double]
branch: [7x21 double]
gencost: [2x7 double]
order: [1x1 struct]
om: [1x1 opf_model]
x: [14x1 double]
mu: [1x1 struct]
f: 2.0196e+03
var: [1x1 struct]
nln: [1x1 struct]
et: 0.0930
success: 1
raw: [1x1 struct]
You can see that the gencost is only a 2x7 double. Why is the program not
taking the other rows into account?
Please help me out.
Thank you.