Description
MATLAB code Highlights
 the MATLAB code for EV load demand rescheduling uses the GWO optimization
 the cost of charging and power losses on the grid are minimized
 the SoC of the EV battery is the constraint which need to be managed during the optimization
In this work, we presented a MATLAB code for EV load demand rescheduling to minimize the charging cost, grid losses and load variance. An Electric vehicle (EV) is the most reliable and ecofriendly product of present days transportation system. EV has not polluted the environment because it does not consume any fossil oil. The main components of EV are an electric motor, battery, power electronic devices. In EV the battery is used as the storage bank of electricity. The electricity is provided for the EV charging by power grid. The grid is affected by the power losses during the charging of electric vehicles. The number of electric vehicles increases the power demand as well as grid losses. So a smart charging method or optimal scheduling of EV is necessary for the loss and cost minimization.
Work Statement
In this MATLAB code, we proposed Grey Wolf Optimization (GWO) [2] algorithm for the optimal EV load demand rescheduling on the IEEE 33 bus radial distribution system. The charging cost, power loss on grid and load variance minimization is the key objective of our work.
You can also check out our other work on Network reconfiguration to minimize the power losses in the IEEE 33 radial distribution system.
We have analyzed the proposed method for four different cases: lowlevel penetration of EV, highlevel EV penetration, summer, and winter load of EV charging. The theoretical approach related to the GWO can be studied in the research paper [2] or from the Freethesis.com
The GWO algorithm based project Hybrid Particle Swarm and Grey Wolf Optimization testing for benchmark function Â is available at Freethesis.com
Advantages of EV
 Less dependency on the import of foreign
 Minimum noise pollution compared to the ICE vehicle.
 More economical and less maintenance
 No release of air pollution and deliver improved
EV charging station
EV charging depends on the battery state of charge (SoC) during the initial and desired stage, charging time, and load on the grid line. The connection of EV on different buses of IEEE 33 radial bus system is shown in figure 1.
Figure 1 EV insert into the IEEE 33 radial bus system [3]
The entire work is designed in the MATLAB 2018a software. We take the IEEE33 bus radial distribution system model and inserted 10 EV charging stations on selected buses. The bus numbers 3, 6, 10, 14, 19, 22, 23, 25, 29, and 31 are selected for the installation of the charging station of electric vehicles. The plugin EV load connected to the charging station is divided into two categories low and high penetration level. The number of plugin EV is higher in high penetration level and lower in low penetration level.
Objective Function to Optimize EV Charging Cost

Minimum cost of charging
The charging cost of EV should be minimum so that the extra burden of money on customer pocket is reduced. Equation 1 shows the objective function of minimum cost of charging
Where n represents the total number of a plugin vehicle, the total number of time steps are shown byÂ m, C_{k} is the TOU price at time stamp k, p_{i, k} reflects the i^{th} plugin EV charging power at each time, and time stamp is represented by delta t.

Load variance Minimization
While EV connected to the grid the power loss occurs, so the load variance is must required to reduce them. The equation of load variance is formulated as:
P_{k} is the grid forecasted load at time stamp k and t is the time stamp

Active power loss minimization
The active power loss of the distribution grid system is to be minimized at the time of EV load connected to the buses. The objective function is designed by estimating optimal scheduling coordination for the charging of EV load [3]. The equation is written as
F_{3}= active power loss, I_{k} =branch current, R_{k} =branch impedance, ntl=total number of lines
A single objective function is formed by the combination of three multiobjective function
The objectives function of minimum cost (F_{1}), minimum load variance (F_{2}) and minimum active power loss (F_{3}) of power grid are combined to form a multiobjective function.
Constraints in the EV Optimization
The constraints of the objective function are considered as
GWO optimized EV rescheduling
The power transferred from the grid to the EV in each timestamp is the key factor of smart charging control. The smart charging of EV operation includes various unsure terms like available grid power, arrival and departure time of EV at charging station, and initial SoC of battery. The hourly charging time is evaluated with the probability density function (PDF) of the arrival and departure times of EV.
GWO algorithm is used to optimize the objective function, as designed in equation 4. GWO is an iterative algorithm inspired by the hunting nature of wolves. The searching space dimension in GWO is the number of tuning variables. We have considered 156 electric vehicles for a timestamp of 24 hrs. We need to optimize the power transmitted to these 156 electric vehicles for 24 hrs, which makes the number of tuning variables equal to 24*156=3744 in a low penetration case. During high penetration, the number of vehicles reaches 312, and tuning variables are calculated as per them. The wolvesâ€™ position is changed after each iteration and the process is repeated until the optimal value of equation 1 is computed. The flow chart of the complete process is shown in figure 2.
Figure 2 flow chart of proposed work@freethesis.com
Results
The overall work is performed on the MATLAB software. All scripts and plots are generated with the help of MATLAB coding. We used the load data per hour, TOU price and flat rate from the historical Dominian Virgina Power system. The data is available on Verigina power website.Â It contains the load information of many states of America for each appliance for every hour.Â Three states dataset are used collectively in our case which are
 USA_AK_Anchorage.Intl.AP.702730_TMY3_HIGH.csv
 USA_AK_Fairbanks.Intl.AP.702610_TMY3_HIGH.csv
 USA_KS_Hays.Muni.AWOS.724518_TMY3_HIGH.csv
The GWO controlled EV charging rescheduling minimizes the power loss of the grid, load variation and cost of charging power. Figure 3 shows the comparison among the three optimized objective functions which are formulated above.
Figure 3 Comparison of charging cost, load variance and active power loss during the uncontrolled and controlled cases for low penetration level@freethesis.com
Table 1 Cost, load variance and active power loss by GWO tuned power supplied to EV charging for summer load data
Comparison terms  Uncontrolled Load  GWO controlled 
Cost ($/Kw/h)  2.4  1.7 
Load variance  5.5*10^{5}  5*10^{5} 
Active power loss (KW)  263.5  217.4 
Figure 4 Active power loss comparisons @freethesis.com
The power loss comparison among the GWO controlled, basic load and uncontrolled EV load is shown in figure 4. The minimum active power loss belongs to the GWO controlled category.
Conclusion
We tested the proposed EV rescheduling algorithm on IEEE 33 radial bus system model with inserting the EV charging station on 10 different buses. There are two cases tested as per the climate condition summer and winter. Further, the lowlevel penetration and highlevel penetration EV cases are analyzed for both summer and winter connected load. The overall cost of electricity and active power loss of the grid are minimized using the GWO controller.
FAQs
1. Is the data used for EV and load of the grid of 24hrs?
This project has considered the 24hrs consumer load profile taken from the USA Fairbank power grid. The consumer data is categories into winter and summer load with load demand of individual home appliances. The Appliances list in the data is given below. The code is though clubbing few appliances into a single variable.
The EV demand is also generated for 24 hr with the help of the Gaussian Probability Distribution Function
% Date/Time %Electricity:Facility [kW](Hourly) %Gas:Facility [kW](Hourly) %Heating:Electricity [kW](Hourly) %Heating:Gas [kW](Hourly) %Cooling:Electricity [kW](Hourly) %HVACFan:Fans:Electricity [kW](Hourly) %Electricity:HVAC [kW](Hourly) %Fans:Electricity [kW](Hourly) %General:InteriorLights:Electricity [kW](Hourly) %General:ExteriorLights:Electricity [kW](Hourly) %Appl:InteriorEquipment:Electricity [kW](Hourly) %Misc:InteriorEquipment:Electricity [kW](Hourly) %Water Heater:WaterSystems:Electricity [kW](Hourly)
2. How is the charging pattern of EVs defined and implemented?
The Gaussian Probability Distribution Function has been used to generate the charging profile for EV. The Mean of 20 and Standard Deviation of 2 are used to generate the profile.
x=[1:24]; mu=20; sigma=2; pdf_normal=pdf('Normal',x,mu,sigma); % normal pdf for a single vehicle
3. The per unit price of electricity changes at peak demand. Is it also taken considered in this MATLAB code of EV charging scheduling?
This is an appropriate question, but for the sake of the simplicity of this project, a uniform per unit price is considered in the code. This 24 hrs price can be easily integrated into the current code.
4. The charging time of EVs can vary depending on the battery type. Is it taken care of in this code?
Yes, this is already implemented in the code. The SoC constraint is defined. Whenever this is matched, the charging of that vehicle is stopped. Moreover, since the vehicle connects for the charging at varying SoC present in the vehicle, different charging tome required is obvious. Though a total parking time of 7 hrs is kept fixed.
References
 Ãlvarez, Jorge GarcÃa, Miguel Ãngel GonzÃ¡lez, Camino RodrÃguez Vela, and Ramiro Varela. “Electric vehicle charging scheduling by an enhanced artificial bee colony algorithm.”Â Energies11, no. 10 (2018): 2752.
 Faris, Hossam & Aljarah, Ibrahim & AlBetar, Mohammed & Mirjalili, Seyedali, â€œGrey wolf optimizer: a review of recent variants and applicationsâ€ Neural Computing and Applications, 2017.
 Zalnidzam, Wan Iqmal Faezy Wan, Hasmaini Mohamad, Nur Ashida Salim, Hazlie Mokhlis, and Zuhaila Mat Yasin. “Optimal Charging Schedule Coordination of Electric Vehicles in Smart Grid.”Â Indonesian Journal of Electrical Engineering and Computer Science11, no. 1 (2018): 8289.
 Balram, Pavan, Tuan Le Anh, and Lina Bertling Tjernberg. “Effects of plugin electric vehicle charge scheduling on the dayahead electricity market price.” InÂ 2012 3rd IEEE PES Innovative Smart Grid Technologies Europe (ISGT Europe), pp. 18. IEEE, 2012.
Other Recommended Similar works
papori.banik –
nice
papori.banik –
NICE SERVICE
nurain syahirah.saharenam (verified owner) –
i hope i can get the ebook as soon as possible. Thank you
bijaydas123 (verified owner) –
I am working electric vehicle cost minimization. It will be helpful for my research work if I get the matlab code
karim.hardani (verified owner) –
good job
sowmya.r (verified owner) –
Very good resources
fatir.burhan (verified owner) –
EV
jim.sun (verified owner) –
good
jayati.vaish (verified owner) –
THANK YOU
emmanuel.kinoti (verified owner) –
ok
bijaydas123 (verified owner) –
I am working on electric vehicle charging cost minimization. The MATLAB coding will be helpful in my research
sumeet.kumar (verified owner) –
Ghn
jayati.vaish (verified owner) –
good
sowmya.r (verified owner) –
Very nice work.