case5b_2g.m文件:
function mpc = case5b_2g
%CASE5b_2g Power flow data for 5 bus, 2 gen case
%浙大的电力系统分析例3.3
% MATPOWER
%% 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 1 160 80 0 0 1 1 0 100 1 1.1 0.9;
2 1 200 100 0 0 1 1 0 100 1 1.1 0.9;
3 1 370 130 0 0 1 1 0 100 1 1.1 0.9;
4 2 0 0 0 0 1 1.05 0 100 1 1.1 0.9;
5 3 0 0 0 0 1 1.05 0 100 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 = [
5 0 0 10000 -10000 1.05 100 1 0 0 0 0 0 0 0 0 0 0 0 0 0;
4 500 0 10000 -10000 1.05 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 = [
2 4 0 0.015 0 250 250 250 1.05 0 1 -360 360;
3 2 0.08 0.3 0.5 250 250 250 0 0 1 -360 360;
3 5 0 0.03 0 250 250 250 1.05 0 1 -360 360;
2 1 0.04 0.25 0.5 250 250 250 0 0 1 -360 360;
1 3 0.1 0.35 0 250 250 250 0 0 1 -360 360;
];
运行:
runpf(‘case5b_2g’)
输出结果:
>> runpf('case5b_2g')
MATPOWER Version 6.0, 16-Dec-2016 -- AC Power Flow (Newton)
Newton's method power flow converged in 5 iterations.
Converged in 0.00 seconds
================================================================================
| System Summary |
================================================================================
How many? How much? P (MW) Q (MVAr)
--------------------- ------------------- ------------- -----------------
Buses 5 Total Gen Capacity 0.0 -20000.0 to 20000.0
Generators 2 On-line Capacity 0.0 -20000.0 to 20000.0
Committed Gens 2 Generation (actual) 757.9 411.2
Loads 3 Load 730.0 310.0
Fixed 3 Fixed 730.0 310.0
Dispatchable 0 Dispatchable -0.0 of -0.0 -0.0
Shunts 0 Shunt (inj) -0.0 0.0
Branches 5 Losses (I^2 * Z) 27.94 204.78
Transformers 2 Branch Charging (inj) - 103.5
Inter-ties 0 Total Inter-tie Flow 0.0 0.0
Areas 1
Minimum Maximum
------------------------- --------------------------------
Voltage Magnitude 0.862 p.u. @ bus 1 1.078 p.u. @ bus 2
Voltage Angle -4.78 deg @ bus 1 21.84 deg @ bus 4
P Losses (I^2*R) - 13.81 MW @ line 3-2
Q Losses (I^2*X) - 73.98 MVAr @ line 2-1
================================================================================
| Bus Data |
================================================================================
Bus Voltage Generation Load
# Mag(pu) Ang(deg) P (MW) Q (MVAr) P (MW) Q (MVAr)
----- ------- -------- -------- -------- -------- --------
1 0.862 -4.779 - - 160.00 80.00
2 1.078 17.854 - - 200.00 100.00
3 1.036 -4.282 - - 370.00 130.00
4 1.050 21.843 500.00 181.31 - -
5 1.050 0.000* 257.94 229.94 - -
-------- -------- -------- --------
Total: 757.94 411.25 730.00 310.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 2 4 -500.00 -142.82 500.00 181.31 0.000 38.49
2 3 2 -127.74 20.32 141.55 -24.43 13.809 51.78
3 3 5 -257.94 -197.45 257.94 229.94 0.000 32.49
4 2 1 158.45 67.26 -146.62 -40.91 11.837 73.98
5 1 3 -13.38 -39.09 15.68 47.13 2.297 8.04
-------- --------
Total: 27.943 204.78
case4b_2g.m文件:
function mpc = case4b_2g
%CASE4GS Power flow data for 4 bus, 2 gen case.
% MATPOWER
%% 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 1 0 0 0 0 1 1 0 110 1 1.1 0.9;
2 1 50 24.6 0 0.05 1 1 0 38.5 1 1.1 0.9;
3 2 0 0 0 0 1 1.05 0 110 1 1.1 0.9;
4 3 15 10 0 0 1 1.05 0 110 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 = [
4 0 0 10000 -10000 1.05 100 1 0 0 0 0 0 0 0 0 0 0 0 0 0;
3 20 0 10000 -10000 1.05 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 = [
4 1 0.173554 0.330579 0.017243*2 250 250 250 0 0 1 -360 360;
4 3 0.260331 0.495868 0.025864*2 250 250 250 0 0 1 -360 360;
3 1 0.130165 0.247934 0.012932*2 250 250 250 0 0 1 -360 360;
2 1 0 0.166667 0 250 250 250 1.128205 0 1 -360 360;
];
运行:
runpf(‘case4b_2g’)
输出结果:
>> runpf('case4b_2g')
MATPOWER Version 6.0, 16-Dec-2016 -- AC Power Flow (Newton)
Newton's method power flow converged in 4 iterations.
Converged in 0.04 seconds
================================================================================
| System Summary |
================================================================================
How many? How much? P (MW) Q (MVAr)
--------------------- ------------------- ------------- -----------------
Buses 4 Total Gen Capacity 0.0 -20000.0 to 20000.0
Generators 2 On-line Capacity 0.0 -20000.0 to 20000.0
Committed Gens 2 Generation (actual) 67.8 34.0
Loads 2 Load 65.0 34.6
Fixed 2 Fixed 65.0 34.6
Dispatchable 0 Dispatchable -0.0 of -0.0 -0.0
Shunts 1 Shunt (inj) -0.0 0.1
Branches 4 Losses (I^2 * Z) 2.76 11.36
Transformers 1 Branch Charging (inj) - 11.9
Inter-ties 0 Total Inter-tie Flow 0.0 0.0
Areas 1
Minimum Maximum
------------------------- --------------------------------
Voltage Magnitude 0.970 p.u. @ bus 1 1.050 p.u. @ bus 4
Voltage Angle -9.23 deg @ bus 2 0.00 deg @ bus 4
P Losses (I^2*R) - 1.38 MW @ line 4-1
Q Losses (I^2*X) - 6.10 MVAr @ line 2-1
================================================================================
| Bus Data |
================================================================================
Bus Voltage Generation Load
# Mag(pu) Ang(deg) P (MW) Q (MVAr) P (MW) Q (MVAr)
----- ------- -------- -------- -------- -------- --------
1 0.970 -3.876 - - - -
2 1.039 -9.231 - - 50.00 24.60
3 1.050 -1.841 20.00 19.64 - -
4 1.050 0.000* 47.76 14.40 15.00 10.00
-------- -------- -------- --------
Total: 67.76 34.04 65.00 34.60
================================================================================
| 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 4 1 27.12 10.10 -25.73 -10.99 1.384 2.64
2 4 3 5.65 -5.70 -5.55 0.18 0.094 0.18
3 3 1 25.55 19.47 -24.27 -19.66 1.286 2.45
4 2 1 -50.00 -24.55 50.00 30.64 0.000 6.10
-------- --------
Total: 2.765 11.36
我在算这两个算例的时候,又发现了一个问题:带变压器的支路,是向高压侧归算还是低压侧归算?浙大韩祯祥老师的书中例题有两个变压器支路,分别向两侧归算;而夏道止老师的书中例题有一个变压器支路,是向高压侧归算的。
我的理解是,变压器支路向靠着发电机近的那一侧进行归算,发电机侧一般是高压侧,所以说是向高压侧进行归算。
链接: link.
百度文库的一个总结,写的挺明白的,对于学习matpower挺有用。