| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Model-Based Calibration |
| Contents | Index |
| Learn more about Model-Based Calibration |
| On this page… |
|---|
When you create your optimization, you can set up initial objectives and a boundary constraint within the Create Optimization from Model wizard. You can add and edit constraints and objectives in the main CAGE Optimization view.
You can perform the following tasks by using the right-click context menu or Optimization menu (if allowed by the algorithm—foptcon can only have a single objective):
You can Add, Edit, Delete, or Rename objectives and constraints.
For objectives, if your objective model has a boundary model, you can select Add modelname Boundary to Constraints. This shortcut allows you to set up a boundary constraint without needing to open the Edit Constraint dialog box.
For constraints, you can:
Select Duplicate to copy an existing constraint.
Select Import to copy existing constraints from another suitable optimization (with common free variables) in your session. Values for any new variables are only imported if the number of points in the optimization match.
Select Disable to remove constraints without deleting them, and use Enable to reapply them.
For objectives and constraints, you can Select Application Point Set. See Using Application Point Sets.
Double-click to edit existing objectives and constraints in the Objectives or Constraints panes. This opens the Edit Objective or Edit Constraint dialog boxes.
You can run two types of optimizations, point optimizations and sum optimizations. Point optimizations look for the optimal values of each objective function at each point of an operating point set. A sum optimization finds the optimal value of a weighted sum of each objective function. The weighted sum is taken over each point, and the weights can be edited. For an example, see the tutorial section Sum Optimization in the Getting Started documentation.
You can set up sum objectives either in the Create Optimization from Model wizard or the Edit Objective dialog box.
You need to use the Edit Constraint dialog box to set up model sum constraints. You cannot set up sum constraints from the Create Optimization from Model wizard or the Optimization Wizard.
You can also set up linear, 1- and 2-D table, and ellipsoid constraints in the Edit Constraint dialog box, as for designs in the Model Browser part of the Model-Based Calibration Toolbox product.
Double-click or right-click objectives to open the Edit Objective dialog box.

You can select Point objective or Sum objective from the Objective type drop-down menu. Use sum objectives only for weighted sum optimizations; otherwise, use point objectives.
You can rename the objective by editing the Objective name edit box, to aid analysis in the Optimization views. This may be disabled for user-defined optimizations.
The preceding example shows the point objective controls. Select which models from your session you want to use for the optimization, and whether you want to maximize or minimize the model output. The foptcon algorithm is for single objectives, so you can only maximize or minimize one model. The NBI algorithm can evaluate multiple objectives. For example, you might want to maximize torque while minimizing NOX emissions.
You can also include 'helper' models in your user-defined optimizations, so you can view other useful information to help you make optimization decisions (this is not enabled for NBI or foptcon).
These are the same options you can choose in the Optimization Wizard. See Optimization Wizard Step 4.
For weighted sum optimizations, the objectives are typically sum objectives. See the following example.

As for point objectives, select which models from your session you want to use for the optimization, and whether you want to maximize or minimize the model output.
You can edit weights in the Optimization view, to make certain operating points more important, giving more flexibility to solutions for other points. You can edit the weights in the Fixed Variables pane. This is the same process as selecting weights for the Weighted Pareto View. See Weighted Objective Pareto Slice.
For a tutorial example of a sum optimization, see Sum Optimization in the Getting Started documentation.
You can rename the constraint by editing the Constraint name edit box, to aid analysis in the Optimization views. This may be disabled for user-defined optimizations.
Select a Constraint type in the drop-down menu. The first four choices are the same as the following design constraint types:
These are the same constraints you can apply to designs in the Model Browser part of the Model-Based Calibration Toolbox product.
In the context of optimization you can select constraint inputs on the additional Inputs tab. You can select any variable or model as an input into constraints. The default selects the free variables where possible. Models are treated as nonlinear functions, so if you choose to feed a model into a linear constraint it will make that constraint nonlinear. You are not able to access it as a linear constraint in user-defined optimization scripts.
For optimization constraints you can also select the following constraint types:
To construct a model constraint:
Select an Input model in the left list.
You can use the Evaluate quantity drop-down list to choose Evaluation value, Boundary constraint, or PEV value (model prediction error variance) to define your constraint.
Choose the appropriate option button to either enter a value in the Constant edit box, or to select a CAGE item from the list of models or variables.
Select the Constraint type operator to define whether the optimization output should be constrained to be greater than or less than the constant or item value specified on the right.
Check the displayed Constraint description, and click OK.
The model constraint settings are shown in the following figure.

You can specify an upper and lower bound to constrain expressions (which can be variables, models or tables). You can specify bounds with constants, vectors, variables, models, or tables.
Select a CAGE item to constrain on the Bound Expression tab. Use the drop-down menu to switch between variables, models, or tables, and then select the item to constrain. For appropriate models you can also choose to constrain either the PEV or evaluation value.
On the Lower Bound tab, select an option button to choose whether to use a constant, vector, or CAGE item to specify the bound.
For constants, enter a value.
For vectors, you can enter the lower bound for each point in the Input Variable Values pane in the Optimization view after you close the Edit Constraint dialog box.
For CAGE items, use the drop-down menu to switch between variables, models, or tables, and then select the item to specify the lower bound. For appropriate models you can also choose to use either the PEV or evaluation value.
Specify the upper bound on the Upper Bound tab in the same way as you specified the lower bound on the Lower Bound tab.
Check the displayed Constraint description, and click OK.
For a detailed explanation of range constraint outputs, see Range Constraint Output.
Use these for weighted sum optimizations. Choose a model, constraint bound value and an operator.
You can have a mixture of point and sum constraints.
See the tutorial Sum Optimization in the Getting Started documentation for a step-by-step example, and for descriptions of optimization output specific to sum problems, see Interpreting Sum Optimization Output.
Table Gradient constraints allow you to constrain the gradient of a free variable over a grid of fixed variables. These constraints are most useful in 'sum' problems. Unless you are using a user-defined optimization, you should normally use a sum objective (and therefore runs normally have multiple values).
Select a free variable to constrain.
Specify one or two fixed variables, and a grid of points either manually or by selecting table axes.
Enter values in the edit boxes to specify the maximum change in the free variable per amount of fixed variable change between cells. For example, enter 5 and 1000 to specify 5 degrees maximum change in cam angle per 1000 rpm.
Check the displayed Constraint description, and click OK.
For a detailed explanation of table gradient outputs, see Table Gradient Constraint Output.
![]() | Editing Variable Values | Running Optimizations | ![]() |

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