| Model-Based Calibration Toolbox | ![]() |
www.kxcad.net Home > CAE Software Index > MATLAB Index >
| On this page… |
|---|
Creating a design in the Model-Based Calibration toolbox comprises several steps. First, you need to enter the ranges and names of the variables being used and choose a default model. Then you can create an initial design and set up the constraints on the space. These constraints will be the same for all designs. From this constrained design, you can create a series of child designs adding varying numbers of points and using different construction techniques. You can choose the final design by comparing the statistics of the various child designs, while considering how many test points you can afford to run.
Variables are
| measrpm | Engine speed (rpm) |
| basefuelmass | Fuel quantity per injection (mg) |
| fuelpress | Fuel pressure (MPa) |
| grackmea | VGT rack position (%) |
| egrlft | EGR valve position (mm) |
| soi | Start of injection (deg ATDC) |
You need to set up a test plan before you can make designs. This experiment is set up as a two-stage test plan with start-of-injection (SOI) sweeps at the local level and the other five variables at the global level.
Open the example session with the test plan set up as follows:
Start the Model Browser by typing mbcmodel at the MATLAB command line.
Select File > Open Project. Locate the example session with the test plan set up, Diesel_testplan.mat, in the mbctraining directory and double click to load the project.
Click the Two-Stage test plan node in the model tree to see the test plan diagram.


Double-click the Global Inputs block in the diagram to set the ranges of the inputs. You should set up the ranges before designing an experiment. You can enter the ranges in the min/max boxes to include the most extreme values you want to set for each variable. Check the ranges match those shown in the following example, then click OK.

Double-click the Global Model block in the test plan diagram to view the model type. For this exercise, leave the model type at the default, which is a quadratic in all factors. Click OK to dismiss the dialog.
Remember that the statistical usefulness of different designs depends on the model type. For example, if you think you need cubic instead of quadratic in EGR, the number of points required rises dramatically and this has a highly adverse effect on the statistical quality of the designs.
Some possible models are
Cubic polynomial, quadratic in fuel pressure: 41 terms
Cubic polynomial, quadratic in fuel pressure and EGR: 31 terms
However, you do need to bear in mind that the final model will probably not be either of the possibilities listed here, because some terms will have been removed, or it might even be an RBF (radial basis function). You choose the most suitable model you can in order to construct a design, then when you have collected the data you might find that a different model type produces the best fit.
These are the constraints you want to apply to the design space:
basefuelmass
Maximum 200 at 1600 rpm, 175 at 2200 rpm
fuelpress
Range 90 - 110 at 1600 rpm
Range 120 - 160 at 2200 rpm
grackmea
Range 0.2 - 0.6 at 1600 rpm
Range 0.4 - 0.9 at 2200 rpm
The tables here are very simple: one output value defined at the min and max settings of RPM. The final constraint is a cube within the base fuel mass-fuel pressure-VGT space that moves and changes size as RPM is altered.
To add a constraint to a design,
First open the Design Editor by right-clicking the Global Model block in the test plan diagram and selecting Design Experiment.
Click the New Design
button in the toolbar or select File > New Design.
A new node called Linear Model Design appears.
The new Linear Model Design node is automatically selected. An empty Design Table appears because you have not yet chosen a design, unless you have previous design views from other sessions. The Design Editor retains memory of view settings.
The Edit Constraint dialog with available constraints appears. Make sure the default 1D Table is selected from the Constraint Type drop-down menu. These are easier to set up than linear constraints, although working out the linear constraint numbers might be worthwhile for larger problems as it is faster.
You can select the appropriate factors to use. For the first constraint, choose measrpm, basefuelmass, and the inequality <= from the menus.
You can define the constraint by typing values in the edit boxes or by moving the large dots (clicking and dragging them) to define a boundary. For this constraint, you want to define two points.
Select the Table Editor tab and edit the Number of breakpoints to 2, and click Span range.
On the Graphical Editor tab, click Move
Points
, then click and drag the right
point (where measrpm =2200) down to basefuelmass =175. You can also enter
the values in the measrpm and basefuelmass edit
boxes, or in the table on the Table Editor tab.
Click to select the left point. Make sure the values are 1600 in the measrpm edit box and 200 in the basefuelmass edit box. The dialog should look like the following example.

This constraint defines the range of basefuelmass in terms of RPM to within these bounds: maximum 200 at 1600 rpm, 175 at 2200 rpm.
In the Constraints Manager, click Duplicate four times. This saves you setting up tables with only two points for the next constraints. Click to select the first new constraint, then click Edit.
You need to add constraints that define each of the following:
fuelpress
Range 90 - 110 at 1600 rpm
Range 120 - 160 at 2200 rpm
You achieve this by defining two constraints. In the first, the two table points define a fuelpress minimum of 90 at 1600 rpm and a minimum of 120 at 2200 rpm. In the second, the two table points define a fuelpress maximum of 110 at 1600 rpm and a maximum of 160 at 2200 rpm.
In the Edit Constraint dialog, change the Y factor to fuelpress and leave the X factor as measrpm.
Change the Inequality to >=.
Select the left point (where measrpm = 1600) and enter 90 in the fuelpress edit box.
Select the right point (where measrpm = 2200) and enter 120 in the fuelpress edit box. The dialog should look like the following.

Click OK to return to the Constraint Manager.
Select the next constraint and click Edit. Edit the constraint to define a fuelpress maximum of 110 at 1600 rpm and a maximum of 160 at 2200 rpm, as shown.

Click OK to return to the Constraint Manager.
Complete the other constraints in a similar way.
grackmea
Range 0.2 - 0.6 at 1600 rpm
Range 0.4 - 0.9 at 2200 rpm
This is achieved as shown in the following two constraints.


The Constraints Manager should contain all five constraints as shown.

Click OK to return to the Design Editor.
Right-click a Design Editor view and select Current View > 3D Constraints to view the constrained design space.

Number of points
How many do you have time for? When you consider the number of points, you need to remember that a sweep will be done at each point, and this will take some time.
Do you need to allow time to fix problems or redo experimental points that can't be achieved due to combustion stability constraints?
Design type
V-optimal: reduces average prediction error
V-optimal designs are often the preferred choice for engine testing. Optimal designs tend to push points to the edge, so they should give good coverage of the 1600 and 2200 RPM points while also allowing good modeling of the entire experimental region.
Create an optimal design with 65 points to compare to the example design.
Click Optimal Design
in
the toolbar. The Optimal Design dialog opens.
Select V-Optimal from the Optimality criteria drop-down menu and click OK.
The Optimizing Design dialog appears. Click Accept when iterations are not producing noticeable improvements; that is, the graph becomes very flat.
Examine the design points and compare to the constraint space by right-clicking the 3D Constraints view and selecting Split View > 3D Design Projection.
The final design used contained 65 points, for a quadratic in fuel pressure and EGR lift. V-optimal value = 0.302.
Data was generated by a Ricardo WAVE model using the experimental design. Simulation tools in MATLAB and Simulink control WAVE. Simulation tools support multiple WAVE processes retrieving test points from a central store. Average simulation time was 8 points (30 engine cycles each) per hour using four processors in parallel. Transient test results were then processed to extract steady-state results.
You can use the toolbox to import test data, view it, sort it into tests, verify ranges, filter out unwanted points, and select data for modeling. For details on any of these processes, see the examples in the gasoline case study section Importing and Filtering Data, and for comprehensive information on data handling in the toolbox, see Data in the Model Browser documentation. See also the examples in the Tutorial: Data Editor.
The example project provided (Diesel_testplan.mat) contains the filtered data attached to the test plan.
| Diesel Case Study Overview | Modeling | ![]() |
© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments