Commit 22574814 by wzc-a

Merge remote-tracking branch 'origin/master'

parents cb9546e1 84670c83
a = sparse([0,0,0,1,2,2], [0,1,2,1,1,2], [1,1,2,3,3,sin(8-2)], 3, 3);
b = [1,12,7];
r = sp_linsolve(a, b, [0,0,0]);
r2 = sp_linsolve(a, b);
return r - r2;
\ No newline at end of file
g1 = x1+3/3 * x2+ min(2,5)*x3 - 1;
g2 = 1*3*x2 - 4*3;
g3 = 1*3 * x2+sin(8-2)*x3 - 7;
b = [0,0,0];
r = sp_linsolvex([g1,g2,g3], b, [0,0,0], [x1,x2,x3]);
r2 = sp_linsolvex([g1,g2,g3], [], [], [x1,x2,x3]);
return r-r2;
\ No newline at end of file
baseMVA = 10; baseMVA = 10;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,23,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 23, 1, 1, 1],
[2,1,1.84,0.46,0,0,1,1,0,23,1,1.1,0.9], [ 2, 1, 1.84, 0.46, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[3,1,0.98,0.34,0,0,1,1,0,23,1,1.1,0.9], [ 3, 1, 0.98, 0.34, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[4,1,1.79,0.446,0,0,1,1,0,23,1,1.1,0.9], [ 4, 1, 1.79, 0.446, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[5,1,1.598,1.84,0,0,1,1,0,23,1,1.1,0.9], [ 5, 1, 1.598, 1.84, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[6,1,1.61,0.6,0,0,1,1,0,23,1,1.1,0.9], [ 6, 1, 1.61, 0.6, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[7,1,0.78,0.11,0,0,1,1,0,23,1,1.1,0.9], [ 7, 1, 0.78, 0.11, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[8,1,1.15,0.06,0,0,1,1,0,23,1,1.1,0.9], [ 8, 1, 1.15, 0.06, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[9,1,0.98,0.13,0,0,1,1,0,23,1,1.1,0.9], [ 9, 1, 0.98, 0.13, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[10,1,1.64,0.2,0,0,1,1,0,23,1,1.1,0.9] [10, 1, 1.64, 0.2, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.0023308,0.0078015,0,0,0,0,0,0,1,-360,360], [1, 2, 0.0023308, 0.0078015, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.00026465,0.011439,0,0,0,0,0,0,1,-360,360], [2, 3, 0.00026465, 0.011439, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.014108,0.022779,0,0,0,0,0,0,1,-360,360], [3, 4, 0.014108, 0.022779, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.013202,0.011501,0,0,0,0,0,0,1,-360,360], [4, 5, 0.013202, 0.011501, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.037488,0.032658,0,0,0,0,0,0,1,-360,360], [5, 6, 0.037488, 0.032658, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.017113,0.014907,0,0,0,0,0,0,1,-360,360], [6, 7, 0.017113, 0.014907, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.038851,0.022004,0,0,0,0,0,0,1,-360,360], [7, 8, 0.038851, 0.022004, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.090648,0.051342,0,0,0,0,0,0,1,-360,360], [8, 9, 0.090648, 0.051342, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.10101,0.05721,0,0,0,0,0,0,1,-360,360] [9, 10, 0.10101, 0.05721, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 1; baseMVA = 1;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,11,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[2,1,0.06,0.06,0,0,1,1,0,11,1,1.1,0.9], [ 2, 1, 0.06, 0.06, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[3,1,0.04,0.03,0,0,1,1,0,11,1,1.1,0.9], [ 3, 1, 0.04, 0.03, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[4,1,0.055,0.055,0,0,1,1,0,11,1,1.1,0.9], [ 4, 1, 0.055, 0.055, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[5,1,0.03,0.03,0,0,1,1,0,11,1,1.1,0.9], [ 5, 1, 0.03, 0.03, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[6,1,0.02,0.015,0,0,1,1,0,11,1,1.1,0.9], [ 6, 1, 0.02, 0.015, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[7,1,0.055,0.055,0,0,1,1,0,11,1,1.1,0.9], [ 7, 1, 0.055, 0.055, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[8,1,0.045,0.045,0,0,1,1,0,11,1,1.1,0.9], [ 8, 1, 0.045, 0.045, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[9,1,0.04,0.04,0,0,1,1,0,11,1,1.1,0.9], [ 9, 1, 0.04, 0.04, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[10,1,0.035,0.03,0,0,1,1,0,11,1,1.1,0.9], [10, 1, 0.035, 0.03, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[11,1,0.04,0.03,0,0,1,1,0,11,1,1.1,0.9], [11, 1, 0.04, 0.03, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[12,1,0.015,0.015,0,0,1,1,0,11,1,1.1,0.9] [12, 1, 0.015, 0.015, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.0090331,0.0037603,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.0090331, 0.0037603, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.0097851,0.0040826,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.0097851, 0.0040826, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.017314,0.0072149,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.017314, 0.0072149, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.026347,0.010983,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.026347, 0.010983, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.0090331,0.0037603,0,0,0,0,0,0,1,-360,360], [ 5, 6, 0.0090331, 0.0037603, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.008281,0.0034463,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.008281, 0.0034463, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.036388,0.010041,0,0,0,0,0,0,1,-360,360], [ 7, 8, 0.036388, 0.010041, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.046628,0.013198,0,0,0,0,0,0,1,-360,360], [ 8, 9, 0.046628, 0.013198, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.023884,0.0067603,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.023884, 0.0067603, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[10,11,0.012512,0.0035372,0,0,0,0,0,0,1,-360,360], [10, 11, 0.012512, 0.0035372, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,0.010231,0.0029008,0,0,0,0,0,0,1,-360,360] [11, 12, 0.010231, 0.0029008, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 1; baseMVA = 1;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,11,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[2,1,0.0441,0.044991,0,0,1,1,0,11,1,1.1,0.9], [ 2, 1, 0.0441, 0.044991, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[3,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [ 3, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[4,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9], [ 4, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[5,1,0.0441,0.044991,0,0,1,1,0,11,1,1.1,0.9], [ 5, 1, 0.0441, 0.044991, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[6,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9], [ 6, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[7,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9], [ 7, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[8,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [ 8, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[9,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [ 9, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[10,1,0.0441,0.044991,0,0,1,1,0,11,1,1.1,0.9], [10, 1, 0.0441, 0.044991, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[11,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9], [11, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[12,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [12, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[13,1,0.0441,0.044991,0,0,1,1,0,11,1,1.1,0.9], [13, 1, 0.0441, 0.044991, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[14,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [14, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[15,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9] [15, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.011183,0.010938,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.011183, 0.010938, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.0096714,0.0094598,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.0096714, 0.0094598, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.0069513,0.0067993,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.0069513, 0.0067993, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.012591,0.0084926,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.012591, 0.0084926, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,9,0.016638,0.011222,0,0,0,0,0,0,1,-360,360], [ 2, 9, 0.016638, 0.011222, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.01394,0.0094025,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.01394, 0.0094025, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,6,0.021134,0.014255,0,0,0,0,0,0,1,-360,360], [ 2, 6, 0.021134, 0.014255, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.0089934,0.0060661,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.0089934, 0.0060661, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,8,0.010342,0.006976,0,0,0,0,0,0,1,-360,360], [ 6, 8, 0.010342, 0.006976, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,11,0.014839,0.010009,0,0,0,0,0,0,1,-360,360], [ 3, 11, 0.014839, 0.010009, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,0.020235,0.013649,0,0,0,0,0,0,1,-360,360], [11, 12, 0.020235, 0.013649, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,0.016638,0.011222,0,0,0,0,0,0,1,-360,360], [12, 13, 0.016638, 0.011222, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,14,0.018436,0.012436,0,0,0,0,0,0,1,-360,360], [ 4, 14, 0.018436, 0.012436, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,15,0.0098927,0.0066727,0,0,0,0,0,0,1,-360,360] [ 4, 15, 0.0098927, 0.0066727, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 100; baseMVA = 100;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,11,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[2,1,0.0441,0.044991,0,0,1,1,0,11,1,1.1,0.9], [ 2, 1, 0.0441, 0.044991, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[3,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [ 3, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[4,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9], [ 4, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[5,1,0.0441,0.044991,0,0,1,1,0,11,1,1.1,0.9], [ 5, 1, 0.0441, 0.044991, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[6,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9], [ 6, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[7,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9], [ 7, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[8,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [ 8, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[9,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [ 9, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[10,1,0.0441,0.044991,0,0,1,1,0,11,1,1.1,0.9], [10, 1, 0.0441, 0.044991, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[11,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9], [11, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[12,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [12, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[13,1,0.0441,0.044991,0,0,1,1,0,11,1,1.1,0.9], [13, 1, 0.0441, 0.044991, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[14,1,0.07,0.071414,0,0,1,1,0,11,1,1.1,0.9], [14, 1, 0.07, 0.071414, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[15,1,0.14,0.14283,0,0,1,1,0,11,1,1.1,0.9] [15, 1, 0.14, 0.14283, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.7766,0.7596,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.7766, 0.7596, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.6716,0.6569,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.6716, 0.6569, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.4827,0.4722,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.4827, 0.4722, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.8744,0.5898,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.8744, 0.5898, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,9,1.1554,0.7793,0,0,0,0,0,0,1,-360,360], [ 2, 9, 1.1554, 0.7793, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.968,0.6529,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.968, 0.6529, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,6,1.4677,0.99,0,0,0,0,0,0,1,-360,360], [ 2, 6, 1.4677, 0.99, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.6245,0.4213,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.6245, 0.4213, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,8,0.7182,0.4844,0,0,0,0,0,0,1,-360,360], [ 6, 8, 0.7182, 0.4844, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,11,1.0305,0.6951,0,0,0,0,0,0,1,-360,360], [ 3, 11, 1.0305, 0.6951, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,1.4052,0.9478,0,0,0,0,0,0,1,-360,360], [11, 12, 1.4052, 0.9478, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,1.1554,0.7793,0,0,0,0,0,0,1,-360,360], [12, 13, 1.1554, 0.7793, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,14,1.2803,0.8636,0,0,0,0,0,0,1,-360,360], [ 4, 14, 1.2803, 0.8636, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,15,0.687,0.4634,0,0,0,0,0,0,1,-360,360] [ 4, 15, 0.687, 0.4634, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 10; baseMVA = 10;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,12.66,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1, 1],
[2,1,0,0,0,0,1,1,0,12.66,1,1.1,0.9], [ 2, 1, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[3,1,2,1.6,0,0,1,1,0,12.66,1,1.1,0.9], [ 3, 1, 2, 1.6, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[4,1,3,0.4,0,0,1,1,0,12.66,1,1.1,0.9], [ 4, 1, 3, 0.4, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[5,1,2,-0.4,0,0,1,1,0,12.66,1,1.1,0.9], [ 5, 1, 2, -0.4, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[6,1,1.5,1.2,0,0,1,1,0,12.66,1,1.1,0.9], [ 6, 1, 1.5, 1.2, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[7,1,4,2.7,0,0,1,1,0,12.66,1,1.1,0.9], [ 7, 1, 4, 2.7, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[8,1,5,1.8,0,0,1,1,0,12.66,1,1.1,0.9], [ 8, 1, 5, 1.8, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[9,1,1,0.9,0,0,1,1,0,12.66,1,1.1,0.9], [ 9, 1, 1, 0.9, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[10,1,0.6,-0.5,0,0,1,1,0,12.66,1,1.1,0.9], [10, 1, 0.6, -0.5, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[11,1,4.5,-1.7,0,0,1,1,0,12.66,1,1.1,0.9], [11, 1, 4.5, -1.7, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[12,1,1,0.9,0,0,1,1,0,12.66,1,1.1,0.9], [12, 1, 1, 0.9, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[13,1,1,-1.1,0,0,1,1,0,12.66,1,1.1,0.9], [13, 1, 1, -1.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[14,1,1,0.9,0,0,1,1,0,12.66,1,1.1,0.9], [14, 1, 1, 0.9, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[15,1,2.1,-0.8,0,0,1,1,0,12.66,1,1.1,0.9] [15, 1, 2.1, -0.8, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0,6.2393e-10,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0, 6.2393e-10, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.0074996,0.010002,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.0074996, 0.010002, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.0079987,0.011,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.0079987, 0.011, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,5,0.008997,0.018,0,0,0,0,0,0,1,-360,360], [ 3, 5, 0.008997, 0.018, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.0039994,0.0039994,0,0,0,0,0,0,1,-360,360], [ 5, 6, 0.0039994, 0.0039994, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,7,0.011,0.011,0,0,0,0,0,0,1,-360,360], [ 2, 7, 0.011, 0.011, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.0079987,0.011,0,0,0,0,0,0,1,-360,360], [ 7, 8, 0.0079987, 0.011, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,9,0.011,0.011,0,0,0,0,0,0,1,-360,360], [ 7, 9, 0.011, 0.011, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,10,0.011,0.011,0,0,0,0,0,0,1,-360,360], [ 8, 10, 0.011, 0.011, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,11,0.0079987,0.011,0,0,0,0,0,0,1,-360,360], [ 8, 11, 0.0079987, 0.011, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,12,0.011,0.011,0,0,0,0,0,0,1,-360,360], [ 2, 12, 0.011, 0.011, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,0.008997,0.011998,0,0,0,0,0,0,1,-360,360], [12, 13, 0.008997, 0.011998, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,14,0.0079987,0.011,0,0,0,0,0,0,1,-360,360], [12, 14, 0.0079987, 0.011, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,15,0.0039994,0.0039994,0,0,0,0,0,0,1,-360,360] [14, 15, 0.0039994, 0.0039994, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 10; baseMVA = 10;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,12.66,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1, 1],
[2,3,0,0,0,0,1,1,0,12.66,1,1,1], [ 2, 3, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1, 1],
[3,3,0,0,0,0,1,1,0,12.66,1,1,1], [ 3, 3, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1, 1],
[4,1,2,1.6,0,0,1,1,0,12.66,1,1,1], [ 4, 1, 2, 1.6, 0, 0, 1, 1, 0, 12.66, 1, 1, 1],
[5,1,3,0.4,0,0,1,1,0,12.66,1,1.1,0.9], [ 5, 1, 3, 0.4, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[6,1,2,-0.4,0,0,1,1,0,12.66,1,1.1,0.9], [ 6, 1, 2, -0.4, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[7,1,1.5,1.2,0,0,1,1,0,12.66,1,1.1,0.9], [ 7, 1, 1.5, 1.2, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[8,1,4,2.7,0,0,1,1,0,12.66,1,1.1,0.9], [ 8, 1, 4, 2.7, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[9,1,5,1.8,0,0,1,1,0,12.66,1,1.1,0.9], [ 9, 1, 5, 1.8, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[10,1,1,0.9,0,0,1,1,0,12.66,1,1.1,0.9], [10, 1, 1, 0.9, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[11,1,0.6,-0.5,0,0,1,1,0,12.66,1,1.1,0.9], [11, 1, 0.6, -0.5, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[12,1,4.5,-1.7,0,0,1,1,0,12.66,1,1.1,0.9], [12, 1, 4.5, -1.7, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[13,1,1,0.9,0,0,1,1,0,12.66,1,1.1,0.9], [13, 1, 1, 0.9, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[14,1,1,-1.1,0,0,1,1,0,12.66,1,1.1,0.9], [14, 1, 1, -1.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[15,1,1,0.9,0,0,1,1,0,12.66,1,1.1,0.9], [15, 1, 1, 0.9, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[16,1,2.1,-0.8,0,0,1,1,0,12.66,1,1.1,0.9] [16, 1, 2.1, -0.8, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0], [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[2,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0], [2, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[3,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [3, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,4,0.0046794,0.0062393,0,0,0,0,0,0,1,-360,360], [ 1, 4, 0.0046794, 0.0062393, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.0049914,0.0068632,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.0049914, 0.0068632, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,6,0.0056153,0.011231,0,0,0,0,0,0,1,-360,360], [ 4, 6, 0.0056153, 0.011231, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.0024957,0.0024957,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.0024957, 0.0024957, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,8,0.0068632,0.0068632,0,0,0,0,0,0,1,-360,360], [ 2, 8, 0.0068632, 0.0068632, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.0049914,0.0068632,0,0,0,0,0,0,1,-360,360], [ 8, 9, 0.0049914, 0.0068632, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,10,0.0068632,0.0068632,0,0,0,0,0,0,1,-360,360], [ 8, 10, 0.0068632, 0.0068632, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,11,0.0068632,0.0068632,0,0,0,0,0,0,1,-360,360], [ 9, 11, 0.0068632, 0.0068632, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,12,0.0049914,0.0068632,0,0,0,0,0,0,1,-360,360], [ 9, 12, 0.0049914, 0.0068632, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,13,0.0068632,0.0068632,0,0,0,0,0,0,1,-360,360], [ 3, 13, 0.0068632, 0.0068632, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,14,0.0056153,0.0074871,0,0,0,0,0,0,1,-360,360], [13, 14, 0.0056153, 0.0074871, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,15,0.0049914,0.0068632,0,0,0,0,0,0,1,-360,360], [13, 15, 0.0049914, 0.0068632, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[15,16,0.0024957,0.0024957,0,0,0,0,0,0,1,-360,360], [15, 16, 0.0024957, 0.0024957, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,11,0.0024957,0.0024957,0,0,0,0,0,0,0,-360,360], [ 5, 11, 0.0024957, 0.0024957, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[10,14,0.0024957,0.0024957,0,0,0,0,0,0,0,-360,360], [10, 14, 0.0024957, 0.0024957, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[7,16,0.0056153,0.0074871,0,0,0,0,0,0,0,-360,360] [ 7, 16, 0.0056153, 0.0074871, 0, 0, 0, 0, 0, 0, 0, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0], [2, 0, 0, 3, 0, 20, 0],
[2,0,0,3,0,20,0], [2, 0, 0, 3, 0, 20, 0],
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 100; baseMVA = 100;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,23,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 23, 1, 1, 1],
[2,1,0.8,0.6,0,0,1,1,0,23,1,1.1,0.9], [ 2, 1, 0.8, 0.6, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[3,1,0.8,0.6,0,0,1,1,0,23,1,1.1,0.9], [ 3, 1, 0.8, 0.6, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[4,1,0.8,0.6,0,0,1,1,0,23,1,1.1,0.9], [ 4, 1, 0.8, 0.6, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[5,1,0.8,0.64,0,0,1,1,0,23,1,1.1,0.9], [ 5, 1, 0.8, 0.64, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[6,1,1.2,0.16,0,0,1,1,0,23,1,1.1,0.9], [ 6, 1, 1.2, 0.16, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[7,1,0.8,-0.16,0,0,1,1,0,23,1,1.1,0.9], [ 7, 1, 0.8, -0.16, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[8,1,0.6,0.48,0,0,1,1,0,23,1,1.1,0.9], [ 8, 1, 0.6, 0.48, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[9,1,1.6,1.08,0,0,1,1,0,23,1,1.1,0.9], [ 9, 1, 1.6, 1.08, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[10,1,2,0.72,0,0,1,1,0,23,1,1.1,0.9], [10, 1, 2, 0.72, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[11,1,0.4,0.36,0,0,1,1,0,23,1,1.1,0.9], [11, 1, 0.4, 0.36, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[12,1,0.24,-0.2,0,0,1,1,0,23,1,1.1,0.9], [12, 1, 0.24, -0.2, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[13,1,1.8,0.8,0,0,1,1,0,23,1,1.1,0.9], [13, 1, 1.8, 0.8, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[14,1,0.4,0.36,0,0,1,1,0,23,1,1.1,0.9], [14, 1, 0.4, 0.36, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[15,1,0.4,-0.44,0,0,1,1,0,23,1,1.1,0.9], [15, 1, 0.4, -0.44, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[16,1,0.4,0.36,0,0,1,1,0,23,1,1.1,0.9], [16, 1, 0.4, 0.36, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9],
[17,1,0.84,-0.32,0,0,1,1,0,23,1,1.1,0.9] [17, 1, 0.84, -0.32, 0, 0, 1, 1, 0, 23, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.05,0.05,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.05, 0.05, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.11,0.11,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.11, 0.11, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.15,0.11,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.15, 0.11, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.08,0.11,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.08, 0.11, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,6,0.11,0.11,0,0,0,0,0,0,1,-360,360], [ 4, 6, 0.11, 0.11, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.04,0.04,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.04, 0.04, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.8,0.11,0,0,0,0,0,0,1,-360,360], [ 7, 8, 0.8, 0.11, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.075,0.1,0,0,0,0,0,0,1,-360,360], [ 8, 9, 0.075, 0.1, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,10,0.09,0.18,0,0,0,0,0,0,1,-360,360], [ 8, 10, 0.09, 0.18, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[10,11,0.04,0.04,0,0,0,0,0,0,1,-360,360], [10, 11, 0.04, 0.04, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,12,0.11,0.11,0,0,0,0,0,0,1,-360,360], [ 3, 12, 0.11, 0.11, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,0.04,0.04,0,0,0,0,0,0,1,-360,360], [12, 13, 0.04, 0.04, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,14,0.09,0.12,0,0,0,0,0,0,1,-360,360], [13, 14, 0.09, 0.12, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,15,0.11,0.11,0,0,0,0,0,0,1,-360,360], [14, 15, 0.11, 0.11, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,16,0.08,0.11,0,0,0,0,0,0,1,-360,360], [14, 16, 0.08, 0.11, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[16,17,0.04,0.04,0,0,0,0,0,0,1,-360,360] [16, 17, 0.04, 0.04, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 100; baseMVA = 100;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,11,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[2,1,0.0441,0.045,0,0,1,1,0,11,1,1.1,0.9], [ 2, 1, 0.0441, 0.045, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[3,1,0.07,0.0714,0,0,1,1,0,11,1,1.1,0.9], [ 3, 1, 0.07, 0.0714, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[4,1,0.14,0.1428,0,0,1,1,0,11,1,1.1,0.9], [ 4, 1, 0.14, 0.1428, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[5,1,0.0441,0.045,0,0,1,1,0,11,1,1.1,0.9], [ 5, 1, 0.0441, 0.045, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[6,1,0.14,0.1428,0,0,1,1,0,11,1,1.1,0.9], [ 6, 1, 0.14, 0.1428, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[7,1,0.14,0.1428,0,0,1,1,0,11,1,1.1,0.9], [ 7, 1, 0.14, 0.1428, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[8,1,0.07,0.0714,0,0,1,1,0,11,1,1.1,0.9], [ 8, 1, 0.07, 0.0714, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[9,1,0.07,0.0714,0,0,1,1,0,11,1,1.1,0.9], [ 9, 1, 0.07, 0.0714, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[10,1,0.0441,0.045,0,0,1,1,0,11,1,1.1,0.9], [10, 1, 0.0441, 0.045, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[11,1,0.14,0.1428,0,0,1,1,0,11,1,1.1,0.9], [11, 1, 0.14, 0.1428, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[12,1,0.07,0.0714,0,0,1,1,0,11,1,1.1,0.9], [12, 1, 0.07, 0.0714, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[13,1,0.0441,0.045,0,0,1,1,0,11,1,1.1,0.9], [13, 1, 0.0441, 0.045, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[14,1,0.07,0.0714,0,0,1,1,0,11,1,1.1,0.9], [14, 1, 0.07, 0.0714, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[15,1,0.14,0.1428,0,0,1,1,0,11,1,1.1,0.9], [15, 1, 0.14, 0.1428, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[16,1,0.07,0.0714,0,0,1,1,0,11,1,1.1,0.9], [16, 1, 0.07, 0.0714, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[17,1,0.07,0.0714,0,0,1,1,0,11,1,1.1,0.9], [17, 1, 0.07, 0.0714, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[18,1,0.0441,0.045,0,0,1,1,0,11,1,1.1,0.9] [18, 1, 0.0441, 0.045, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.7766,0.7596,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.7766, 0.7596, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.6716,0.6569,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.6716, 0.6569, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.4827,0.4722,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.4827, 0.4722, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.8744,0.5898,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.8744, 0.5898, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,9,1.1554,0.7793,0,0,0,0,0,0,1,-360,360], [ 2, 9, 1.1554, 0.7793, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.968,0.6529,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.968, 0.6529, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,6,1.4677,0.99,0,0,0,0,0,0,1,-360,360], [ 2, 6, 1.4677, 0.99, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.6245,0.4213,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.6245, 0.4213, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,8,0.7182,0.4844,0,0,0,0,0,0,1,-360,360], [ 6, 8, 0.7182, 0.4844, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,11,1.0305,0.6951,0,0,0,0,0,0,1,-360,360], [ 3, 11, 1.0305, 0.6951, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,1.4052,0.9478,0,0,0,0,0,0,1,-360,360], [11, 12, 1.4052, 0.9478, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,1.1554,0.7793,0,0,0,0,0,0,1,-360,360], [12, 13, 1.1554, 0.7793, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,14,1.2803,0.8636,0,0,0,0,0,0,1,-360,360], [ 4, 14, 1.2803, 0.8636, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,15,0.687,0.4634,0,0,0,0,0,0,1,-360,360], [ 4, 15, 0.687, 0.4634, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,16,0.6245,0.4213,0,0,0,0,0,0,1,-360,360], [ 5, 16, 0.6245, 0.4213, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[16,17,0.7182,0.4844,0,0,0,0,0,0,1,-360,360], [16, 17, 0.7182, 0.4844, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[17,18,0.7182,0.4844,0,0,0,0,0,0,1,-360,360] [17, 18, 0.7182, 0.4844, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 1; baseMVA = 1;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,11,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[2,1,0.01678,0.02091,0,0,1,1,0,11,1,1.1,0.9], [ 2, 1, 0.01678, 0.02091, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[3,1,0.01678,0.02091,0,0,1,1,0,11,1,1.1,0.9], [ 3, 1, 0.01678, 0.02091, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[4,1,0.0338,0.03732,0,0,1,1,0,11,1,1.1,0.9], [ 4, 1, 0.0338, 0.03732, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[5,1,0.01456,0.01252,0,0,1,1,0,11,1,1.1,0.9], [ 5, 1, 0.01456, 0.01252, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[6,1,0.01049,0.01421,0,0,1,1,0,11,1,1.1,0.9], [ 6, 1, 0.01049, 0.01421, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[7,1,0.008821,0.01166,0,0,1,1,0,11,1,1.1,0.9], [ 7, 1, 0.008821, 0.01166, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[8,1,0.01435,0.01859,0,0,1,1,0,11,1,1.1,0.9], [ 8, 1, 0.01435, 0.01859, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[9,1,0.01931,0.02587,0,0,1,1,0,11,1,1.1,0.9], [ 9, 1, 0.01931, 0.02587, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[10,1,0.01435,0.01859,0,0,1,1,0,11,1,1.1,0.9], [10, 1, 0.01435, 0.01859, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[11,1,0.01627,0.01948,0,0,1,1,0,11,1,1.1,0.9], [11, 1, 0.01627, 0.01948, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[12,1,0.01627,0.01948,0,0,1,1,0,11,1,1.1,0.9], [12, 1, 0.01627, 0.01948, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[13,1,0.08213,0.07165,0,0,1,1,0,11,1,1.1,0.9], [13, 1, 0.08213, 0.07165, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[14,1,0.03471,0.03012,0,0,1,1,0,11,1,1.1,0.9], [14, 1, 0.03471, 0.03012, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[15,1,0.03471,0.03012,0,0,1,1,0,11,1,1.1,0.9], [15, 1, 0.03471, 0.03012, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[16,1,0.08031,0.07012,0,0,1,1,0,11,1,1.1,0.9], [16, 1, 0.08031, 0.07012, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[17,1,0.04962,0.04782,0,0,1,1,0,11,1,1.1,0.9], [17, 1, 0.04962, 0.04782, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[18,1,0.04962,0.04782,0,0,1,1,0,11,1,1.1,0.9], [18, 1, 0.04962, 0.04782, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[19,1,0.04377,0.03893,0,0,1,1,0,11,1,1.1,0.9], [19, 1, 0.04377, 0.03893, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[20,1,0.03732,0.03596,0,0,1,1,0,11,1,1.1,0.9], [20, 1, 0.03732, 0.03596, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[21,1,0.03732,0.03596,0,0,1,1,0,11,1,1.1,0.9], [21, 1, 0.03732, 0.03596, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[22,1,0.03102,0.02936,0,0,1,1,0,11,1,1.1,0.9] [22, 1, 0.03102, 0.02936, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.0030281,0.0014934,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.0030281, 0.0014934, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.00045207,0.00023306,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.00045207, 0.00023306, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,4,0.004476,0.002305,0,0,0,0,0,0,1,-360,360], [ 2, 4, 0.004476, 0.002305, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.001595,0.00081818,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.001595, 0.00081818, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,9,0.0061413,0.0031628,0,0,0,0,0,0,1,-360,360], [ 4, 9, 0.0061413, 0.0031628, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.010835,0.0055802,0,0,0,0,0,0,1,-360,360], [ 5, 6, 0.010835, 0.0055802, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.00049421,0.00025455,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.00049421, 0.00025455, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,8,0.0024008,0.0012364,0,0,0,0,0,0,1,-360,360], [ 6, 8, 0.0024008, 0.0012364, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.00045207,0.00023306,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.00045207, 0.00023306, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,11,0.0055785,0.0028769,0,0,0,0,0,0,1,-360,360], [ 9, 11, 0.0055785, 0.0028769, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,0.00045207,0.00023306,0,0,0,0,0,0,1,-360,360], [11, 12, 0.00045207, 0.00023306, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,13,0.0032579,0.0016777,0,0,0,0,0,0,1,-360,360], [11, 13, 0.0032579, 0.0016777, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,14,0.0086446,0.0044529,0,0,0,0,0,0,1,-360,360], [13, 14, 0.0086446, 0.0044529, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,15,0.00018182,9.5868e-05,0,0,0,0,0,0,1,-360,360], [14, 15, 0.00018182, 9.5868e-05, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,16,0.00045207,0.00023306,0,0,0,0,0,0,1,-360,360], [14, 16, 0.00045207, 0.00023306, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[16,17,0.0026545,0.0013669,0,0,0,0,0,0,1,-360,360], [16, 17, 0.0026545, 0.0013669, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[17,18,0.0007843,0.00040331,0,0,0,0,0,0,1,-360,360], [17, 18, 0.0007843, 0.00040331, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[17,19,0.0047438,0.0024455,0,0,0,0,0,0,1,-360,360], [17, 19, 0.0047438, 0.0024455, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[19,20,0.0010678,0.00054545,0,0,0,0,0,0,1,-360,360], [19, 20, 0.0010678, 0.00054545, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[20,21,0.00071983,0.0003719,0,0,0,0,0,0,1,-360,360], [20, 21, 0.00071983, 0.0003719, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[20,22,0.0044041,0.0022678,0,0,0,0,0,0,1,-360,360] [20, 22, 0.0044041, 0.0022678, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 1; baseMVA = 1;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,11,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[2,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [ 2, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[3,1,0.014,0.014283,0,0,1,1,0,11,1,1,1], [ 3, 1, 0.014, 0.014283, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[4,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [ 4, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[5,1,0.014,0.014283,0,0,1,1,0,11,1,1,1], [ 5, 1, 0.014, 0.014283, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[6,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [ 6, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[7,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [ 7, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[8,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [ 8, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[9,1,0.014,0.014283,0,0,1,1,0,11,1,1,1], [ 9, 1, 0.014, 0.014283, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[10,1,0.014,0.014283,0,0,1,1,0,11,1,1,1], [10, 1, 0.014, 0.014283, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[11,1,0.056,0.057131,0,0,1,1,0,11,1,1,1], [11, 1, 0.056, 0.057131, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[12,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [12, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[13,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [13, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[14,1,0.014,0.014283,0,0,1,1,0,11,1,1,1], [14, 1, 0.014, 0.014283, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[15,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [15, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[16,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [16, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[17,1,0.00896,0.009141,0,0,1,1,0,11,1,1,1], [17, 1, 0.00896, 0.009141, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[18,1,0.00896,0.009141,0,0,1,1,0,11,1,1,1], [18, 1, 0.00896, 0.009141, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[19,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [19, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[20,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [20, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[21,1,0.014,0.014283,0,0,1,1,0,11,1,1,1], [21, 1, 0.014, 0.014283, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[22,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [22, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[23,1,0.00896,0.009141,0,0,1,1,0,11,1,1,1], [23, 1, 0.00896, 0.009141, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[24,1,0.056,0.057131,0,0,1,1,0,11,1,1,1], [24, 1, 0.056, 0.057131, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[25,1,0.00896,0.009141,0,0,1,1,0,11,1,1,1], [25, 1, 0.00896, 0.009141, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[26,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [26, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[27,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1], [27, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[28,1,0.03528,0.035993,0,0,1,1,0,11,1,1,1] [28, 1, 0.03528, 0.035993, 0, 0, 1, 1, 0, 11, 1, 1, 1]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.0098926,0.0067769,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.0098926, 0.0067769, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.014843,0.010174,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.014843, 0.010174, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.010793,0.0073967,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.010793, 0.0073967, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.015298,0.010479,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.015298, 0.010479, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.012595,0.0086281,0,0,0,0,0,0,1,-360,360], [ 5, 6, 0.012595, 0.0086281, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.015744,0.010785,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.015744, 0.010785, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.0098926,0.0067769,0,0,0,0,0,0,1,-360,360], [ 7, 8, 0.0098926, 0.0067769, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.0053967,0.0036942,0,0,0,0,0,0,1,-360,360], [ 8, 9, 0.0053967, 0.0036942, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.0094463,0.0064711,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.0094463, 0.0064711, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,11,0.023331,0.009686,0,0,0,0,0,0,1,-360,360], [ 4, 11, 0.023331, 0.009686, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,0.0097851,0.0040579,0,0,0,0,0,0,1,-360,360], [11, 12, 0.0097851, 0.0040579, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,0.008281,0.003438,0,0,0,0,0,0,1,-360,360], [12, 13, 0.008281, 0.003438, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,14,0.0037603,0.001562,0,0,0,0,0,0,1,-360,360], [13, 14, 0.0037603, 0.001562, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,15,0.0045124,0.001876,0,0,0,0,0,0,1,-360,360], [14, 15, 0.0045124, 0.001876, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,16,0.021074,0.0087438,0,0,0,0,0,0,1,-360,360], [ 5, 16, 0.021074, 0.0087438, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,17,0.011289,0.004686,0,0,0,0,0,0,1,-360,360], [ 6, 17, 0.011289, 0.004686, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[17,18,0.0067686,0.0028099,0,0,0,0,0,0,1,-360,360], [17, 18, 0.0067686, 0.0028099, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[18,19,0.012793,0.0053058,0,0,0,0,0,0,1,-360,360], [18, 19, 0.012793, 0.0053058, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[19,20,0.011289,0.004686,0,0,0,0,0,0,1,-360,360], [19, 20, 0.011289, 0.004686, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[20,21,0.029355,0.012182,0,0,0,0,0,0,1,-360,360], [20, 21, 0.029355, 0.012182, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,22,0.012793,0.0053058,0,0,0,0,0,0,1,-360,360], [ 7, 22, 0.012793, 0.0053058, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[22,23,0.0090248,0.0037438,0,0,0,0,0,0,1,-360,360], [22, 23, 0.0090248, 0.0037438, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[23,24,0.0075207,0.003124,0,0,0,0,0,0,1,-360,360], [23, 24, 0.0075207, 0.003124, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[24,25,0.0037603,0.001562,0,0,0,0,0,0,1,-360,360], [24, 25, 0.0037603, 0.001562, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[25,26,0.0030083,0.0012479,0,0,0,0,0,0,1,-360,360], [25, 26, 0.0030083, 0.0012479, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,27,0.0045124,0.0018678,0,0,0,0,0,0,1,-360,360], [ 8, 27, 0.0045124, 0.0018678, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[27,28,0.0022562,0.00093388,0,0,0,0,0,0,1,-360,360] [27, 28, 0.0022562, 0.00093388, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 10; baseMVA = 10;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,12.66,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1, 1],
[2,1,0.1,0.06,0,0,1,1,0,12.66,1,1.1,0.9], [ 2, 1, 0.1, 0.06, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[3,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [ 3, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[4,1,0.12,0.08,0,0,1,1,0,12.66,1,1.1,0.9], [ 4, 1, 0.12, 0.08, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[5,1,0.06,0.03,0,0,1,1,0,12.66,1,1.1,0.9], [ 5, 1, 0.06, 0.03, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[6,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [ 6, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[7,1,0.2,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [ 7, 1, 0.2, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[8,1,0.2,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [ 8, 1, 0.2, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[9,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [ 9, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[10,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [10, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[11,1,0.045,0.03,0,0,1,1,0,12.66,1,1.1,0.9], [11, 1, 0.045, 0.03, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[12,1,0.06,0.035,0,0,1,1,0,12.66,1,1.1,0.9], [12, 1, 0.06, 0.035, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[13,1,0.06,0.035,0,0,1,1,0,12.66,1,1.1,0.9], [13, 1, 0.06, 0.035, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[14,1,0.12,0.08,0,0,1,1,0,12.66,1,1.1,0.9], [14, 1, 0.12, 0.08, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[15,1,0.06,0.01,0,0,1,1,0,12.66,1,1.1,0.9], [15, 1, 0.06, 0.01, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[16,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [16, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[17,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [17, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[18,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [18, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[19,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [19, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[20,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [20, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[21,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [21, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[22,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [22, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[23,1,0.09,0.05,0,0,1,1,0,12.66,1,1.1,0.9], [23, 1, 0.09, 0.05, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[24,1,0.42,0.2,0,0,1,1,0,12.66,1,1.1,0.9], [24, 1, 0.42, 0.2, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[25,1,0.42,0.2,0,0,1,1,0,12.66,1,1.1,0.9], [25, 1, 0.42, 0.2, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[26,1,0.06,0.025,0,0,1,1,0,12.66,1,1.1,0.9], [26, 1, 0.06, 0.025, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[27,1,0.06,0.025,0,0,1,1,0,12.66,1,1.1,0.9], [27, 1, 0.06, 0.025, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[28,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [28, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[29,1,0.12,0.07,0,0,1,1,0,12.66,1,1.1,0.9], [29, 1, 0.12, 0.07, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[30,1,0.2,0.6,0,0,1,1,0,12.66,1,1.1,0.9], [30, 1, 0.2, 0.6, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[31,1,0.15,0.07,0,0,1,1,0,12.66,1,1.1,0.9], [31, 1, 0.15, 0.07, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[32,1,0.21,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [32, 1, 0.21, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[33,1,0.06,0.04,0,0,1,1,0,12.66,1,1.1,0.9] [33, 1, 0.06, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.0057526,0.0029324,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.0057526, 0.0029324, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.03076,0.015667,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.03076, 0.015667, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.022836,0.01163,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.022836, 0.01163, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.023778,0.01211,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.023778, 0.01211, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.051099,0.044112,0,0,0,0,0,0,1,-360,360], [ 5, 6, 0.051099, 0.044112, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.01168,0.038608,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.01168, 0.038608, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.044386,0.014668,0,0,0,0,0,0,1,-360,360], [ 7, 8, 0.044386, 0.014668, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.064264,0.04617,0,0,0,0,0,0,1,-360,360], [ 8, 9, 0.064264, 0.04617, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.065138,0.04617,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.065138, 0.04617, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[10,11,0.012266,0.0040555,0,0,0,0,0,0,1,-360,360], [10, 11, 0.012266, 0.0040555, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,0.02336,0.0077242,0,0,0,0,0,0,1,-360,360], [11, 12, 0.02336, 0.0077242, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,0.091592,0.072063,0,0,0,0,0,0,1,-360,360], [12, 13, 0.091592, 0.072063, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,14,0.033792,0.04448,0,0,0,0,0,0,1,-360,360], [13, 14, 0.033792, 0.04448, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,15,0.036874,0.032818,0,0,0,0,0,0,1,-360,360], [14, 15, 0.036874, 0.032818, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[15,16,0.046564,0.034004,0,0,0,0,0,0,1,-360,360], [15, 16, 0.046564, 0.034004, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[16,17,0.080424,0.10738,0,0,0,0,0,0,1,-360,360], [16, 17, 0.080424, 0.10738, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[17,18,0.045671,0.035813,0,0,0,0,0,0,1,-360,360], [17, 18, 0.045671, 0.035813, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,19,0.010232,0.0097644,0,0,0,0,0,0,1,-360,360], [ 2, 19, 0.010232, 0.0097644, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[19,20,0.093851,0.084567,0,0,0,0,0,0,1,-360,360], [19, 20, 0.093851, 0.084567, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[20,21,0.02555,0.029849,0,0,0,0,0,0,1,-360,360], [20, 21, 0.02555, 0.029849, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[21,22,0.04423,0.058481,0,0,0,0,0,0,1,-360,360], [21, 22, 0.04423, 0.058481, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,23,0.028152,0.019236,0,0,0,0,0,0,1,-360,360], [ 3, 23, 0.028152, 0.019236, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[23,24,0.056028,0.044243,0,0,0,0,0,0,1,-360,360], [23, 24, 0.056028, 0.044243, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[24,25,0.055904,0.043743,0,0,0,0,0,0,1,-360,360], [24, 25, 0.055904, 0.043743, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,26,0.012666,0.0064514,0,0,0,0,0,0,1,-360,360], [ 6, 26, 0.012666, 0.0064514, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[26,27,0.017732,0.0090282,0,0,0,0,0,0,1,-360,360], [26, 27, 0.017732, 0.0090282, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[27,28,0.066074,0.058256,0,0,0,0,0,0,1,-360,360], [27, 28, 0.066074, 0.058256, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[28,29,0.050176,0.043712,0,0,0,0,0,0,1,-360,360], [28, 29, 0.050176, 0.043712, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[29,30,0.031664,0.016128,0,0,0,0,0,0,1,-360,360], [29, 30, 0.031664, 0.016128, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[30,31,0.060795,0.060084,0,0,0,0,0,0,1,-360,360], [30, 31, 0.060795, 0.060084, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[31,32,0.019373,0.02258,0,0,0,0,0,0,1,-360,360], [31, 32, 0.019373, 0.02258, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[32,33,0.021276,0.033081,0,0,0,0,0,0,1,-360,360], [32, 33, 0.021276, 0.033081, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[21,8,0.12479,0.12479,0,0,0,0,0,0,0,-360,360], [21, 8, 0.12479, 0.12479, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[9,15,0.12479,0.12479,0,0,0,0,0,0,0,-360,360], [ 9, 15, 0.12479, 0.12479, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[12,22,0.12479,0.12479,0,0,0,0,0,0,0,-360,360], [12, 22, 0.12479, 0.12479, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[18,33,0.031196,0.031196,0,0,0,0,0,0,0,-360,360], [18, 33, 0.031196, 0.031196, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[25,29,0.031196,0.031196,0,0,0,0,0,0,0,-360,360] [25, 29, 0.031196, 0.031196, 0, 0, 0, 0, 0, 0, 0, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 1; baseMVA = 1;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,12.66,1,1.1,0.9], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[2,1,0.1,0.06,0,0,1,1,0,12.66,1,1.1,0.9], [ 2, 1, 0.1, 0.06, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[3,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [ 3, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[4,1,0.12,0.08,0,0,1,1,0,12.66,1,1.1,0.9], [ 4, 1, 0.12, 0.08, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[5,1,0.06,0.03,0,0,1,1,0,12.66,1,1.1,0.9], [ 5, 1, 0.06, 0.03, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[6,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [ 6, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[7,1,0.2,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [ 7, 1, 0.2, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[8,1,0.2,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [ 8, 1, 0.2, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[9,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [ 9, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[10,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [10, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[11,1,0.045,0.03,0,0,1,1,0,12.66,1,1.1,0.9], [11, 1, 0.045, 0.03, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[12,1,0.06,0.035,0,0,1,1,0,12.66,1,1.1,0.9], [12, 1, 0.06, 0.035, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[13,1,0.06,0.035,0,0,1,1,0,12.66,1,1.1,0.9], [13, 1, 0.06, 0.035, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[14,1,0.12,0.08,0,0,1,1,0,12.66,1,1.1,0.9], [14, 1, 0.12, 0.08, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[15,1,0.06,0.01,0,0,1,1,0,12.66,1,1.1,0.9], [15, 1, 0.06, 0.01, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[16,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [16, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[17,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [17, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[18,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [18, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[19,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [19, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[20,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [20, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[21,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [21, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[22,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [22, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[23,1,0.09,0.05,0,0,1,1,0,12.66,1,1.1,0.9], [23, 1, 0.09, 0.05, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[24,1,0.42,0.2,0,0,1,1,0,12.66,1,1.1,0.9], [24, 1, 0.42, 0.2, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[25,1,0.42,0.2,0,0,1,1,0,12.66,1,1.1,0.9], [25, 1, 0.42, 0.2, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[26,1,0.06,0.025,0,0,1,1,0,12.66,1,1.1,0.9], [26, 1, 0.06, 0.025, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[27,1,0.06,0.025,0,0,1,1,0,12.66,1,1.1,0.9], [27, 1, 0.06, 0.025, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[28,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [28, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[29,1,0.12,0.07,0,0,1,1,0,12.66,1,1.1,0.9], [29, 1, 0.12, 0.07, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[30,1,0.2,0.6,0,0,1,1,0,12.66,1,1.1,0.9], [30, 1, 0.2, 0.6, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[31,1,0.15,0.07,0,0,1,1,0,12.66,1,1.1,0.9], [31, 1, 0.15, 0.07, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[32,1,0.21,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [32, 1, 0.21, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[33,1,0.06,0.04,0,0,1,1,0,12.66,1,1.1,0.9] [33, 1, 0.06, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.00057526,0.00029324,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.00057526, 0.00029324, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.003076,0.0015667,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.003076, 0.0015667, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.0022836,0.001163,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.0022836, 0.001163, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.0023778,0.001211,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.0023778, 0.001211, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.0051099,0.0044112,0,0,0,0,0,0,1,-360,360], [ 5, 6, 0.0051099, 0.0044112, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.001168,0.0038608,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.001168, 0.0038608, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.010678,0.0077061,0,0,0,0,0,0,1,-360,360], [ 7, 8, 0.010678, 0.0077061, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.0064264,0.004617,0,0,0,0,0,0,1,-360,360], [ 8, 9, 0.0064264, 0.004617, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.0065138,0.004617,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.0065138, 0.004617, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[10,11,0.0012266,0.00040555,0,0,0,0,0,0,1,-360,360], [10, 11, 0.0012266, 0.00040555, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,0.002336,0.00077242,0,0,0,0,0,0,1,-360,360], [11, 12, 0.002336, 0.00077242, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,0.0091592,0.0072063,0,0,0,0,0,0,1,-360,360], [12, 13, 0.0091592, 0.0072063, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,14,0.0033792,0.004448,0,0,0,0,0,0,1,-360,360], [13, 14, 0.0033792, 0.004448, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,15,0.0036874,0.0032818,0,0,0,0,0,0,1,-360,360], [14, 15, 0.0036874, 0.0032818, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[15,16,0.0046564,0.0034004,0,0,0,0,0,0,1,-360,360], [15, 16, 0.0046564, 0.0034004, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[16,17,0.0080424,0.010738,0,0,0,0,0,0,1,-360,360], [16, 17, 0.0080424, 0.010738, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[17,18,0.0045671,0.0035813,0,0,0,0,0,0,1,-360,360], [17, 18, 0.0045671, 0.0035813, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,19,0.0010232,0.00097644,0,0,0,0,0,0,1,-360,360], [ 2, 19, 0.0010232, 0.00097644, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[19,20,0.0093851,0.0084567,0,0,0,0,0,0,1,-360,360], [19, 20, 0.0093851, 0.0084567, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[20,21,0.002555,0.0029849,0,0,0,0,0,0,1,-360,360], [20, 21, 0.002555, 0.0029849, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[21,22,0.004423,0.0058481,0,0,0,0,0,0,1,-360,360], [21, 22, 0.004423, 0.0058481, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,23,0.0028152,0.0019236,0,0,0,0,0,0,1,-360,360], [ 3, 23, 0.0028152, 0.0019236, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[23,24,0.0056028,0.0044243,0,0,0,0,0,0,1,-360,360], [23, 24, 0.0056028, 0.0044243, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[24,25,0.0055904,0.0043743,0,0,0,0,0,0,1,-360,360], [24, 25, 0.0055904, 0.0043743, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,26,0.0012666,0.00064514,0,0,0,0,0,0,1,-360,360], [ 6, 26, 0.0012666, 0.00064514, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[26,27,0.0017732,0.00090282,0,0,0,0,0,0,1,-360,360], [26, 27, 0.0017732, 0.00090282, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[27,28,0.0066074,0.0058256,0,0,0,0,0,0,1,-360,360], [27, 28, 0.0066074, 0.0058256, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[28,29,0.0050176,0.0043712,0,0,0,0,0,0,1,-360,360], [28, 29, 0.0050176, 0.0043712, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[29,30,0.0031664,0.0016128,0,0,0,0,0,0,1,-360,360], [29, 30, 0.0031664, 0.0016128, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[30,31,0.0060795,0.0060084,0,0,0,0,0,0,1,-360,360], [30, 31, 0.0060795, 0.0060084, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[31,32,0.0019373,0.002258,0,0,0,0,0,0,1,-360,360], [31, 32, 0.0019373, 0.002258, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[32,33,0.0021276,0.0033081,0,0,0,0,0,0,1,-360,360], [32, 33, 0.0021276, 0.0033081, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[21,8,0.012479,0.012479,0,0,0,0,0,0,0,-360,360], [21, 8, 0.012479, 0.012479, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[9,15,0.012479,0.012479,0,0,0,0,0,0,0,-360,360], [ 9, 15, 0.012479, 0.012479, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[12,22,0.012479,0.012479,0,0,0,0,0,0,0,-360,360], [12, 22, 0.012479, 0.012479, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[18,33,0.0031196,0.0031196,0,0,0,0,0,0,0,-360,360], [18, 33, 0.0031196, 0.0031196, 0, 0, 0, 0, 0, 0, 0, -360, 360],
[25,29,0.0031196,0.0031196,0,0,0,0,0,0,0,-360,360] [25, 29, 0.0031196, 0.0031196, 0, 0, 0, 0, 0, 0, 0, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 1; baseMVA = 1;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,11,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1, 1],
[2,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [ 2, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[3,1,0,0,0,0,1,1,0,11,1,1.1,0.9], [ 3, 1, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[4,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [ 4, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[5,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [ 5, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[6,1,0,0,0,0,1,1,0,11,1,1.1,0.9], [ 6, 1, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[7,1,0,0,0,0,1,1,0,11,1,1.1,0.9], [ 7, 1, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[8,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [ 8, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[9,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [ 9, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[10,1,0,0,0,0,1,1,0,11,1,1.1,0.9], [10, 1, 0, 0, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[11,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [11, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[12,1,0.084,0.137,0,0,1,1,0,11,1,1.1,0.9], [12, 1, 0.084, 0.137, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[13,1,0.045,0.072,0,0,1,1,0,11,1,1.1,0.9], [13, 1, 0.045, 0.072, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[14,1,0.045,0.072,0,0,1,1,0,11,1,1.1,0.9], [14, 1, 0.045, 0.072, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[15,1,0.045,0.072,0,0,1,1,0,11,1,1.1,0.9], [15, 1, 0.045, 0.072, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[16,1,0.0075,0.0135,0,0,1,1,0,11,1,1.1,0.9], [16, 1, 0.0075, 0.0135, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[17,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [17, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[18,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [18, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[19,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [19, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[20,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [20, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[21,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [21, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[22,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [22, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[23,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [23, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[24,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [24, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[25,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [25, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[26,1,0.1425,0.23,0,0,1,1,0,11,1,1.1,0.9], [26, 1, 0.1425, 0.23, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[27,1,0.085,0.137,0,0,1,1,0,11,1,1.1,0.9], [27, 1, 0.085, 0.137, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[28,1,0.048,0.075,0,0,1,1,0,11,1,1.1,0.9], [28, 1, 0.048, 0.075, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[29,1,0.048,0.075,0,0,1,1,0,11,1,1.1,0.9], [29, 1, 0.048, 0.075, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[30,1,0.048,0.075,0,0,1,1,0,11,1,1.1,0.9], [30, 1, 0.048, 0.075, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[31,1,0.0345,0.057,0,0,1,1,0,11,1,1.1,0.9], [31, 1, 0.0345, 0.057, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[32,1,0.0345,0.057,0,0,1,1,0,11,1,1.1,0.9], [32, 1, 0.0345, 0.057, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[33,1,0.0345,0.057,0,0,1,1,0,11,1,1.1,0.9], [33, 1, 0.0345, 0.057, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9],
[34,1,0.0345,0.057,0,0,1,1,0,11,1,1.1,0.9] [34, 1, 0.0345, 0.057, 0, 0, 1, 1, 0, 11, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.00096694,0.00039669,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.00096694, 0.00039669, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.00088636,0.00036364,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.00088636, 0.00036364, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.0013591,0.00037727,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.0013591, 0.00037727, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.0012355,0.00034298,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.0012355, 0.00034298, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.0012355,0.00034298,0,0,0,0,0,0,1,-360,360], [ 5, 6, 0.0012355, 0.00034298, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.0025983,0.00044628,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.0025983, 0.00044628, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.0017322,0.00029752,0,0,0,0,0,0,1,-360,360], [ 7, 8, 0.0017322, 0.00029752, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.0025983,0.00044628,0,0,0,0,0,0,1,-360,360], [ 8, 9, 0.0025983, 0.00044628, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.0017322,0.00029752,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.0017322, 0.00029752, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[10,11,0.0010826,0.00018595,0,0,0,0,0,0,1,-360,360], [10, 11, 0.0010826, 0.00018595, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,0.00086612,0.00014876,0,0,0,0,0,0,1,-360,360], [11, 12, 0.00086612, 0.00014876, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,13,0.0012992,0.00022314,0,0,0,0,0,0,1,-360,360], [ 3, 13, 0.0012992, 0.00022314, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,14,0.0017322,0.00029752,0,0,0,0,0,0,1,-360,360], [13, 14, 0.0017322, 0.00029752, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,15,0.00086612,0.00014876,0,0,0,0,0,0,1,-360,360], [14, 15, 0.00086612, 0.00014876, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[15,16,0.00043306,7.438e-05,0,0,0,0,0,0,1,-360,360], [15, 16, 0.00043306, 7.438e-05, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,17,0.0014826,0.00041157,0,0,0,0,0,0,1,-360,360], [ 6, 17, 0.0014826, 0.00041157, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[17,18,0.0013591,0.00037727,0,0,0,0,0,0,1,-360,360], [17, 18, 0.0013591, 0.00037727, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[18,19,0.0017182,0.00039091,0,0,0,0,0,0,1,-360,360], [18, 19, 0.0017182, 0.00039091, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[19,20,0.001562,0.00035537,0,0,0,0,0,0,1,-360,360], [19, 20, 0.001562, 0.00035537, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[20,21,0.001562,0.00035537,0,0,0,0,0,0,1,-360,360], [20, 21, 0.001562, 0.00035537, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[21,22,0.0021653,0.0003719,0,0,0,0,0,0,1,-360,360], [21, 22, 0.0021653, 0.0003719, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[22,23,0.0021653,0.0003719,0,0,0,0,0,0,1,-360,360], [22, 23, 0.0021653, 0.0003719, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[23,24,0.0025983,0.00044628,0,0,0,0,0,0,1,-360,360], [23, 24, 0.0025983, 0.00044628, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[24,25,0.0017322,0.00029752,0,0,0,0,0,0,1,-360,360], [24, 25, 0.0017322, 0.00029752, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[25,26,0.0010826,0.00018595,0,0,0,0,0,0,1,-360,360], [25, 26, 0.0010826, 0.00018595, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[26,27,0.00086612,0.00014876,0,0,0,0,0,0,1,-360,360], [26, 27, 0.00086612, 0.00014876, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,28,0.0012992,0.00022314,0,0,0,0,0,0,1,-360,360], [ 7, 28, 0.0012992, 0.00022314, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[28,29,0.0012992,0.00022314,0,0,0,0,0,0,1,-360,360], [28, 29, 0.0012992, 0.00022314, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[29,30,0.0012992,0.00022314,0,0,0,0,0,0,1,-360,360], [29, 30, 0.0012992, 0.00022314, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[10,31,0.0012992,0.00022314,0,0,0,0,0,0,1,-360,360], [10, 31, 0.0012992, 0.00022314, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[31,32,0.0017322,0.00029752,0,0,0,0,0,0,1,-360,360], [31, 32, 0.0017322, 0.00029752, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[32,33,0.0012992,0.00022314,0,0,0,0,0,0,1,-360,360], [32, 33, 0.0012992, 0.00022314, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[33,34,0.00086612,0.00014876,0,0,0,0,0,0,1,-360,360] [33, 34, 0.00086612, 0.00014876, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 1; baseMVA = 1;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,12.66,1,1,1], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1, 1],
[2,1,0.1,0.06,0,0,1,1,0,12.66,1,1.1,0.9], [ 2, 1, 0.1, 0.06, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[3,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [ 3, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[4,1,0.12,0.08,0,0,1,1,0,12.66,1,1.1,0.9], [ 4, 1, 0.12, 0.08, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[5,1,0.06,0.03,0,0,1,1,0,12.66,1,1.1,0.9], [ 5, 1, 0.06, 0.03, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[6,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [ 6, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[7,1,0.2,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [ 7, 1, 0.2, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[8,1,0.2,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [ 8, 1, 0.2, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[9,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [ 9, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[10,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [10, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[11,1,0.045,0.03,0,0,1,1,0,12.66,1,1.1,0.9], [11, 1, 0.045, 0.03, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[12,1,0.06,0.035,0,0,1,1,0,12.66,1,1.1,0.9], [12, 1, 0.06, 0.035, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[13,1,0.06,0.035,0,0,1,1,0,12.66,1,1.1,0.9], [13, 1, 0.06, 0.035, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[14,1,0.12,0.08,0,0,1,1,0,12.66,1,1.1,0.9], [14, 1, 0.12, 0.08, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[15,1,0.06,0.01,0,0,1,1,0,12.66,1,1.1,0.9], [15, 1, 0.06, 0.01, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[16,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [16, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[17,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [17, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[18,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [18, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[19,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [19, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[20,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [20, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[21,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [21, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[22,1,0.09,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [22, 1, 0.09, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[23,1,0.09,0.05,0,0,1,1,0,12.66,1,1.1,0.9], [23, 1, 0.09, 0.05, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[24,1,0.42,0.2,0,0,1,1,0,12.66,1,1.1,0.9], [24, 1, 0.42, 0.2, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[25,1,0.42,0.2,0,0,1,1,0,12.66,1,1.1,0.9], [25, 1, 0.42, 0.2, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[26,1,0.06,0.025,0,0,1,1,0,12.66,1,1.1,0.9], [26, 1, 0.06, 0.025, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[27,1,0.06,0.025,0,0,1,1,0,12.66,1,1.1,0.9], [27, 1, 0.06, 0.025, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[28,1,0.06,0.02,0,0,1,1,0,12.66,1,1.1,0.9], [28, 1, 0.06, 0.02, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[29,1,0.12,0.07,0,0,1,1,0,12.66,1,1.1,0.9], [29, 1, 0.12, 0.07, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[30,1,0.2,0.6,0,0,1,1,0,12.66,1,1.1,0.9], [30, 1, 0.2, 0.6, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[31,1,0.15,0.07,0,0,1,1,0,12.66,1,1.1,0.9], [31, 1, 0.15, 0.07, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[32,1,0.21,0.1,0,0,1,1,0,12.66,1,1.1,0.9], [32, 1, 0.21, 0.1, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[33,1,0.06,0.04,0,0,1,1,0,12.66,1,1.1,0.9], [33, 1, 0.06, 0.04, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[34,1,0,0,0,0,1,1,0,12.66,1,1.1,0.9], [34, 1, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[35,1,0,0,0,0,1,1,0,12.66,1,1.1,0.9], [35, 1, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[36,1,0,0,0,0,1,1,0,12.66,1,1.1,0.9], [36, 1, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[37,1,0,0,0,0,1,1,0,12.66,1,1.1,0.9], [37, 1, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9],
[38,1,0,0,0,0,1,1,0,12.66,1,1.1,0.9] [38, 1, 0, 0, 0, 0, 1, 1, 0, 12.66, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [1, 0, 0, 10, -10, 1, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[1,2,0.00057526,0.00029324,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.00057526, 0.00029324, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,3,0.003076,0.0015667,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.003076, 0.0015667, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,4,0.0022836,0.001163,0,0,0,0,0,0,1,-360,360], [ 3, 4, 0.0022836, 0.001163, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[4,5,0.0023778,0.001211,0,0,0,0,0,0,1,-360,360], [ 4, 5, 0.0023778, 0.001211, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[5,6,0.0051099,0.0044112,0,0,0,0,0,0,1,-360,360], [ 5, 6, 0.0051099, 0.0044112, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,7,0.001168,0.0038608,0,0,0,0,0,0,1,-360,360], [ 6, 7, 0.001168, 0.0038608, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[7,8,0.0044386,0.0014668,0,0,0,0,0,0,1,-360,360], [ 7, 8, 0.0044386, 0.0014668, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,9,0.0064264,0.004617,0,0,0,0,0,0,1,-360,360], [ 8, 9, 0.0064264, 0.004617, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,10,0.0065138,0.004617,0,0,0,0,0,0,1,-360,360], [ 9, 10, 0.0065138, 0.004617, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[10,11,0.0012266,0.00040555,0,0,0,0,0,0,1,-360,360], [10, 11, 0.0012266, 0.00040555, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[11,12,0.002336,0.00077242,0,0,0,0,0,0,1,-360,360], [11, 12, 0.002336, 0.00077242, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,13,0.0091592,0.0072063,0,0,0,0,0,0,1,-360,360], [12, 13, 0.0091592, 0.0072063, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[13,14,0.0033792,0.004448,0,0,0,0,0,0,1,-360,360], [13, 14, 0.0033792, 0.004448, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[14,15,0.0036874,0.0032818,0,0,0,0,0,0,1,-360,360], [14, 15, 0.0036874, 0.0032818, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[15,16,0.0046564,0.0034004,0,0,0,0,0,0,1,-360,360], [15, 16, 0.0046564, 0.0034004, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[16,17,0.0080424,0.010738,0,0,0,0,0,0,1,-360,360], [16, 17, 0.0080424, 0.010738, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[17,18,0.0045671,0.0035813,0,0,0,0,0,0,1,-360,360], [17, 18, 0.0045671, 0.0035813, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[2,19,0.0010232,0.00097644,0,0,0,0,0,0,1,-360,360], [ 2, 19, 0.0010232, 0.00097644, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[19,20,0.0093851,0.0084567,0,0,0,0,0,0,1,-360,360], [19, 20, 0.0093851, 0.0084567, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[20,21,0.002555,0.0029849,0,0,0,0,0,0,1,-360,360], [20, 21, 0.002555, 0.0029849, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[21,22,0.004423,0.0058481,0,0,0,0,0,0,1,-360,360], [21, 22, 0.004423, 0.0058481, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[3,23,0.0028152,0.0019236,0,0,0,0,0,0,1,-360,360], [ 3, 23, 0.0028152, 0.0019236, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[23,24,0.0056028,0.0044243,0,0,0,0,0,0,1,-360,360], [23, 24, 0.0056028, 0.0044243, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[24,25,0.0055904,0.0043743,0,0,0,0,0,0,1,-360,360], [24, 25, 0.0055904, 0.0043743, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[6,26,0.0012666,0.00064514,0,0,0,0,0,0,1,-360,360], [ 6, 26, 0.0012666, 0.00064514, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[26,27,0.0017732,0.00090282,0,0,0,0,0,0,1,-360,360], [26, 27, 0.0017732, 0.00090282, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[27,28,0.0066074,0.0058256,0,0,0,0,0,0,1,-360,360], [27, 28, 0.0066074, 0.0058256, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[28,29,0.0050176,0.0043712,0,0,0,0,0,0,1,-360,360], [28, 29, 0.0050176, 0.0043712, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[29,30,0.0031664,0.0016128,0,0,0,0,0,0,1,-360,360], [29, 30, 0.0031664, 0.0016128, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[30,31,0.0060795,0.0060084,0,0,0,0,0,0,1,-360,360], [30, 31, 0.0060795, 0.0060084, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[31,32,0.0019373,0.002258,0,0,0,0,0,0,1,-360,360], [31, 32, 0.0019373, 0.002258, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[32,33,0.0021276,0.0033081,0,0,0,0,0,0,1,-360,360], [32, 33, 0.0021276, 0.0033081, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[8,34,0.012479,0.012479,0,0,0,0,0,0,1,-360,360], [ 8, 34, 0.012479, 0.012479, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[9,35,0.012479,0.012479,0,0,0,0,0,0,1,-360,360], [ 9, 35, 0.012479, 0.012479, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[12,36,0.012479,0.012479,0,0,0,0,0,0,1,-360,360], [12, 36, 0.012479, 0.012479, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[18,37,0.0031196,0.0031196,0,0,0,0,0,0,1,-360,360], [18, 37, 0.0031196, 0.0031196, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[25,38,0.0031196,0.0031196,0,0,0,0,0,0,1,-360,360] [25, 38, 0.0031196, 0.0031196, 0, 0, 0, 0, 0, 0, 1, -360, 360]
]; ];
gencost = [ gencost = [
[2,0,0,3,0,20,0] [2, 0, 0, 3, 0, 20, 0]
]; ];
baseMVA = 1; baseMVA = 1;
bus = [ bus = [
[1,3,0,0,0,0,1,1,0,12.5,1,1.1,0.9], [ 1, 3, 0, 0, 0, 0, 1, 1, 0, 12.5, 1, 1.1, 0.9],
[2,1,0.4,0.2,0,0,1,1,0,12.5,1,1.1,0.9], [ 2, 1, 0.4, 0.2, 0, 0, 1, 1, 0, 12.5, 1, 1.1, 0.9],
[3,1,0.4,0.2,0,0,1,1,0,12.5,1,1.1,0.9], [ 3, 1, 0.4, 0.2, 0, 0, 1, 1, 0, 12.5, 1, 1.1, 0.9],
[400,2,0.4,0.2,0,0,1,1,0,12.5,1,1.1,0.9] [400, 2, 0.4, 0.2, 0, 0, 1, 1, 0, 12.5, 1, 1.1, 0.9]
]; ];
gen = [ gen = [
[1,0,0,10,-10,1.05,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0], [ 1, 0, 0, 10, -10, 1.05, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[400,0,0,10,-10,1.05,100,1,10,0,0,0,0,0,0,0,0,0,0,0,0] [400, 0, 0, 10, -10, 1.05, 100, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]; ];
branch = [ branch = [
[2,3,0.003,0.006,0,0,0,0,0,0,1,-360,360], [ 2, 3, 0.003, 0.006, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[1,2,0.003,0.006,0,0,0,0,0,0,1,-360,360], [ 1, 2, 0.003, 0.006, 0, 0, 0, 0, 0, 0, 1, -360, 360],
[400,1,0.003,0.006,0,0,0,0,1.025,0,1,-360,360] [400, 1, 0.003, 0.006, 0, 0, 0, 0, 1.025, 0, 1, -360, 360]
]; ];
function convert_m_file(input_file, output_file) function convert_m_file3(input_file, output_file)
% input_file: 输入.m文件路径(例如 'case14.m') % input_file: 输入.m文件路径(例如 'case14.m')
% output_file:输出.txt文件路径(例如 'case14_mems.txt') % output_file:输出.txt文件路径(例如 'case14_mems.txt')
% 将matpower矩阵格式转换为mems支持的脚本矩阵格式 % 将matpower矩阵格式转换为mems支持的脚本矩阵格式
% 可识别mpc的bus、gen、branch、gencost矩阵(第21行处可手动增删) % 可识别mpc的bus、gen、branch、gencost矩阵(第21行处可手动增删)
% 读取输入文件 % 读取输入文件
run(input_file); run(input_file);
mpc = ans; mpc = ans;
% 打开输出文件 % 打开输出文件
fid = fopen(output_file, 'w'); fid = fopen(output_file, 'w');
if fid == -1 if fid == -1
error('无法打开文件'); error('无法打开输出文件');
end end
% 写入baseMVA % 写入baseMVA
fprintf(fid, 'baseMVA = %d;\n\n', mpc.baseMVA); fprintf(fid, 'baseMVA = %d;\n\n', mpc.baseMVA);
% 固定读取的矩阵名称并遍历、转换 % 固定矩阵名称并遍历、转换
matrix_names = {'bus', 'gen', 'branch', 'gencost'}; matrix_names = {'bus', 'gen', 'branch', 'gencost'};
for i = 1:length(matrix_names) for i = 1:length(matrix_names)
matrix_name = matrix_names{i}; name = matrix_names{i};
if isfield(mpc, name)
if isfield(mpc, matrix_name) data = mpc.(name);
matrix_data = mpc.(matrix_name); if ~isempty(data)
formatted = format_matrix_aligned(data);
if ~isempty(matrix_data) fprintf(fid, '%s = [\n%s];\n\n', name, formatted);
formatted_matrix = format_matrix(matrix_data);
fprintf(fid, '%s = [\n%s];\n\n', matrix_name, formatted_matrix);
end end
end end
end end
...@@ -36,22 +34,30 @@ function convert_m_file(input_file, output_file) ...@@ -36,22 +34,30 @@ function convert_m_file(input_file, output_file)
disp(['文件已转换并保存为: ', output_file]); disp(['文件已转换并保存为: ', output_file]);
end end
function formatted_matrix = format_matrix(input_matrix) function formatted_matrix = format_matrix_aligned(input_matrix)
% 输入矩阵input_matrix,输出格式化后的formatted_matrix % 输出带右对齐的格式化矩阵字符串,从第二行开始每行缩进4个空格
[num_rows, num_cols] = size(input_matrix);
[num_rows, ~] = size(input_matrix); % 计算每列的最大宽度
formatted_matrix = []; col_widths = zeros(1, num_cols);
for j = 1:num_cols
col_strs = arrayfun(@(x) num2str(x), input_matrix(:, j), 'UniformOutput', false);
col_widths(j) = max(cellfun(@length, col_strs));
end
% 构造格式化矩阵行
formatted_matrix = '';
for i = 1:num_rows for i = 1:num_rows
row = input_matrix(i, :); row = input_matrix(i, :);
% 将该行的元素转换为逗号分隔的字符串 % 对每列使用最大宽度进行右对齐,格式化每个元素
formatted_row = strjoin(arrayfun(@(x) num2str(x), row, 'UniformOutput', false), ','); formatted_row = arrayfun(@(x, w) sprintf(['%' num2str(w) 's'], num2str(x)), row, col_widths, 'UniformOutput', false);
joined_row = strjoin(formatted_row, ', ');
if i ~= num_rows if i ~= num_rows
formatted_matrix = [formatted_matrix, sprintf('[%s],\n', formatted_row)]; formatted_matrix = [formatted_matrix, sprintf(' [%s],\n', joined_row)]; % 从第二行起缩进
else else
formatted_matrix = [formatted_matrix, sprintf('[%s]\n', formatted_row)]; formatted_matrix = [formatted_matrix, sprintf(' [%s]\n', joined_row)]; % 最后一行没有逗号
end end
end end
end end
\ No newline at end of file
#include ../data/case14.txt
#include ../lib/idx_gen.txt
#include ../lib/idx_bus.txt
#include ../lib/idx_brch.txt
#include ../lib/make_y_bus.txt
#include ../lib/make_y_bus_Yf.txt
#include ../lib/make_y_bus_Yt.txt
#include ../lib/dsbus_dv.txt
#include ../lib/make_sdzip.txt
#include ../lib/make_sbus.txt
#include ../lib/newtonpf.txt
#include ../lib/runpf.txt
#include ../lib/pfsoln.txt
info("Running power flow on case14...");
for i in 0..5 {
r = runpf();
}
info("Run power flow on case14 end");
Ybus = make_y_bus(baseMVA, bus, branch);
Yf = make_y_bus_Yf(baseMVA, bus, branch);
Yt = make_y_bus_Yt(baseMVA, bus, branch);
V = r;
bus_type = slice(bus, [0], [BUS_TYPE-1,BUS_TYPE]);
ref = find(bus_type == REF) + 1;
pv = find(bus_type == PV) + 1;
pq = find(bus_type == PQ) + 1;
mpopt = 12;
bus_output = pfsoln(baseMVA, bus, gen, branch, Ybus, Yf, Yt, V, ref, pv, pq, mpopt);
return bus_output;
\ No newline at end of file
...@@ -39,8 +39,10 @@ fn make_y_bus(baseMVA, bus, branch) { ...@@ -39,8 +39,10 @@ fn make_y_bus(baseMVA, bus, branch) {
// small case // small case
// build Yf and Yt such that Yf * V is the vector of complex branch currents injected // build Yf and Yt such that Yf * V is the vector of complex branch currents injected
// at each branch's "from" bus, and Yt is the same for the "to" bus end // at each branch's "from" bus, and Yt is the same for the "to" bus end
i = horzcat(range(0, nl),range(0, nl)) - 1; // double set of row indices i = horzcat(range(0, nl),range(0, nl)); // double set of row indices
j = range(0,nb); j = range(0,nb);
upper = horzcat(Yff', Yft');
lower = horzcat(Ytf', Ytt');
Yf = full(sparse(i, horzcat(f, t), upper, nl, nb)); Yf = full(sparse(i, horzcat(f, t), upper, nl, nb));
Yt = full(sparse(i, horzcat(f, t), lower, nl, nb)); Yt = full(sparse(i, horzcat(f, t), lower, nl, nb));
......
fn make_y_bus_Yf(baseMVA, bus, branch) {
// constants
nb = size(bus, 0); // number of buses
nl = size(branch, 0); // number of lines
// for each branch, compute the elements of the branch admittance matrix where
//
// | If | | Yff Yft | | Vf |
// | | = | | * | |
// | It | | Ytf Ytt | | Vt |
//
stat = slice(branch, [0], [BR_STATUS-1,BR_STATUS]); // ones at in-service branches
Ys = stat ./ (slice(branch, [0], [BR_R-1,BR_R])
+ c(0,1) * slice(branch, [0], [BR_X-1,BR_X])); // series admittance
Bc = stat .* slice(branch, [0], [BR_B-1,BR_B]); // line charging susceptance
tap_col = slice(branch, [0], [TAP-1,TAP]); // tap ratio column
index = find(tap_col); // indices of non-zero tap ratios
tap_init = set(ones(nl, 1), index, get_multi(tap_col, index)); // assign non-zero tap ratios
tap = tap_init .* exp(c(0,1)*pi/180 * slice(branch, [0], [SHIFT-1,SHIFT])); // add phase shifters
Ytt = Ys + c(0,1) * Bc/2;
Yff = Ytt ./ (tap .* conj(tap));
Yft = - Ys ./ conj(tap);
Ytf = - Ys ./ tap;
// compute shunt admittance
// if Psh is the real power consumed by the shunt at V = 1.0 p.u.
// and Qsh is the reactive power injected by the shunt at V = 1.0 p.u.
// then Psh - j Qsh = V * conj(Ysh * V) = conj(Ysh) = Gs - j Bs,
// i.e. Ysh = Psh + j Qsh, so ...
// vector of shunt admittances
Ysh = (slice(bus, [0], [GS-1,GS]) + c(0,1) * slice(bus, [0], [BS-1,BS])) / baseMVA;
// bus indices
f = slice(branch, [0], F_BUS-1) - 1; // list of "from" buses
t = slice(branch, [0], T_BUS-1) - 1; // list of "to" buses
if nb < 300 {
// small case
// build Yf and Yt such that Yf * V is the vector of complex branch currents injected
// at each branch's "from" bus, and Yt is the same for the "to" bus end
i = horzcat(range(0, nl),range(0, nl)); // double set of row indices
j = range(0,nb);
upper = horzcat(Yff', Yft');
lower = horzcat(Ytf', Ytt');
Yf = full(sparse(i, horzcat(f, t), upper, nl, nb));
Yt = full(sparse(i, horzcat(f, t), lower, nl, nb));
// build Ybus
// branch admittances + shunt admittance
Ybus = full(sparse(horzcat(f,f,t,t), horzcat(f,t,f,t), vertcat(Yff,Yft,Ytf,Ytt), nb, nb)) +
full(sparse(j, j, Ysh, nb, nb));
} else {
// large case running on MATLAB
// build connection matrices
i = range(0, nl);
j = range(0, nb);
Cf = full(sparse(i, f, ones(nl, 1), nl, nb)); // connection matrix for line & from buses
Ct = full(sparse(i, t, ones(nl, 1), nl, nb)); // connection matrix for line & to buses
// build Yf and Yt such that Yf * V is the vector of complex branch currents injected
// at each branch's "from" bus, and Yt is the same for the "to" bus end
Yf = full(sparse(i, i, Yff, nl, nl)) * Cf + full(sparse(i, i, Yft, nl, nl)) * Ct;
Yt = full(sparse(i, i, Ytf, nl, nl)) * Cf + full(sparse(i, i, Ytt, nl, nl)) * Ct;
// build Ybus
// branch admittances + shunt admittance
Ybus = Cf' * Yf + Ct' * Yt +
full(sparse(j, j, Ysh, nb, nb));
}
return Yf;
}
\ No newline at end of file
fn make_y_bus_Yt(baseMVA, bus, branch) {
// constants
nb = size(bus, 0); // number of buses
nl = size(branch, 0); // number of lines
// for each branch, compute the elements of the branch admittance matrix where
//
// | If | | Yff Yft | | Vf |
// | | = | | * | |
// | It | | Ytf Ytt | | Vt |
//
stat = slice(branch, [0], [BR_STATUS-1,BR_STATUS]); // ones at in-service branches
Ys = stat ./ (slice(branch, [0], [BR_R-1,BR_R])
+ c(0,1) * slice(branch, [0], [BR_X-1,BR_X])); // series admittance
Bc = stat .* slice(branch, [0], [BR_B-1,BR_B]); // line charging susceptance
tap_col = slice(branch, [0], [TAP-1,TAP]); // tap ratio column
index = find(tap_col); // indices of non-zero tap ratios
tap_init = set(ones(nl, 1), index, get_multi(tap_col, index)); // assign non-zero tap ratios
tap = tap_init .* exp(c(0,1)*pi/180 * slice(branch, [0], [SHIFT-1,SHIFT])); // add phase shifters
Ytt = Ys + c(0,1) * Bc/2;
Yff = Ytt ./ (tap .* conj(tap));
Yft = - Ys ./ conj(tap);
Ytf = - Ys ./ tap;
// compute shunt admittance
// if Psh is the real power consumed by the shunt at V = 1.0 p.u.
// and Qsh is the reactive power injected by the shunt at V = 1.0 p.u.
// then Psh - j Qsh = V * conj(Ysh * V) = conj(Ysh) = Gs - j Bs,
// i.e. Ysh = Psh + j Qsh, so ...
// vector of shunt admittances
Ysh = (slice(bus, [0], [GS-1,GS]) + c(0,1) * slice(bus, [0], [BS-1,BS])) / baseMVA;
// bus indices
f = slice(branch, [0], F_BUS-1) - 1; // list of "from" buses
t = slice(branch, [0], T_BUS-1) - 1; // list of "to" buses
if nb < 300 {
// small case
// build Yf and Yt such that Yf * V is the vector of complex branch currents injected
// at each branch's "from" bus, and Yt is the same for the "to" bus end
i = horzcat(range(0, nl),range(0, nl)); // double set of row indices
j = range(0,nb);
upper = horzcat(Yff', Yft');
lower = horzcat(Ytf', Ytt');
Yf = full(sparse(i, horzcat(f, t), upper, nl, nb));
Yt = full(sparse(i, horzcat(f, t), lower, nl, nb));
// build Ybus
// branch admittances + shunt admittance
Ybus = full(sparse(horzcat(f,f,t,t), horzcat(f,t,f,t), vertcat(Yff,Yft,Ytf,Ytt), nb, nb)) +
full(sparse(j, j, Ysh, nb, nb));
} else {
// large case running on MATLAB
// build connection matrices
i = range(0, nl);
j = range(0, nb);
Cf = full(sparse(i, f, ones(nl, 1), nl, nb)); // connection matrix for line & from buses
Ct = full(sparse(i, t, ones(nl, 1), nl, nb)); // connection matrix for line & to buses
// build Yf and Yt such that Yf * V is the vector of complex branch currents injected
// at each branch's "from" bus, and Yt is the same for the "to" bus end
Yf = full(sparse(i, i, Yff, nl, nl)) * Cf + full(sparse(i, i, Yft, nl, nl)) * Ct;
Yt = full(sparse(i, i, Ytf, nl, nl)) * Cf + full(sparse(i, i, Ytt, nl, nl)) * Ct;
// build Ybus
// branch admittances + shunt admittance
Ybus = Cf' * Yf + Ct' * Yt +
full(sparse(j, j, Ysh, nb, nb));
}
return Yt;
}
\ No newline at end of file
//PFSOLN Updates bus, gen, branch data structures to match power flow soln.
// [BUS, GEN, BRANCH] = PFSOLN(BASEMVA, BUS0, GEN0, BRANCH0, ...
// YBUS, YF, YT, V, REF, PV, PQ, MPOPT)
// 调用本函数时,需要调用如下文件
// #include ../lib/idx_gen.txt
// #include ../lib/idx_bus.txt
// #include ../lib/idx_brch.txt
// #include total_load.txt
fn pfsoln(baseMVA, bus0, gen0, branch0, Ybus, Yf, Yt, V, ref, pv, pq, mpopt){
// initialize return values(创建原始数据的副本)
bus = bus0;
gen = gen0;
branch = branch0;
//----- update bus voltages -----(将求解得到的复数电压转换为幅值和角度)
bus = assign(bus, abs(V), [0], [VM-1, VM] );
bus = assign(bus, angle(V) * 180 / pi, [0], [VA-1, VA] );
//----- update Qg for gens at PV/slack buses and Pg for slack bus(es) -----
// generator info
//取非PQ且GEN_STATUS=1的generators
on_temp = find(slice(gen, [0], [GEN_STATUS-1, GEN_STATUS]) > 0); //which generators are on?
index_gbus_type = get_multi(slice(gen, [0], [GEN_BUS-1, GEN_BUS]), on_temp) - 1; //得到GEN_STATUS=1的发电机母线节点索引
on = find(get_multi(slice(bus, [0], [BUS_TYPE-1, BUS_TYPE]), index_gbus_type) != PQ)'; // which generators are not at PQ buses
off = find(slice(gen, [0], [GEN_STATUS-1, GEN_STATUS]) <= 0)'; // which generators are off?
gbus = get_multi(slice(gen, [0], [GEN_BUS-1, GEN_BUS]), on)'; // what buses are they at?(注意索引需-1)
// compute total injected bus powers(计算节点注入功率)
Sbus = get_multi(V, gbus-1)' .* conj(select(Ybus, gbus-1) * V );
// update Qg for generators at PV/slack buses
gen_QG = set(slice(gen, [0], [QG-1, QG]), off, zeros(length(off), 1)); // zero out off-line Qg(离线发电机QG=0)
gen = assign(gen, gen_QG, [0], [QG-1, QG] );
// don't touch the ones at PQ buses
[Pd_gbus, Qd_gbus] = total_load(bus(gbus, :), [], 'bus', [], mpopt); //total_load()函数现在没有,要另外开发(gbus索引注意是否-1)
gen_QG = set(slice(gen, [0], [QG-1, QG]), on, imag(Sbus) * baseMVA + Qd_gbus); // inj Q + local Qd
gen = assign(gen, gen_QG, [0], [QG-1, QG] );
// ... at this point any buses with more than one generator will have
// the total Q dispatch for the bus assigned to each generator. This
// must be split between them. We do it first equally, then in proportion
// to the reactive range of the generator.(处理多发电机母线的无功分配)
if length(on) > 1 {
// build connection matrix, element i, j is 1 if gen on(i) at bus j is ON
nb = size(bus, 0);
ngon = size(on, 0);
Cg = full(sparse(range(0,ngon)', (gbus-1)', ones(ngon, 1), ngon, nb));
// divide Qg by number of generators at the bus to distribute equally(平均分配)
ngg = Cg * sum(Cg)'; // ngon x 1, number of gens at this gen's bus
gen_QG = set(slice(gen, [0], [QG-1, QG]), on, get_multi(slice(gen, [0], [QG-1, QG]), on)' ./ ngg);
gen = assign(gen, gen_QG, [0], [QG-1, QG] );
// set finite proxy M for infinite limits (for ~ proportional splitting)(处理无限限值)
// equal to sum over all gens at bus of abs(Qg) plus any finite Q limits
Qmin = select(gen, on, QMIN-1);
Qmax = select(gen, on, QMAX-1);
M = abs(select(gen, on, QG-1));
index_Qmax_inf = find( ~~is_inf(Qmax) );
M = set(M, index_Qmax_inf, get_multi(M, index_Qmax_inf) + abs(get_multi(Qmax, index_Qmax_inf)) );
index_Qmin_inf = find( ~~is_inf(Qmin) );
M = set(M, index_Qmin_inf, get_multi(M, index_Qmin_inf) + abs(get_multi(Qmin, index_Qmin_inf)) );
M = Cg * Cg' * M; // each gen gets sum over all gens at same bus
// replace +/- Inf limits with proxy +/- M
Qmin = set(Qmin, find(Qmin == INF), get_multi(M, find(Qmin == INF) ) );
Qmin = set(Qmin, find(Qmin == -INF), -get_multi(M, find(Qmin == -INF) ) );
Qmax = set(Qmax, find(Qmax == INF), get_multi(M, find(Qmax == INF) ) );
Qmax = set(Qmax, find(Qmax == -INF), -get_multi(M, find(Qmax == -INF) ) );
// divide proportionally(按比例分配)
Cmin = full(sparse(range(0,ngon)', (gbus-1)', Qmin, ngon, nb) );
Cmax = full(sparse(range(0,ngon)', (gbus-1)', Qmax, ngon, nb) );
Qg_tot = Cg' * select(gen, on, QG-1); // nb x 1 vector of total Qg at each bus(母线总无功)
Qg_min = sum(Cmin)'; // nb x 1 vector of min total Qg at each bus
Qg_max = sum(Cmax)'; // nb x 1 vector of max total Qg at each bus
gen_QG = set(slice(gen, [0], [QG-1, QG]), on, Qmin + (Cg * ((Qg_tot - Qg_min)./(Qg_max - Qg_min+eps))) .* (Qmax - Qmin) );
gen = assign(gen, gen_QG, [0], [QG-1, QG] );
// fix gens at buses with Qg range = 0 (use equal violation for all)(处理零范围特殊情况)
ig = find(abs(Cg * (Qg_min - Qg_max)) < 10*eps); // gens at buses with Qg range = 0
if ~~(length(ig)==0){ //matlab中是isempty()函数,这里用length==0代替
ib = find(sum(select(Cg,ig), 0)')'; // buses with Qg range = 0
// total mismatch @ bus div by number of gens
mis_value = (get_multi(Qg_tot, ib)' - get_multi(Qg_min, ib)' ) ./ sum(select(Cg, [], ib)' , 1)';
mis = full(sparse(range(0,nb)', zeros(nb,1), set(zeros(nb,1), ib, mis_value), nb, 1) );
gen_QG = set(slice(gen, [0], [QG-1, QG]), get_multi(on, ig), get_multi(Qmin, ig)' + select(Cg, ig) * mis);
gen = assign(gen, gen_QG, [0], [QG-1, QG] );
}
} // (terms are mult by 0 anyway)
// update Pg for slack gen(s)
for k in 1..length(ref){
refgen = find(gbus == get_multi(get_multi(ref, [k-1]), 0) ); // which is(are) the reference gen(s)?
Pd_refk = total_load(bus(ref(k-1), :), [], 'bus', [], mpopt); //total_load()函数现在没有,要另外开发
gen_PG = set(slice(gen, [0], [PG-1, PG]), get_multi(on, [get_multi(refgen,0)]), real(get_multi(Sbus, [get_multi(refgen,0)])) * baseMVA + Pd_refk );
gen = assign(gen, gen_PG, [0], [PG-1, PG] );
if length(refgen) > 1{ // more than one generator at this ref bus
// subtract off what is generated by other gens at this bus
refgen_PG_value = get_multi(slice(gen, [0], [PG-1, PG]), get_multi(on, [get_multi(refgen,0)]) )
- sum(get_multi(slice(gen, [0], [PG-1, PG]), get_multi(on, get_multi(refgen,range(1,length(refgen)))) ));
gen_PG = set(slice(gen, [0], [PG-1, PG]), get_multi(on, [get_multi(refgen,0)]), refgen_PG_value);
gen = assign(gen, gen_PG, [0], [PG-1, PG] );
}
}
//----- update/compute branch power flows -----(计算支路潮流)
out = find(slice(branch, [0], [BR_STATUS-1, BR_STATUS]) == 0); // out-of-service branches
br = find(slice(branch, [0], [BR_STATUS-1, BR_STATUS] )); // in-service branches
Sf = get_multi(V, get_multi(br, slice(branch, [0], [F_BUS-1, F_BUS] ) ) - 1)' .* conj(select(Yf, br) * V) * baseMVA; // complex power at "from" bus(bus索引需-1)
St = get_multi(V, get_multi(br, slice(branch, [0], [T_BUS-1, T_BUS] ) ) - 1)' .* conj(select(Yt, br) * V) * baseMVA; // complex power injected at "to" bus
branch_PF = zeros(size(branch,0), 1);
branch_PF = set(branch_PF, br, real(Sf));
branch = horzcat(branch, branch_PF);
branch_QF = zeros(size(branch,0), 1);
branch_QF = set(branch_QF, br, imag(Sf));
branch = horzcat(branch, branch_QF);
branch_PT = zeros(size(branch,0), 1);
branch_PT = set(branch_PT, br, real(St));
branch = horzcat(branch, branch_PT);
branch_QT = zeros(size(branch,0), 1);
branch_QT = set(branch_QT, br, imag(St));
branch = horzcat(branch, branch_QT);
//return bus, gen, branch;
return bus;
}
\ No newline at end of file
//TOTAL_LOAD Returns vector of total load in each load zone.
// PD = TOTAL_LOAD(MPC)
// PD = TOTAL_LOAD(MPC, LOAD_ZONE)
// PD = TOTAL_LOAD(MPC, LOAD_ZONE, OPT)
// PD = TOTAL_LOAD(MPC, LOAD_ZONE, OPT, MPOPT)
// PD = TOTAL_LOAD(BUS)
// PD = TOTAL_LOAD(BUS, GEN)
// PD = TOTAL_LOAD(BUS, GEN, LOAD_ZONE)
// PD = TOTAL_LOAD(BUS, GEN, LOAD_ZONE, OPT)
// PD = TOTAL_LOAD(BUS, GEN, LOAD_ZONE, OPT, MPOPT)
// [PD, QD] = TOTAL_LOAD(...) returns both active and reative power
// demand for each zone.
//
// MPC - standard MATPOWER case struct
//
// BUS - standard BUS matrix with nb rows, where the fixed active
// and reactive loads are specified in columns PD and QD
//
// GEN - (optional) standard GEN matrix with ng rows, where the
// dispatchable loads are specified by columns PG, QG, PMIN,
// QMIN and QMAX (in rows for which ISLOAD(GEN) returns true).
// If GEN is empty, it assumes there are no dispatchable loads.
//
// LOAD_ZONE - (optional) nb element vector where the value of
// each element is either zero or the index of the load zone
// to which the corresponding bus belongs. If LOAD_ZONE(b) = k
// then the loads at bus b will added to the values of PD(k) and
// QD(k). If LOAD_ZONE is empty, the default is defined as the areas
// specified in the BUS matrix, i.e. LOAD_ZONE = BUS(:, BUS_AREA)
// and load will have dimension = MAX(BUS(:, BUS_AREA)). LOAD_ZONE
// can also take the following string values:
// 'all' - use a single zone for the entire system (return scalar)
// 'area' - use LOAD_ZONE = BUS(:, BUS_AREA), same as default
// 'bus' - use a different zone for each bus (i.e. to compute
// final values of bus-wise loads, including voltage dependent
// fixed loads and or dispatchable loads)
//
// OPT - (optional) option struct, with the following fields:
// 'type' - string specifying types of loads to include, default
// is 'BOTH' if GEN is provided, otherwise 'FIXED'
// 'FIXED' : sum only fixed loads
// 'DISPATCHABLE' : sum only dispatchable loads
// 'BOTH' : sum both fixed and dispatchable loads
// 'nominal' - 1 : use nominal load for dispatchable loads
// 0 : (default) use actual realized load for
// dispatchable loads
//
// For backward compatibility with MATPOWER 4.x, OPT can also
// take the form of a string, with the same options as OPT.type above.
// In this case, again for backward compatibility, it is the "nominal"
// load that is computed for dispatchable loads, not the actual
// realized load. Using a string for OPT is deprecated and
// will be removed in a future version.
//
// MPOPT - (optional) MATPOWER options struct, which may specify
// a voltage dependent (ZIP) load model for fixed loads
//
// Examples:
// Return the total active load for each area as defined in BUS_AREA.
//
// Pd = total_load(bus);
//
// Return total active and reactive load, fixed and dispatchable, for
// entire system.
//
// [Pd, Qd] = total_load(bus, gen, 'all');
//
// Return the total of the nominal dispatchable loads at buses 10-20.
//
// load_zone = zeros(nb, 1);
// load_zone(10:20) = 1;
// opt = struct('type', 'DISPATCHABLE', 'nominal', 1);
// Pd = total_load(mpc, load_zone, opt)
//
// See also SCALE_LOAD.
fn total_load(bus, gen, load_zone, opt, mpopt){
//return Pd, Qd;
return Pd;
}
\ No newline at end of file
# RustScript 语言规范 # RustScript 语言规范
...@@ -40,8 +40,14 @@ PQ_bus ...@@ -40,8 +40,14 @@ PQ_bus
"Power flow data for IEEE 14 bus" "Power flow data for IEEE 14 bus"
"File path: /data/case14.txt" "File path: /data/case14.txt"
``` ```
### 2.4 数学常量约定
- π:pi
- 分母为零:NAN
- 正无穷大:INF
- 负无穷大:NEG_INF
### 2.4 注释
### 2.5 注释
```rustscript ```rustscript
// 单行注释 // 单行注释
/* 多行注释 */ /* 多行注释 */
...@@ -400,19 +406,20 @@ linspace(start, end, num) // 在start和end间生成num个等间距点 ...@@ -400,19 +406,20 @@ linspace(start, end, num) // 在start和end间生成num个等间距点
// 统计函数 // 统计函数
sum(tensor), mean(tensor), std(tensor), var(tensor) sum(tensor), mean(tensor), std(tensor), var(tensor)
max(tensor), min(tensor), median(tensor) max(tensor), min(tensor), median(tensor)
//其中,max()和min()可以如下用法:max(a, [0],1),min(a, [0],1),参数和slice函数的定义相同
// 查找函数 // 查找函数
find(condition) // 查找满足条件的索引 find(condition) // 查找满足条件的索引
any(tensor), all(tensor) any(tensor), all(tensor)
// 获取多个元素 // 获取多个元素
get_multi(tensor, indices) // 根据索引获取多个元素 get_multi(tensor, indices) // 根据索引获取多个元素(可不连续)
``` ```
### 9.4 稀疏矩阵 ### 9.4 稀疏矩阵
```rustscript ```rustscript
// 创建稀疏矩阵 // 创建稀疏矩阵
sparse(row_indices, col_indices, values, m, n); // 创建m×n稀疏矩阵 sparse(row_indices, col_indices, values, m, n); // 创建m×n稀疏矩阵,其中row_indices, col_indices, values是三个等长的向量,分别指定非零元素的行下标、列下标和值。
// 稀疏矩阵操作 // 稀疏矩阵操作
full_mat = full(sparse_mat); // 转为密集矩阵 full_mat = full(sparse_mat); // 转为密集矩阵
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论