The high voltage battery of an electric vehicle (EV) is one of the most important components since it dictates the dynamic performance, range and charging time of the vehicle. In order to calculate the size of the battery we need two main inputs: the average energy consumption and the range of the vehicle.
This article is explaining how to calculate the energy consumption of a vehicle and it’s part of a EV design series:
- EV design – introduction
- EV design – energy consumption
- EV design – battery
- EV design – electric motors
- EV design – mode management
- EV design – vehicle systems and components
- EV design – simulation model
- EV design – simulation results and evaluation
WLTC drive cycle
The average energy consumption of the vehicle Eavg [Wh/km] will be calculated on a homologation cycle. For our example we are going to use the WLTC drive cycle. The test procedure WLTP (Worldwide harmonized Light vehicles Test Procedure) contains several driving cycles:
- Class 1 – low power vehicles with PWr <= 22
- Class 2 – vehicles with 22 < PWr <= 34
- Class 3 – high-power vehicles with PWr > 34
Where PWr [kW/Tonne] is the power-to-weight ratio, defined as the ratio between the rated engine power and kerb weight.
\[PW_{r} = \frac{P_{max}}{m_{v}} \tag{1}\]Our target is to convert the 16MY Jaguar F-type vehicle into a battery electric vehicle (BEV). Therefore we need to understand what is the current energy consumption of the vehicle. From the article EV design – introduction we can extract the maximum power and kerb weight and calculate the power-to-weight ratio:
\[PW_{r} = \frac{253.538}{1.741} =145.6278 \]Since the vehicle’s PWr is bigger than 34, we are going to use the WLTC Class 3 driving cycle to calculate the energy consumption.
The parameters of the WLTC Class 3 cycle are summarised in the table below:
Low | Medium | High | Extra High | Total | |
---|---|---|---|---|---|
Duration, s | 589 | 433 | 455 | 323 | 1800 |
Stop duration, s | 150 | 49 | 31 | 8 | 235 |
Distance, m | 3095 | 4756 | 7162 | 8254 | 23266 |
% of stops | 26.5% | 11.1% | 6.8% | 2.2% | 13.4% |
Maximum speed, km/h | 56.5 | 76.6 | 97.4 | 131.3 | |
Average speed without stops, km/h | 25.3 | 44.5 | 60.7 | 94.0 | 53.5 |
Average speed with stops, km/h | 18.9 | 39.4 | 56.5 | 91.7 | 46.5 |
Minimum acceleration, m/s2 | -1.5 | -1.5 | -1.5 | -1.44 | |
Maximum acceleration, m/s2 | 1.611 | 1.611 | 1.666 | 1.055 |
The method to calculate the energy consumption is straight forward and it makes use of the Scilab/Xcos simulation environment. The steps are as follows:
- Determine the mathematical expression of the energy consumption
- Create a Scilab script file (
*.sce
) for the vehicle parameters (input data) - Create the Xcos block diagram (
*.zcos
) - Run the simulation on the WLTC driving cycle
- Create a post-processing script (
*.sce
) and analyse the result
Mathematical expression of the energy consumption
The energy consumption is calculated based on the road loads. The total road load Ftot [N] is the sum of the inertial force, road slope force, road load (friction) force and aerodynamic drag force.
\[F_{tot}=F_i + F_s + F_r + F_a \tag{2}\]where:
Fi [N] – inertial force
Fs [N] – road slope force
Fr [N] – road load force
Fa [N] – aerodynamic drag force
The inertial force is given by the equation:
\[F_i = m_v \cdot a_v \tag{3}\]where:
mv [kg] – total vehicle mass
av [m/s2] – vehicle acceleration
The vehicle acceleration can be calculated as:
\[a_{v} = \frac{\Delta v}{\Delta t} \tag{4}\]where:
Δv [m/s] – speed difference
Δt [s] – time difference
The road slope force is given by the equation:
\[F_s = m_v \cdot g \cdot sin(\alpha_s) \tag{5}\]where:
g [m/s2] – gravitational acceleration
αs [rad] – road slope angle
The road load (friction) force is given by the equation:
\[F_r = m_v \cdot g \cdot c_{rr} \cdot cos(\alpha_s) \tag{6}\]where:
crr [-] – road rolling resistance coefficient
The aerodynamic drag force is given by the equation:
\[F_a = \frac{1}{2} \cdot \rho \cdot c_d \cdot A \cdot v_{v}^2 \tag{7}\]where:
ρ [kg/m3] – air density at 20 °C
cd [-] – air drag coefficient
A [m2] – vehicle frontal area
vv [m/s] – vehicle speed
The total power Ptot [W] is calculated as the product between the total road forces and the vehicle speed:
\[P_{tot} = F_{tot} \cdot v_{v} \tag{8}\]By integrating the total power over time (for the whole duration of the cycle), we get the total energy consumption Etot [J]:
\[E_{tot} = \int P_{tot} \cdot dt \tag{9}\]All the equations above will be used in the Xcos block diagram in order to calculate the energy consumption of the vehicle over the drive cycle.
Vehicle parameters (input data)
The main vehicle parameters used for the WLTC drive cycle are explained in the article EV design – introduction defined in a Scilab script (*.sce
).
vehMassKerb = 1741; // [kg] vehMassDriver = 80; // [kg] vehMassfm = 1.05; // [-] vehMass = vehMassKerb * vehMassfm + vehMassDriver; // [kg] vehg = 9.81; // [m/s^2] vehcd = 0.36; // [-] vehfa = 2.42; // [m^2] vehro = 1.202; // [kg/m^3] roadSlope = 0; // [rad] roadCrr = 0.011; // [-]
Xcos block diagram (vehicle simulation over WLTC)
The Xcos block diagram model is run for 1800 s
, which is to total duration of the WLTC drive cycle. A Clock
block is used to generate a time step of 1 s
. This time step is set because the input data (WLTC speed profile) is sampled at 1 s. The speed profile is read with a From workspace
block. Before running the simulation we need to load the speed profile as a variable of type structure, containing the speed values and time (e.g. WLTC.time
and WLTC.values
).
Since the sample time is 1 s
, which means Δt = 1, the vehicle acceleration will be calculated as the difference between the current speed value and the previous speed value. In the WLTC driving cycle, the road slope is considered 0 rad
, therefore will not have any influence on the energy consumption.
Depending on the sign of the total power, we can distinguish between the acceleration and braking (deceleration) phases of the vehicle. The integration of the power, for a Δt = 1, gives the energy. The acceleration and braking energies are calculated separately and then summed up to give the total energy.
By dividing the last calculated value of the total energy (3205.39 Wh
) to the total length of the WLTC drive cycle (23.266 km
), we get the average energy consumption of the vehicle, 137.8 Wh/km
.
The WLTC speed profile, total road load forces, total power, acceleration energy, brake energy and total energy are saved in the Scilab workspace for further visualisation and analysis.
Data post-processing
Using a Scilab script we can plot the drive cycle simulation result. In this particular case we are going to plot only the acceleration, braking and total energy.
plot(WLTC_vehTotEgy_kWh.time, WLTC_vehTotEgy_kWh.values,'k') plot(WLTC_vehAccEgy_kWh.time, WLTC_vehAccEgy_kWh.values,'r') plot(WLTC_vehBrkEgy_kWh.time, WLTC_vehBrkEgy_kWh.values,'b') xgrid() xlabel('Time [s]','FontSize',2) ylabel('Energy [kJ]','FontSize',2) title('x-engineer.org','FontSize',2) legend('Total','Acceleration','Braking',2)
Running the script will generate the following plot.
The same model can be used for any other vehicle, the only change needed being the input parameters update. Also, the simulation can be run for different drive cycles, like FTP or NEDC or for custom cycles which can include also a road gradient.
The average energy consumption over WLTC drive cycle is 137.8 Wh/km. This value will be used to calculate the total energy required for the high voltage battery.
Disha
Thank You So much!! it is really very helpful.
Tapash Dey
Thank you for this work.
Quang Vo
From my point of view, the statement “The acceleration and braking energies are calculated separately and then summed up to give the total energy” is only right with assumption that the vehicle has regenerative braking system and all the brake energy is used to charge battery. Am I correct?
Furthermore, I am confused when looking into the energy graph. Based on the graph, at the every moment, the acceleration and braking event happens at the same time
Anthony Stark
Yes, your assumption is correct, regarding brake energy. This is possible if the regen braking force is not very high, you can recuperate almost all the braking energy, of course except the losses.
Regarding the energy graph, when the speed drops (vehicle deceleration), the braking energy increases, when the vehicle speed increases (vehicle acceleration), the acceleration energy increases. You can find more information here:
https://x-engineer.com/pages/ev-perf-calc.html
Pat Flynn
Where is the 253.538 figure found that is used in the P to W calculation?
Anthony Stark
That is your rated power of your vehicle, which is the nominal power output of the motor(s). For example 150 kW motor. The assumption is that you know what the power output of the motor will be.
Alan Rajan
Is the tire radius considered here ? I would assume based on your tire radius your torque required and hence power & energy would change. Please advise on this.
Anthony Stark
You don’t need to consider tire radius since the power is calculated based on wheel force and speed.
Raja
Why unit delay blocks are used instead of integration and differentiation blocks?
Harshit
hi,
i came across a error where i couldn’t input the condition for the dynamic switches it says “undefined variable:u2”
Sagar Patil
Hi,
Thanks for this articles. Can I do above calculation in the excel sheet. Could you please help me in doing above calculation. I have tried above calculation in the excel but getting much higher power.
Thank you
CHANDRAPRAKASH PILLAI
Hi,
Could you please explain the logic you have used for the dynamic switches to segregate between the acceleration values and breaking values. I am getting the plot similar to what you have achieved, but the energy/km is 93 instead of 137.8wh/km.
Veeru
is there any specific formula to determine drive cycle distance ? if yes please mention or attach reference.
Anthony Stark
Easiest way is to integrate speed over time and you get the travelled distance. Last value will be the total cycle distance.
Vedant Kulkarni
If we calculate total power by reverse calculation of the total energy capacity using formula E = P total × t
Then we get P total = 6410 watts and then apply
P total = F total × V considering V = 12.91 then we get F total = 496.25 but this value is very less.
Vedant Kulkarni
Please give the value of vehicle velocity which you considered in calculation of aero dynamic resistance force ,Or provide value total force on the vehicle used for calculation of energy capacity
Anthony Stark
The velocity comes from the “From workspace” block, function of simulation time. It is the velocity setpoint of the WLTC drive cycle.
Saurabh
Sir we are not use to scilab and Xcos. So are there any handwritten method for getting total energy value.For example I calculated the Power but now we need to integrate so what limits we must put. Please guide me for the same. Trying to figure it out from past few days. So please help regarding the same. Thank you.
Mudit Verma
what are the limits of the integral in the accleration and braking energy calculation??
Anthony Stark
The integration is discrete, not continuous. The 1/z blocks are not Integration blocks but Unit Delay blocks. To answer your question, there is no limit put on the integration.
Samir darji
Thank you so much for your article, it is very useful for my study. But I need help to make Xcos block. In XCos block, I am confused in expression block. What is “ul^2”?
Please help as soon as possible
Anthony Stark
Hi,
That is not “ul” but “u1” and is the input of block (vehicle speed).
Georg
Hi!
Just tried to rebuild your work but I have to admit that I´m struggeling to load the WLTC data into a “variable” and then use it within the XCOS module.
Please could you help me out and explain how you load the cycle data into scilab?
Many thanks in advance!
@Ernesto: The WLTC data can be found here:
http://www.unece.org/fileadmin/DAM/trans/doc/2012/wp29grpe/WLTP-DHC-12-07e.xls
Anthony Stark
Hi Georg,
I’ve wrote a new article explaining how to import the data from the *.xls file:
https://x-engineer.org/graduate-engineering/programming-languages/scilab/how-to-import-xls-data-into-scilab-and-xcos/
Enjoy!
Georg Heym
Hi Anthony,
thanks for the additional info!
With your method everything works just fine.
Meanwhile I used:
M = csvRead(‘Doc1.csv’)
V.time=(1:1801)’;
V.values=(M);
B = csvRead(‘Doc2.csv’)
D.time=(1:1801)’;
D.values=(B);
whre M is the speed and B the accelartion.
Shane Smith
Is it possible to get the SciLab files for research purposes ? (MPhil. Applied Physics)
Shrikant
What is procedure to calculate energy consumption for low power vehicles PWr<22?
Ernesto Tur
Dear
Great job you’ve published, I am a student of Mechanical Engineering in Argentina.
Would you be so kind as to give me the speed-time value of the WLTP, which you typed as WLTP.time WLTP.value ?
I have spent time looking for the information, but if you can provide it to me, it would help me a lot.
Kind regards
Erensto
MM
hello,
this is really great & extensive article.
Is it possible to download the Xcos files?. Being a bigginer in X cos, i find it very difficult to do it quickly.