Index: misc/publications/2012/journals/IEEE_TII/EvalSolutionTC4.m
===================================================================
--- misc/publications/2012/journals/IEEE_TII/EvalSolutionTC4.m	(revision 9157)
+++ misc/publications/2012/journals/IEEE_TII/EvalSolutionTC4.m	(revision 9157)
@@ -0,0 +1,191 @@
+errorBranch=zeros(108,24);
+numberSamples=Samples;
+evaluatedSamples=Samples;
+penaltyFactors=[5,5,1,0.1];
+costPenaltyGrid=zeros(numberSamples,24);
+costPenaltyTotal=zeros(numberSamples,1);
+cost=zeros(numberSamples,24);
+costTemp=zeros(3,1);
+resultingCost=zeros(numberSamples,1);
+resultingCostLog=zeros(numberSamples,1);
+
+%%sample ziehen und bewerten
+for s=1:numberSamples    
+    
+    %Schedules mit Zeitfenster übelagern, für jeden Zeitschritt PF lösen
+    n=0; %spaltenindex in der Kostenmatrix, Zeitstempel im Schedule    
+    for j=1:24
+        casexx=eval('ieeecase118');    
+  
+        n=n+1;
+         
+            r = 1 + 0.04.*randn(1,1);
+            %Lasten ins Stromnetz einfügen
+            %Lastprofile setzen und randomisieren
+            %Busse 1-30 häuslich
+            casexx.bus(1:30,3)=casexx.bus(1:30,3)*scheduleBaseLoad1(j)*r;
+            casexx.bus(1:30,4)=casexx.bus(1:30,4)*scheduleBaseLoad1(j)*r;
+            %Busse 31-60 häuslich/gewerblich
+            casexx.bus(31:60,3)=casexx.bus(31:60,3)*(scheduleBaseLoad2(j)+scheduleBaseLoad4(j))/2*r;
+            casexx.bus(31:60,4)=casexx.bus(31:60,4)*(scheduleBaseLoad2(j)+scheduleBaseLoad4(j))/2*r;
+            %Busse 61-90 häuslich/industriell
+            casexx.bus(61:90,3)=casexx.bus(61:90,3)*(scheduleBaseLoad3(j)+scheduleBaseLoad7(j))/2*r;
+            casexx.bus(61:90,4)=casexx.bus(61:90,4)*(scheduleBaseLoad3(j)+scheduleBaseLoad7(j))/2*r;
+            %Busse 91-100 industriell/gewerblich
+            casexx.bus(91:100,3)=casexx.bus(91:100,3)*(scheduleBaseLoad8(j)+scheduleBaseLoad5(j))/2*r;
+            casexx.bus(91:100,4)=casexx.bus(91:100,4)*(scheduleBaseLoad8(j)+scheduleBaseLoad5(j))/2*r;
+            %Busse 101-110 industriell
+            casexx.bus(101:110,3)=casexx.bus(101:110,3)*scheduleBaseLoad9(j)*r;
+            casexx.bus(101:110,4)=casexx.bus(101:110,4)*scheduleBaseLoad9(j)*r;
+            %Busse 111-118 gewerblich           
+            casexx.bus(111:118,3)=casexx.bus(111:118,3)*scheduleBaseLoad6(j)*r;
+            casexx.bus(111:118,4)=casexx.bus(111:118,4)*scheduleBaseLoad6(j)*r;
+
+            %Erzeugung aus Windkraft setzen
+            %zufällige Windkraft ziehen
+            %%Erzeuger randomisieren
+            %Weibull- Verteilung wie in "probabilistic constrained load flow
+            %considering integration of wind power generation and electric vehicles"
+            %jedoch direkt über wbl- funktion und mit geänderten parametern
+            v=wblrnd(1.11,3)*14*scheduleWindSpeed(j); % gibt im mittel 1; 14m/s=windspeed rated
+            %shape=1.11, scale=3
+            %PW1 aus Leistungskurve berechnen
+            PW=polyval(p1,v);          
+            
+            if(PW<0)
+                PW1=0;
+            end
+            if(PW>5)
+                PW=5;
+            end          
+            
+     
+			%PV u Wind setzen
+            indexBus=1;
+            for i=1:108
+                if(mod(i,2)==0)
+                    casexx.gen(indexBus,2)=casexx.gen(indexBus,2)+(scheduleIrradiance(j)*Solution(i)*0.5);
+                    indexBus=indexBus+1;
+                end
+                if(mod(i,2)==1)
+                    casexx.gen(indexBus,2)=casexx.gen(indexBus,2)+(Solution(i)*PW);                  
+                end                
+            end
+            %PV u. Wind mit halber Leistung
+            indexBus=1;
+            for i=109:216
+                if(mod(i,2)==0)
+                    casexx.gen(indexBus,2)=casexx.gen(indexBus,2)+(scheduleIrradiance(j)*Solution(i)*0.25);
+                    indexBus=indexBus+1;
+                end
+                if(mod(i,2)==1)
+                    casexx.gen(indexBus,2)=casexx.gen(indexBus,2)+(Solution(i)*PW*0.5);                  
+                end                
+            end 			
+     
+            %LF berechnen mit Fast Decoupled XB (PF_ALG=2)
+            opt = mpoption('PF_ALG', 2,'VERBOSE',0,'OUT_ALL',0);
+            results=runpf(casexx,opt);
+            
+            %Restriktionen überprüfen
+                % max Leitungsscheinleistung
+                results.branchMVA=sqrt(results.branch(:,14).^2+results.branch(:,15).^2);
+                
+                %anpassen, falls notwendig
+                 k=1;
+                 deltaMVA=0;
+                 while k<=length(MaxBranchMVA)
+                    if results.branchMVA(k,1)>MaxBranchMVA(k,1)
+                       deltaMVA=deltaMVA+(results.branchMVA(k,1)-MaxBranchMVA(k,1))^2;
+                       errorBranch(k,j)=1;
+                       %dlmwrite('errorBranch.txt',errorBranch,'-append');
+                    end 
+                    k=k+1;   
+                 end
+
+                % max Generatorblindleistung                
+                 deltaQ=0;
+%                 k=1;
+%                 while k<=size(results.gen,1)
+%                     if results.gen(k,3)>results.gen(k,4)
+%                         deltaQ=deltaQ+(results.gen(k,3)-results.gen(k,4))^2;
+%                     end
+%                     if results.gen(k,3)<results.gen(k,5)
+%                         deltaQ=deltaQ+(results.gen(k,3)-results.gen(k,5))^2;
+%                     end
+%                     k=k+1;
+%                 end
+                
+                % max Spannung
+                k=1;
+                deltaV=0;
+                while k<=size(results.bus,1)
+                    if results.bus(k,8)>results.bus(k,12) 
+                        deltaV=deltaV+(results.bus(k,8)-results.bus(k,12))^2;
+                    end
+                    if results.bus(k,8)<results.bus(k,13)
+                        deltaV=deltaV+(results.bus(k,8)-results.bus(k,13))^2;
+                    end
+                    k=k+1;
+                end
+                
+            %Kosten ausdrücken
+                        
+            %Kostenfunktion: min. Verlustleistung
+            sumgenerated=sum(results.gen(:,2));
+            sumload=sum(results.bus(:,3));
+            losses=sumgenerated-sumload;
+            
+            costPenaltyGrid(s,n)=deltaV*penaltyFactors(3)+deltaMVA*penaltyFactors(4);
+            cost(s,n)=losses;      
+    end
+            %Anzahl d. verbauten Kraftwerke soll minimiert werden
+            maxPlants=0;
+            lengthSolution=(sum(Solution)-18);       
+            if(lengthSolution<0)
+                lengthSolution=0;
+            end
+            if(sum(Solution)>27)
+                maxPlants=sum(Solution)-27;
+            end
+            
+            %an jedem Bus entweder Wind oder PV
+            config=0;
+            for i=1:2:108
+                if((Solution(i)+Solution(i+1))>1)
+                config = config +1;
+                end
+            end
+            
+    
+    costPenaltyTotal(s)=penaltyFactors(1)*lengthSolution+penaltyFactors(2)*maxPlants+sum(costPenaltyGrid(s,:));   
+    
+    if(s==4 && Generations>1)
+        
+        for i=1:3    
+        costTemp(i)=sum(cost(i,:))+costPenaltyTotal(i)/Generations;
+        end
+        
+        fitnessTemp=sum(costTemp(:))/size(costTemp,1);
+        
+        if(fitnessTemp>threshold)
+            evaluatedSamples=3;
+            break;
+        end
+    end
+end
+
+%% Kosten ermitteln
+for i=1:evaluatedSamples
+     
+    if(Generations < 1)
+        Generations=1;
+    end
+    
+    resultingCost(i)=sum(cost(i,:))+costPenaltyTotal(i);
+end
+
+%dlmwrite('logSamples.txt',evaluatedSamples,'-append','newline', 'pc');
+
+Fitness=sum(resultingCost(1:evaluatedSamples))/evaluatedSamples;
+Fitness
Index: misc/publications/2012/journals/IEEE_TII/ieeecase118.m
===================================================================
--- misc/publications/2012/journals/IEEE_TII/ieeecase118.m	(revision 9157)
+++ misc/publications/2012/journals/IEEE_TII/ieeecase118.m	(revision 9157)
@@ -0,0 +1,442 @@
+function mpc = ieeecase118reduced_1
+
+%% MATPOWER Case Format : Version 2
+mpc.version = '2';
+
+%%-----  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	2	5.1	2.7	0	0	1	0.955	10.67	0	1	1.06	0.94;
+	2	1	2	0.9	0	0	1	0.971	11.22	0	1	1.06	0.94;
+	3	1	3.9	1	0	0	1	0.968	11.56	0	1	1.06	0.94;
+	4	2	3.9	1.2	0	0	1	0.998	15.28	0	1	1.06	0.94;
+	5	1	3.59492	1.21864	0	-4	1	1.002	15.73	0	1	1.06	0.94;
+	6	2	5.2	2.2	0	0	1	0.99	13	0	1	1.06	0.94;
+	7	1	1.9	0.2	0	0	1	0.989	12.56	0	1	1.06	0.94;
+	8	2	2.8	1.22897	0	0	1	1.015	20.77	0	1	1.06	0.94;
+	9	1	3.62538	1.23939	0	0	1	1.043	28.02	0	1	1.06	0.94;
+	10	2	3.6561	1.24989	0	0	1	1.05	35.61	0	1	1.06	0.94;
+	11	1	7	2.3	0	0	1	0.985	12.72	0	1	1.06	0.94;
+	12	2	4.7	1	0	0	1	0.99	12.2	0	1	1.06	0.94;
+	13	1	3.4	1.6	0	0	1	0.968	11.35	0	1	1.06	0.94;
+	14	1	1.4	0.1	0	0	1	0.984	11.5	0	1	1.06	0.94;
+	15	2	9	3	0	0	1	0.97	11.23	0	1	1.06	0.94;
+	16	1	2.5	1	0	0	1	0.984	11.91	0	1	1.06	0.94;
+	17	1	1.1	0.3	0	0	1	0.995	13.74	0	1	1.06	0.94;
+	18	2	6	3.4	0	0	1	0.973	11.53	0	1	1.06	0.94;
+	19	2	4.5	2.5	0	0	1	0.963	11.05	0	1	1.06	0.94;
+	20	1	1.8	0.3	0	0	1	0.958	11.93	0	1	1.06	0.94;
+	21	1	1.4	0.8	0	0	1	0.959	13.52	0	1	1.06	0.94;
+	22	1	1	0.5	0	0	1	0.97	16.08	0	1	1.06	0.94;
+	23	1	0.7	0.3	0	0	1	1	21	0	1	1.06	0.94;
+	24	2	1.3	1.26048	0	0	1	0.992	20.89	0	1	1.06	0.94;
+	25	2	3.68709	1.27116	0	0	1	1.05	27.93	0	1	1.06	0.94;
+	26	2	3.71833	1.28194	0	0	1	1.015	29.71	0	1	1.06	0.94;
+	27	2	7.1	1.3	0	0	1	0.968	15.35	0	1	1.06	0.94;
+	28	1	1.7	0.7	0	0	1	0.962	13.62	0	1	1.06	0.94;
+	29	1	2.4	0.4	0	0	1	0.963	12.63	0	1	1.06	0.94;
+	30	1	3.74985	1.2928	0	0	1	0.968	18.79	0	1	1.06	0.94;
+	31	2	4.3	2.7	0	0	1	0.967	12.75	0	1	1.06	0.94;
+	32	2	5.9	2.3	0	0	1	0.964	14.8	0	1	1.06	0.94;
+	33	1	2.3	0.9	0	0	1	0.972	10.63	0	1	1.06	0.94;
+	34	2	5.9	2.6	0	1.4	1	0.986	11.3	0	1	1.06	0.94;
+	35	1	3.3	0.9	0	0	1	0.981	10.87	0	1	1.06	0.94;
+	36	2	3.1	1.7	0	0	1	0.98	10.87	0	1	1.06	0.94;
+	37	1	3.78162	1.30376	0	-2.5	1	0.992	11.77	0	1	1.06	0.94;
+	38	1	3.81367	1.31481	0	0	1	0.962	16.91	0	1	1.06	0.94;
+	39	1	2.7	1.1	0	0	1	0.97	8.41	0	1	1.06	0.94;
+	40	2	6.6	2.3	0	0	1	0.97	7.35	0	1	1.06	0.94;
+	41	1	3.7	1	0	0	1	0.967	6.92	0	1	1.06	0.94;
+	42	2	9.6	2.3	0	0	1	0.985	8.53	0	1	1.06	0.94;
+	43	1	1.8	0.7	0	0	1	0.978	11.28	0	1	1.06	0.94;
+	44	1	1.6	0.8	0	1	1	0.985	13.82	0	1	1.06	0.94;
+	45	1	5.3	2.2	0	1	1	0.987	15.67	0	1	1.06	0.94;
+	46	2	2.8	1	0	1	1	1.005	18.49	0	1	1.06	0.94;
+	47	1	3.4	1.32595	0	0	1	1.017	20.73	0	1	1.06	0.94;
+	48	1	2	1.1	0	1.5	1	1.021	19.93	0	1	1.06	0.94;
+	49	2	8.7	3	0	0	1	1.025	20.94	0	1	1.06	0.94;
+	50	1	1.7	0.4	0	0	1	1.001	18.9	0	1	1.06	0.94;
+	51	1	1.7	0.8	0	0	1	0.967	16.28	0	1	1.06	0.94;
+	52	1	1.8	0.5	0	0	1	0.957	15.32	0	1	1.06	0.94;
+	53	1	2.3	1.1	0	0	1	0.946	14.35	0	1	1.06	0.94;
+	54	2	11.3	3.2	0	0	1	0.955	15.26	0	1	1.06	0.94;
+	55	2	6.3	2.2	0	0	1	0.952	14.97	0	1	1.06	0.94;
+	56	2	8.4	1.8	0	0	1	0.954	15.16	0	1	1.06	0.94;
+	57	1	1.2	0.3	0	0	1	0.971	16.36	0	1	1.06	0.94;
+	58	1	1.2	0.3	0	0	1	0.959	15.51	0	1	1.06	0.94;
+	59	2	27.7	11.3	0	0	1	0.985	19.37	0	1	1.06	0.94;
+	60	1	7.8	0.3	0	0	1	0.993	23.15	0	1	1.06	0.94;
+	61	2	3.84599	1.33718	0	0	1	0.995	24.04	0	1	1.06	0.94;
+	62	2	7.7	1.4	0	0	1	0.998	23.43	0	1	1.06	0.94;
+	63	1	3.87858	1.34852	0	0	1	0.969	22.75	0	1	1.06	0.94;
+	64	1	3.91145	1.35994	0	0	1	0.984	24.52	0	1	1.06	0.94;
+	65	2	3.9446	1.37147	0	0	1	1.005	27.65	0	1	1.06	0.94;
+	66	2	3.9	1.8	0	0	1	1.05	27.48	0	1	1.06	0.94;
+	67	1	2.8	0.7	0	0	1	1.02	24.84	0	1	1.06	0.94;
+	68	1	3.97803	1.38309	0	0	1	1.003	27.55	0	1	1.06	0.94;
+	69	3	4.01174	1.39481	0	0	1	1.035	30	0	1	1.06	0.94;
+	70	2	6.6	2	0	0	1	0.984	22.58	0	1	1.06	0.94;
+	71	1	4.04574	1.40663	0	0	1	0.987	22.15	0	1	1.06	0.94;
+	72	2	1.2	1.41855	0	0	1	0.98	20.98	0	1	1.06	0.94;
+	73	2	0.6	1.43058	0	0	1	0.991	21.94	0	1	1.06	0.94;
+	74	2	6.8	2.7	0	1.2	1	0.958	21.64	0	1	1.06	0.94;
+	75	1	4.7	1.1	0	0	1	0.967	22.91	0	1	1.06	0.94;
+	76	2	6.8	3.6	0	0	1	0.943	21.77	0	1	1.06	0.94;
+	77	2	6.1	2.8	0	0	1	1.006	26.72	0	1	1.06	0.94;
+	78	1	7.1	2.6	0	0	1	1.003	26.42	0	1	1.06	0.94;
+	79	1	3.9	3.2	0	2	1	1.009	26.72	0	1	1.06	0.94;
+	80	2	13	2.6	0	0	1	1.04	28.96	0	1	1.06	0.94;
+	81	1	4.08003	1.4427	0	0	1	0.997	28.1	0	1	1.06	0.94;
+	82	1	5.4	2.7	0	2	1	0.989	27.24	0	1	1.06	0.94;
+	83	1	2	1	0	1	1	0.985	28.42	0	1	1.06	0.94;
+	84	1	1.1	0.7	0	0	1	0.98	30.95	0	1	1.06	0.94;
+	85	2	2.4	1.5	0	0	1	0.985	32.51	0	1	1.06	0.94;
+	86	1	2.1	1	0	0	1	0.987	31.14	0	1	1.06	0.94;
+	87	2	4.1146	1.45493	0	0	1	1.015	31.4	0	1	1.06	0.94;
+	88	1	4.8	1	0	0	1	0.987	35.64	0	1	1.06	0.94;
+	89	2	4.14947	1.46726	0	0	1	1.005	39.69	0	1	1.06	0.94;
+	90	2	16.3	4.2	0	0	1	0.985	33.29	0	1	1.06	0.94;
+	91	2	1	1.47969	0	0	1	0.98	33.31	0	1	1.06	0.94;
+	92	2	6.5	1	0	0	1	0.993	33.8	0	1	1.06	0.94;
+	93	1	1.2	0.7	0	0	1	0.987	30.79	0	1	1.06	0.94;
+	94	1	3	1.6	0	0	1	0.991	28.64	0	1	1.06	0.94;
+	95	1	4.2	3.1	0	0	1	0.981	27.67	0	1	1.06	0.94;
+	96	1	3.8	1.5	0	0	1	0.993	27.51	0	1	1.06	0.94;
+	97	1	1.5	0.9	0	0	1	1.011	27.88	0	1	1.06	0.94;
+	98	1	3.4	0.8	0	0	1	1.024	27.4	0	1	1.06	0.94;
+	99	2	4.2	1.49223	0	0	1	1.01	27.04	0	1	1.06	0.94;
+	100	2	3.7	1.8	0	0	1	1.017	28.03	0	1	1.06	0.94;
+	101	1	2.2	1.5	0	0	1	0.993	29.61	0	1	1.06	0.94;
+	102	1	0.5	0.3	0	0	1	0.991	32.3	0	1	1.06	0.94;
+	103	2	2.3	1.6	0	0	1	1.001	24.44	0	1	1.06	0.94;
+	104	2	3.8	2.5	0	0	1	0.971	21.69	0	1	1.06	0.94;
+	105	2	3.1	2.6	0	2	1	0.965	20.57	0	1	1.06	0.94;
+	106	1	4.3	1.6	0	0	1	0.962	20.32	0	1	1.06	0.94;
+	107	2	5	1.2	0	0.6	1	0.952	17.53	0	1	1.06	0.94;
+	108	1	0.2	0.1	0	0	1	0.967	19.38	0	1	1.06	0.94;
+	109	1	0.8	0.3	0	0	1	0.967	18.93	0	1	1.06	0.94;
+	110	2	3.9	3	0	0.6	1	0.973	18.09	0	1	1.06	0.94;
+	111	2	4.18464	1.50488	0	0	1	0.98	19.74	0	1	1.06	0.94;
+	112	2	6.8	1.3	0	0	1	0.975	14.99	0	1	1.06	0.94;
+	113	2	0.6	1.51763	0	0	1	0.993	13.74	0	1	1.06	0.94;
+	114	1	0.8	0.3	0	0	1	0.96	14.46	0	1	1.06	0.94;
+	115	1	2.2	0.7	0	0	1	0.96	14.46	0	1	1.06	0.94;
+	116	2	18.4	1.53049	0	0	1	1.005	27.12	0	1	1.06	0.94;
+	117	1	2	0.8	0	0	1	0.974	10.67	0	1	1.06	0.94;
+	118	1	3.3	1.5	0	0	1	0.949	21.92	0	1	1.06	0.94;
+];
+
+%% 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	0	1.5	-0.5	0.955	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	4	0	0	30	-30	0.998	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	6	0	0	5	-1.3	0.99	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	8	0	0	30	-30	1.015	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	10	40.5	0	20	-14.7	1.05	10	1	55	0	0	0	0	0	0	0	0	0	0	0	0;
+	12	7.65	0	12	-3.5	0.99	10	1	18.5	0	0	0	0	0	0	0	0	0	0	0	0;
+	15	0	0	3	-1	0.97	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	18	0	0	5	-1.6	0.973	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	19	0	0	2.4	-0.8	0.962	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	24	0	0	30	-30	0.992	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	25	19.8	0	14	-4.7	1.05	10	1	32	0	0	0	0	0	0	0	0	0	0	0	0;
+	26	28.26	0	100	-100	1.015	10	1	41.4	0	0	0	0	0	0	0	0	0	0	0	0;
+	27	0	0	30	-30	0.968	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	31	0.63	0	30	-30	0.967	10	1	10.7	0	0	0	0	0	0	0	0	0	0	0	0;
+	32	0	0	4.2	-1.4	0.963	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	34	0	0	2.4	-0.8	0.984	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	36	0	0	2.4	-0.8	0.98	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	40	0	0	30	-30	0.97	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	42	0	0	30	-30	0.985	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	46	1.71	0	10	-10	1.005	10	1	11.9	0	0	0	0	0	0	0	0	0	0	0	0;
+	49	18.36	0	21	-8.5	1.025	10	1	30.4	0	0	0	0	0	0	0	0	0	0	0	0;
+	54	4.32	0	30	-30	0.955	10	1	14.8	0	0	0	0	0	0	0	0	0	0	0	0;
+	55	0	0	2.3	-0.8	0.952	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	56	0	0	1.5	-0.8	0.954	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	59	13.95	0	18	-6	0.985	10	1	25.5	0	0	0	0	0	0	0	0	0	0	0	0;
+	61	14.4	0	30	-10	0.995	10	1	26	0	0	0	0	0	0	0	0	0	0	0	0;
+	62	0	0	2	-2	0.998	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	65	35.19	0	20	-6.7	1.005	10	1	49.1	0	0	0	0	0	0	0	0	0	0	0	0;
+	66	35.28	0	20	-6.7	1.05	10	1	49.2	0	0	0	0	0	0	0	0	0	0	0	0;
+	69	46.476	0	30	-30	1.035	10	1	80.52	0	0	0	0	0	0	0	0	0	0	0	0;
+	70	0	0	3.2	-1	0.984	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	72	0	0	10	-10	0.98	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	73	0	0	10	-10	0.991	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	74	0	0	0.9	-0.6	0.958	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	76	0	0	2.3	-0.8	0.943	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	77	0	0	7	-2	1.006	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	80	42.93	0	28	-16.5	1.04	10	1	57.7	0	0	0	0	0	0	0	0	0	0	0	0;
+	85	0	0	2.3	-0.8	0.985	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	87	0.36	0	100	-10	1.015	10	1	10.4	0	0	0	0	0	0	0	0	0	0	0	0;
+	89	54.63	0	30	-21	1.005	10	1	70.7	0	0	0	0	0	0	0	0	0	0	0	0;
+	90	0	0	30	-30	0.985	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	91	0	0	10	-10	0.98	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	92	0	0	0.9	-0.3	0.99	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	99	0	0	10	-10	1.01	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	100	22.68	0	15.5	-5	1.017	10	1	35.2	0	0	0	0	0	0	0	0	0	0	0	0;
+	103	3.6	0	4	-1.5	1.01	10	1	14	0	0	0	0	0	0	0	0	0	0	0	0;
+	104	0	0	2.3	-0.8	0.971	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	105	0	0	2.3	-0.8	0.965	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	107	0	0	20	-20	0.952	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	110	0	0	2.3	-0.8	0.973	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	111	3.24	0	100	-10	0.98	10	1	13.6	0	0	0	0	0	0	0	0	0	0	0	0;
+	112	0	0	100	-10	0.975	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	113	0	0	20	-10	0.993	10	1	10	0	0	0	0	0	0	0	0	0	0	0	0;
+	116	0	0	100	-100	1.005	10	1	10	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	angmin	angmax
+mpc.branch = [
+	1	2	0.0303	0.0999	0.0254	9900	0	0	0	0	1	-360	360;
+	1	3	0.0129	0.0424	0.01082	9900	0	0	0	0	1	-360	360;
+	4	5	0.00176	0.00798	0.0021	9900	0	0	0	0	1	-360	360;
+	3	5	0.0241	0.108	0.0284	9900	0	0	0	0	1	-360	360;
+	5	6	0.0119	0.054	0.01426	9900	0	0	0	0	1	-360	360;
+	6	7	0.00459	0.0208	0.0055	9900	0	0	0	0	1	-360	360;
+	8	9	0.00244	0.0305	1.162	9900	0	0	0	0	1	-360	360;
+	8	5	0	0.0267	0	9900	0	0	0.985	0	1	-360	360;
+	9	10	0.00258	0.0322	1.23	9900	0	0	0	0	1	-360	360;
+	4	11	0.0209	0.0688	0.01748	9900	0	0	0	0	1	-360	360;
+	5	11	0.0203	0.0682	0.01738	9900	0	0	0	0	1	-360	360;
+	11	12	0.00595	0.0196	0.00502	9900	0	0	0	0	1	-360	360;
+	2	12	0.0187	0.0616	0.01572	9900	0	0	0	0	1	-360	360;
+	3	12	0.0484	0.16	0.0406	9900	0	0	0	0	1	-360	360;
+	7	12	0.00862	0.034	0.00874	9900	0	0	0	0	1	-360	360;
+	11	13	0.02225	0.0731	0.01876	9900	0	0	0	0	1	-360	360;
+	12	14	0.0215	0.0707	0.01816	9900	0	0	0	0	1	-360	360;
+	13	15	0.0744	0.2444	0.06268	9900	0	0	0	0	1	-360	360;
+	14	15	0.0595	0.195	0.0502	9900	0	0	0	0	1	-360	360;
+	12	16	0.0212	0.0834	0.0214	9900	0	0	0	0	1	-360	360;
+	15	17	0.0132	0.0437	0.0444	9900	0	0	0	0	1	-360	360;
+	16	17	0.0454	0.1801	0.0466	9900	0	0	0	0	1	-360	360;
+	17	18	0.0123	0.0505	0.01298	9900	0	0	0	0	1	-360	360;
+	18	19	0.01119	0.0493	0.01142	9900	0	0	0	0	1	-360	360;
+	19	20	0.0252	0.117	0.0298	9900	0	0	0	0	1	-360	360;
+	15	19	0.012	0.0394	0.0101	9900	0	0	0	0	1	-360	360;
+	20	21	0.0183	0.0849	0.0216	9900	0	0	0	0	1	-360	360;
+	21	22	0.0209	0.097	0.0246	9900	0	0	0	0	1	-360	360;
+	22	23	0.0342	0.159	0.0404	9900	0	0	0	0	1	-360	360;
+	23	24	0.0135	0.0492	0.0498	9900	0	0	0	0	1	-360	360;
+	23	25	0.0156	0.08	0.0864	9900	0	0	0	0	1	-360	360;
+	26	25	0	0.0382	0	9900	0	0	0.96	0	1	-360	360;
+	25	27	0.0318	0.163	0.1764	9900	0	0	0	0	1	-360	360;
+	27	28	0.01913	0.0855	0.0216	9900	0	0	0	0	1	-360	360;
+	28	29	0.0237	0.0943	0.0238	9900	0	0	0	0	1	-360	360;
+	30	17	0	0.0388	0	9900	0	0	0.96	0	1	-360	360;
+	8	30	0.00431	0.0504	0.514	9900	0	0	0	0	1	-360	360;
+	26	30	0.00799	0.086	0.908	9900	0	0	0	0	1	-360	360;
+	17	31	0.0474	0.1563	0.0399	9900	0	0	0	0	1	-360	360;
+	29	31	0.0108	0.0331	0.0083	9900	0	0	0	0	1	-360	360;
+	23	32	0.0317	0.1153	0.1173	9900	0	0	0	0	1	-360	360;
+	31	32	0.0298	0.0985	0.0251	9900	0	0	0	0	1	-360	360;
+	27	32	0.0229	0.0755	0.01926	9900	0	0	0	0	1	-360	360;
+	15	33	0.038	0.1244	0.03194	9900	0	0	0	0	1	-360	360;
+	19	34	0.0752	0.247	0.0632	9900	0	0	0	0	1	-360	360;
+	35	36	0.00224	0.0102	0.00268	9900	0	0	0	0	1	-360	360;
+	35	37	0.011	0.0497	0.01318	9900	0	0	0	0	1	-360	360;
+	33	37	0.0415	0.142	0.0366	9900	0	0	0	0	1	-360	360;
+	34	36	0.00871	0.0268	0.00568	9900	0	0	0	0	1	-360	360;
+	34	37	0.00256	0.0094	0.00984	9900	0	0	0	0	1	-360	360;
+	38	37	0	0.0375	0	9900	0	0	0.935	0	1	-360	360;
+	37	39	0.0321	0.106	0.027	9900	0	0	0	0	1	-360	360;
+	37	40	0.0593	0.168	0.042	9900	0	0	0	0	1	-360	360;
+	30	38	0.00464	0.054	0.422	9900	0	0	0	0	1	-360	360;
+	39	40	0.0184	0.0605	0.01552	9900	0	0	0	0	1	-360	360;
+	40	41	0.0145	0.0487	0.01222	9900	0	0	0	0	1	-360	360;
+	40	42	0.0555	0.183	0.0466	9900	0	0	0	0	1	-360	360;
+	41	42	0.041	0.135	0.0344	9900	0	0	0	0	1	-360	360;
+	43	44	0.0608	0.2454	0.06068	9900	0	0	0	0	1	-360	360;
+	34	43	0.0413	0.1681	0.04226	9900	0	0	0	0	1	-360	360;
+	44	45	0.0224	0.0901	0.0224	9900	0	0	0	0	1	-360	360;
+	45	46	0.04	0.1356	0.0332	9900	0	0	0	0	1	-360	360;
+	46	47	0.038	0.127	0.0316	9900	0	0	0	0	1	-360	360;
+	46	48	0.0601	0.189	0.0472	9900	0	0	0	0	1	-360	360;
+	47	49	0.0191	0.0625	0.01604	9900	0	0	0	0	1	-360	360;
+	42	49	0.0715	0.323	0.086	9900	0	0	0	0	1	-360	360;
+	42	49	0.0715	0.323	0.086	9900	0	0	0	0	1	-360	360;
+	45	49	0.0684	0.186	0.0444	9900	0	0	0	0	1	-360	360;
+	48	49	0.0179	0.0505	0.01258	9900	0	0	0	0	1	-360	360;
+	49	50	0.0267	0.0752	0.01874	9900	0	0	0	0	1	-360	360;
+	49	51	0.0486	0.137	0.0342	9900	0	0	0	0	1	-360	360;
+	51	52	0.0203	0.0588	0.01396	9900	0	0	0	0	1	-360	360;
+	52	53	0.0405	0.1635	0.04058	9900	0	0	0	0	1	-360	360;
+	53	54	0.0263	0.122	0.031	9900	0	0	0	0	1	-360	360;
+	49	54	0.073	0.289	0.0738	9900	0	0	0	0	1	-360	360;
+	49	54	0.0869	0.291	0.073	9900	0	0	0	0	1	-360	360;
+	54	55	0.0169	0.0707	0.0202	9900	0	0	0	0	1	-360	360;
+	54	56	0.00275	0.00955	0.00732	9900	0	0	0	0	1	-360	360;
+	55	56	0.00488	0.0151	0.00374	9900	0	0	0	0	1	-360	360;
+	56	57	0.0343	0.0966	0.0242	9900	0	0	0	0	1	-360	360;
+	50	57	0.0474	0.134	0.0332	9900	0	0	0	0	1	-360	360;
+	56	58	0.0343	0.0966	0.0242	9900	0	0	0	0	1	-360	360;
+	51	58	0.0255	0.0719	0.01788	9900	0	0	0	0	1	-360	360;
+	54	59	0.0503	0.2293	0.0598	9900	0	0	0	0	1	-360	360;
+	56	59	0.0825	0.251	0.0569	9900	0	0	0	0	1	-360	360;
+	56	59	0.0803	0.239	0.0536	9900	0	0	0	0	1	-360	360;
+	55	59	0.04739	0.2158	0.05646	9900	0	0	0	0	1	-360	360;
+	59	60	0.0317	0.145	0.0376	9900	0	0	0	0	1	-360	360;
+	59	61	0.0328	0.15	0.0388	9900	0	0	0	0	1	-360	360;
+	60	61	0.00264	0.0135	0.01456	9900	0	0	0	0	1	-360	360;
+	60	62	0.0123	0.0561	0.01468	9900	0	0	0	0	1	-360	360;
+	61	62	0.00824	0.0376	0.0098	9900	0	0	0	0	1	-360	360;
+	63	59	0	0.0386	0	9900	0	0	0.96	0	1	-360	360;
+	63	64	0.00172	0.02	0.216	9900	0	0	0	0	1	-360	360;
+	64	61	0	0.0268	0	9900	0	0	0.985	0	1	-360	360;
+	38	65	0.00901	0.0986	1.046	9900	0	0	0	0	1	-360	360;
+	64	65	0.00269	0.0302	0.38	9900	0	0	0	0	1	-360	360;
+	49	66	0.018	0.0919	0.0248	9900	0	0	0	0	1	-360	360;
+	49	66	0.018	0.0919	0.0248	9900	0	0	0	0	1	-360	360;
+	62	66	0.0482	0.218	0.0578	9900	0	0	0	0	1	-360	360;
+	62	67	0.0258	0.117	0.031	9900	0	0	0	0	1	-360	360;
+	65	66	0	0.037	0	9900	0	0	0.935	0	1	-360	360;
+	66	67	0.0224	0.1015	0.02682	9900	0	0	0	0	1	-360	360;
+	65	68	0.00138	0.016	0.638	9900	0	0	0	0	1	-360	360;
+	47	69	0.0844	0.2778	0.07092	9900	0	0	0	0	1	-360	360;
+	49	69	0.0985	0.324	0.0828	9900	0	0	0	0	1	-360	360;
+	68	69	0	0.037	0	9900	0	0	0.935	0	1	-360	360;
+	69	70	0.03	0.127	0.122	9900	0	0	0	0	1	-360	360;
+	24	70	0.00221	0.4115	0.10198	9900	0	0	0	0	1	-360	360;
+	70	71	0.00882	0.0355	0.00878	9900	0	0	0	0	1	-360	360;
+	24	72	0.0488	0.196	0.0488	9900	0	0	0	0	1	-360	360;
+	71	72	0.0446	0.18	0.04444	9900	0	0	0	0	1	-360	360;
+	71	73	0.00866	0.0454	0.01178	9900	0	0	0	0	1	-360	360;
+	70	74	0.0401	0.1323	0.03368	9900	0	0	0	0	1	-360	360;
+	70	75	0.0428	0.141	0.036	9900	0	0	0	0	1	-360	360;
+	69	75	0.0405	0.122	0.124	9900	0	0	0	0	1	-360	360;
+	74	75	0.0123	0.0406	0.01034	9900	0	0	0	0	1	-360	360;
+	76	77	0.0444	0.148	0.0368	9900	0	0	0	0	1	-360	360;
+	69	77	0.0309	0.101	0.1038	9900	0	0	0	0	1	-360	360;
+	75	77	0.0601	0.1999	0.04978	9900	0	0	0	0	1	-360	360;
+	77	78	0.00376	0.0124	0.01264	9900	0	0	0	0	1	-360	360;
+	78	79	0.00546	0.0244	0.00648	9900	0	0	0	0	1	-360	360;
+	77	80	0.017	0.0485	0.0472	9900	0	0	0	0	1	-360	360;
+	77	80	0.0294	0.105	0.0228	9900	0	0	0	0	1	-360	360;
+	79	80	0.0156	0.0704	0.0187	9900	0	0	0	0	1	-360	360;
+	68	81	0.00175	0.0202	0.808	9900	0	0	0	0	1	-360	360;
+	81	80	0	0.037	0	9900	0	0	0.935	0	1	-360	360;
+	77	82	0.0298	0.0853	0.08174	9900	0	0	0	0	1	-360	360;
+	82	83	0.0112	0.03665	0.03796	9900	0	0	0	0	1	-360	360;
+	83	84	0.0625	0.132	0.0258	9900	0	0	0	0	1	-360	360;
+	83	85	0.043	0.148	0.0348	9900	0	0	0	0	1	-360	360;
+	84	85	0.0302	0.0641	0.01234	9900	0	0	0	0	1	-360	360;
+	85	86	0.035	0.123	0.0276	9900	0	0	0	0	1	-360	360;
+	86	87	0.02828	0.2074	0.0445	9900	0	0	0	0	1	-360	360;
+	85	88	0.02	0.102	0.0276	9900	0	0	0	0	1	-360	360;
+	85	89	0.0239	0.173	0.047	9900	0	0	0	0	1	-360	360;
+	88	89	0.0139	0.0712	0.01934	9900	0	0	0	0	1	-360	360;
+	89	90	0.0518	0.188	0.0528	9900	0	0	0	0	1	-360	360;
+	89	90	0.0238	0.0997	0.106	9900	0	0	0	0	1	-360	360;
+	90	91	0.0254	0.0836	0.0214	9900	0	0	0	0	1	-360	360;
+	89	92	0.0099	0.0505	0.0548	9900	0	0	0	0	1	-360	360;
+	89	92	0.0393	0.1581	0.0414	9900	0	0	0	0	1	-360	360;
+	91	92	0.0387	0.1272	0.03268	9900	0	0	0	0	1	-360	360;
+	92	93	0.0258	0.0848	0.0218	9900	0	0	0	0	1	-360	360;
+	92	94	0.0481	0.158	0.0406	9900	0	0	0	0	1	-360	360;
+	93	94	0.0223	0.0732	0.01876	9900	0	0	0	0	1	-360	360;
+	94	95	0.0132	0.0434	0.0111	9900	0	0	0	0	1	-360	360;
+	80	96	0.0356	0.182	0.0494	9900	0	0	0	0	1	-360	360;
+	82	96	0.0162	0.053	0.0544	9900	0	0	0	0	1	-360	360;
+	94	96	0.0269	0.0869	0.023	9900	0	0	0	0	1	-360	360;
+	80	97	0.0183	0.0934	0.0254	9900	0	0	0	0	1	-360	360;
+	80	98	0.0238	0.108	0.0286	9900	0	0	0	0	1	-360	360;
+	80	99	0.0454	0.206	0.0546	9900	0	0	0	0	1	-360	360;
+	92	100	0.0648	0.295	0.0472	9900	0	0	0	0	1	-360	360;
+	94	100	0.0178	0.058	0.0604	9900	0	0	0	0	1	-360	360;
+	95	96	0.0171	0.0547	0.01474	9900	0	0	0	0	1	-360	360;
+	96	97	0.0173	0.0885	0.024	9900	0	0	0	0	1	-360	360;
+	98	100	0.0397	0.179	0.0476	9900	0	0	0	0	1	-360	360;
+	99	100	0.018	0.0813	0.0216	9900	0	0	0	0	1	-360	360;
+	100	101	0.0277	0.1262	0.0328	9900	0	0	0	0	1	-360	360;
+	92	102	0.0123	0.0559	0.01464	9900	0	0	0	0	1	-360	360;
+	101	102	0.0246	0.112	0.0294	9900	0	0	0	0	1	-360	360;
+	100	103	0.016	0.0525	0.0536	9900	0	0	0	0	1	-360	360;
+	100	104	0.0451	0.204	0.0541	9900	0	0	0	0	1	-360	360;
+	103	104	0.0466	0.1584	0.0407	9900	0	0	0	0	1	-360	360;
+	103	105	0.0535	0.1625	0.0408	9900	0	0	0	0	1	-360	360;
+	100	106	0.0605	0.229	0.062	9900	0	0	0	0	1	-360	360;
+	104	105	0.00994	0.0378	0.00986	9900	0	0	0	0	1	-360	360;
+	105	106	0.014	0.0547	0.01434	9900	0	0	0	0	1	-360	360;
+	105	107	0.053	0.183	0.0472	9900	0	0	0	0	1	-360	360;
+	105	108	0.0261	0.0703	0.01844	9900	0	0	0	0	1	-360	360;
+	106	107	0.053	0.183	0.0472	9900	0	0	0	0	1	-360	360;
+	108	109	0.0105	0.0288	0.0076	9900	0	0	0	0	1	-360	360;
+	103	110	0.03906	0.1813	0.0461	9900	0	0	0	0	1	-360	360;
+	109	110	0.0278	0.0762	0.0202	9900	0	0	0	0	1	-360	360;
+	110	111	0.022	0.0755	0.02	9900	0	0	0	0	1	-360	360;
+	110	112	0.0247	0.064	0.062	9900	0	0	0	0	1	-360	360;
+	17	113	0.00913	0.0301	0.00768	9900	0	0	0	0	1	-360	360;
+	32	113	0.0615	0.203	0.0518	9900	0	0	0	0	1	-360	360;
+	32	114	0.0135	0.0612	0.01628	9900	0	0	0	0	1	-360	360;
+	27	115	0.0164	0.0741	0.01972	9900	0	0	0	0	1	-360	360;
+	114	115	0.0023	0.0104	0.00276	9900	0	0	0	0	1	-360	360;
+	68	116	0.00034	0.00405	0.164	9900	0	0	0	0	1	-360	360;
+	12	117	0.0329	0.14	0.0358	9900	0	0	0	0	1	-360	360;
+	75	118	0.0145	0.0481	0.01198	9900	0	0	0	0	1	-360	360;
+	76	118	0.0164	0.0544	0.01356	9900	0	0	0	0	1	-360	360;
+];
+
+%%-----  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	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.0222222	20	0;
+	2	0	0	3	0.117647	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.0454545	20	0;
+	2	0	0	3	0.0318471	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	1.42857	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.526316	20	0;
+	2	0	0	3	0.0490196	20	0;
+	2	0	0	3	0.208333	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.0645161	20	0;
+	2	0	0	3	0.0625	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.0255754	20	0;
+	2	0	0	3	0.0255102	20	0;
+	2	0	0	3	0.0193648	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.0209644	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	2.5	20	0;
+	2	0	0	3	0.0164745	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.0396825	20	0;
+	2	0	0	3	0.25	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.277778	20	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+	2	0	0	3	0.01	40	0;
+];
