Design & Implementation of Battery Electric Vehicle (BEV) using MATLAB

Опубликовано: 20 Август 2026
на канале: Dr.M.Sivakumar
4,865
70

#free #matlab #microgrid #tutorial #electricvehicle #predictions #project #viral
#viralvideo
#electric
#electricvehicle
This project is a MATLAB project that showcases a model of a Battery Electric Vehicle (BEV) along with its key components, including the motor, high voltage battery, and longitudinal vehicle dynamics. It aims to showcase the versatile and advanced modeling capabilities of Simscape, which enables modular and multi-fidelity simulations.

1) Battery Electric Vehicle (BEV) Model for System Level Simulation
2) BEV Project Detailed Model Applications

Main script:
modelName = "BEV_system_model";
% Load the model file.
load_system(modelName)
% Set referenced subsystems and load parameters.
BEV_useComponents_Basic
% Load drive cycle.
VehSpdRef_loadSimulationCase_SimpleDrivePattern( ...
ModelName = modelName, ...
TargetSubsystemPath = ...
"/Controller & Environment" + ...
"/Vehicle speed reference" )
simData = extractTimetable(simOut.logsout);
fig = BEV_plotResultsCompact( SimData=simData, PlotTemperature=false );
% Save the plot to a PNG file.
prjRoot = currentProject().RootFolder;
imgFilename = "BEV_SimulationResultPlot.png";
exportgraphics(fig, fullfile(prjRoot, "BEV", "results", imgFilename))
% Extract logged signals at once with extractTimetable.
simData = extractTimetable(simOut.logsout);

% Adjust time format so as not to lose the subsecond information.
simData.Time.Format = 'hh:mm:ss.SSSS';

% Signal names to save in file.
% These must be specified in the model as signal logging names.
% For example, in the BEV system model, see the Measurement subsystem.
dataColumns = [ ...
"HV Battery SOC", "HV Battery Power", "HV Battery Current", ...
"G-Force", "Vehicle Speed (km/hr)" ];

% Select the logged signals to save.
simData = simData(:, dataColumns);

% Add unit information to signal names.
varNames = string(simData.Properties.VariableNames');
% disp(varNames)
varUnits = string(simData.Properties.VariableUnits');
% disp(varUnits)
varNames2 = varNames + " (" + varUnits + ")";
disp(varNames2)
simData.Properties.VariableNames = varNames2;

% Save data to CSV file.
simResultFilename = "BEV_SimulationResult_1.csv";
simResultFile_FullPath = fullfile(prjRoot, "BEV", "results", simResultFilename);
writetimetable(simData, simResultFile_FullPath)
% result plot
dataVehSpd = data.("Vehicle Speed");
unitStr = varUnits(varNames == "Vehicle Speed");
vehicleSpeed = simscape.Value(dataVehSpd, unitStr{:});
averageSpeed = sum(vehicleSpeed)/numel(vehicleSpeed)
maxSpeed = max(vehicleSpeed)
tmpDistance = sum(vehicleSpeed(2:end).*dt);
travelledDistance = tidyUnit( tmpDistance, "km" )
dataBattPwr = data.("HV Battery Power");
unitStr = varUnits(varNames == "HV Battery Power");
batteryPower = simscape.Value(dataBattPwr, unitStr{:}); % J/s
batteryEnergyUsed = sum(batteryPower(2:end).*dt)
batteryEnergyUsed = tidyUnit(batteryEnergyUsed, "kW*hr")
energyEfficiency_kWh_per_100km = 100 * value(batteryEnergyUsed / travelledDistance, "kW*hr/km")
Click here to download the complete Project file:
https://drive.google.com/file/d/1rOrg...

Kindly Subscribe My YouTube Channel...
Please like, share and comments on My Videos 🙏
Please click the below links to Subscribe/Join & View my Videos
https: //   / drmsivakumar  
For More Details about this Video Join/ View the following
Telegram : t.me/Dr_MSivakumar
website : drmsivakumar78.blogspot.com