Engmodel Documentation
A program to automatically generate engine files for ADVISOR from test
data.
Tutorial
with Sample Files
See plotting and processing of sample files to help you get your engine
data in the correct format.
Processing Engine Test Data
Engmodel takes columns of engine test data (unevenly spaced) and generates
square matrices for the fuel use and emissions. The maximum torque
envelope is taken from the maximum observed torque at each given test speed.
To convert test data into an ADVISOR file, Engmodel follows three steps:
-
Read in text file: Converts text file with headers into a Matlab mat file
-
Set Parameters/Process: Allows the user to specify output limits/increments
and processes the data
-
Create ADVISOR File: Takes data from the workspace and writes out an m
file for use in ADVISOR
'Load' loads a mat file containing the test data in column form.
Read in text file
Engine data should be put in a text file in column form with the first
line containing headers. The headers should have no spaces.
Ultimately, the variable names should be the following:
Variable
|
Required Name
|
Units
|
Engine Speed
|
fc_spd
|
rpm
|
Engine Torque
|
fc_trq
|
Nm
|
Engine Fuel Use
|
fc_fuel
|
g/s
|
HC emissions
|
fc_hc
|
g/s
|
CO emissions
|
fc_co
|
g/s
|
NOx emissions
|
fc_nox
|
g/s
|
PM emissions
|
fc_pm
|
g/s
|
The headers may be set as the required name either in the text file,
or via the 'Read in text file' gui.
Toubleshooting
-
Increasing speed (>= previous point) is assumed for the speed column.
-
Emissions are optional inputs; if emissions do not exist, they will be
set to zero.
-
Jagged behavior is sometimes observed in the output plots. This may
be due to small differences in input speed over the test points.
To eliminate this jagged behavior, round the input speeds. For example,
if fc_spd has values of [800.15 800.17 800.2] round them to [800 800 800].

To convert the text file to a mat file, the user should follow the following
steps:
-
Select file to convert (pushbutton allows gui selection)
-
Set header/variable names to required names (see table above)
-
Select mat file to save to (pushbutton allows user to specify filename)
Set Parameters/Process
To process the test data, the user follows these steps:
-
Specify mat file with test data
-
Choose algorithm to extrapolate map points which are outside the envelope
of tested data
-
Specify the minimum, maximum, and increments for speed and torque of the
desired square matrix.
-
Specify the lower heating value of the fuel
-
Choose to plot results
-
Process
Algorithm for extrapolation
When test data exists surrounding a region of the speed-torque map
space, the Matlab function griddata is used for interpolation (linear).
This ensures that the surface will pass through available data points.
When an evenly spaced grid point lies outside the envelope of test data,
extrapolation is required. The user can specify one of two algorithms
to perform this: polynomial fit and nearest neighbor.
Polynomial Fit A least squares fit is obtained over the
data for the following equation:
where y is the output (e.g. fuel use, hc emissions), w
is speed and T is torque. Printed to the workspace is the
point with maximum error, as well as an average error.
Nearest Neighbor This approach lets the data take on the tested
value at it's nearest neighbor.
The maximum torque curve is taken from the maximum tested torque levels
at a given speed. The average error for each map is recorded.
Plotting the results will pull up 3-7 graphs (up to seven if data for
all four emissions is present):
-
Maps (g/s): The contours plotted are the generated map points.
The test points are plotted with their values for comparison.
-
Fuel use (g/kWh)
-
Efficiency Map: The contours plotted are the generated map points.
Again, the test points are plotted with their values for comparison.
Create ADVISOR File
Finally, the user specifies additional information used to create the
ADVISOR file.
-
Specify name of file to create (format FC_SIxx.m or FC_CIxx.m where xx
is maximum power in kW)
-
Fill in the top information (required)
-
Choose to use default mass and thermal characteristics, or edit them as
desired.
-
Select Make ADVISOR file
For a description of the fuel converter variable names see ADVISOR documentation.

Last revised: 1/24/01, vhj