function mpc = existing_system
%CASE5  Power flow data for modified 6 bus, 3 gen case based on Milos existing system 6-bus system
%%


%% MATPOWER Case Format : Version 2
mpc.version = '2';

%%-----  Power Flow Data  -----%%
%% system MVA base
mpc.baseMVA = 100;

%% gia PD=10MW SUNOLIKO KAI COSF=0.97

%% 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	0	15	1	1.1	0.9;
	2	1	2.8 	0.70168  0	0	1	1	0	15	1	1.1	0.9;
	3	1	1.4     0.35084  0	0	1	1	0	15	1	1.1	0.9;
	4	1	3.2 	0.80192	 0	0	1	1	0	15	1	1.1	0.9;
	5	1	2.1 	0.52626	 0	0	1	1	0	15	1	1.1	0.9;
	6	1	0.5 	0.1253	 0	0	1	1	0	15	1	1.1	0.9;    
];

%% generator data
%	bus	Pg	Qg	Qmax	Qmin	Vg	mBase	status	Pmax	Pmin	Pc1	Pc2	Qc1min	Qc1max	Qc2min	Qc2max	ramp_agc	ramp_10	ramp_30	ramp_q	apf
mpc.gen = [
	%1	0           4.5 	-3.5     0     1	100	1	5	 2.7 	0	0	0	0	0	0	0	0	0	0	0;
    %1	1.4         1.1 	-1       0     1	100	1	1.3	 1.5 	0	0	0	0	0	0	0	0	0	0	0;
    1	0     4.5 	-3.5     0     1	100	1	5	 2.7 	0	0	0	0	0	0	0	0	0	0	0;
	1	0     4.5 	-3.5     0     1	100	1	5	 2.7 	0	0	0	0	0	0	0	0	0	0	0;
	1	0     4.5 	-3.5     0     1	100	1	5	 2.7 	0	0	0	0	0	0	0	0	0	0	0;
];

%% branch data
%	fbus	tbus	r	x	b	rateA	rateB	rateC	ratio	angle	status	angmin	angmax
mpc.branch = [
	
    1	2	0.76666667	0.306666667	0	1.5     1.5     1.5     0	0	1	-2500   2500;
	1	3	0.22222222	0.066666667	0	2.25	2.25    2.25	0   0	1	-2500   2500;
    %%1	3	0.53333333	0.008888889	0	2.25	2.25    2.25	0   0	1	-2500   2500;
	1	4	0.18888889	0.007555556	0	2.25	2.25    2.25	0	0	1	-2500   2500;
    %%1	4	1.55555556	0.222222222	0	2.25	2.25    2.25	0	0	1	-2500   2500;
	1	5	0.44444444	0.177777778	0	1.5     1.5     1.5     0	0	1	-2500   2500;
	1	6	0.88888889	0.355555556	0	1.8     1.8     1.8     0	0	1	-2500   2500;
];

%%-----  OPF Data  -----%%
%% generator cost data
%	1	startup	shutdown	n	x1	y1	...	xn	yn
%	2	startup	shutdown	n	c(n-1)	...	c0
mpc.gencost = [
	2	0	0  0    0.2264 34.6264	9.9068;
	2	0	0  0    0.2264 34.6264	9.9068;
	2	0	0  0    0.2264 34.6264	9.9068;
];
