You are on page 1of 5

%% bus data

% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin


mpc.bus = [
1 2 0 0 0 0 1 1 0 230 1 1.1 0.9;
2 1 300 98.61 0 0 1 1 0 230 1 1.1 0.9;
3 2 300 98.61 0 0 1 1 0 230 1 1.1 0.9;
4 3 400 131.47 0 0 1 1 0 230 1 1.1 0.9;
5 2 0 0 0 0 1 1 0 230 1 1.1 0.9;
];

%% 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 40 0 30 -30 1 100 1 40 0 0 0 0 0 0 0 0 0 0 0 0;
1 170 0 127.5 -127.5 1 100 1 170 0 0 0 0 0 0 0 0 0 0 0 0;
3 323.49 0 390 -390 1 100 1 520 0 0 0 0 0 0 0 0 0 0 0 0;
4 0 0 150 -150 1 100 1 200 0 0 0 0 0 0 0 0 0 0 0 0;
5 466.51 0 450 -450 1 100 1 600 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.00281 0.0281 0.00712 400 400 400 0 0 1 -360 360;
1 4 0.00304 0.0304 0.00658 0 0 0 0 0 1 -360 360;
1 5 0.00064 0.0064 0.03126 0 0 0 0 0 1 -360 360;
2 3 0.00108 0.0108 0.01852 0 0 0 0 0 1 -360 360;
3 4 0.00297 0.0297 0.00674 0 0 0 0 0 1 -360 360;
4 5 0.00297 0.0297 0.00674 240 240 240 0 0 1 -360 360;
];
After adding id = 37 with the real power Pd, generated real power Pg and rate at branch data, the new
data are as follows:
%% bus data
% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
mpc.bus = [
1 2 0 0 0 0 1 1 0 230 1 1.1 0.9;
2 1 337 98.61 0 0 1 1 0 230 1 1.1 0.9;
3 2 337 98.61 0 0 1 1 0 230 1 1.1 0.9;
4 3 437 131.47 0 0 1 1 0 230 1 1.1 0.9;
5 2 0 0 0 0 1 1 0 230 1 1.1 0.9;
];

%% 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 77 0 30 -30 1 100 1 40 0 0 0 0 0 0 0 0 0 0 0 0;
1 207 0 127.5 -127.5 1 100 1 170 0 0 0 0 0 0 0 0 0 0 0 0;
3 557 0 390 -390 1 100 1 520 0 0 0 0 0 0 0 0 0 0 0 0;
4 237 0 150 -150 1 100 1 200 0 0 0 0 0 0 0 0 0 0 0 0;
5 637 0 450 -450 1 100 1 600 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.00281 0.0281 0.00712 437 437 437 0 0 1 -360 360;
1 4 0.00304 0.0304 0.00658 0 0 0 0 0 1 -360 360;
1 5 0.00064 0.0064 0.03126 0 0 0 0 0 1 -360 360;
2 3 0.00108 0.0108 0.01852 0 0 0 0 0 1 -360 360;
3 4 0.00297 0.0297 0.00674 0 0 0 0 0 1 -360 360;
4 5 0.00297 0.0297 0.00674 277 277 277 0 0 1 -360 360;
];
Output:
MATPOWER Version 7.0b1, 31-Oct-2018 -- AC Optimal Power Flow

AC OPF formulation: polar voltages, power balance eqns

MATPOWER Interior Point Solver -- MIPS, Version 1.3, 30-Oct-2018

(using built-in linear solver)

Converged!

Converged in 5.54 seconds

Objective Function Value = 18850.09 $/hr

================================================================================

| System Summary |

================================================================================

How many? How much? P (MW) Q (MVAr)

--------------------- ------------------- ------------- -----------------

Buses 5 Total Gen Capacity 1530.0 -1147.5 to 1147.5

Generators 5 On-line Capacity 1530.0 -1147.5 to 1147.5

Committed Gens 5 Generation (actual) 1117.7 386.7

Loads 3 Load 1111.0 328.7

Fixed 3 Fixed 1111.0 328.7

Dispatchable 0 Dispatchable -0.0 of -0.0 -0.0

Shunts 0 Shunt (inj) -0.0 0.0

Branches 6 Losses (I^2 * Z) 6.70 67.00

Transformers 0 Branch Charging (inj) - 9.0

Inter-ties 0 Total Inter-tie Flow 0.0 0.0

Areas 1

Minimum Maximum

------------------------- --------------------------------

Voltage Magnitude 1.065 p.u. @ bus 4 1.100 p.u. @ bus 3

Voltage Angle -1.01 deg @ bus 2 4.13 deg @ bus 5

P Losses (I^2*R) - 2.16 MW @ line 1-2

Q Losses (I^2*X) - 21.63 MVAr @ line 1-2

Lambda P 10.00 $/MWh @ bus 5 39.63 $/MWh @ bus 4

Lambda Q -0.00 $/MWh @ bus 5 0.44 $/MWh @ bus 2


================================================================================

| 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.079 3.137 210.00 157.50 - - 16.916 0.421

2 1.084 -1.006 - - 337.00 98.61 26.562 0.441

3 1.100 -0.868 333.15 390.00 337.00 98.61 30.000 0.140

4 1.065 0.000* 0.00 -0.68 437.00 131.47 39.626 -

5 1.071 4.132 574.55 -160.09 - - 10.000 -

-------- -------- -------- --------

Total: 1117.70 386.72 1111.00 328.69

================================================================================

| 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 296.80 -38.86 -294.64 59.65 2.163 21.63

2 1 4 210.11 31.88 -208.93 -20.83 1.180 11.80

3 1 5 -296.91 164.48 297.55 -161.72 0.637 6.37

4 2 3 -42.36 -158.26 42.60 158.49 0.244 2.44

5 3 4 -46.45 132.90 46.94 -128.80 0.489 4.89

6 4 5 -275.01 17.47 277.00 1.63 1.987 19.87

-------- --------

Total: 6.700 67.00

================================================================================

| Voltage Constraints |

================================================================================

Bus # Vmin mu Vmin |V| Vmax Vmax mu

----- -------- ----- ----- ----- --------

3 - 0.900 1.100 1.100 244.587


================================================================================

| Generation Constraints |

================================================================================

Gen Bus Active Power Limits

# # Pmin mu Pmin Pg Pmax Pmax mu

---- ----- ------- -------- -------- -------- -------

1 1 - 0.00 40.00 40.00 2.916

2 1 - 0.00 170.00 170.00 1.916

4 4 0.374 0.00 0.00 200.00 -

Gen Bus Reactive Power Limits

# # Qmin mu Qmin Qg Qmax Qmax mu

---- ----- ------- -------- -------- -------- -------

1 1 - -30.00 30.00 30.00 0.421

2 1 - -127.50 127.50 127.50 0.421

3 3 - -390.00 390.00 390.00 0.140

================================================================================

| Branch Flow Constraints |

================================================================================

Brnch From "From" End Limit "To" End To

# Bus |Sf| mu |Sf| |Smax| |St| |St| mu Bus

----- ----- ------- -------- -------- -------- ------- -----

6 4 - 275.56 277.00 277.00 60.965 5

You might also like