|
|
|
| R2012a Documentation → Model-Based Calibration Toolbox | |
Learn more about Model-Based Calibration Toolbox |
|
| Contents | Index |
| On this page… |
|---|
CAGE generally calibrates lookup tables by reference to models. The Models view is a storage place for all the models in your session.
To view and edit the models in your session, select Models by clicking the button shown in the Data Objects pane.
![]()
The Models view displays the following:
A list of all the models in the current project.
The model connections. That is, which constants, variables, and models are inputs to the selected model. You can use the View menu or the right-click context menu on the graph to zoom in and out, zoom to fit, and reset.
An image of the response surface of the selected model; you can select factors to display. Use the View menu to choose between:
No Constraint Display — Shows entire model surface.
Show Constraint — Areas outside the boundary constraint model (if any) are yellow.
Clip to Constraint — The surface is only shown within the boundary constraint model.
View > Edit Input Set Points opens a dialog box where you can edit the set points of your model variables. This setting alters the model display and also any calculations involving the set points throughout CAGE. Altering this setting is the same as altering the set points in the Variable Dictionary, see Using Set Points in the Variable Dictionary.
Following is an example of the Models display.

The icons in the Models list indicate the type of model, as listed in the Type column. As shown in the following illustration, a model can be a Model Browser statistical model, the boundary of a model, the prediction error variance (PEV) of a model, a user-defined function model, or a feature model (converted from a feature).
![]()
You can use the Model Properties dialog to switch a model output between the model value and the boundary or PEV of the model. For function models see Adding New Function Models. You can convert a feature to a model by selecting Feature > Convert to Model.
CAGE enables you to calibrate lookup tables by referring to models constructed in the Model Browser.
CAGE can only open Model-Based Calibration Toolbox model files. You can import models from project files (.mat, .cag) and from exported model files (.exm).
You can use the CAGE Import Tool to select models to import from any Model-Based Calibration Toolbox project file produced in CAGE or the Model Browser (.mat or .cag). You can replace suitable models in your current CAGE project (note that Model Browser models must have exactly the same input names as the CAGE model you are replacing).
See CAGE Import Tool for instructions.
To import models from a Model Browser exported models file (.exm):
A file browser dialog opens. Locate the desired file or files. You can select multiple files. Examples can be found in matlab/toolbox/mbc/mbctraining. You can select MBC Model (*.exm) to filter for .exm files.
Click to select the model file, then click Open .
This opens the Model Import Wizard.
Select the models that you want to import by highlighting the models from the list, or click Select All if you want every model.
Either:
Select the check box Automatically assign/create inputs, then you can click Finish.
Alternatively to match inputs up manually, instead click Next .
Associate the model factors with the available inputs in your session.
For example, to associate the model factor spark with the variable spk in your session,

Highlight a Model Input, spark, in the list on the left and the corresponding variable, spark, in the list of Available Inputs on the right.
Click the Assign Input button.
Repeat a and b for all the model factors.
Click Finish to close the wizard and return to the Models view.
You can now see a display of the model surface and the model connections (inputs).
A function model is a model that is expressed algebraically. The function can be any MATLAB function (including user-defined functions). The only restriction is that the function must be vectorized, that is, take in column vectors and return a column vector of the same size, as in this example:
function y = foo(x1, x2) y = x1 .* x2;
Once you have a function like this, you can create a function model applying it to any models or variables in your session, like the following example.
foo(NOX, SPK)
For example, you might want to view the behavior of torque efficiency. So you create a function model of torque efficiency = torque/peak torque.
To add a function model to your session,
Select File > New > Function Model.
This opens the Function Model Wizard.
In the dialog box, enter the formula for your function model. For example, enter torque_efficiency=torque/peak_torque.
Press Enter. CAGE checks that the function is recognized; if so, you can click Next. If the function is incorrectly entered, you cannot click Next.
Select the models that you want to import by highlighting the models from the list.

You can select the check box to Automatically assign/create inputs and click Finish to close the wizard and return you to the Models view, or you can click Next and go to the next screen. Here you can manually associate the model factors with the available inputs as follows:
Highlight a Model Input, e.g., peak_torque, in the list on the left and the corresponding model, peak_torque, in the Available Inputs list on the right.
Click the Assign input button.
Repeat a and b for all the model factors. Click Finish to close the wizard and return you to the Models view.
You can now see a display of the model and its connections (inputs).
To rename a model,
You can also rename the model by selecting a model and clicking the name, or pressing F2.
You can adjust a model so that variables, formulas, or other models are the factors of the model. For example, a model of torque depends on the spark angle. In place of the spark angle variable, you can use a model of the maximum brake torque (MBT) as the spark input.
To edit the inputs of a model,
This opens the Edit Inputs dialog box, shown.

Highlight the Model Input that you want to edit, in the list on the left.
Highlight the new input for that factor, in the Available Inputs list on the right.
Note If you want to change the range of a variable in the session, change the range in the variable dictionary. For more information, see Using the Variable Menu. |
![]() | Setting Up Variable Items | Creating and Viewing Composite Models in CAGE | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |