function [baseMVA, bus, gen, branch, areas, gencost] = my_11_opf

%  UTILIZING MATPOWER IN OPTIMAL POWER FLOW. Tarjei Kristiansen. 
%  Department of Electrical Power Engineering. Norwegian University of Science and Technology
 
%%-----  Power Flow Data  -----%%
%% system MVA base
baseMVA = 100;

%% bus data
%	bus_i	type	Pd		Qd	Gs	Bs	area	Vm	Va	baseKV	zone	Vmax	Vmin
bus = [
	1		3		1000	0	0	0	1		1	0	100		1		1.1		0.9;
	2		2		1000	0	0	0	1		1	0	100		2		1.1		0.9;
	3		2		1000	0	0	0	1		1	0	100		3		1.1		0.9;
	4		2		1000	0	0	0	1		1	0	100		4		1.1		0.9;
	5		2		1000	0	0	0	1		1	0	100		5		1.1		0.9;
	6		2		1000	0	0	0	1		1	0	100		6		1.1		0.9;
	7		2		1000	0	0	0	1		1	0	100		7		1.1		0.9;
	8		2		1000	0	0	0	1		1	0	100		8		1.1		0.9;
	9		2		1000	0	0	0	1		1	0	100		9		1.1		0.9;
	10		2		1000	0	0	0	1		1	0	100		10		1.1		0.9;
	11		2		1500	0	0	0	1		1	0	100		11		1.1		0.9;
	12		2		0		0	0	0	1		1	0	100		11		1.1		0.9;
];

%% generator data
%	bus	Pg	Qg	Qmax	Qmin	Vg	mBase	status	Pmax	Pmin
gen = [
	1	0	0	3000	-3000	1	100	1	1000	0;
	2	0	0	3000	-3000	1	100	1	800 	0;
	3	0	0	3000	-3000	1	100	1	1500	0;
	4	0	0	3000	-3000	1	100	1	2500	0;
	5	0	0	3000	-3000	1	100	1	1500	0;
	6	0	0	3000	-3000	1	100	1	1500	0;
	7	0	0	3000	-3000	1	100	1	1500	0;
	8	0	0	3000	-3000	1	100	1	1500	0;
	9	0	0	3000	-3000	1	100	1	1500	0;
	10	0	0	3000	-3000	1	100	1	1500	0;
	11	0	0	3000	-3000	1	100	1	700 	0;
	12	0	0	3000	-3000	1	100	1	2000 	0;
];

%% branch data
%	fbus	tbus	r	x	b	rateA	rateB	rateC	ratio	angle	status
branch = [
	1	2	0.5	0.8	0	2000	2000	2000	0	0	1 -360 360;
	1	3	1.0	1.2	0	1600	1600	1600	0	0	1 -360 360;
	2	3	2.0	3.2	0	250		250		250 	0	0	1 -360 360;
	2	4	0.3	0.4	0	3000	3000	3000	0	0	1 -360 360;
	2	5	0.5	0.8	0	1000	1000	1000	0	0	1 -360 360;
	3	8	1.0	1.6	0	1000	1000	1000	0	0	1 -360 360;
	3	9	1.5	2.0	0	400		400		400		0	0	1 -360 360;
	4	5	0.3	0.4	0	2000	2000	2000	0	0	1 -360 360;
	4	6	1.0	0.8	0	2000	2000	2000	0	0	1 -360 360;
	4	7	0.3	0.4	0	3000	3000	3000	0	0	1 -360 360;
	5	7	0.5	0.8	0	2000	2000	2000	0	0	1 -360 360;
	6	7	0.75	0.8	0	2000	2000	2000	0	0	1 -360 360;
	8	10	1.0	1.2	0	1600	1600	1600	0	0	1 -360 360;
	8	9	1.0	1.2	0	1000	1000	1000	0	0	1 -360 360;
	9	10	1.0	1.6	0	500	500	500	0	0	1 -360 360;
	6	11	0.75	0.8	0	1500	1500	1500	0	0	1 -360 360;
	7	11	1.0	1.2	0	1200	1200	1200	0	0	1 -360 360;
	10	11	1.0	1.6	0	500	500	500	0	0	1 -360 360;
	12	11	0.01	0.01	0	5000	5000	5000	0	0	1 -360 360;
	];

%%-----  OPF Data  -----%%
%% area data
%	area	refbus
areas = [
	1	1;
];

%% generator cost data
%	1	startup	shutdown	n	x1	y1	...	xn	yn
%	2	startup	shutdown	n	c(n-1)	...	c0
gencost = [
	2	0	0	3		0.004	10	0;
	2	0	0	3		0.006	15	0;
	2	0	0	3		0.008	50	0;
	2	0	0	3		0.005	12	0;
	2	0	0	3		0.006	15.5	0;
	2	0	0	3		0.007	15.5	0;
	2	0	0	3		0.008	21.5	0;
	2	0	0	3		0.006	16	0;
	2	0	0	3		0.005	14	0;
	2	0	0	3		0.004	13	0;
	2	0	0	3		0.006	16	0;
	2	0	0	3		0.009	31	0;
];
