0% found this document useful (0 votes)
3 views4 pages

Ex 3 Script

The document outlines a MATLAB program for estimating the energy requirements of electric vehicles (EVs) in India, specifically for two, three, and four-wheelers. Users can select the vehicle type and input various parameters such as mass, drag coefficient, and desired range, which are then used to calculate energy consumption and battery capacity. The program also visualizes speed profiles, battery power demand, and cumulative distance traveled during the driving cycle.

Uploaded by

kathan.025
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Ex 3 Script

The document outlines a MATLAB program for estimating the energy requirements of electric vehicles (EVs) in India, specifically for two, three, and four-wheelers. Users can select the vehicle type and input various parameters such as mass, drag coefficient, and desired range, which are then used to calculate energy consumption and battery capacity. The program also visualizes speed profiles, battery power demand, and cumulative distance traveled during the driving cycle.

Uploaded by

kathan.025
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

clc;

clear;

fprintf('=============================================================\
n');
fprintf(' EV ENERGY ESTIMATION USING EUDC (2W / 3W / 4W - INDIA)\n');
fprintf('=============================================================\n\
n');

%% ================= VEHICLE TYPE SELECTION =================

fprintf('Select Vehicle Category:\n');


fprintf('1 -> Two Wheeler\n');
fprintf('2 -> Three Wheeler\n');
fprintf('3 -> Four Wheeler (Passenger Car)\n');

vehType = input('Enter choice (1 / 2 / 3): ');

switch vehType
case 1
vehName = 'Two Wheeler';

ranges.m = '130–180 kg';


[Link] = '0.40–0.60';
ranges.A = '0.5–0.7 m^2';
[Link] = '0.012–0.020';
ranges.v = '30–60 km/h';
ranges.V = '48–72 V';
ranges.R = '50–80 km';
[Link] = '0.88–0.92';

defaults = struct('m',150,'Cd',0.45,'A',0.6,'Crr',0.015,...
'v',40,'V',48,'R',70,'eta',0.88,'r',0.30);

case 2
vehName = 'Three Wheeler';

ranges.m = '400–700 kg';


[Link] = '0.55–0.75';
ranges.A = '1.2–1.6 m^2';
[Link] = '0.015–0.020';
ranges.v = '30–55 km/h';
ranges.V = '48–96 V';
ranges.R = '80–120 km';
[Link] = '0.83–0.88';

defaults = struct('m',550,'Cd',0.65,'A',1.4,'Crr',0.018,...
'v',40,'V',72,'R',100,'eta',0.85,'r',0.32);

case 3
vehName = 'Four Wheeler';

ranges.m = '1200–1800 kg';


[Link] = '0.28–0.35';
ranges.A = '2.0–2.5 m^2';
[Link] = '0.010–0.015';
ranges.v = '40–90 km/h';
ranges.V = '300–400 V';
ranges.R = '200–350 km';
[Link] = '0.88–0.92';

defaults = struct('m',1500,'Cd',0.32,'A',2.2,'Crr',0.012,...
'v',60,'V',350,'R',300,'eta',0.90,'r',0.32);

otherwise
error('Invalid selection.');
end

fprintf('\nSelected Vehicle: %s\n\n',vehName);

%% ================= INPUT SECTION ==========================

m = input(sprintf('Vehicle mass (kg) [Typical %s | Default %.0f]:


',ranges.m,defaults.m));
if isempty(m); m = defaults.m; end

Cd = input(sprintf('Drag coefficient [Typical %s | Default %.2f]:


',[Link],[Link]));
if isempty(Cd); Cd = [Link]; end

A = input(sprintf('Frontal area (m^2) [Typical %s | Default %.2f]:


',ranges.A,defaults.A));
if isempty(A); A = defaults.A; end

Crr = input(sprintf('Rolling resistance coeff [Typical %s | Default


%.3f]: ',[Link],[Link]));
if isempty(Crr); Crr = [Link]; end

eta = input(sprintf('Drivetrain efficiency [Typical %s | Default %.2f]:


',[Link],[Link]));
if isempty(eta); eta = [Link]; end

V_pack = input(sprintf('Battery voltage (V) [Typical %s | Default %.0f]:


',ranges.V,defaults.V));
if isempty(V_pack); V_pack = defaults.V; end

range_km = input(sprintf('Desired range (km) [Typical %s | Default %.0f]:


',ranges.R,defaults.R));
if isempty(range_km); range_km = defaults.R; end

%% ================= CONSTANTS ===============================

rho = 1.225;
g = 9.81;

%% ================= EUDC SPEED PROFILE =====================

t = [0 20 70 110 140 190 230 260 290 350 380 400];


v_kmh = [0 0 70 70 50 50 70 70 90 90 0 0];

tq = 0:1:400;
vq = interp1(t,v_kmh,tq,'linear');
v = vq/3.6;

%% ================= FORCE CALCULATION ======================

F_rr = Crr*m*g;
F_ad = 0.5*rho*Cd*A.*v.^2;
F_tot = F_rr + F_ad;

%% ================= POWER ================================

P_wheel = F_tot.*v;
P_batt = P_wheel/eta;

%% ================= ENERGY INTEGRATION ===================

E_J = trapz(tq,P_batt);
E_Wh = E_J/3600;

dist_km = trapz(tq,v)/1000;

Wh_km = E_Wh/dist_km;

%% ================= BATTERY ENERGY FOR RANGE ==============

TripEnergy_kWh = Wh_km*range_km/1000;
Capacity_Ah = (TripEnergy_kWh*1000)/V_pack;

%% ================= VISUALIZATION =========================

figure;
plot(tq,vq,'LineWidth',2);
xlabel('Time (s)');
ylabel('Speed (km/h)');
title(['EUDC Speed Profile - ' vehName]);
grid on;

figure;
plot(tq,P_batt/1000,'LineWidth',2);
xlabel('Time (s)');
ylabel('Battery Power (kW)');
title(['Battery Power Demand - ' vehName]);
grid on;

cumDist = cumtrapz(tq,v)/1000;

figure;
plot(tq,cumDist,'LineWidth',2);
xlabel('Time (s)');
ylabel('Distance Travelled (km)');
title(['Cumulative Distance - ' vehName]);
grid on;

%% ================= RESULTS ===============================

fprintf('\n==================== RESULTS ====================\n');


fprintf('Vehicle Type : %s\n',vehName);
fprintf('Cycle Distance : %.2f km\n',dist_km);
fprintf('Energy per Cycle : %.2f Wh\n',E_Wh);
fprintf('Energy Consumption : %.1f Wh/km\n',Wh_km);
fprintf('-----------------------------------------------\n');
fprintf('Energy for %.0f km Range : %.2f kWh\n',range_km,TripEnergy_kWh);
fprintf('Battery Capacity : %.1f Ah @ %.0f V\
n',Capacity_Ah,V_pack);
fprintf('================================================\n');

fprintf('\nConclusion:\n');
fprintf('Energy requirement was computed using EUDC\n');
fprintf('driving cycle and longitudinal dynamics for\n');
fprintf('%s category vehicle.\n',vehName);
fprintf('================================================\n');

You might also like