├── EV-PSO Project Report.pdf ├── Project code ├── EPTcalculatorfinal.m ├── LoadDemandPlotter.m ├── PSOcurvePlotter.m ├── PSOtester.m └── obj2.m ├── README.md └── References ├── Decentralized EV charging.pdf ├── Energy efficient algorithm for EV charging with RES.pdf ├── EnergyInteractionBetweenBuildingsandVehicles.pdf ├── FULLTEXT01.pdf ├── Generic PSO Matlab.pdf ├── MOPSO.pdf ├── Multi EV charging smart grid PSO.pdf ├── PEV EMS with PSO.pdf ├── PEV Market drivers.pdf ├── PSO PEV strategy.pdf ├── PSO convergence analysis and parameter selection.pdf ├── PSO for EV driving.pdf ├── PSO research parameters.pdf ├── PSO with master and slave swarms.pdf ├── Real time charging with fuzzy PSO.pdf ├── Stochastic PEV HEMS.pdf ├── Unceratinities HEMS PEV PV.pdf └── project paper.pdf /EV-PSO Project Report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/EV-PSO Project Report.pdf -------------------------------------------------------------------------------- /Project code/EPTcalculatorfinal.m: -------------------------------------------------------------------------------- 1 | bpFinal=2*[0.8058 0.7322 0.3469 0.6069 -0.3441 0.5729 0.8030 0.2257 -0.0181 0 0 0 0 0.9888 1.1886 0.3673 0.5982 0.2853 0.3388 0.1422 0.2781 0.0430 -0.0221 -0.0748 -0.8167 -0.1902 -0.4846 -0.7461]; 2 | 3 | loadDemand=[3.811 4.132 3.962 3.981 3.868 3.83 3.811 3.736 3.66 3.585 3.509 3.434 3.321 3.264 3.189 3.151 3.208 3.226 3.189 3.208 3.302 3.491 3.736 3.868 3.811 3.792 3.906 4.255]; 4 | 5 | OP_demand=bpFinal+loadDemand; 6 | 7 | grid_price=[2.946 2.865 2.842 3.039 3.34 3.595 3.629 3.398 3.015 2.714 2.517 2.448 2.008 1.718 1.683 1.718 1.683 1.637 1.614 1.625 1.625 1.614 1.637 1.822 2.286 2.842 3.27 3.525]; 8 | 9 | ept=zeros(1,28); 10 | soc=zeros(1,28); 11 | 12 | for a=1:28 13 | if(a==1) 14 | soc(a)=0.4+((OP_demand(a))/54); 15 | else 16 | soc(a)=soc(a-1)+((OP_demand(a))/54); 17 | end 18 | end 19 | 20 | for i=1:28 21 | if(bpFinal(i)>0) 22 | if(i==1) 23 | ept(i)=(3*0.4*54 + bpFinal(i)*grid_price(i))/(0.4*54+bpFinal(i)); 24 | else 25 | ept(i)=(ept(i-1)*soc(i-1)*54 + bpFinal(i)*grid_price(i))/(soc(i)*54+bpFinal(i)); 26 | end 27 | else 28 | ept(i)=ept(i-1); 29 | end 30 | end 31 | 32 | %%reference check 33 | %ref=zeros(1,28); 34 | %r=zeros(1,28); 35 | %for i=1:28 36 | % if(grid_price(i)>EPT(i)) 37 | % r=0; 38 | % else 39 | % r=1; 40 | % end 41 | %end 42 | 43 | x = 0:0.5:13.5; 44 | y1 = [3 2.97 2.95 2.96 3.006 3.07 3.13 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16 3.16]; 45 | plot(x,y1) 46 | title('PEV Energy Price Tag Comaprison') 47 | 48 | hold on 49 | 50 | plot(x,ept) 51 | 52 | xlabel('Time'); 53 | ylabel('PEV EPT'); 54 | legend('Without Optimization', 'With Optimization'); 55 | grid on; 56 | 57 | 58 | hold off 59 | 60 | -------------------------------------------------------------------------------- /Project code/LoadDemandPlotter.m: -------------------------------------------------------------------------------- 1 | bp1=[-1.4515 3.7202 3.2495 -0.4211 0.5138 -0.4088 2.5714 -1.2155 -2.4577 0.2387 3.9377 -3.5891 2.9884 4.7521 1.5966 0.8434 2.7935 -1.2133 -0.8841 0.7054 -2.4292 -0.4390 0.0941 -2.6951]; 2 | 3 | bp2=[1.2406 0.3841 -0.6282 1.0360 1.9452 -0.5125 2.1012 0.3542 0.3232 3.7982 -1.8558 3.4615 1.9710 -0.3405 0.6249 -1.7308 1.3714 -0.7060 0.9401 2.4691 -3.3259 -1.2803 -0.4955 -0.3452]; 4 | 5 | bp3=[5.4999 -0.9956 -0.5663 4.6212 3.7876 1.5395 2.5201 -1.6724 -0.9824 5.1236 -1.5434 0.2796 2.2708 -1.3253 0.9628 1.1296 -1.2004 -0.8721 1.3671 -1.7229 -1.6127 2.4786 -0.7021 -3.0431]; 6 | 7 | bp4=[1.0045 -2.1109 -0.2811 3.7085 -1.0655 4.0989 4.4326 3.5243 1.0298 1.0964 1.0919 1.7347 -1.6285 -0.8672 0.9261 -0.5108 -0.1116 2.6343 -0.8541 -0.1812 0.2413 -3.3556 -0.1479 -3.6089]; 8 | 9 | bp5=[3.1533 3.4558 -0.3017 3.8477 -2.8085 0.9562 0.6927 2.0246 -1.5794 -2.0568 5.4987 -0.4386 4.3104 -0.8739 -0.8431 -2.5644 -0.0664 0.8122 4.2481 -2.7544 -2.0990 -1.1769 0.5382 -1.1749]; 10 | 11 | bp6=[0.6328 -0.8028 -0.9890 2.9224 0.3078 -1.7896 -0.2408 -0.0298 4.7362 3.9217 3.3871 2.0878 1.0452 1.7399 0.9795 0.5742 -0.1007 -3.3345 -1.0192 2.0025 -2.1207 -0.1374 -2.0999 -0.8726]; 12 | 13 | bp7=[2.8588 2.0469 2.2740 -2.2996 -2.3546 1.4680 -0.6776 -0.0716 0.4387 0.5001 4.7146 2.1299 1.6760 0.3134 -0.3575 1.4184 -0.9162 0.8483 -0.7857 2.0028 -1.7315 -0.2921 -1.7396 -0.6639]; 14 | 15 | bp8=[1.1482 3.0562 -0.2674 -1.7453 -2.9963 4.3301 2.6266 -0.0175 -0.4760 3.8908 3.4201 -0.9552 0.1774 -0.4499 1.7849 1.1326 1.3681 0.3152 -0.8711 -0.9779 -1.5391 0.1463 -0.7164 -1.5843]; 16 | 17 | bp9=[-0.9967 3.4438 3.0149 -1.4147 -2.7641 3.0515 2.0220 -1.9655 0.9536 3.4764 2.6462 0.5366 0.0604 -0.7413 0.7789 -0.3358 1.1364 3.1408 -2.3165 -2.0524 -0.3715 1.6065 -1.7821 -0.3275]; 18 | 19 | bp10=[3.0267 2.4457 1.4335 1.8834 -1.4475 -1.2747 0.0118 3.5836 -2.3478 -0.2132 2.4754 2.0994 -0.9075 3.4994 0.3223 2.8877 1.2875 -0.7659 -0.2657 -0.9876 -1.3448 -1.3549 -2.6408 -0.6059]; 20 | 21 | bp=(bp1+bp2+bp3+bp4+bp5+bp6+bp7+bp8+bp9+bp10)/20 22 | 23 | bpFinal=2*[0.8058 0.7322 0.3469 0.6069 -0.3441 0.5729 0.8030 0.2257 -0.0181 0 0 0 0 0.9888 1.1886 0.3673 0.5982 0.2853 0.3388 0.1422 0.2781 0.0430 -0.0221 -0.0748 -0.8167 -0.1902 -0.4846 -0.7461]; 24 | 25 | loadDemand=[3.811 4.132 3.962 3.981 3.868 3.83 3.811 3.736 3.66 3.585 3.509 3.434 3.321 3.264 3.189 3.151 3.208 3.226 3.189 3.208 3.302 3.491 3.736 3.868 3.811 3.792 3.906 4.255]; 26 | 27 | OP_demand=bpFinal+loadDemand; 28 | 29 | x = 0:0.5:13.5; 30 | y1 = [8.811 9.132 8.962 8.981 8.868 8.83 8.811 3.736 3.66 3.585 3.509 3.434 3.377 3.264 3.189 3.151 3.208 3.226 3.189 3.208 3.302 3.491 3.736 3.868 3.811 3.792 3.906 4.255]; 31 | plot(x,y1/2) 32 | title('Energy Grid demand comparison curve') 33 | 34 | hold on 35 | 36 | plot(x,OP_demand/2) 37 | 38 | xlabel('Time'); 39 | ylabel('Grid Demand in Kwhr'); 40 | legend('Without Optimization', 'With Optimization'); 41 | grid on; 42 | 43 | hold off -------------------------------------------------------------------------------- /Project code/PSOcurvePlotter.m: -------------------------------------------------------------------------------- 1 | t=1:1:100; 2 | bc1=[280.2651 3 | 279.7894 4 | 279.7894 5 | 279.7894 6 | 279.7894 7 | 279.7894 8 | 279.7894 9 | 279.7894 10 | 279.7266 11 | 279.7266 12 | 279.7261 13 | 279.7261 14 | 279.7261 15 | 279.7261 16 | 279.7261 17 | 279.7115 18 | 279.7115 19 | 279.7115 20 | 279.7115 21 | 279.7115 22 | 279.7115 23 | 279.7115 24 | 279.7044 25 | 279.7044 26 | 279.7044 27 | 279.7018 28 | 279.7018 29 | 279.7018 30 | 279.7018 31 | 279.7018 32 | 279.7018 33 | 279.7018 34 | 279.7018 35 | 279.7018 36 | 279.7018 37 | 279.7018 38 | 279.6979 39 | 279.6979 40 | 279.6979 41 | 279.6979 42 | 279.6979 43 | 279.6979 44 | 279.6979 45 | 279.6979 46 | 279.6979 47 | 279.6979 48 | 279.6979 49 | 279.6979 50 | 279.6979 51 | 279.6974 52 | 279.6974 53 | 279.6974 54 | 279.6974 55 | 279.6974 56 | 279.6968 57 | 279.6967 58 | 279.6967 59 | 279.6967 60 | 279.6967 61 | 279.6967 62 | 279.6967 63 | 279.6967 64 | 279.6967 65 | 279.6967 66 | 279.6967 67 | 279.6967 68 | 279.6967 69 | 279.6967 70 | 279.6967 71 | 279.6967 72 | 279.6967 73 | 279.6967 74 | 279.6967 75 | 279.6967 76 | 279.6967 77 | 279.6967 78 | 279.6967 79 | 279.6967 80 | 279.6967 81 | 279.6967 82 | 279.6967 83 | 279.6967 84 | 279.6967 85 | 279.6967 86 | 279.6967 87 | 279.6967 88 | 279.6967 89 | 279.6967 90 | 279.6967 91 | 279.6967 92 | 279.6967 93 | 279.6967 94 | 279.6967 95 | 279.6967 96 | 279.6967 97 | 279.6967 98 | 279.6967 99 | 279.6967 100 | 279.6967 101 | 279.6967]; 102 | 103 | figure; 104 | semilogy(t,bc1/2,'LineWidth',2) 105 | xlabel('Iteration'); 106 | ylabel('Best Cost'); 107 | title('Optimization curve'); 108 | grid on; 109 | 110 | 111 | 112 | bc2=[279.7668 113 | 279.7668 114 | 279.7668 115 | 279.7668 116 | 279.7668 117 | 279.7668 118 | 279.7668 119 | 279.7668 120 | 279.7668 121 | 279.7048 122 | 279.7048 123 | 279.7048 124 | 279.7048 125 | 279.7048 126 | 279.7048 127 | 279.7048 128 | 279.7048 129 | 279.7048 130 | 279.7048 131 | 279.7048 132 | 279.7048 133 | 279.7048 134 | 279.7048 135 | 279.7048 136 | 279.7048 137 | 279.6996 138 | 279.6996 139 | 279.6996 140 | 279.6996 141 | 279.6996 142 | 279.6996 143 | 279.6964 144 | 279.6964 145 | 279.6964 146 | 279.6963 147 | 279.6963 148 | 279.6963 149 | 279.6963 150 | 279.6962 151 | 279.6961 152 | 279.6961 153 | 279.6961 154 | 279.6961 155 | 279.6961 156 | 279.6961 157 | 279.6961 158 | 279.6961 159 | 279.6961 160 | 279.6961 161 | 279.6961 162 | 279.6961 163 | 279.6961 164 | 279.6961 165 | 279.6961 166 | 279.6961 167 | 279.6961 168 | 279.6961 169 | 279.6961 170 | 279.6961 171 | 279.6961 172 | 279.6961 173 | 279.6961 174 | 279.6961 175 | 279.6961 176 | 279.6961 177 | 279.6961 178 | 279.6961 179 | 279.6961 180 | 279.6961 181 | 279.6961 182 | 279.6961 183 | 279.6961 184 | 279.6961 185 | 279.6961 186 | 279.6961 187 | 279.6961 188 | 279.696 189 | 279.696 190 | 279.696 191 | 279.696 192 | 279.696 193 | 279.696 194 | 279.696 195 | 279.696 196 | 279.696 197 | 279.696 198 | 279.696 199 | 279.696 200 | 279.696 201 | 279.696 202 | 279.696 203 | 279.696 204 | 279.696 205 | 279.696 206 | 279.696 207 | 279.696 208 | 279.696 209 | 279.696 210 | 279.696 211 | 279.696]; 212 | 213 | figure; 214 | semilogy(t,bc2/2,'LineWidth',2) 215 | xlabel('Iteration'); 216 | ylabel('Best Cost'); 217 | title('Optimization curve'); 218 | grid on; 219 | 220 | 221 | 222 | bc3=[279.7153 223 | 279.7153 224 | 279.7153 225 | 279.7153 226 | 279.7153 227 | 279.7153 228 | 279.7153 229 | 279.7153 230 | 279.7073 231 | 279.7073 232 | 279.7073 233 | 279.7046 234 | 279.7046 235 | 279.7046 236 | 279.7046 237 | 279.7046 238 | 279.7046 239 | 279.7046 240 | 279.7046 241 | 279.7046 242 | 279.7046 243 | 279.7046 244 | 279.7046 245 | 279.7046 246 | 279.7046 247 | 279.7046 248 | 279.7046 249 | 279.7046 250 | 279.7 251 | 279.7 252 | 279.7 253 | 279.7 254 | 279.6977 255 | 279.6977 256 | 279.6961 257 | 279.6961 258 | 279.6961 259 | 279.6961 260 | 279.6961 261 | 279.696 262 | 279.696 263 | 279.696 264 | 279.696 265 | 279.696 266 | 279.696 267 | 279.696 268 | 279.696 269 | 279.696 270 | 279.696 271 | 279.696 272 | 279.696 273 | 279.696 274 | 279.696 275 | 279.696 276 | 279.696 277 | 279.696 278 | 279.696 279 | 279.696 280 | 279.696 281 | 279.696 282 | 279.696 283 | 279.696 284 | 279.696 285 | 279.696 286 | 279.696 287 | 279.696 288 | 279.696 289 | 279.696 290 | 279.696 291 | 279.696 292 | 279.696 293 | 279.696 294 | 279.696 295 | 279.696 296 | 279.696 297 | 279.696 298 | 279.696 299 | 279.696 300 | 279.696 301 | 279.696 302 | 279.696 303 | 279.696 304 | 279.696 305 | 279.696 306 | 279.696 307 | 279.696 308 | 279.696 309 | 279.696 310 | 279.696 311 | 279.696 312 | 279.696 313 | 279.696 314 | 279.696 315 | 279.696 316 | 279.696 317 | 279.696 318 | 279.696 319 | 279.696 320 | 279.696 321 | 279.696]; 322 | 323 | figure; 324 | semilogy(t,bc3/2,'LineWidth',2) 325 | xlabel('Iteration'); 326 | ylabel('Best Cost'); 327 | title('Optimization curve'); 328 | grid on; 329 | 330 | 331 | 332 | bc4=[279.7111 333 | 279.7111 334 | 279.7111 335 | 279.7111 336 | 279.7111 337 | 279.7111 338 | 279.7111 339 | 279.7103 340 | 279.7103 341 | 279.7035 342 | 279.7035 343 | 279.7035 344 | 279.7035 345 | 279.7035 346 | 279.7035 347 | 279.7035 348 | 279.7035 349 | 279.7035 350 | 279.7035 351 | 279.7035 352 | 279.7022 353 | 279.7022 354 | 279.7022 355 | 279.6997 356 | 279.6997 357 | 279.6997 358 | 279.6997 359 | 279.6997 360 | 279.6997 361 | 279.6973 362 | 279.6973 363 | 279.6973 364 | 279.6973 365 | 279.6973 366 | 279.6973 367 | 279.6973 368 | 279.6973 369 | 279.6973 370 | 279.6973 371 | 279.6973 372 | 279.6973 373 | 279.6973 374 | 279.6973 375 | 279.6973 376 | 279.6973 377 | 279.6965 378 | 279.6962 379 | 279.6961 380 | 279.6961 381 | 279.6961 382 | 279.6961 383 | 279.6961 384 | 279.6961 385 | 279.6961 386 | 279.6961 387 | 279.6961 388 | 279.6961 389 | 279.6961 390 | 279.6961 391 | 279.6961 392 | 279.6961 393 | 279.6961 394 | 279.6961 395 | 279.6961 396 | 279.6961 397 | 279.6961 398 | 279.6961 399 | 279.6961 400 | 279.6961 401 | 279.6961 402 | 279.6961 403 | 279.6961 404 | 279.6961 405 | 279.6961 406 | 279.6961 407 | 279.6961 408 | 279.6961 409 | 279.6961 410 | 279.6961 411 | 279.6961 412 | 279.6961 413 | 279.6961 414 | 279.6961 415 | 279.6961 416 | 279.6961 417 | 279.6961 418 | 279.6961 419 | 279.6961 420 | 279.6961 421 | 279.6961 422 | 279.6961 423 | 279.6961 424 | 279.6961 425 | 279.6961 426 | 279.6961 427 | 279.6961 428 | 279.6961 429 | 279.6961 430 | 279.6961 431 | 279.6961]; 432 | 433 | figure; 434 | semilogy(t,bc4/2,'LineWidth',2) 435 | xlabel('Iteration'); 436 | ylabel('Best Cost'); 437 | title('Optimization curve'); 438 | grid on; 439 | 440 | 441 | 442 | bc5=[279.7052 443 | 279.7052 444 | 279.7052 445 | 279.7052 446 | 279.7052 447 | 279.7052 448 | 279.7052 449 | 279.7052 450 | 279.7052 451 | 279.7052 452 | 279.7052 453 | 279.6986 454 | 279.6986 455 | 279.6986 456 | 279.6986 457 | 279.6981 458 | 279.6981 459 | 279.6981 460 | 279.6981 461 | 279.6981 462 | 279.6981 463 | 279.6981 464 | 279.6981 465 | 279.6981 466 | 279.6981 467 | 279.6981 468 | 279.6981 469 | 279.6981 470 | 279.6981 471 | 279.6981 472 | 279.6981 473 | 279.6981 474 | 279.6981 475 | 279.6965 476 | 279.6965 477 | 279.6965 478 | 279.6965 479 | 279.6965 480 | 279.6961 481 | 279.6961 482 | 279.6961 483 | 279.6961 484 | 279.6961 485 | 279.6961 486 | 279.6961 487 | 279.6961 488 | 279.6961 489 | 279.6961 490 | 279.6961 491 | 279.6961 492 | 279.6961 493 | 279.6961 494 | 279.6961 495 | 279.6961 496 | 279.6961 497 | 279.6961 498 | 279.6961 499 | 279.6961 500 | 279.6961 501 | 279.6961 502 | 279.6961 503 | 279.6961 504 | 279.6961 505 | 279.6961 506 | 279.6961 507 | 279.6961 508 | 279.6961 509 | 279.6961 510 | 279.6961 511 | 279.6961 512 | 279.6961 513 | 279.6961 514 | 279.6961 515 | 279.6961 516 | 279.6961 517 | 279.6961 518 | 279.6961 519 | 279.6961 520 | 279.6961 521 | 279.6961 522 | 279.6961 523 | 279.6961 524 | 279.6961 525 | 279.6961 526 | 279.6961 527 | 279.6961 528 | 279.6961 529 | 279.6961 530 | 279.6961 531 | 279.6961 532 | 279.6961 533 | 279.6961 534 | 279.6961 535 | 279.696 536 | 279.696 537 | 279.696 538 | 279.696 539 | 279.696 540 | 279.696 541 | 279.696]; 542 | 543 | figure; 544 | semilogy(t,bc5/2,'LineWidth',2) 545 | xlabel('Iteration'); 546 | ylabel('Best Cost'); 547 | title('Optimization curve'); 548 | grid on; 549 | 550 | 551 | 552 | bc6=[281.3412 553 | 279.8557 554 | 279.8557 555 | 279.8557 556 | 279.7451 557 | 279.7451 558 | 279.7451 559 | 279.7451 560 | 279.7451 561 | 279.7451 562 | 279.7451 563 | 279.7451 564 | 279.7451 565 | 279.7451 566 | 279.7451 567 | 279.7451 568 | 279.7451 569 | 279.7451 570 | 279.7451 571 | 279.7451 572 | 279.7451 573 | 279.7451 574 | 279.7451 575 | 279.7451 576 | 279.7195 577 | 279.7195 578 | 279.7195 579 | 279.7195 580 | 279.7195 581 | 279.7195 582 | 279.7195 583 | 279.7195 584 | 279.6971 585 | 279.6971 586 | 279.6971 587 | 279.6971 588 | 279.6971 589 | 279.6971 590 | 279.6971 591 | 279.6971 592 | 279.6971 593 | 279.6971 594 | 279.6966 595 | 279.6966 596 | 279.6966 597 | 279.6965 598 | 279.6965 599 | 279.6964 600 | 279.6964 601 | 279.6964 602 | 279.6964 603 | 279.6964 604 | 279.6964 605 | 279.6964 606 | 279.6964 607 | 279.6964 608 | 279.6964 609 | 279.6964 610 | 279.6964 611 | 279.6964 612 | 279.6964 613 | 279.6964 614 | 279.6964 615 | 279.6964 616 | 279.6964 617 | 279.6964 618 | 279.6964 619 | 279.6964 620 | 279.6964 621 | 279.6964 622 | 279.6964 623 | 279.6964 624 | 279.6964 625 | 279.6964 626 | 279.6964 627 | 279.6964 628 | 279.6964 629 | 279.6964 630 | 279.6964 631 | 279.6964 632 | 279.6964 633 | 279.6964 634 | 279.6964 635 | 279.6964 636 | 279.6964 637 | 279.6964 638 | 279.6964 639 | 279.6964 640 | 279.6964 641 | 279.6964 642 | 279.6964 643 | 279.6964 644 | 279.6964 645 | 279.6964 646 | 279.6964 647 | 279.6964 648 | 279.6964 649 | 279.6964 650 | 279.6964 651 | 279.6964]; 652 | 653 | figure; 654 | semilogy(t,bc6/2,'LineWidth',2) 655 | xlabel('Iteration'); 656 | ylabel('Best Cost'); 657 | title('Optimization curve'); 658 | grid on; 659 | 660 | 661 | 662 | bc7=[283.3713 663 | 281.1669 664 | 280.0999 665 | 279.8039 666 | 279.7144 667 | 279.7144 668 | 279.7144 669 | 279.7144 670 | 279.7144 671 | 279.7144 672 | 279.7144 673 | 279.7144 674 | 279.7144 675 | 279.7078 676 | 279.7078 677 | 279.7029 678 | 279.7029 679 | 279.7029 680 | 279.7029 681 | 279.7029 682 | 279.7029 683 | 279.7029 684 | 279.7029 685 | 279.7029 686 | 279.7029 687 | 279.7029 688 | 279.7029 689 | 279.7029 690 | 279.7029 691 | 279.7029 692 | 279.7029 693 | 279.7029 694 | 279.7029 695 | 279.7029 696 | 279.701 697 | 279.6981 698 | 279.6972 699 | 279.6968 700 | 279.6967 701 | 279.6967 702 | 279.6967 703 | 279.6967 704 | 279.6967 705 | 279.6967 706 | 279.6967 707 | 279.6967 708 | 279.6967 709 | 279.6967 710 | 279.6967 711 | 279.6967 712 | 279.6967 713 | 279.6967 714 | 279.6967 715 | 279.6967 716 | 279.6967 717 | 279.6967 718 | 279.6967 719 | 279.6967 720 | 279.6967 721 | 279.6967 722 | 279.6967 723 | 279.6967 724 | 279.6967 725 | 279.696 726 | 279.696 727 | 279.696 728 | 279.696 729 | 279.696 730 | 279.696 731 | 279.696 732 | 279.696 733 | 279.696 734 | 279.696 735 | 279.696 736 | 279.696 737 | 279.696 738 | 279.696 739 | 279.696 740 | 279.696 741 | 279.696 742 | 279.696 743 | 279.696 744 | 279.696 745 | 279.696 746 | 279.696 747 | 279.696 748 | 279.696 749 | 279.696 750 | 279.696 751 | 279.696 752 | 279.696 753 | 279.696 754 | 279.696 755 | 279.696 756 | 279.696 757 | 279.696 758 | 279.696 759 | 279.696 760 | 279.696 761 | 279.696]; 762 | 763 | figure; 764 | semilogy(t,bc7/2,'LineWidth',2) 765 | xlabel('Iteration'); 766 | ylabel('Best Cost'); 767 | title('Optimization curve'); 768 | grid on; 769 | 770 | 771 | 772 | bc8=[279.8364 773 | 279.7612 774 | 279.7612 775 | 279.7612 776 | 279.7612 777 | 279.7612 778 | 279.7612 779 | 279.7612 780 | 279.737 781 | 279.737 782 | 279.737 783 | 279.737 784 | 279.737 785 | 279.737 786 | 279.737 787 | 279.7365 788 | 279.7365 789 | 279.7365 790 | 279.7365 791 | 279.7365 792 | 279.7365 793 | 279.7365 794 | 279.7248 795 | 279.7248 796 | 279.7248 797 | 279.7248 798 | 279.7042 799 | 279.7042 800 | 279.7042 801 | 279.7042 802 | 279.7042 803 | 279.7042 804 | 279.7042 805 | 279.7042 806 | 279.7014 807 | 279.7014 808 | 279.7014 809 | 279.7014 810 | 279.7014 811 | 279.7014 812 | 279.7014 813 | 279.7014 814 | 279.6968 815 | 279.6968 816 | 279.6968 817 | 279.6968 818 | 279.6968 819 | 279.6968 820 | 279.6968 821 | 279.6968 822 | 279.6968 823 | 279.6968 824 | 279.6968 825 | 279.6968 826 | 279.6968 827 | 279.6968 828 | 279.6964 829 | 279.6961 830 | 279.696 831 | 279.696 832 | 279.696 833 | 279.696 834 | 279.696 835 | 279.696 836 | 279.696 837 | 279.696 838 | 279.696 839 | 279.696 840 | 279.696 841 | 279.696 842 | 279.696 843 | 279.696 844 | 279.696 845 | 279.696 846 | 279.696 847 | 279.696 848 | 279.696 849 | 279.696 850 | 279.696 851 | 279.696 852 | 279.696 853 | 279.696 854 | 279.696 855 | 279.696 856 | 279.696 857 | 279.696 858 | 279.696 859 | 279.696 860 | 279.696 861 | 279.696 862 | 279.696 863 | 279.696 864 | 279.696 865 | 279.696 866 | 279.696 867 | 279.696 868 | 279.696 869 | 279.696 870 | 279.696 871 | 279.696]; 872 | 873 | figure; 874 | semilogy(t,bc8/2,'LineWidth',2) 875 | xlabel('Iteration'); 876 | ylabel('Best Cost'); 877 | title('Optimization curve'); 878 | grid on; 879 | 880 | 881 | 882 | bc9=[279.8006 883 | 279.708 884 | 279.708 885 | 279.708 886 | 279.708 887 | 279.708 888 | 279.708 889 | 279.708 890 | 279.708 891 | 279.708 892 | 279.708 893 | 279.708 894 | 279.708 895 | 279.7024 896 | 279.7024 897 | 279.7024 898 | 279.7024 899 | 279.7024 900 | 279.7024 901 | 279.7024 902 | 279.7024 903 | 279.7024 904 | 279.7024 905 | 279.7024 906 | 279.7024 907 | 279.7024 908 | 279.7024 909 | 279.7024 910 | 279.7024 911 | 279.7024 912 | 279.6979 913 | 279.6979 914 | 279.6979 915 | 279.6979 916 | 279.6965 917 | 279.6965 918 | 279.6965 919 | 279.6965 920 | 279.6962 921 | 279.6961 922 | 279.696 923 | 279.696 924 | 279.696 925 | 279.696 926 | 279.696 927 | 279.696 928 | 279.696 929 | 279.696 930 | 279.696 931 | 279.696 932 | 279.696 933 | 279.696 934 | 279.696 935 | 279.696 936 | 279.696 937 | 279.696 938 | 279.696 939 | 279.696 940 | 279.696 941 | 279.696 942 | 279.696 943 | 279.696 944 | 279.696 945 | 279.696 946 | 279.696 947 | 279.696 948 | 279.696 949 | 279.696 950 | 279.696 951 | 279.696 952 | 279.696 953 | 279.696 954 | 279.696 955 | 279.696 956 | 279.696 957 | 279.696 958 | 279.696 959 | 279.696 960 | 279.696 961 | 279.696 962 | 279.696 963 | 279.696 964 | 279.696 965 | 279.696 966 | 279.696 967 | 279.696 968 | 279.696 969 | 279.696 970 | 279.696 971 | 279.696 972 | 279.696 973 | 279.696 974 | 279.696 975 | 279.696 976 | 279.696 977 | 279.696 978 | 279.696 979 | 279.696 980 | 279.696 981 | 279.696]; 982 | 983 | figure; 984 | semilogy(t,bc9/2,'LineWidth',2) 985 | xlabel('Iteration'); 986 | ylabel('Best Cost'); 987 | title('Optimization curve'); 988 | grid on; 989 | 990 | 991 | bc10=[279.8299 992 | 279.8299 993 | 279.7614 994 | 279.7614 995 | 279.7614 996 | 279.7614 997 | 279.7614 998 | 279.7614 999 | 279.7614 1000 | 279.7614 1001 | 279.7614 1002 | 279.7388 1003 | 279.7388 1004 | 279.7173 1005 | 279.7173 1006 | 279.7173 1007 | 279.7173 1008 | 279.7173 1009 | 279.7033 1010 | 279.7033 1011 | 279.7033 1012 | 279.7033 1013 | 279.7033 1014 | 279.7033 1015 | 279.7033 1016 | 279.6963 1017 | 279.6963 1018 | 279.6963 1019 | 279.6963 1020 | 279.6963 1021 | 279.6963 1022 | 279.6963 1023 | 279.6963 1024 | 279.6963 1025 | 279.6963 1026 | 279.6963 1027 | 279.6963 1028 | 279.6963 1029 | 279.6963 1030 | 279.6963 1031 | 279.6963 1032 | 279.6963 1033 | 279.6963 1034 | 279.6962 1035 | 279.6961 1036 | 279.6961 1037 | 279.6961 1038 | 279.6961 1039 | 279.6961 1040 | 279.6961 1041 | 279.6961 1042 | 279.6961 1043 | 279.6961 1044 | 279.6961 1045 | 279.6961 1046 | 279.6961 1047 | 279.6961 1048 | 279.6961 1049 | 279.6961 1050 | 279.6961 1051 | 279.6961 1052 | 279.6961 1053 | 279.6961 1054 | 279.6961 1055 | 279.6961 1056 | 279.6961 1057 | 279.6961 1058 | 279.6961 1059 | 279.6961 1060 | 279.6961 1061 | 279.6961 1062 | 279.6961 1063 | 279.6961 1064 | 279.6961 1065 | 279.6961 1066 | 279.696 1067 | 279.696 1068 | 279.696 1069 | 279.696 1070 | 279.696 1071 | 279.696 1072 | 279.696 1073 | 279.696 1074 | 279.696 1075 | 279.696 1076 | 279.696 1077 | 279.696 1078 | 279.696 1079 | 279.696 1080 | 279.696 1081 | 279.696 1082 | 279.696 1083 | 279.696 1084 | 279.696 1085 | 279.696 1086 | 279.696 1087 | 279.696 1088 | 279.696 1089 | 279.696 1090 | 279.696]; 1091 | 1092 | figure; 1093 | semilogy(t,bc10/2,'LineWidth',2) 1094 | xlabel('Iteration'); 1095 | ylabel('Best Cost'); 1096 | title('Optimization curve'); 1097 | grid on; 1098 | 1099 | bbc=(bc1+bc2+bc3+bc4+bc5+bc6+bc7+bc8+bc9+bc10)/10; 1100 | 1101 | figure; 1102 | semilogy(t,bbc/2,'LineWidth',2) 1103 | xlabel('Iteration'); 1104 | ylabel('Best Cost'); 1105 | title('Overall Optimization curve'); 1106 | grid on; 1107 | 1108 | -------------------------------------------------------------------------------- /Project code/PSOtester.m: -------------------------------------------------------------------------------- 1 | clc; 2 | clear; 3 | close all; 4 | 5 | %% Problem Definition 6 | 7 | CostFunction=@(x) obj2(x); % Cost Function 8 | 9 | nVar=24; % Number of Decision Variables 10 | 11 | VarSize=[1 nVar]; % Size of Decision Variables Matrix 12 | 13 | VarMin= -3.5; % Lower Bound of Variables 14 | VarMax= 5.5; % Upper Bound of Variables 15 | 16 | 17 | %% PSO Parameters 18 | 19 | MaxIt=100; % Maximum Number of Iterations 20 | 21 | nPop=50; % Population Size (Swarm Size) 22 | 23 | % PSO Parameters 24 | w=1; % Inertia Weight 25 | wdamp=0.97; % Inertia Weight Damping Ratio 26 | c1=1.5; % Personal Learning Coefficient 27 | c2=2.0; % Global Learning Coefficient 28 | 29 | % Velocity Limits 30 | VelMax=0.2*(VarMax-VarMin); 31 | VelMin=-VelMax; 32 | 33 | %% Initialization 34 | 35 | empty_particle.Position=[]; 36 | empty_particle.Cost=[]; 37 | empty_particle.Velocity=[]; 38 | empty_particle.Best.Position=[]; 39 | empty_particle.Best.Cost=[]; 40 | 41 | particle=repmat(empty_particle,nPop,1); 42 | 43 | GlobalBest.Cost=inf; 44 | 45 | for i=1:nPop 46 | 47 | x=1; 48 | while x==1 49 | x=0; 50 | % Initialize Position 51 | particle(i).Position=unifrnd(VarMin,VarMax,VarSize); 52 | 53 | soc=zeros(1, nVar); 54 | 55 | % State of charge calculation 56 | for a=1:nVar 57 | if(a==1) 58 | soc(a)=0.4+((particle(i).Position(a))/54); 59 | else 60 | soc(a)=soc(a-1)+((particle(i).Position(a))/54); 61 | end 62 | end 63 | % State of charge limitation 64 | for a=1:nVar 65 | if(soc(a)>0.8) 66 | x=1; 67 | break; 68 | end 69 | end 70 | for a=1:13 71 | if(soc(a)<0.3) 72 | x=1; 73 | break; 74 | end 75 | end 76 | for a=14:nVar 77 | if(soc(a)<0.6) 78 | x=1; 79 | break; 80 | end 81 | end 82 | end 83 | 84 | 85 | 86 | % Initialize Velocity 87 | particle(i).Velocity=zeros(VarSize); 88 | 89 | % Evaluation 90 | particle(i).Cost=CostFunction(particle(i).Position); 91 | 92 | % Update Personal Best 93 | particle(i).Best.Position=particle(i).Position; 94 | particle(i).Best.Cost=particle(i).Cost; 95 | 96 | % Update Global Best 97 | if particle(i).Best.CostVarMax); 129 | particle(i).Velocity(IsOutside)=-particle(i).Velocity(IsOutside); 130 | 131 | % Apply Position Limits 132 | particle(i).Position = max(particle(i).Position,VarMin); 133 | particle(i).Position = min(particle(i).Position,VarMax); 134 | 135 | for a=1:nVar 136 | if(a==1) 137 | soc(a)=0.4+((particle(i).Position(a))/54); 138 | 139 | else 140 | soc(a)=soc(a-1)+((particle(i).Position(a))/54); 141 | 142 | end 143 | end 144 | for a=1:nVar 145 | if(soc(a)>0.8) 146 | x=1; 147 | break; 148 | end 149 | end 150 | for a=1:13 151 | if(soc(a)<0.3) 152 | x=1; 153 | break; 154 | end 155 | end 156 | 157 | for a=14:nVar 158 | if(soc(a)<0.6) 159 | x=1; 160 | break; 161 | end 162 | end 163 | 164 | end 165 | 166 | % Evaluation 167 | particle(i).Cost = CostFunction(particle(i).Position); 168 | 169 | % Update Personal Best 170 | if particle(i).Cost0.5) 108 | % { 109 | % x=0; 110 | % } 111 | % end 112 | %end 113 | 114 | z= sum(((3.811+x)*2.946)+((4.132+x)*2.865)+((3.962+x)*2.842)+((3.981+x)*3.039)+((3.868+x)*3.34)+((3.83+x)*3.595)+((3.811+x)*3.629)+((3.736+x)*3.398)+((3.66+x)*3.015)+((3.585)*2.714)+((3.509)*2.517)+((3.434)*2.448)+((3.321)*2.008)+((3.264+x)*1.718)+((3.189+x)*1.683)+((3.151+x)*1.718)+((3.208+x)*1.683)+((3.226+x)*1.637)+((3.189+x)*1.614)+((3.208+x)*1.625)+((3.302+x)*1.625)+((3.491+x)*1.614)+((3.736+x)*1.637)+((3.868+x)*1.822)+((3.811++x)*2.286)+((3.792+x)*2.842)+((3.906+x)*3.27)+((4.255+x)*3.525)); 115 | end -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Electric Vehicle Charging Strategy Optimization 2 | 3 | 4 |
5 | Table of Contents 6 |
    7 |
  1. 8 | About The Project 9 | 12 |
  2. 13 |
  3. 14 | Getting Started 15 | 19 |
  4. 20 |
  5. Usage
  6. 21 |
  7. Contact
  8. 22 |
  9. Acknowledgments
  10. 23 |
24 |
25 | 26 | 27 | 28 | ## About the project 29 | 30 | This project proposes a Particle Swarm Optimization (PSO) based technique for charging a plug-in Electric Vehicle considering real time pricing of the electricity grid. The technique was able to achieve a 30% reduction in the consumer's electricity via implementation of this strategy. 31 | 32 | ### Built with 33 | 34 | * MATLAB 35 | 36 | 37 | 38 | ## Getting Started 39 | 40 | ### Prerequisites 41 | 42 | * Basic understanding of MATLAB 43 | * Download Link for MATLAB : [MATLAB](https://www.mathworks.com/products/get-matlab.html?s_tid=gn_getml) 44 | * Understanding of Particle Swarm Optimization technique. Basic tutorial video : [PSO Basics](https://www.youtube.com/watch?v=JhgDMAm-imI) 45 | 46 | ### Installation 47 | 48 | 1. Download the folder named "Project Code" and run the file named "PSOtester" which contains the main PSO code. 49 | 2. Remaining files are for plotting the various curves which show the difference between the conventional charging and PSO based charging. 50 | 51 | 52 | 53 | ## Usage 54 | 55 | 1. The PSO parameters can be changed in the "PSOtester" code as per the user's requirments and reused in different scenarios where optimization is required for large scale search space problems. 56 | 2. The Project report explains the entire algorithm and the various curves step by step. Do run the code by yourself and verify with the curves present in the report. 57 | 3. Given below is the flow chart of the PSO algorithm. Please keep it handy while going through the code in the "PSOtester" file. 58 | 59 | ![PSO Flowchart](https://user-images.githubusercontent.com/40661826/159780187-ba3e8fb4-7285-4926-b6af-51c341225d2f.jpg) 60 | 61 | 62 | 63 | ## Contact 64 | 65 | * [LinkedIn](https://www.linkedin.com/in/hitesh-holla-13b8661b5/) 66 | * [Gmail](mailto:hiteshholla@gmail.com) 67 | 68 | 69 | 70 | ## Acknowledgments 71 | 72 | You can go through the references and acknowledgements in the project file that has been uploaded. 73 | -------------------------------------------------------------------------------- /References/Decentralized EV charging.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/Decentralized EV charging.pdf -------------------------------------------------------------------------------- /References/Energy efficient algorithm for EV charging with RES.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/Energy efficient algorithm for EV charging with RES.pdf -------------------------------------------------------------------------------- /References/EnergyInteractionBetweenBuildingsandVehicles.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/EnergyInteractionBetweenBuildingsandVehicles.pdf -------------------------------------------------------------------------------- /References/FULLTEXT01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/FULLTEXT01.pdf -------------------------------------------------------------------------------- /References/Generic PSO Matlab.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/Generic PSO Matlab.pdf -------------------------------------------------------------------------------- /References/MOPSO.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/MOPSO.pdf -------------------------------------------------------------------------------- /References/Multi EV charging smart grid PSO.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/Multi EV charging smart grid PSO.pdf -------------------------------------------------------------------------------- /References/PEV EMS with PSO.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/PEV EMS with PSO.pdf -------------------------------------------------------------------------------- /References/PEV Market drivers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/PEV Market drivers.pdf -------------------------------------------------------------------------------- /References/PSO PEV strategy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/PSO PEV strategy.pdf -------------------------------------------------------------------------------- /References/PSO convergence analysis and parameter selection.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/PSO convergence analysis and parameter selection.pdf -------------------------------------------------------------------------------- /References/PSO for EV driving.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/PSO for EV driving.pdf -------------------------------------------------------------------------------- /References/PSO research parameters.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/PSO research parameters.pdf -------------------------------------------------------------------------------- /References/PSO with master and slave swarms.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/PSO with master and slave swarms.pdf -------------------------------------------------------------------------------- /References/Real time charging with fuzzy PSO.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/Real time charging with fuzzy PSO.pdf -------------------------------------------------------------------------------- /References/Stochastic PEV HEMS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/Stochastic PEV HEMS.pdf -------------------------------------------------------------------------------- /References/Unceratinities HEMS PEV PV.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/Unceratinities HEMS PEV PV.pdf -------------------------------------------------------------------------------- /References/project paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiteshHolla/EV-Charging-Optimization/a42cbfb3b4163c846a5221fa87403db59fdac528/References/project paper.pdf --------------------------------------------------------------------------------