% data for New England Test case

% to be used with the MatNetEig toolbox and 
% Power System toolbox available at http://www.ecse.rpi.edu/pst/PST.html

disp('New England data')

% -----------
% bus data
%(bus#)( volt )( ang  )(  pgen )(  qgen )( pload )( qload )(gshunt)(bshunt)(bus type)
bus=[
   1   1.048  -9.43   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
   2   1.0505 -6.89   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
   3   1.0341 -9.73   0.0000   0.0000   3.2200   0.0240 0.00000 0.00000 3 99  -99 1.0   0     0;
   4   1.0116 -10.53  0.0000   0.0000   5.0000   1.8400 0.00000 1.00000 3 99  -99 1.0   0     0;
   5   1.0165 -9.38   0.0000   0.0000   0.0000   0.0000 0.00000 2.00000 3 99  -99 1.0   0     0;
   6   1.0172 -8.68   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
   7   1.0067 -10.84  0.0000   0.0000   2.3380   8.4000 0.00000 0.00000 3 99  -99 1.0   0     0;
   8   1.0057 -11.34  0.0000   0.0000   5.2200   1.7600 0.00000 0.00000 3 99  -99 1.0   0     0;
   9   1.0322 -11.15  0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
  10   1.0235 -6.31   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
  11   1.0201 -7.12   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
  12   1.0072 -7.14   0.0000   0.0000   0.0850   0.8800 0.00000 0.00000 3 99  -99 1.0   0     0;
  13   1.0207 -7.02   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
  14   1.0181 -8.66   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
  15   1.0194 -9.06   0.0000   0.0000   3.2000   1.5300 0.00000 0.00000 3 99  -99 1.0   0     0;
  16   1.0346 -7.66   0.0000   0.0000   3.2940   3.2300 0.00000 0.00000 3 99  -99 1.0   0     0;
  17   1.0365 -8.65   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
  18   1.0343 -9.49   0.0000   0.0000   1.5800   0.3000 0.00000 0.00000 3 99  -99 1.0   0     0;
  19   1.0509 -3.04   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
  20   0.9914 -4.45   0.0000   0.0000   6.8000   1.0300 0.00000 0.00000 3 99  -99 1.0   0     0;
  21   1.0337 -5.26   0.0000   0.0000   2.7400   1.1500 0.00000 0.00000 3 99  -99 1.0   0     0;
  22   1.0509 -0.82   0.0000   0.0000   0.0000   0.0000 0.00000 0.00000 3 99  -99 1.0   0     0;
  23   1.0459 -1.02   0.0000   0.0000   2.4750   0.8460 0.00000 0.00000 3 99  -99 1.0   0     0;
  24   1.0399 -7.54   0.0000   0.0000   3.0860   -0.922 0.00000 0.00000 3 99  -99 1.0   0     0;
  25   1.0587 -5.51   0.0000   0.0000   2.2400   0.4720 0.00000 0.00000 3 99  -99 1.0   0     0;
  26   1.0536 -6.77   0.0000   0.0000   1.3900   0.1700 0.00000 0.00000 3 99  -99 1.0   0     0;
  27   1.0399 -8.78   0.0000   0.0000   2.8100   0.7550 0.00000 0.00000 3 99  -99 1.0   0     0;
  28   1.0509 -3.27   0.0000   0.0000   2.0600   0.2760 0.00000 0.00000 3 99  -99 1.0   0     0;
  29   1.0505 -0.51   0.0000   0.0000   2.8350   1.2690 0.00000 1.00000 2 99  -99 1.0   0     0;
  30   1.0475 -4.47   2.5000   1.3621   0.0000   0.0000 0.00000 0.00000 2  8   -5 1.0   0     0;
  31   1.0400  0.00   5.7293   1.7036   0.0920   0.0460 0.00000 0.00000 2  8   -5 1.0   0     0;
  32   0.9831  1.63   6.5000   1.7590   0.0000   0.0000 0.00000 0.00000 2  8   -5 1.0   0     0;
  33   0.9972  2.18   6.3200   1.0335   0.0000   0.0000 0.00000 0.00000 2  8   -5 1.0   0     0;
  34   1.0123  0.74   5.0800   1.6400   0.0000   0.0000 0.00000 0.00000 2  4   -3 1.0   0     0;
  35   1.0493  4.14   6.5000   2.0884   0.0000   0.0000 0.00000 0.00000 2  8   -5 1.0   0     0;
  36   1.0635  6.83   5.6000   0.9688   0.0000   0.0000 0.00000 0.00000 2  8   -5 1.0   0     0;
  37   1.0278  1.26   5.4000  -0.0444   0.0000   0.0000 0.00000 0.00000 2  8   -5 1.0   0     0;
  38   1.0265  6.55   8.3000   0.1939   0.0000   0.0000 0.00000 0.00000 2  8   -5 1.0   0     0;
  39   1.0300 -10.96  10.000   0.6846   11.040   2.5000 0.00000 0.00000 1  15 -10 1.0   0     0];

% -----------
% line data
%b#1 b#2( res  )(  rea  )(charg )(tap )(phase)
line = [
   1   2 0.00350  0.04110 0.69870 0.0000 0   0    0    0;
   1  39 0.00100  0.02500 0.75000 0.0000 0   0    0    0;
   2   3 0.00130  0.01510 0.25720 0.0000 0   0    0    0;
   2  25 0.00700  0.00860 0.14600 0.0000 0   0    0    0;
   2  30 0.00000  0.01810 0.00000 1.0250 0   0    0    0;
   3   4 0.00130  0.02130 0.22140 0.0000 0   0    0    0;
   3  18 0.00110  0.01330 0.21380 0.0000 0   0    0    0;
   4   5 0.00080  0.01280 0.13420 0.0000 0   0    0    0;
   4  14 0.00080  0.01290 0.13820 0.0000 0   0    0    0;
   5   8 0.00080  0.01120 0.14760 0.0000 0   0    0    0;
   6   5 0.00020  0.00260 0.04340 0.0000 0   0    0    0;
   6   7 0.00060  0.00920 0.11300 0.0000 0   0    0    0;
   6  11 0.00070  0.00820 0.13890 0.0000 0   0    0    0;
   7   8 0.00040  0.00460 0.07800 0.0000 0   0    0    0;
   8   9 0.00230  0.03630 0.38040 0.0000 0   0    0    0;
   9  39 0.00100  0.02500 1.20000 0.0000 0   0    0    0;
  10  11 0.00040  0.00430 0.07290 0.0000 0   0    0    0;
  10  13 0.00040  0.00430 0.07290 0.0000 0   0    0    0;
  10  32 0.00000  0.02000 0.00000 1.0700 0   0    0    0;
  12  11 0.00160  0.04350 0.00000 1.0060 0   0    0    0;
  12  13 0.00160  0.04350 0.00000 1.0060 0   0    0    0;
  13  14 0.00090  0.01010 0.17230 0.0000 0   0    0    0;
  14  15 0.00180  0.02170 0.36600 0.0000 0   0    0    0;
  15  16 0.00090  0.00940 0.17100 0.0000 0   0    0    0;
  16  17 0.00070  0.00890 0.13420 0.0000 0   0    0    0;
  16  19 0.00160  0.01950 0.30400 0.0000 0   0    0    0;
  16  21 0.00080  0.01350 0.25480 0.0000 0   0    0    0;
  16  24 0.00030  0.00590 0.06800 0.0000 0   0    0    0;
  17  18 0.00070  0.00820 0.13190 0.0000 0   0    0    0;
  17  27 0.00130  0.01730 0.32160 0.0000 0   0    0    0;
  19  33 0.00070  0.01420 0.00000 1.0700 0   0    0    0;
  19  20 0.00070  0.01380 0.00000 1.0600 0   0    0    0;
  20  34 0.00090  0.01800 0.00000 1.0090 0   0    0    0;
  21  22 0.00080  0.01400 0.25650 0.0000 0   0    0    0;
  22  23 0.00060  0.00960 0.18460 0.0000 0   0    0    0;
  22  35 0.00000  0.01430 0.00000 1.0250 0   0    0    0;
  23  24 0.00220  0.03500 0.36100 0.0000 0   0    0    0;
  23  36 0.00050  0.02720 0.00000 1.0000 0   0    0    0;
  25  26 0.00320  0.03230 0.51300 0.0000 0   0    0    0;
  25  37 0.00060  0.02320 0.00000 1.0250 0   0    0    0;
  26  27 0.00140  0.01470 0.23960 0.0000 0   0    0    0;
  26  28 0.00430  0.04740 0.78020 0.0000 0   0    0    0;
  26  29 0.00570  0.06250 1.02900 0.0000 0   0    0    0;
  28  29 0.00140  0.01510 0.24900 0.0000 0   0    0    0;
  29  38 0.00080  0.01560 0.00000 1.0250 0   0    0    0;
  31   6 0.00000  0.02500 0.00000 1.0000 0   0    0    0];

% -----------
% machine data
% num bus b-mva x_1  r_a  x_d  x'_d  x"_d T'_do T"_do
%                         x_q  x'_q  x"_q T'_qo T"_qo
%                         H    d_o   d_1 type s s apf rpf
mac_con = [
  1  30  1000.0 0.130 0  1.000 0.31  0.31 10.20 0.00 ...
                         0.690 0.69  0.69  0    0 ...
                         4.200 0     0.00 2 0 0;
  2  31  1000.0 0.350 0  2.950 0.7   0.7 6.560 0.00 ...
                         2.820 1.7   1.7 1.500 0.00 ...
                         3.030 0     0.00 3 0 0;
  3  32  1000.0 0.30  0  2.500 0.530 0.530 5.700 0.0 ... 
                         2.370 0.88  0.88   1.500 0.0 ...
                         3.580 0      0.00 3 0 0;
  4  33  1000.0 0.295 0  2.620 0.440 0.440 5.690 0.0 ...
                         2.580 1.66  1.66  1.500 0.0 ...
                         2.860 0     0.00 3 0 0;
  5  34  1000.0 0.540 0  6.700 1.320 1.32 5.400 0.0 ...
                         6.200 1.660 1.66 0.440 0.0 ...
                         2.600 0     0.00 3 0 0;
  6  35  1000.0 0.224 0  2.540 0.500  0.5  7.300 0.0 ...
                         2.410 0.810 0.81  0.400 0.0 ... 
                         3.480 0     0.00 3 0 0;
  7  36  1000.0 0.322 0  2.900 0.490 0.49 5.660 0.0 ...
                         2.800 1.86  1.86 1.500 0.0 ...
                         2.640 0     0.00 3 0 0;
  8  37  1000.0 0.280 0  2.900 0.570 0.570 6.700 0.0 ...
                         2.800 0.91 0.91 0.410 0.0 ...
                         2.430 0     0.00 3 0 0;
  9  38  1000.0 0.298 0  2.106 0.570 0.570 4.790 0.0 ...
                         2.050 0.590 0.590 1.960 0.0 ...
                         3.450 0     0.00 3 0 0;
  10 39  1000.0 0.030 0  0.200 0.060 0.06  7.000 0 ...
                         0.190 0.080 0.08  0.700 0 ...
                         50.00 50.00 0.00 3 0 0;
];

% -----------
% exciter data
% AC exciter (type 7 -- IEEE AC4a)
exc_con = [...
    7   1     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
    7   2     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
    7   3     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
    7   4     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
    7   5     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
    7   6     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
    7   7     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
    7   8     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
    7   9     0		0		0.0   	200	      0.015  0        0     0      0     0     0     10 ...
-10.0   0     0     5.64   -4.53      0       0      0        0     0      0     0     0      0 ...
  0     0     0 ;%ac4
  ];




gsib_idx = [];geib_idx = [];
load_con = [];
hgt_con = [];
svc_con = [];tcsc_con = [];upfc_con = [];
lmod_con= [];rlmod_con = [];
tgt_con = [];

% -----------
% pss data
% column 1 type 1for speed input
% column 2 generator number
% column 3 Gpss pss gain
% column 4 Tw
% column 5 Tn1
% column 6 Td1
% column 7 Tn2
% column 8 Td2
% column 9 ymax
% column 10 ymin
% columns 11 to 12 define a deltapomega filter if one is fitted
% column 11 Twd
% column 12 Tnf
% column 13 Tdf
% column 14 nnf
% column 15 ndf
% column 16 Gp



% Data from "Robust and coordinated tuning of PSS gains using sequenetial
% linear programming" 
Tw = 3; Tn1 = 0.1; Td1 = 0.01; Tn2 = 0.1;
Td2 = 0.01; ymax = 5; ymin = -5;


% Target: MDR 10 - Table 2
pss_con = [... 
   1   1  12  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0;
   1   2  12  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0;
   1   3  12  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0;
   1   4  10  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0;
   1   5  12  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0;
   1   6  12  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0;
   1   7  11.03  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0;
   1   8  9.51  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0;
   1   9  12  Tw   Tn1  Td1  Tn2  Td2  ymax   ymin  0  0  0  0  0  0
];


dcl_con = [];dcr_con = [];dci_con = [];
dcld_con = [];dcrc_con = [];dcic_con = [];
