Conventional Vehicle Spark-Ignition Engine Fuel Economy and Emissions

This example shows how to calculate the city and highway fuel economy and the emissions for a conventional vehicle with a 1.5-L spark-ignition (SI) engine. To run this example, make sure you have the city (FTP75) and the highway (HWFET) drive cycles installed. After you open the conventional vehicle reference application, open the Drive Cycle Source block and click Install additional drive cycles. For more information, see Install Drive Cycle Data.

setupconvehMPG;

Prepare the Conventional Vehicle Reference Application For Simulation

Name the Drive Cycle Source block and Visualization subsystem.

model = 'SiCiPtReferenceApplication';
dcs = [model, '/Drive Cycle Source'];
vis_sys = [model, '/Visualization'];

In the Visualization subsystem, log the emissions signal data.

pt_set_logging([vis_sys, '/Performance Calculations'], 'US MPG', 'Fuel Economy [mpg]', 'both');
pt_set_logging([vis_sys, '/Emission Calculations'], 'TP HC Mass (g/mi)', 'HC [g/mi]', 'both');
pt_set_logging([vis_sys, '/Emission Calculations'], 'TP CO Mass (g/mi)', 'CO [g/mi]', 'both');
pt_set_logging([vis_sys, '/Emission Calculations'], 'TP NOx Mass (g/mi)', 'NOx [g/mi]', 'both');
pt_set_logging([vis_sys, '/Emission Calculations'], 'TP CO2 Mass (g/km)', 'CO2 [g/km]', 'both');

Run City Drive Cycle Simulation

Configure the Drive Cycle Source block to run the city drive cycle (FTP75).

set_param(dcs,'cycleVar','FTP75');

Run a simulation of the city drive cycle. View the results in the Performance and FE Scope.

tfinal = get_param(dcs, 'tfinal');
tf = tfinal(1:strfind(tfinal,' '));
simout1 = sim(model,'ReturnWorkspaceOutputs','on', 'StopTime', tf);
open_system('SiCiPtReferenceApplication/Visualization/Performance and FE Scope')
Model 'PowertrainMaxPowerController' was created with a newer Update release (R2020a Prerelease Update 6) of Simulink.
Model 'SiDrivetrain' was created with a newer Update release (R2020a Prerelease Update 6) of Simulink.
Model 'SiEngineController' was created with a newer Update release (R2020a Prerelease Update 6) of Simulink.
Model 'SiMappedEngine' was created with a newer Update release (R2020a Prerelease Update 6) of Simulink.
### Starting serial model reference simulation build
Model 'PowertrainMaxPowerController' was created with a newer Update release (R2020a Prerelease Update 6) of Simulink.
### Successfully updated the model reference simulation target for: PowertrainMaxPowerController
Model 'SiDrivetrain' was created with a newer Update release (R2020a Prerelease Update 6) of Simulink.
### Successfully updated the model reference simulation target for: SiDrivetrain
Model 'SiEngineController' was created with a newer Update release (R2020a Prerelease Update 6) of Simulink.
### Successfully updated the model reference simulation target for: SiEngineController
Model 'SiMappedEngine' was created with a newer Update release (R2020a Prerelease Update 6) of Simulink.
### Successfully updated the model reference simulation target for: SiMappedEngine

The results indicate that the fuel economy is approximately 28 mpg at the end of the drive cycle. The scope also provides the target velocity, engine speed, and brake specific fuel consumption (BSFC).

Run Highway Drive Cycle Simulation

Configure the Drive Cycle Source block to run the highway drive cycle (HWFET). Make sure that you have installed the highway drive cycle.

set_param(dcs,'cycleVar','HWFET');

Run a simulation of the highway drive cycle. View the results in the Performance and FE Scope.

tfinal = get_param(dcs, 'tfinal');
tf = tfinal(1:strfind(tfinal,' '));
simout2 = sim(model,'ReturnWorkspaceOutputs','on', 'StopTime', tf);
open_system('SiCiPtReferenceApplication/Visualization/Performance and FE Scope')
### Starting serial model reference simulation build
### Model reference simulation target for PowertrainMaxPowerController is up to date.
### Model reference simulation target for SiDrivetrain is up to date.
### Model reference simulation target for SiEngineController is up to date.
### Model reference simulation target for SiMappedEngine is up to date.

The results indicate that the fuel economy is approximately 32 mpg at the end of the drive cycle. The scope also provides the target velocity, engine speed, and brake specific fuel consumption (BSFC).

Extract Results

Extract the city and highway fuel economy results for the city and highway drive cycles from the logged data.

logsout1 = simout1.get('logsout');
FE_urban = logsout1.get('Fuel Economy [mpg]').Values.Data(end);
logsout2 = simout2.get('logsout');
FE_hwy = logsout2.get('Fuel Economy [mpg]').Values.Data(end);

Use the city and highway fuel economy results to compute the combined sticker mpg.

FE_combined = 0.55*FE_urban + 0.45*FE_hwy;

Extract the tailpipe emissions from the city drive cycle.

HC = logsout1.get('HC [g/mi]').Values.Data(end);
CO = logsout1.get('CO [g/mi]').Values.Data(end);
NOx = logsout1.get('NOx [g/mi]').Values.Data(end);
CO2 = logsout1.get('CO2 [g/km]').Values.Data(end);

Display the fuel economy and city drive cycle tailpipe emissions results in the command window.

fprintf('\n***********************\n')
fprintf('FUEL ECONOMY\n');
fprintf('   City:     %4.2f mpg\n', FE_urban);
fprintf('   Highway:  %4.2f mpg\n', FE_hwy);
fprintf('   Combined: %4.2f mpg\n', FE_combined);
fprintf('\nTAILPIPE EMISSIONS\n');
fprintf('   HC:   %4.3f [g/mi]\n',HC);
fprintf('   CO:   %4.3f [g/mi]\n',CO);
fprintf('   NOx:  %4.3f [g/mi]\n',NOx);
fprintf('   CO2:  %4.1f [g/km]\n',CO2);
fprintf('   NMOG: %4.3f [g/mi]',HC+NOx);
fprintf('\n***********************\n');
***********************
FUEL ECONOMY
   City:     26.06 mpg
   Highway:  32.02 mpg
   Combined: 28.74 mpg

TAILPIPE EMISSIONS
   HC:   0.001 [g/mi]
   CO:   0.000 [g/mi]
   NOx:  0.002 [g/mi]
   CO2:  208.7 [g/km]
   NMOG: 0.003 [g/mi]
***********************

See Also

Related Examples

More About