Main Content

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 theDrive Cycle Sourceblock and clickInstall additional drive cycles. For more information, seeInstall 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,“源/驱动周期”]; 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')
### Starting serial model reference simulation build ### Successfully updated the model reference simulation target for: DrivetrainConVeh ### Successfully updated the model reference simulation target for: PowertrainMaxPowerController ### Successfully updated the model reference simulation target for: SiEngineController ### Successfully updated the model reference simulation target for: SiMappedEngine Build Summary Simulation targets built: Model Action Rebuild Reason ==================================================================================================================== DrivetrainConVeh Code generated and compiled DrivetrainConVeh_msf.mexw64 does not exist. PowertrainMaxPowerController Code generated and compiled PowertrainMaxPowerController_msf.mexw64 does not exist. SiEngineController Code generated and compiled SiEngineController_msf.mexw64 does not exist. SiMappedEngine Code generated and compiled SiMappedEngine_msf.mexw64 does not exist. 4 of 4 models built (0 models already up to date) Build duration: 0h 3m 47.506s

The results indicate that the fuel economy is approximately 30 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 DrivetrainConVeh is up to date. ### Model reference simulation target for PowertrainMaxPowerController is up to date. ### Model reference simulation target for SiEngineController is up to date. ### Model reference simulation target for SiMappedEngine is up to date. Build Summary 0 of 4 models built (4 models already up to date) Build duration: 0h 0m 1.383s

The results indicate that the fuel economy is approximately 34 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(结束);logsout2 = simout2.get ('logsout'); FE_hwy = logsout2.get('Fuel Economy [mpg]') .Values.Data(结束);

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(结束);CO = logsout1.get('CO [g/mi]') .Values.Data(结束);NOx = logsout1.get('NOx [g/mi]') .Values.Data(结束);CO2 = logsout1.get('CO2 [g/km]') .Values.Data(结束);

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: 30.51 mpg Highway: 36.63 mpg Combined: 33.26 mpg TAILPIPE EMISSIONS HC: 0.001 [g/mi] CO: 0.000 [g/mi] NOx: 0.002 [g/mi] CO2: 178.0 [g/km] NMOG: 0.003 [g/mi] ***********************

See Also

Related Examples

More About