function mpc = TwentyFourBus
    % CASE24_IEEE_RTS  Power flow data for the IEEE RELIABILITY TEST SYSTEM.
    %   Please see CASEFORMAT for details on the case file format.
    %
    %   This system data is from the IEEE RELIABILITY TEST SYSTEM, see
    %
    %   IEEE Reliability Test System Task Force of the Applications of
    %   Probability Methods Subcommittee, "IEEE reliability test system,"
    %   IEEE Transactions on Power Apparatus and Systems, Vol. 98, No. 6,
    %   Nov./Dec. 1979, pp. 2047-2054.
    %
    %   IEEE Reliability Test System Task Force of Applications of
    %   Probability Methods Subcommittee, "IEEE reliability test system-96,"
    %   IEEE Transactions on Power Systems, Vol. 14, No. 3, Aug. 1999,
    %   pp. 1010-1020.
    %
    %   Cost data is from Web site run by Georgia Tech Power Systems Control
    %   and Automation Laboratory:
    %
    %       http://pscal.ece.gatech.edu/testsys/index.html
    %
    %   MATPOWER case file data provided by Bruce Wollenberg.
    
    %   MATPOWER
    %   $Id: case24_ieee_rts.m,v 1.4 2010/03/10 18:08:13 ray Exp $
    
    %% MATPOWER Case Format : Version 2
    mpc.version = '2';
    x = 1;
    %%-----  Power Flow Data  -----%%
    %% system MVA base
    mpc.baseMVA = 100;
    
    %% bus data
    %	bus_i	type	Pd	Qd	Gs	Bs	area	Vm	   Va	baseKV	zone	Vmax	Vmin
    mpc.bus = [
        1	    3      0	0	0	0	1       1.05	0	230     1       1.05	0.95;
        2       2      0	0	0	0	1       1.05	0	230 	1       1.05	0.95;
        3       1      0	0	0	0	1       1	    0	230     1       1.05	0.95;
        4       1      0	0	0	0	1       1	    0	230     1       1.05	0.95;
        5       1      0	0	0	0	1       1	    0	230     1       1.05	0.95;
        6       1      0	0   0   0	1       1	    0	230     1       1.05	0.95; % original type 1
        ];
    
    %% generator data
    %	bus   Pg	 Qg	      Qmax	Qmin	Vg      mBase	status	Pmax	Pmin	Unit Code
    mpc.gen = [
        1      0      0       0  	  0     1.00	100      1      110      0  %	U1 WindFarm
        2      0      0       0       0     1.00	100      1      130      0  %   U2 
        2      0	  0       0       0     1.00	100      1       0      -20	%	(3) For load shedding 1
        3      0	  0       0       0     1.00	100      1       0      -85	%	(4) For load shedding 2
        4      0	  0       0       0     1.00	100      1       0      -40	%	(5) For load shedding 3
        5      0	  0       0       0     1.00	100      1       0      -20	%	(6) For load shedding 4
        6      0	  0       0       0     1.00	100      1       0      -20	%	(7) For load shedding 5
        ];
    
    %% branch data
    %	fbus   tbus	   r	  x	       b	Con 	LTE	    STE 	ratio	angle	status	angmin	angmax
    mpc.branch = [
        1       3	0.0342	0.1800	0.0212	 85      0       0       0       0         1	 -360	 360; % 230KV 1 CSA
        2       4	0.1140	0.6000	0.0704	 71      0       0       0       0         1     -360	 360; % 230KV 2 CSB
        1       2	0.0912	0.4800	0.0282	 71      0       0       0       0         1     -360	 360; % 230KV 3
        3       4	0.0228	0.1200	0.0071	 71      0       0       0       0         1     -360	 360; % 230KV 4
        3       5	0.0228	0.1200	0.0071	 71      0 	     0       0       0         1     -360	 360; % 230KV 5
        1       3	0.0342	0.1800	0.0212	 85      0       0       0       0         1     -360	 360; % 230KV 6 CSA
        2       4	0.1140	0.6000	0.0704	 71      0       0       0       0         1     -360	 360; % 230KV 7 CSB
        4       5	0.0228	0.1200	0.0071	 71      0 	     0       0       0         1     -360	 360; % 230KV 8
        5       6	0.0228	0.1200	0.0071	 71      0 	     0       0       0         1     -360	 360; % 230KV 9
        ];
        
    %% Branch reliability data (all in /year unit)
    mpc.branch_FRRR = [
        1.5 873.6; % 1
        5.0 873.6; % 2
        4.0 873.6; % 3
        1.0 873.6; % 4
        1.0 873.6; % 5
        1.5 873.6; % 6
        5.0 873.6; % 7
        1.0 873.6; % 8
        1.0 873.6; % 9        
        ];
    
    %% generator cost data
    % Nodel Startup cost  shutdowncost    No.Coeff
    mpc.gencost = [
        2	0               0               2           0           0       0; % U1
        2	1500            0               2           0           0       0; % U2
        2	1500            0               2           1500    	750     0; % Dispatchable load
        2	1500            0               2           1500        750     0; % Dispatchable load
        2	1500            0               2           1500        750     0; % Dispatchable load
        2	1500            0               2           1500        750     0; % Dispatchable load
        2	1500            0               2           1500        750     0; % Dispatchable load        
        ];