function mpc = case3
%CASE3  Power flow data for 3 bus, 2 gen "loop" case
%   [baseMVA, bus, gen, branch, areas, gencost] = case3;
%   Please see 'help caseformat' for details on the case file format.

%%-----  Power Flow Data  -----%%
%% system MVA base

mpc.version = '2';

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.04	0	    230	1	1.04	1.04;
	2	2	0	0	0	0	1	1.03	0.0286	230	1	1.03	1.03;
	3	1	100	50	0	0	1	1.0115	-6.0592	230	1	1.05	0.95;
];

%% generator data
%	bus	Pg	Qg	Qmax	Qmin	Vg	mBase	status	Pmax	Pmin
mpc.gen = [
	1	71.38    	 94.44	500	-100	1.04	100	1	500	50    0	    0	0	0	    0	    0	    0	    0	        0	    0	    0	    0;
	2	70   	-126.70	500	-100	1.03	100	1	150	37.5  0	    0	0	0	    0	    0	    0	    0	        0	    0	    0	    0;
];
%% branch data
%	fbus	tbus	r	x	b	rateA	rateB	rateC	ratio	angle	status
mpc.branch = [
	1	2	0.0	    0.01	0.00	41	40	40	0	0	1 -360	360;
	1	3	0.02	0.2	    0.40	61	60	60	0	0	1 -360	360;
	2	3	0.04	0.25	0.50	41	40	40	0	0	1 -360	360;
];
%%6	    28	    0.02	0.06	0.01	32	    32	    32	    0	     0	     1	     -360	360;

%% generator cost data
%	1	startup	shutdown	n	x1	y1	...	xn	yn
%	2	startup	shutdown	n	c(n-1)	...	c0
mpc.gencost = [
	2	0	0	3	0.00533	11.669	213.1;
	2	0	0	3	0.00889	10.333	200;
];
%%
mpc.reserves.zones = [
 1  1;
 ];
%%
%% 
%%
%%% reserve requirements for each zone in MW
mpc.reserves.req   = [10];
%%
%%% reserve costs in $/MW for each gen that belongs to at least 1 zone
%%% (same order as gens, but skipping any gen that does not belong to any zone)
mpc.reserves.cost  = [213; 200];
%%mpc.reserves.cost  = [	6;	5;	4;	3;	2;	1	];
%%
%%% OPTIONAL max reserve quantities for each gen that belongs to at least 1 zone
%%% (same order as gens, but skipping any gen that does not belong to any zone)
%%%mpc.reserves.qty   = [	25;	25;	25;	25;	25;100	];
mpc.reserves.qty   = [10;10];
%%
%%%-----  OPF Data  -----%%
%%% area data
mpc.areas = [
1	1;
];

