Project 1
PROJECT -1 (DEVELOPMENT OF HYBRID DRIVE)
Aim=Development of a forward energy-based fuel consumption model of a conventional vehicle.
Task=In this project, a typical midsize car with a 1.9L engine and a 4-speed automatic transmission is considered. Data is taken from the ADVISOR database developed by NREL, USA. The transmission shift map and controller are taken from Matlab/Simulink example database.
To do that, the following steps need to be followed:
1) Load the Project1 folder as the Current Folder in Matlab.
2) Run the “Project1_InitFile.m” Matlab script.
3) The provided vehicle Simulink model “Project1_VehicleModel.sex” is incomplete. The engine and vehicle dynamics block contents have been deleted. Build the Simulink blocks by referring to the course lecture and example block images provided. You can run the model and analyze the results using a ‘Scope’ for debugging.
4) Add additional ‘To Workspace’ blocks for transferring the desired Simulink vehicle data into the Matlab workspace.
5) Modify the “Project1_ProcessingFile.m” as per the desired plots and required calculations.
6) Write a project report that contains the following:
a. Tabulate the fuel economy numbers (kmpl) for UDDS and HWFET cycles. This forms the baseline numbers for comparison with the future hybrid version.
b. Plot the time trace for the engine, transmission input, transmission output and wheel speed on one plot.
c. Plot engine torque, engine power, fuel rate and fuel consumption using subplots.
d. Plot accelerator and brake pedal, gear command, vehicle desired and actual speed, and vehicle distance using subplots.
e. Plot the engine operating points on the engine fuel map.
f. Write down appropriate brief comments on each of these plots, describing the vehicle behaviour throughout the drive cycle.
g. Generate the plots for both drive cycles.
============================ Project_1=================================
conventional vehicle

Conventional vehicle is those that run on petrochemical energy. Having IC engine, clutch, gearbox, transmission shaft, differential and wheels.
Here in this project, we are going to find out the following parameter of the conventional vehicle from a given model- engine torque, engine power, fuel rate and fuel consumption, time trace for the engine, transmission input, transmission output and wheel speed.
Forward Models.
Forward models are utilized for detailed simulations, whereas dynamic models are used for forwarding models (refer to Figure 1). The input is force/torque/power, and the outputs are the vehicle state variables velocity and acceleration. Because physical casualty makes models and simulations more realistic, they are better for control development. To achieve the desired vehicle state, there is a feedback loop. Because of the dynamics, the simulation is slower, and the approach is mostly used to model a vehicle drive cycle and study the system's dynamic behaviour. Significantly aids in the management of development.

A forward-facing vehicle model features a driver model that provides torque demand in the form of desired ICE torque and brake torque, to meet the speed trace from a drive cycle. The topology of the forward-facing model that is used in this investigation is shown in Figure 1. A basic driver model typically uses one or more Proportional-Integral (PI) controllers to achieve the torque demand, concerning the desired speed trace. This is discussed further in the next section. The torque produced by the ICE propagates through the transmission and final drive ratios, before ending up as torque applied at the wheels. This is then exerted on the vehicle mass via force on the tire contact patch. The vehicle speed that results from the applied force is propagated back through the drivetrain and returns to the ICE as angular velocity at the crankshaft. Brake torque is applied directly to the wheels.
Unlike backwards-facing models (Figure 2), the speed trace is not “imposed” onto the vehicle model in forward-facing models, and therefore there will inevitably be a small margin of error between the actual vehicle speed and the speed trace. It is the role of the driver model to minimize this margin of error. This is similar to the role of a real-world test driver carrying out an emissions test for vehicle-type approval. Forward-facing models provide insight into the vehicle model's drivability, and it captures the limits of the physical system. It also makes control development and implementation on HIL systems easier. However, with the presence of multiple state equations in a typical forward-facing model, the vehicle speed (and subsequently drivetrain angular velocity) is computed via multiple state integration, resulting in the need to simulate smaller time steps. This results in longer simulation times when compared to backwards-facing models. Furthermore, resizing the powertrain will alter the dynamics of the system. This potentially requires the driver model to be re-tuned to maximize the performance of the system in areas such as fuel economy and longitudinal acceleration.

Backward Models
Backward models are calculated in a quasi-static manner. The inputs include vehicle conditions like velocity and acceleration, whereas the output is the force, torque, and power required at the source, i.e. the engine. They are simple and quick to use, making them ideal for quick computations and comparisons. They lack dynamics, and the method is mostly used to calculate simple fuel consumption and optimize energy management.

The ability of the vehicle model to meet the demands of the drive cycle is the principal assumption of a backwards-facing model. Based on the speed trace, the resultant force at the tire contact patch is calculated, where it is converted into wheel torque and propagated back to the ICE via the drivetrain, along with angular velocity. As a result, there is no driver model present. With both speed and torque imposed onto the powertrain components, a backwards-facing model can also be considered non-causal (physically non-realizable), as described by Hauer and Moore. During the optimization routine, the powertrain component sizing is determined by the ability of the component to address both the speed and torque imposed on the component (i.e., the power requirements). Backwards-facing models rely on efficiency maps that were created based on torque and speed data and are usually produced during steady-state real-world testing. This results in the calculation being relatively simpler than forward-facing models (essentially lookup tables instead of state equations), and can therefore be run over relatively larger time steps. Unfortunately, the very nature of using steady-state maps hinders the performance of backwards-facing models when it comes to representing dynamic effects.

Conventional Vehicle
Conventional vehicles use an internal combustion engine fueled by gasoline or diesel, to power the wheels. The heat engine works on the premise of releasing heat by combusting fuel with an oxidizer in a combustion chamber to produce expanding gases that push against a piston, producing force and torque. The chemical energy of the fuel is transformed into heat energy in internal combustion (IC) engines to produce meaningful mechanical work. Four-stroke reciprocating engines are the most prevalent type of engine. Internal combustion engines and conventional vehicles use ideal thermodynamic cycles like the Otto Cycle, Diesel Cycle, Over expanded cycle, and so on.
Energy Demand for Drive Cycle
Energy demand at the wheel, due to a drive cycle can be computed. The force at the wheels is given by,
Ftractive=MdV/dt+12ρaAfCd(V±Vw)2+CrMgcos(α)+Mgsin(α)
where M is the vehicle mass [kg],
V is the vehicle velocity [m/s],
ρa is the air density [kg/m3],
Af is the frontal area of the vehicle [m2],
Cd is the drag coefficient,
Vw is the wind velocity [m/s],
Cr is the rolling coefficient,
g is the acceleration due to gravity [m/s2],
`and is the road inclination a`
The power at the wheels is given by,
Ptractive=Ftractive⋅V
Ptractive=M*Vd/Vdt+12ρaAfCdV(V±Vw)2+CrVMgcos(α)+VMgsin(α)
Ptractive=MVd/Vdt+12ρaAfCdV(V±Vw)2+CrVMgcos(α)+VMgsin(α)
Assuming no grade (α= 0) and no headwind (Vw= 0),
Ptractive=Pw=MVdVdt+12ρaAfCdV3+CrMgV
Energy demand for the drive cycle is computed by integrating power over time for the entire cycle,
Ew=∫Pwdt=∫MVdV/dtdt+∫12ρaAfCdV3dt+∫CrMgVdt
Assuming mass, air density, drag coefficient, frontal area, rolling resistance coefficient and acceleration due to gravity are constant for the drive cycle,
Ew=M∫VdVdtdt+12ρaAfCd∫V3dt+CrMg∫Vdt
Ew=ki∫VdVdtdt+ka∫V3dt+kr∫Vdt
`span role="presentation"MathJax-Element-25-Frame" tabindex="0" role="presentation">ki is the coefficient of inertial resistance, ka is the coefficient of aerodynamic drag, kr is the coefficient of rolling resistance, and they are given by,
ki=M
ka=12ρaAfCd
kr=CrMg
The energy component [ki∫VdVdtdt] is the kinetic energy of the vehicle and is always 0 over the entire drive cycle. For a conservative system (i.e. no dissipative forces), the aerodynamic drag and rolling resistance component of the energy will also be 0. Also, when Pw<0, the energy is absorbed by the brakes. This can potentially be recaptured through regenerative braking.
To calculate energy, the integrals can be discretized. Generally, a time step of 1 sec is sufficient for the drive cycles.
Ew=ki∑iV(i)dV(i)dtΔt+ka∑iV3(i)Δt+kr∑iV(i)Δt.
Powertrain Sizing
Based on the individual power requirement for the drive cycle, the effect of aerodynamic drag, rolling resistance and an inertial component can be analyzed. High power is required to sustain high vehicle speeds, due to the increased drag component. From the overall power plot, the maximum positive power is the power that needs to be provided at the wheels by the powertrain to complete the cycle. This sets the minimum powertrain sizing requirement. Additionally, if all the potential braking energy is to be captured, then the regenerative unit must at least be designed to handle maximum negative power for the cycle.
Drive Cycle Development
A driving cycle is a set of values, generally, velocity vs time, which represents how a vehicle travels through a path. In simple words, it would be a velocity vs time graph of a vehicle.
Although the regulatory drive cycles are important as they form part of the certification processes and are well developed, they only form a part of the vehicle development process as they do not represent all the driving conditions that the manufacturer wants to develop for. The manufacturer might have tests representing different driving scenarios and also might have more aggressive tests depending on the application. Therefore, for an optimized design and to minimize the development time, it is important to be able to develop drive cycles, which can be used in simulations or vehicle testing. Cycles that depend on certain vehicle capabilities can be relatively developed. For example, to test the vehicle towing capacity up to a grade, need to specify towing load, speed, grade and time of operation. Multiple cycles can be added to test the capability of the powertrain. For developing a drive cycle from a real-world driving trip, the data is divided into kinematic sequences. The sequences are classified into distinct clusters. The probability of the occurrence of each type of sequence during a certain type of driving trip is calculated. Drive cycles are constructed by randomly selecting sequences based on their probabilities and a cycle is built based on the selection of cycle type, minimum cycle duration, distance, number of stops, average and top speeds, etc.
Energy-Based Models - Element Models
To model the internal physical properties of the element and the losses, there are two kinds of approaches: Map based models and Analytical models.
- Map-based models:
Elements are modelled using maps, which characterize the relationship between the input & output and output & losses etc. - Analytical models:
Elements are modelled using the physical equations, that represent the internal dynamics.
Load the “Project1_InitFile.m” Matlab script.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Skill-Lync -> Hybrid Drives Development
% Project 1 - Conventional Vehicle Model
% By - Ajay Ghanwat
% Description:
%% Initialization File
% Initialization file for loading the variables for the Conventional vehicle simulation model
%% Vehicle Parameters
M = 1500; % Vehicle weight [kg]
Cr = 0.015; % Rolling resistance coefficient
Rw = 0.35; % Rolling radius [m]
Cd = 0.33; % Drag coefficient
Af = 2; % Frontal area [m2]
rhoa = 1.225; % Air density [kg/m3]
Vwind = 0; % Wind velocity [kmph]
g = 9.81; % Gravitational acceleration [m/s2]
theta = 0; % Slope [deg]
myu_road_tire = 1; % Coefficient of friction between tire - road interface
%% Powertrain Parameters
FDR = 3.73; % Final Drive Ratio / Diff Ratio
DiffEff = 0.99; % Differential efficiency (assumed independent of operating conditions)
NumGear = 4; % Number of gears in transmission
TransGear = [1:NumGear]; % Transmission Gears
TransRatio = [3.06, 1.62, 1, 0.7]; % Corresponding Transmission ratios
TransEff = 0.90; % Transmission efficiency (assumed independent of operating conditions)
TC_SR = [0, .5, .6, .7, .8, .87, .92, .94, .96, .97, 1]; % Torque Converter Speed Ratio (Matlab default) -> TurbSpd/PumpSpd
TC_TR = [2.232, 1.5462, 1.4058, 1.2746, 1.1528, 1.0732, 1.0192, 1, 1, 1, 1]; % Torque Converter Torque Ratio (Matlab default) -> TurbTrq/PumpTrq
TC_Cf = 1e-4 * [.72558, .66322, .63463, .59042, .51331, .4144, .29287, .22444, .12186, .04386, 0]; % Torque Converter Capacity Factor (Matlab default) -> PumpTrq/PumpSpd^2 [Nm/rpm^2]
load Vehicle_Data/Engine_data_1_9L_Saturn_95kW
load Vehicle_Data/Trans_Shift_map
%% Driver Parameters
Kp = 10; % P gain for driver PI model
Ki = 1; % I gain for driver PI model
Drive_Cycle_Select =input('Enter Drive cycle Number ='); % Drive cycle selection
% Drive cycle values in m/s
if Drive_Cycle_Select == 1
load DriveCycles/UDDS;
elseif Drive_Cycle_Select == 2
load DriveCycles/HWFET;
elseif Drive_Cycle_Select == 3
load DriveCycles/FTP;
elseif Drive_Cycle_Select == 4
load DriveCycles/US06;
elseif Drive_Cycle_Select == 5
load DriveCycles/NEDC;
elseif Drive_Cycle_Select == 6
load DriveCycles/WLTP;
end
time_end = cyc_time(end);
vel_end = cyc_vel(end);
The above Matlab code contains engine parameters and drive cycles according to the requirements to be loaded in the workspace.
Simulink Vehicle Model:
The Simulink model consists of three main subsystems: Driver, Controller and Powertrain, as shown in Figure 4. The Driver subsystem generates the accelerator and brake pedal outputs to match the desired and actual vehicle speed. The Controller block represents the electronic control units, which generate the desired engine torque, desired transmission gear and desired brake torque based on the driver inputs. The Powertrain subsystem represents the actual vehicle consisting of all vehicle components which inputs the control signals from the Controller and provides actual vehicle motion characteristics.

In brief, the Simulink model is modelled using a ‘Driver’ block, which is a basic PI controller that generates accelerator and brake pedal outputs to match the desired and actual vehicle speeds. The ‘Controller’ block is the brains of the vehicle, representing the electronic control units. Based on the driver inputs, it generates desired engine torque, desired transmission gear and desired brake torque. These inputs are fed to the ‘Powertrain’ block which represents the drivetrain of the vehicle. It consists of an ‘Engine’ connected to the ‘Automatic Transmission’ through a ‘Torque Converter’. The output of the transmission is connected to the ’Differential’, which powers the ‘Wheels’, which provides the tractive force for vehicle acceleration. The longitudinal dynamics of the vehicle along with the road load are represented in the ‘Vehicle Dynamics’ block. The solver selected is ode3 with a fixed step size of 0.01 sec.
Driver Block

This block is a PI controller. A PI Controller is a feedback control loop that calculates an error signal by taking the difference between the output of a system. It multiplies the error with constant gain for P and I, it integrates and then multiplies with a smaller gain. The constant value for P and I are found by the trial-and-error method. Here, the error is the difference between the desired vehicle speed (from the drive cycle) and the actual vehicle speed. The error could be positive or negative. The integrator block used keeps on adding the error and is then divided into two since the driver block needs to produce the signal for acceleration and brake pedal. The saturation block extracts the positive and negative signal as the acceleration pedal is passed on between the values 0 and 100, while for the brake pedal, the values between -100 and 0 are extracted, which means it provides a value between 0 and 100 per cent. This negative signal for the brake pedal is multiplied by -1 to make it a positive value. The scope is provided to compare the actual and desired speeds. The sample scope output for the UDDS drive cycle is provided in Figure 4. For stopping the simulation when a set of conditions are satisfied, another set of blocks is provided. The comparative block compares the actual time and end time of the drive cycle, similarly, the current velocity is compared with the end velocity. If both conditions are satisfied, then the simulation is forcefully stopped. This is done to stop the simulation when the drive cycle end independent of the drive cycle chosen as different drive cycle has different end time.

Fig shows Driver's Model

Fig Shows Graphical Comparision of Drive cycle velocity VS Actual velocity
Controller Block

The output of the driver block which is the acceleration and brake pedal signal is passed on to the Controller block. The controller block consists of three control units: Engine Control Unit, Transmission Control Unit and Brake Control Unit. All this data from the three Control Units goes to the bus creator. The bus creator is used to combine all these three signals into one signal. This combined signal is then sent to the Powertrain block.
Engine Control Unit 
The engine control unit has Idle Speed Controller to make sure that the engine is idling and doesn't go beyond idle speed. The signal from the Idle Speed controller is added to the throttle request from the Driver block and is then converted into an engine torque request based on the maximum and minimum torque curves made from the 1D lookup table. A sample output from the scope for the UDDS drive cycle is shown in Figure 5.

Idle Speed Controller 
The Idle Speed Controller is a PI Controller where the engine speed and the idle speed of the engine are compared. The error is then multiplied with constant P and the integrated error is multiplied with constant I.
Transmission Control Unit 
It uses a state logic and provided the current gear of the vehicle. The state is defined by comparing the throttle signal and vehicle speed. The ShiftLogic is the logic control block for defining the gear.
ShiftLogic

The gear_state is defined between 4 states as the vehicle has four gears in total. The UP and DOWN values are calculated using another state selection_state. When in the selection_gear state, a function ComputeThreshold is calculated where the inputs are Gear and Throttle. The output will be down_th and up_th for the function which is speed limits. The outputs from the function are fed in, then the downshift and upshift are done based on vehicle speed and the parameter inputs from the Matlab file Trans_Shift_map.
ComputeThreshold function
The function uses lookup tables to find the transmission shifts and provides two outputs which feed the selection_state.
Brake Control Unit 
The Brake pedal signal from the Driver block is multiplied by the maximum friction, which gives the maximum braking torque. The gain block is used to convert to actual value from the percentage.
Powertrain Block

The Powertrain block consists of five main subsystems: Engine, Transmission, Differential, Wheels and Vehicle Dynamics. The signals from the Controller block are extracted using the bus selector, which consists of the signal for Engine torque requirement, Gear command, and Brake Torque Requirement.
Engine

The Engine blocks take in Engine Torque requirement as input and it is compared with the maximum and minimum torque curve and is maintained between the required range using the saturation dynamic block. The maximum and minimum torque curves are found using the lookup table according to the engine speed from the data from the Matlab file "Engine_data_1_9L_Saturn_95kW". The engine torque requirement after filtration is passed to the 2D lookup table along with engine speed where the fuel consumption rate is found. The saturation block ensures that the fuel rate value is positive and integrating it gives the total engine fuel consumption. The required parameters are transferred to the workspace using To Workspace blocks.
Transmission

The transmission takes engine torque and gear as inputs. The signals are then passed into the Torque converter. The transmission torque from the torque converter is passed into the gear system where the speed and torque change as per the gear reduction. The selected gear corresponding to a particular time is used to find the corresponding gear ratio value using the lookup table and is multiplied with torque from the torque converter. The switch is used to consider the efficiency of the transmission. The sample output from the scope for the UDDS drive cycle is shown in Figure 6.

Torque converter

A torque converter is a form of fluid coupling that transfer rotating power from a vehicle's engine to its transmission. In an automatic transmission, it replaces the mechanical clutch. The pump which is coupled with the engine is used to derive the pump speed and dividing it by the transmission speed gives the speed ratio. This speed ratio is used to find the torque ratio and capacity factor using the lookup table. The capacity factor is used for finding the pump torque from the pump speed using the equation,

This pump torque is used to find the turbine torque using the torque ratio. Multiple scopes are used to visualize the various parameters. The sample scope outputs are shown in Figure 7 and 8

Capacit 7: Scope output for analyzing pump speed, turbine speed and speed ratio of the torque
Figure 8: Scope output for analyzing Pump and Turbine Torque
Differential
The Differential subsystem takes the output from the transmission system and reduces it as the gear ratio of the differential. The switch block is used to compensate for the negative and positive sign values. The required parameters are transferred between the other subsystems and the command window using the goto and To Workspace blocks.

Wheels

The Wheels subsystem takes the axle torque and brake torque as the input. The brake torque is to reduce the axle torque to maintain the desired vehicle speed. Dividing the dynamic radius of the wheel with equivalent torque and vehicle velocity gives the tractive force and the wheel speed.
Vehicle Dynamics

The Vehicle Dynamics block is used to find the vehicle's dynamic characteristics like velocity, acceleration, and distance traveled from the tractive force. The vehicle force corresponding to the actual vehicle is the difference between the tractive and the road load. The road load constitutes the drag, rolling, and grading resistance. The velocity saturation is multiplied by the rolling resistance to ensure that it is avoided when the vehicle is not in motion. The saturation gives the value 0 for the zero velocity case and 1 for the vehicle with a certain velocity. From the equivalent force, the actual vehicle acceleration, velocity, and distance traveled can be found. The sample output from the scope for the UDDS drive cycle is shown in Figure 9. The longitudinal dynamics equation which is used for the respective block is,


figure. shows road load acceleration and velocity graph
MATLAB Post Processing Code:
The MATLAB script "Project1_ProcessingFile" is used to analyze the data from the Simulink model and to generate plots. After the Simulink vehicle model is run, some of the data are sent to the workspace which is used to plot different parameters for the study of the conventional vehicle in MATLAB.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Skill-Lync -> Hybrid Drives Development
% Project 1 - Conventional Vehicle Model
% By - Ajay Ghanwat
% Description:
% The following file is to used with the Initialization file and Simulink
% results for post-processing of the data.
% The file is incomplete, has some examples of how the data is imported
% into a readable format, data analysis and plotting examples.
% Based on the project task, use commands in a similar format as given
% below, to analyse the data and generate required plots.
% You can change variable names if desired
%% Post-Processing File
% File for post-processing the Conventional vehicle simulation model data
%% Renaming variables
Time = out.tout;
Acc_Pdl = out.Acc_Pdl; % Accelerator pedal [%]
Brk_Pdl = out.Brk_Pdl; % Brake pedal [%]
Gear_Cmd = out.Gear_Cmd; % Transmission gear
Trans_In_Spd = out.Trans_In_Spd*30/pi; % Transmission input speed [rpm]
Trans_Out_Spd = out.Trans_Out_Spd*30/pi;% Transmission output speed [rpm]
Eng_Trq = out.Eng_Trq; % Engine brake torque [Nm]
Eng_Spd = out.Eng_Spd*30/pi; % Engine speed [rpm]
Eng_Fuel_Consump = out.Eng_Fuel_Consumption; % Engine fuel consumption [g]
Eng_Fuel_Rate=out.Eng_Fuel_Rate;
Veh_Dist = out.Veh_Dist/1000; % Distance traveled by vehicle [km]
Veh_Spd = out.Veh_Spd*18/5; % Vehicle speed [kmph]
WheelSpd = out.WheelSpd; %Wheel speed
Eng_trq=Eng_Trq.Data(:,1);
Eng_spd=Eng_Spd.Data(:,1);
%% Data Analysis
Eng_Pwr = (Eng_Spd.*pi./30.*Eng_Trq)./1000; % Engine brake power [kW]
rho_petrol = 0.7197; % Density of petrol [kg/L]
kmpl = Veh_Dist(end)/(Eng_Fuel_Consump(end)/1000/rho_petrol); % Fuel economy [kmpl]
Eng_pwr=Eng_Pwr.Data(:,1);
%% Plotting time trace for engine,transmission input,transmission output wheel speed
figure('Name','Time vs Trans_input,trans_out,Wheelspeed')
subplot(3,1,1)
hold on
grid on
plot(Time,Trans_In_Spd,'linewidth', 1, 'Color', 'k');
ylabel('Trans InSpd in RPM')
subplot(3,1,2)
plot(Time,Trans_Out_Spd,'linewidth', 1, 'Color', 'r')
ylabel('Trans OutSpd in RPM')
subplot(3,1,3)
plot(Time,WheelSpd,'linewidth', 1, 'Color', 'b')
ylabel('Trans WheelSpd')
xlabel('Tme in sec')
%% Plotting Enginr Torque,engine power,fuel rate,fuel consumption VS Time
figure('Name','Engine Power Performance')
subplot(4,1,1)
plot(Time,Eng_trq,'linewidth',1,'color','k')
ylabel('Torque [Nm]')
subplot(4,1,2)
plot(Time,Eng_pwr,'linewidth',1,'color','r')
ylabel('Power[Kw]')
subplot(4,1,3)
plot(Time,Eng_Fuel_Rate,'linewidth',1,'color','y')
ylabel('Fuel Rate [g/sec]')
subplot(4,1,4)
plot(Time,Eng_Fuel_Consump,'linewidth',1,'color','b')
ylabel('Fuel consum [Kmpl]')
xlabel('Time [sec]')
%% Plotting vehicle characteristics time trace
figure('Name','vehicle characteristics')
subplot(5,1,1)
hold on
grid on
plot(Time, Acc_Pdl, 'linewidth', 1, 'Color', 'black');
plot(Time, Brk_Pdl, 'linewidth', 1, 'Color', 'red');
ylabel('Pedal [%]')
xlim([0, Time(end)]);
legend('Accel','Brake');
subplot(5,1,2)
hold on
grid on
plot(Time, Trans_In_Spd, 'linewidth', 1, 'Color', 'black');
plot(Time, Trans_Out_Spd, 'linewidth', 1, 'Color', 'red');
ylabel('Speed [rpm]')
xlim([0, Time(end)]);
ylim([0, 6000]);
legend('Trans Input','Trans Output');
subplot(5,1,3)
hold on
grid on
plot(Time, Gear_Cmd, 'linewidth', 1, 'Color', 'black');
xlim([0, Time(end)]);
ylabel('Gear');
subplot(5,1,4)
plot(Time,Veh_Spd)
ylabel('Km/hr')
subplot(5,1,5)
plot(Time,Veh_Dist)
ylabel('Km')
xlabel('Time [s]');
%% Plotting engine operating points on engine fuel map
figure('Name','Engine Operating Points');
hold on
grid on
title('Engine Operating Points','fontsize',12);
p1=plot(Eng_map_spd*30/pi,Eng_max_trq,'linewidth',2,'color','r');
p2=line([Eng_map_spd(end)*30/pi Eng_map_spd(end)*30/pi],[0 Eng_max_trq(end)]);
set(p2,'linewidth',1,'linestyle','--','color','k');
p3=line([Eng_map_spd(1)*30/pi Eng_map_spd(1)*30/pi],[0 Eng_max_trq(1)]);
set(p3,'linewidth',1,'linestyle','--','color','k');
[c,h] = contour(Eng_map_spd'*30/pi,Eng_map_trq,Eng_fuel_map');
clabel(c,h);
xlabel('Engine Speed [rpm]');
ylabel('Engine Torque [Nm]');
title('Engine Fuel Consumption Map [g/s]');
%p4 = plot(Eng_spd,Eng_trq,'.','color','k');
%legend([p1 p4],{'Max Curve','Operating Points'});
%axis([Eng_map_spd(1)*30/pi Eng_map_spd(end)*30/pi 0 Eng_map_trq(end)]);
fprintf('Fuel Economy = %9.3f\n',kmpl(end));
For the study of the developed vehicle model with various drive cycle, the code to plot the following relations are made:
- The time trace for engine, transmission input, transmission output and wheel speed on one plot.
- The engine torque, engine power, fuel rate and fuel consumption using subplots.
- The accelerator and brake pedal, gear command, vehicle desired and actual speed, and vehicle distance using subplots.
- The engine operating points on the engine fuel map.
Comparative Study of the Developed Model for UDDS and HWFET Drive Cycle:


| UDDS | HWFET | |
| Fuel Economy Numbers (kmpl) | 13.631 | 16.307 |
The fuel economy seemed to be significantly more for the HWFET drive cycle than the UDDS for the same vehicle characteristics. This variation is purely based on the drive cycle which is easily observable from Figures 10 and 11. The third subplot in Figures 10 and 11 gives information on the variation of velocity concerning time. The UDDS drive cycle seems to have a more prominent varying velocity over time than HWFET. Therefore, more brake pedal has to be used for UDDS than HWFET which can be observed from the first subplot. The more the brake pedal is pressed, the more will be energy lost, which in turn means less will be fuel economy number.
Engine Transmission Characteristics
b.Time trace for engine, transmission input, transmission output and wheel speed on one plot.
for UDDS Cycle

For HWFET Cycle

C.Engine torque, engine power, fuel rate and fuel consumption.
for UDDS Cycle

For HWFET Cycle

D.Accelerator and brake pedal, gear command, vehicle desired and actual speed, vehicle distance
for UDDS Cycle

For HWFET Cycle

E. Plot the engine operating points on the engine fuel map.
for UDDS Cycle

For HWFET Cycle

Conclusion:
The MATLAB script for both initializing and post processing has be successfully made, and a forward energy-based fuel consumption Simulink model of a conventional vehicle is also developed successfully, and the functionality is checked. The comparative study of UDDS and HWFET for the developed vehicle model is analyzed.