-
Notifications
You must be signed in to change notification settings - Fork 0
/
RUNHYBRID.m
50 lines (48 loc) · 17.4 KB
/
RUNHYBRID.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
MaxIteration=1000;
PopSize=10;
Run_no=1;% runs
% for i=1:23
i=102;
SOL_MRFO=[];
SOL_MRFO_PSO=[];
for j=1:Run_no;
FunIndex=i;
[BestX1,BestF1,HisBestF1]=MRFO(FunIndex,MaxIteration,PopSize);
[BestX3,BestF3,HisBestF3]=MRFO_PSO(FunIndex,MaxIteration,PopSize);
results_MRFO(j)=[BestF1];
results_MRFO_PSO(j)=[BestF3];
results_MRFO=results_MRFO';
results_MRFO_PSO=results_MRFO_PSO';
SOL_MRFO=[BestX1];
SOL_MRFO_PSO=[BestX3];
SOL_MRFO=[SOL_MRFO;SOL_MRFO];
SOL_MRFO_PSO=[SOL_MRFO_PSO;SOL_MRFO_PSO];
BEST_MRFO_PSO=min(results_MRFO_PSO);
BEST_MRFO=min(results_MRFO);
end
% BEST_ALL=[BEST_MRFO_PSO,BEST_MRFO_SCA BEST_MRFO];
% end
%% for battery paramters extraxtion using hybrid MRFO_PSO
% [BestX1,BestF1,HisBestF1]=MRFO_PSO(101,1000,50);
% [BestX2,BestF2,HisBestF2]=MRFO_PSO(102,1000,50);
% [BestX3,BestF3,HisBestF3]=MRFO_PSO(103,1000,50);
% % [BestX1,BestF1,HisBestF1]=MRFO(101,1000,50);
% % [BestX2,BestF2,HisBestF2]=MRFO(102,1000,50);
% % [BestX3,BestF3,HisBestF3]=MRFO(103,1000,50);
% I1=.44;
% V_mes1=[4.16370000000000,4.15110000000000,4.14170000000000,4.13220000000000,4.11960000000000,4.10390000000000,4.09450000000000,4.08190000000000,4.07240000000000,4.06610000000000,4.05350000000000,4.04720000000000,4.04090000000000,4.03460000000000,4.02830000000000,4.02200000000000,4.01570000000000,4.00630000000000,4,3.99370000000000,3.98740000000000,3.98110000000000,3.97480000000000,3.96850000000000,3.95910000000000,3.95280000000000,3.94650000000000,3.94020000000000,3.93390000000000,3.92760000000000,3.92130000000000,3.91500000000000,3.90870000000000,3.90240000000000,3.89920000000000,3.89610000000000,3.88980000000000,3.88660000000000,3.88040000000000,3.87410000000000,3.86780000000000,3.86150000000000,3.85520000000000,3.85200000000000,3.84890000000000,3.84570000000000,3.84260000000000,3.83940000000000,3.83630000000000,3.83310000000000,3.83000000000000,3.82680000000000,3.82370000000000,3.81740000000000,3.81420000000000,3.81110000000000,3.80790000000000,3.80480000000000,3.80160000000000,3.79850000000000,3.79530000000000,3.79220000000000,3.78900000000000,3.78590000000000,3.78270000000000,3.77960000000000,3.77640000000000,3.77330000000000,3.77020000000000,3.76700000000000,3.76390000000000,3.76070000000000,3.75760000000000,3.75440000000000,3.75130000000000,3.75130000000000,3.74810000000000,3.74500000000000,3.74180000000000,3.73870000000000,3.73550000000000,3.73240000000000,3.72920000000000,3.72920000000000,3.72920000000000,3.72610000000000,3.72290000000000,3.72290000000000,3.72290000000000,3.71980000000000,3.71660000000000,3.71350000000000,3.71350000000000,3.71350000000000,3.71350000000000,3.71030000000000,3.70720000000000,3.70720000000000,3.70400000000000,3.70400000000000,3.70090000000000,3.69770000000000,3.69770000000000,3.69460000000000,3.69140000000000,3.69140000000000,3.68830000000000,3.68830000000000,3.68830000000000,3.68510000000000,3.68200000000000,3.67880000000000,3.67570000000000,3.67250000000000,3.66940000000000,3.66620000000000,3.66310000000000,3.65990000000000,3.65680000000000,3.65370000000000,3.64740000000000,3.64110000000000,3.63790000000000,3.63160000000000,3.62530000000000,3.61900000000000,3.61270000000000,3.60960000000000,3.59700000000000,3.58440000000000,3.57490000000000,3.56550000000000,3.54970000000000,3.53090000000000,3.51200000000000,3.48680000000000,3.46160000000000,3.43950000000000,3.42380000000000,3.40490000000000,3.38600000000000,3.36400000000000,3.34190000000000,3.32300000000000,3.29790000000000,3.27900000000000,3.26010000000000,3.23800000000000,3.21280000000000,3.18770000000000,3.16250000000000,3.13730000000000,3.11840000000000,3.10260000000000,3.08380000000000,3.06800000000000,3.04910000000000,3.03020000000000,3.00820000000000,2.98300000000000,2.95780000000000,2.93260000000000,2.91370000000000,2.89480000000000,2.86650000000000,2.82560000000000,2.79090000000000,2.75000000000000];
% T1 =[0,0.00550000000000000,0.0166000000000000,0.0277000000000000,0.0443000000000000,0.0721000000000000,0.105300000000000,0.144100000000000,0.177400000000000,0.199600000000000,0.243900000000000,0.282700000000000,0.321500000000000,0.354800000000000,0.388000000000000,0.421300000000000,0.454500000000000,0.498900000000000,0.526600000000000,0.565400000000000,0.598700000000000,0.637500000000000,0.670700000000000,0.698400000000000,0.742800000000000,0.776100000000000,0.820400000000000,0.859200000000000,0.898000000000000,0.936800000000000,0.975600000000000,1.02000000000000,1.06430000000000,1.10860000000000,1.13640000000000,1.15850000000000,1.20290000000000,1.23060000000000,1.27490000000000,1.31930000000000,1.36360000000000,1.40800000000000,1.45230000000000,1.48000000000000,1.51330000000000,1.54100000000000,1.56870000000000,1.59650000000000,1.62420000000000,1.65190000000000,1.67960000000000,1.70730000000000,1.72950000000000,1.77380000000000,1.80160000000000,1.82370000000000,1.85140000000000,1.88470000000000,1.91240000000000,1.94010000000000,1.96780000000000,2.00110000000000,2.03990000000000,2.07870000000000,2.11750000000000,2.15630000000000,2.18960000000000,2.21730000000000,2.24500000000000,2.27270000000000,2.30600000000000,2.33370000000000,2.37800000000000,2.42790000000000,2.46670000000000,2.50550000000000,2.54430000000000,2.58310000000000,2.62200000000000,2.65520000000000,2.69960000000000,2.74940000000000,2.78820000000000,2.82710000000000,2.87140000000000,2.91570000000000,2.95450000000000,2.99330000000000,3.04320000000000,3.08760000000000,3.13190000000000,3.17630000000000,3.22060000000000,3.25940000000000,3.28710000000000,3.32040000000000,3.35920000000000,3.38140000000000,3.43130000000000,3.45340000000000,3.49220000000000,3.54210000000000,3.56430000000000,3.60860000000000,3.65850000000000,3.68070000000000,3.72510000000000,3.73610000000000,3.76390000000000,3.80820000000000,3.85260000000000,3.88580000000000,3.92460000000000,3.96340000000000,4.00780000000000,4.04100000000000,4.07980000000000,4.11860000000000,4.15740000000000,4.17960000000000,4.22950000000000,4.27380000000000,4.30160000000000,4.34590000000000,4.39020000000000,4.42900000000000,4.46780000000000,4.48450000000000,4.52880000000000,4.56760000000000,4.59530000000000,4.62860000000000,4.67290000000000,4.71180000000000,4.75060000000000,4.79490000000000,4.82820000000000,4.85590000000000,4.87250000000000,4.88910000000000,4.90580000000000,4.92240000000000,4.93900000000000,4.95010000000000,4.96670000000000,4.97780000000000,4.98890000000000,5,5.00550000000000,5.01660000000000,5.02770000000000,5.03880000000000,5.04430000000000,5.04990000000000,5.05540000000000,5.06100000000000,5.06650000000000,5.07210000000000,5.07760000000000,5.08310000000000,5.08870000000000,5.09420000000000,5.09980000000000,5.10530000000000,5.11090000000000,5.11640000000000,5.12200000000000,5.12750000000000];
% [V1,IAES1,RSS1,RMSE1]=Battery(BestX1(1),BestX1(2),BestX1(3),BestX1(4),BestX1(5),BestX1(6),V_mes1,T1,I1);
%
% I2=10;
% V_mes2=[3.42910000000000,3.40230000000000,3.37890000000000,3.35540000000000,3.33530000000000,3.30520000000000,3.28840000000000,3.27840000000000,3.27840000000000,3.27840000000000,3.27840000000000,3.27840000000000,3.27500000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.27170000000000,3.26830000000000,3.26830000000000,3.26830000000000,3.26830000000000,3.26830000000000,3.26830000000000,3.26830000000000,3.26830000000000,3.26830000000000,3.26830000000000,3.26500000000000,3.26500000000000,3.26500000000000,3.26500000000000,3.25490000000000,3.25490000000000,3.25490000000000,3.25490000000000,3.25490000000000,3.25490000000000,3.25490000000000,3.24820000000000,3.24490000000000,3.24490000000000,3.24490000000000,3.24490000000000,3.24490000000000,3.24490000000000,3.24490000000000,3.24150000000000,3.23480000000000,3.23480000000000,3.24150000000000,3.24150000000000,3.24150000000000,3.24150000000000,3.24150000000000,3.23820000000000,3.23480000000000,3.23480000000000,3.23480000000000,3.23480000000000,3.23820000000000,3.23480000000000,3.23480000000000,3.23480000000000,3.23480000000000,3.23150000000000,3.23150000000000,3.23150000000000,3.23150000000000,3.23150000000000,3.23150000000000,3.22480000000000,3.21810000000000,3.21810000000000,3.21810000000000,3.21810000000000,3.21810000000000,3.21810000000000,3.21470000000000,3.21470000000000,3.21470000000000,3.21140000000000,3.21140000000000,3.21140000000000,3.20470000000000,3.20470000000000,3.20130000000000,3.20130000000000,3.19800000000000,3.19800000000000,3.19460000000000,3.18790000000000,3.18460000000000,3.18460000000000,3.17790000000000,3.17450000000000,3.16780000000000,3.16110000000000,3.15780000000000,3.15110000000000,3.14440000000000,3.14100000000000,3.13430000000000,3.13100000000000,3.12760000000000,3.12090000000000,3.11090000000000,3.10420000000000,3.09080000000000,3.08070000000000,3.05730000000000,3.03380000000000,3.01370000000000,2.98360000000000,2.95340000000000,2.93330000000000,2.91660000000000,2.89980000000000,2.86970000000000,2.85290000000000,2.82610000000000,2.80940000000000,2.78260000000000,2.75580000000000,2.72900000000000,2.71220000000000,2.68540000000000,2.66530000000000,2.63520000000000,2.61170000000000,2.58160000000000,2.57150000000000,2.52130000000000,2.50450000000000,2.47100000000000,2.45430000000000,2.42750000000000,2.41410000000000,2.38730000000000,2.34710000000000,2.28340000000000,2.26000000000000,2.22650000000000,2.17960000000000,2.14940000000000,2.11930000000000,2.08580000000000,2.02550000000000,2.05560000000000,2];
% T2=[0,0.00910000000000000,0.0122000000000000,0.0213000000000000,0.0274000000000000,0.0365000000000000,0.0517000000000000,0.0760000000000000,0.0973000000000000,0.121700000000000,0.139900000000000,0.161200000000000,0.188600000000000,0.215900000000000,0.237200000000000,0.252400000000000,0.261600000000000,0.285900000000000,0.313300000000000,0.334500000000000,0.349800000000000,0.361900000000000,0.371000000000000,0.380200000000000,0.392300000000000,0.413600000000000,0.431900000000000,0.444000000000000,0.453200000000000,0.462300000000000,0.471400000000000,0.480500000000000,0.495700000000000,0.507900000000000,0.523100000000000,0.532200000000000,0.544400000000000,0.553500000000000,0.580900000000000,0.602200000000000,0.623500000000000,0.641700000000000,0.653900000000000,0.663000000000000,0.681300000000000,0.705600000000000,0.733000000000000,0.754300000000000,0.775500000000000,0.790800000000000,0.799900000000000,0.815100000000000,0.833300000000000,0.845500000000000,0.863700000000000,0.882000000000000,0.909400000000000,0.930700000000000,0.945900000000000,0.964100000000000,0.988400000000000,1.01580000000000,1.03710000000000,1.04930000000000,1.06450000000000,1.07660000000000,1.09180000000000,1.11010000000000,1.12230000000000,1.13140000000000,1.14660000000000,1.16180000000000,1.18000000000000,1.19220000000000,1.20130000000000,1.21350000000000,1.23780000000000,1.25000000000000,1.26520000000000,1.27740000000000,1.30470000000000,1.33210000000000,1.35340000000000,1.37170000000000,1.39290000000000,1.40820000000000,1.42030000000000,1.44160000000000,1.46590000000000,1.48720000000000,1.51160000000000,1.52070000000000,1.54810000000000,1.55410000000000,1.58150000000000,1.60890000000000,1.63020000000000,1.64840000000000,1.66360000000000,1.69100000000000,1.71840000000000,1.74570000000000,1.76700000000000,1.79440000000000,1.82180000000000,1.84310000000000,1.85830000000000,1.87960000000000,1.89170000000000,1.90690000000000,1.91610000000000,1.93130000000000,1.95860000000000,1.97080000000000,1.98910000000000,2.00730000000000,2.02860000000000,2.04080000000000,2.04990000000000,2.06200000000000,2.07420000000000,2.08030000000000,2.08330000000000,2.08640000000000,2.09550000000000,2.09850000000000,2.10160000000000,2.10460000000000,2.11070000000000,2.11370000000000,2.11980000000000,2.12290000000000,2.12590000000000,2.12900000000000,2.13500000000000,2.13810000000000,2.14420000000000,2.14420000000000,2.15020000000000,2.15020000000000,2.15330000000000,2.15940000000000,2.16240000000000,2.16240000000000,2.16550000000000,2.16850000000000,2.17760000000000,2.18070000000000,2.18370000000000,2.18980000000000,2.19280000000000,2.19890000000000,2.20190000000000,2.20500000000000,2.20500000000000,2.20800000000000];
%
% [V2,IAES2,RSS2,RMSE2]=Battery(BestX2(1),BestX2(2),BestX2(3),BestX2(4),BestX2(5),BestX2(6),V_mes2,T2,I2);
% I3=3;
% V_mes3=[16.1036000000000,16.0508000000000,15.9981000000000,15.9058000000000,15.8399000000000,15.8004000000000,15.7476000000000,15.6949000000000,15.6422000000000,15.6026000000000,15.5631000000000,15.5367000000000,15.5235000000000,15.4840000000000,15.4576000000000,15.4444000000000,15.4049000000000,15.3917000000000,15.3653000000000,15.3258000000000,15.2994000000000,15.2863000000000,15.2599000000000,15.2467000000000,15.2203000000000,15.2072000000000,15.1940000000000,15.1676000000000,15.1544000000000,15.1281000000000,15.1149000000000,15.0885000000000,15.0753000000000,15.0490000000000,15.0358000000000,15.0094000000000,14.9962000000000,14.9699000000000,14.9699000000000,14.9567000000000,14.9303000000000,14.9303000000000,14.9171000000000,14.8908000000000,14.8908000000000,14.8776000000000,14.8512000000000,14.8512000000000,14.8380000000000,14.8117000000000,14.8117000000000,14.7985000000000,14.7721000000000,14.7721000000000,14.7589000000000,14.7326000000000,14.7326000000000,14.7194000000000,14.6930000000000,14.6930000000000,14.6798000000000,14.6535000000000,14.6535000000000,14.6403000000000,14.6139000000000,14.6139000000000,14.6008000000000,14.5744000000000,14.5744000000000,14.5744000000000,14.5612000000000,14.5348000000000,14.5348000000000,14.5348000000000,14.5085000000000,14.4953000000000,14.4953000000000,14.4953000000000,14.4821000000000,14.4557000000000,14.4557000000000,14.4557000000000,14.4426000000000,14.4162000000000,14.4162000000000,14.4162000000000,14.4030000000000,14.3766000000000,14.3766000000000,14.3766000000000,14.3635000000000,14.3371000000000,14.3371000000000,14.3371000000000,14.3239000000000,14.2976000000000,14.2976000000000,14.2976000000000,14.2844000000000,14.2580000000000,14.2580000000000,14.2580000000000,14.2448000000000,14.2185000000000,14.2185000000000,14.2185000000000,14.2053000000000,14.1789000000000,14.1789000000000,14.1789000000000,14.1657000000000,14.1394000000000,14.1394000000000,14.1394000000000,14.1262000000000,14.0998000000000,14.0998000000000,14.0998000000000,14.0866000000000,14.0603000000000,14.0603000000000,14.0471000000000,14.0207000000000,14.0075000000000,13.9812000000000,13.9416000000000,13.9153000000000,13.8757000000000,13.8230000000000,13.7834000000000,13.7439000000000,13.6780000000000,13.5857000000000,13.4934000000000,13.4011000000000,13.3484000000000,13.2825000000000,13.1902000000000,13.1243000000000,13.0716000000000,12.9793000000000,12.8870000000000,12.8211000000000,12.7288000000000,12.6365000000000,12.5443000000000,12.4124000000000,12.4915000000000,12.3070000000000,12.2147000000000,12.1092000000000,12];
% T3=[0,0.00310000000000000,0.0154000000000000,0.0369000000000000,0.0554000000000000,0.0708000000000000,0.0923000000000000,0.113800000000000,0.135400000000000,0.153800000000000,0.175400000000000,0.193800000000000,0.209200000000000,0.230800000000000,0.246200000000000,0.261500000000000,0.283100000000000,0.304600000000000,0.326200000000000,0.347700000000000,0.372300000000000,0.387700000000000,0.409200000000000,0.424600000000000,0.446200000000000,0.461500000000000,0.476900000000000,0.495400000000000,0.520000000000000,0.541500000000000,0.563100000000000,0.584600000000000,0.609200000000000,0.630800000000000,0.655400000000000,0.676900000000000,0.698500000000000,0.716900000000000,0.735400000000000,0.750800000000000,0.772300000000000,0.784600000000000,0.800000000000000,0.821500000000000,0.840000000000000,0.855400000000000,0.876900000000000,0.898500000000000,0.913800000000000,0.935400000000000,0.953800000000000,0.969200000000000,0.990800000000000,1.01230000000000,1.03380000000000,1.05540000000000,1.07380000000000,1.09540000000000,1.11690000000000,1.13540000000000,1.16000000000000,1.18150000000000,1.20310000000000,1.22460000000000,1.24620000000000,1.26770000000000,1.28920000000000,1.31080000000000,1.32620000000000,1.34460000000000,1.36620000000000,1.38770000000000,1.40920000000000,1.42150000000000,1.44000000000000,1.45850000000000,1.47380000000000,1.48920000000000,1.51380000000000,1.53540000000000,1.55080000000000,1.56620000000000,1.58770000000000,1.60920000000000,1.62770000000000,1.64310000000000,1.66460000000000,1.68620000000000,1.70150000000000,1.72310000000000,1.74460000000000,1.76620000000000,1.77850000000000,1.80000000000000,1.82460000000000,1.84620000000000,1.86150000000000,1.88310000000000,1.90460000000000,1.92620000000000,1.94150000000000,1.96310000000000,1.98770000000000,2.00920000000000,2.02460000000000,2.04620000000000,2.06770000000000,2.08920000000000,2.10150000000000,2.12310000000000,2.14770000000000,2.16920000000000,2.18460000000000,2.20310000000000,2.22460000000000,2.24620000000000,2.25850000000000,2.27380000000000,2.29850000000000,2.31690000000000,2.33540000000000,2.35080000000000,2.37230000000000,2.39690000000000,2.41850000000000,2.44000000000000,2.45540000000000,2.47380000000000,2.49540000000000,2.51080000000000,2.52310000000000,2.54460000000000,2.56620000000000,2.58150000000000,2.60000000000000,2.60920000000000,2.61850000000000,2.62770000000000,2.63380000000000,2.63690000000000,2.64620000000000,2.65230000000000,2.65540000000000,2.66150000000000,2.66460000000000,2.67080000000000,2.67380000000000,2.67380000000000,2.67690000000000,2.68310000000000,2.68620000000000,2.68920000000000];
%
% [V3,IAES3,RSS3,RMSE3]=Battery(BestX3(1),BestX3(2),BestX3(3),BestX3(4),BestX3(5),BestX3(6),V_mes3,T3,I3);
% RSS=[RSS1;RSS2;RSS3];
%