| 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… |
|---|
From the test plan level, if you select TestPlan > Boundary Models, or the toolbar button Edit Boundary Models, the Boundary Editor appears.

In this editor, you can construct boundary models from your data. Boundary models are nonparametric surfaces you can use as a visual aid to understanding complex operating envelopes. You can use boundaries to guide modeling and constrain optimizations.
These boundary models are integrated with the rest of the toolbox functionality. You can view them in the Model Selection window (in the cross section view and response surface view) and in CAGE in optimizations, tradeoff, model views and the Surface Viewer. You can import boundary models into the Design Editor to use as constraints. You can also use them to clip models to view only the area of interest, to constrain models and designs to realistic engine operating envelopes, or to designate the most valid areas for optimization, tradeoff and calibration.
Before you use the Boundary Editor, you should understand how it works to achieve the best results:
The toolbox saves boundary models implicitly as part of your test plan. Therefore, you do not need to save them separately before closing the Boundary Editor.
From the Boundary Editor you can export boundary models to Simulink.
From the Model Browser you can export boundary models with all your other models, from the test plan level. Use the File menu to export either to CAGE, to the Workspace or as an exported model file (.exm). See Exporting Models.
For local boundary models only, export from the test plan by selecting TestPlan > Export Point-by-Point Models.
You can use the function ceval to evaluate a boundary model exported to the Workspace. For example, if your exported model is M, then ceval(M, X) evaluates the boundary model attached to M at the points given by the matrix X (values less than zero are inside the boundary). See Evaluating Models in the Workspace for more details.
You can import boundary models to use as constraints in the Design Editor.
The following sections describe how to create and understand different types of boundary models:
To create a new boundary model:
In the Boundary Editor, get started by clicking New
Boundary Model
in the toolbar, or select File
> New Boundary.
You cannot access these options for leaf nodes. You can only add new boundary models at the root node and at the second-level nodes (local, global or response).
For two-stage models, the Choose Level dialog box appears. Select a radio button to specify whether you want to model the boundary of the Local, Global, or Response values, and click OK.
The controls available depend on the type of boundary model. See Setting Up Global and Response Boundary Models and Setting Up Local Boundary Models.
Response boundary models are built to cover the combination of the local and global variable spaces.
Global boundary models are built in the global variable space.
If you only select the global variables as active inputs to model, the differences between a global boundary model and a response boundary model are:
For the response boundary model, the data includes all records.
For the global boundary model, the data is one point per test (the average value of the global variables for that test).
Local boundary models fit the boundary of the local inputs. Local boundary models can be either two-stage or point-by-point global evaluation type.
Two-stage boundary models fit the local boundary model parameters as a function of the global inputs. The toolbox uses an interpolating RBF for the function of the global inputs. For example, min_spark = f_1(speed, load) and max_spark = f_2(speed, load). This is useful for modeling borderline spark, for example.
Two-stage boundaries are valid at any operating point.
Point-by-point boundary models are separate boundary models fitted to the data collected at each operating point. Point-by-point boundary models are only valid at the observed operating points. The toolbox uses the global input values are used to select which local boundary model to use.
When you set up a Global or Response boundary model, the Boundary Model Setup dialog box opens, displaying the controls shown in the following figure.

Select a type of boundary model: Range, Star-shaped, Ellipsoid, or Convex Hull.
The Range model finds the furthest extent of points for each variable and draws a hyper-rectangle to enclose all points.
Range is the only type that you can use with only one input.
The Ellipsoid model forms an ellipse to enclose all points.
The Convex Hull model forms the minimal convex set containing the data points.
The Star-shaped model is a more complex model with various settings that determine how your boundary model is calculated. This calculation occurs in three stages: determining the center of the data; deciding which points are on the boundary, and interpolating between those points. The star-shaped model is the only model type that can fit non-convex regions.
Select a set of input factors to model using the Active Inputs check boxes. The required and selected number of inputs is displayed underneath. You may find it useful to build boundary models using subsets of input factors. You can then combine them for the most accurate boundary. This approach can be more effective than including all inputs.
The Fit Options tab is only enabled if your selected boundary type has any options you can set.
Range and Convex Hull models do not have any further settings you can alter.
Star-shaped and ellipsoid models have a variety of parameters you can alter, see Boundary Model Fit Options. Try the defaults before experimenting with these.
Click OK, and the toolbox calculates the boundary model.
For Local boundary models you can set up a two-stage boundary or a point-by-point boundary. When you set up a local boundary model, the Local Boundary Model Setup dialog box opens.
Two-Stage Boundaries. To set up a two-stage boundary model:
Leave the default setting Two-stage in the Global evaluation list. You see the following controls.

You can select Range or Ellipsoid for the Local Boundary (to fit to the local inputs).
You can select Ellipsoid only for more than one local variable. You can select Fit Options only for Ellipsoid models. Click Fit Options to see the parameters you can alter. Try the defaults before experimenting with these. See Boundary Model Fit Options.
The Global model must be an interpolating RBF that interpolates across the global inputs between these local boundaries. You can click Set Up to change the parameters for the interpolating RBF.
Click OK, and the toolbox calculates the boundary model.
To set up a point-by-point boundary model:
Select Point-by-point in the Global evaluation list. You see the controls shown in the following figure.

Select the boundary settings. The available settings for point-by-point boundary models are the same as for global or response boundary models:
Select a Local boundary type: Range, Star-shaped, Ellipsoid, or Convex Hull.
Select a set of input factors to model using the Active Inputs check boxes.
Optionally, view or edit settings on the Fit Options tab, if enabled for your boundary type.
See Setting Up Global and Response Boundary Models for more details.
Click OK, and the toolbox calculates the boundary model.
To edit settings for existing boundary models, you can reach the Boundary Model Setup dialog boxes by selecting Edit > Set Up Boundary or the equivalent toolbar button. You can edit the boundary type and active inputs, and settings where available.
You can view the type and details of the selected boundary model in the Properties pane. This pane displays information about the boundary model such as: number of data points; number of boundary, interior, and exterior points; the type of boundary model and summary of settings (e.g. center point of star). For root and branch nodes, you can see which model or combination of models you have selected as best.
See the next section, Combining Best Boundary Models for an example.
You can select a single boundary model node as best or you can combine models by including them in your best selections. You may find it useful to build boundary models using subsets of inputs and different boundary types. You can then can combine these models to achieve the most accurate boundary. This approach can be more effective than including all inputs.
Note Only models selected as best are exported. You must select one or more models as best, or you cannot export boundary models. |
Look at the tree icons to see which boundary models are included as best. Included tree nodes have a check mark on their icon. In the following example, Response is included in best, and the child node Star-shaped is not included.
![]()
For two-stage or point-by-point test plans, the Local, Global, and Response nodes are included in best by default (even though they are empty to begin with). You can include or exclude any tree node except the root node.
Each parent node displays the combination of child nodes that you have selected as best (if any; otherwise the parent node is empty.) Use the toolbar and Edit menu items Add to Best and Remove From Best to include only the nodes you require at the root node.
For example, if you pick two leaf nodes and select Add to Best for each, the parent node shows a combination of the two boundary models. You may want your final model to combine boundaries of different types, e.g., a star-shaped and a range boundary. You can view the results at the parent node: the combined model is clipped to fit within the ranges defined by both boundaries. You can combine as many leaf nodes as you like.
Note You can always see which boundaries have been combined at the currently selected node by viewing the Properties pane. |
You can combine the best models for one-stage or two-stage (local, global and response) leaf nodes.
The Local node displays the child node or nodes selected as best (or is empty if none are selected as best). The Global and Response nodes also display their child node or combination of nodes selected as best. You can only combine local leaf nodes with other local leaf nodes, and global leaf nodes with other global leaf nodes, etc., because you can only have one best model at the Local node, one best model at the Global node, and one best model at the Response node. However you can choose to combine any of the Local, Global, or Response nodes as best for the root node. You can see which child model (or combination) is currently best from a parent node (e.g., Global) or the root node by looking under Best Boundary Model in the bottom left Properties pane.
See the following figure for an example.

In this example, the root node (DIVCP) is selected—the icon is outlined. Look at the Properties pane to see which leaf node (or nodes) you have included in the set of best boundary models for the selected node—in this case, it is Star-shaped (all inputs) and the Star-shaped(N,L) global nodes. The icons in the rest of the tree show the path of combined nodes.
Looking one level down in the tree, Local, Global, and Response are all included in best, but Local and Response are empty because they do not contain any child nodes selected as best. The Local and Response nodes are included in the best selection for the root node, but they have no effect because they are currently empty. Selections at different levels of the tree (branch and leaf) are independent.
Only the Global node contains any child nodes included in best, and therefore only that combination of global child nodes selected as best is displayed at the parent node (the root).
The Global node has the Star-shaped (all inputs) and the Star-shaped(N,L) child nodes selected as best. Therefore the Global node contains the combination of the Star-shaped (all inputs) and the Star-shaped(N,L) boundary models. The Global node is included in the best for the root node, so the root node also contains the Star-shaped (all inputs) and the Star-shaped(N,L) boundary models.
New
boundary model — Opens a setup dialog box, and, when you click OK,
adds a new child node (containing a fitted boundary model) to the
current node. This button is not enabled at leaf nodes. Similarly
to the model tree in the Model Browser, the new child nodes are different
depending on the location of your current selection in the tree.
For one-stage test plans, new child nodes of the root (top) node are boundary models (leaf nodes).
For two-stage test plans, new child nodes differ depending on the parent node. From the top or root node, you can choose a new child node of either local, global, or response type. From local, global or response nodes, new child nodes are boundary models of the same type as their parent nod — local, global or response. You can add as many boundary models of each type as you want.
See Creating Boundary Models. This button also appears in the File menu.
These toolbar buttons are only available for leaf nodes, and the functions are also available in the Edit menu:
Set
up boundary model — Opens the Boundary Model Setup dialog box
where you can edit settings for the selected model. The new model
is fitted when you click OK.
Duplicate
boundary model — Duplicates the current node.
Delete
boundary model — Deletes the current node.
These toolbar buttons are not available for the root node (only leaf and second-level nodes) and are also in the Edit menu.
Add
to best — Include selected node in best. Only enabled where
the selected node is excluded from best.
Remove
from best — Exclude selected node from best. Only enabled where
the selected node is included in best.
1-D Slice — Shows a 1-D slice
through your model and data. This function also appears in the View menu.
You can select values for variables in the edit boxes. These values determine the point at which the slice through the boundary is plotted.
You can change the tolerance values in the Tolerance edit boxes next to each variable to set the width of the slice. Data points within the tolerances will be displayed with the slice. This display is very similar to the one in the Cross Section model selection view, where the Tolerance either side of the displayed model slice determines how near data points must be to the model slice to be displayed. See Cross Section View for comparison.
You can click and hold on data points to view the values of the inputs at that point, and the distance from the boundary. Double-click a data point to move the slice view to that point, or click Select Data Point to choose a particular point.
2-D
View — Shows a 2-D slice through your model and data. This
function also appears in the View menu.
You can choose which variables to plot on the X and Y drop-down
menus. Similarly to the 1-D Slice view, you can change the values
and tolerances of the other variables in the edit boxes to determine
where the boundary slice is plotted and how much data is also displayed.
You can click and hold on data points to view the values of the inputs at that point, and the distance from the boundary. Double-click a data point to move the slice view to that point, or click Select Data Point to choose a particular point.
3-D
Slice — Shows a 3-D slice of your model and data. This function
also appears in the View menu. You can
choose which variables to use for the three axes using the drop-down
menus and set the resolution of the grid (number of points) to display
in the value edit boxes for each factor. You can set the value of
other variables in the edit boxes as for the 2-D view.
You can click and hold on data points to view the values of the inputs at that point, and the distance from the boundary. Double-click a data point to move the slice view to that point, or click Select Data Point to choose a particular point.
Pairwise
View — Shows a pairwise projection of your boundary and data.
This function also appears in the View menu.
Clicking this button displays a plot of the entire range for each
pair of variables in turn. You can click and drag to select a region.
Do not click on points, instead, click in the blue or white regions
and then drag to define a region. The same region is then highlighted
in yellow in each projection, so you can see how your data is distributed
in each dimension.
4–D
Data Projection — A 3–D plot of the data points colored
by a fourth factor. You can use the drop-down menus to select plot
and color bar inputs. This function also appears in the View menu.
Highlight
Boundary Points — Highlights in red all data points that are
on the boundary surface. This highlighting applies to all views. The
points highlighted red (on the boundary) should have a Distance value
of zero (distance to the boundary) when you click and hold on these
points. Due to rounding errors, the value may not be exactly zero,
although it will be very small. This button is only enabled for leaf
nodes. Highlight Boundary Points is also in the View menu
and the right-click context menu on views.
In the File menu:
New Boundary — Select this to create a new boundary model. See Creating Boundary Models.
Export to Simulink — Exports the currently selected node as a block in a Simulink model. If the currently selected node is a leaf node, the toolbox exports a single boundary model. If the selected node is a parent node (root, local, global or response)the toolbox may export one boundary or a combination of several depending on which nodes you have assigned best and added to best.
Close — Closes the Boundary Editor and saves your boundary models with the test plan.
In the Edit menu:
Set Up Boundary, Duplicate Boundary, and Delete Boundary — edit, copy or remove a node. Only available for leaf nodes. Use Duplicate to make a selection of leaf nodes to make changes and compare many boundary models.
Add to Best — Include in best. The icons of boundary models selected as best display a check mark.
See Combining Best Boundary Models for a detailed example.
Remove From Best — Exclude from best. Use this to reverse your selections of best models.
In the View menu:
Under Current View and Split View there are submenus where you can select any of the views available in the toolbar—1D, 2D, 3D slices, the pairwise view, and the 4D data view.
You can select graph size.
You can toggle boundary point highlighting on and off.
You can split the currently selected view horizontally and vertically, and close the current view, as in the Design Editor and Data Editor.
All these options are available in the right-click context menu on the views.
You can reach the Fit Options settings in the Boundary Model Setup dialog box, either when creating a new boundary model, or when editing an existing boundary model, by selecting Edit > Set Up Boundary or the equivalent toolbar button.
The Fit Options tab (or button for local boundaries) is only enabled if your selected boundary type has any options you can set.
Range and Convex Hull models have no additional settings you can alter.
Star-shaped and ellipsoid models have a variety of parameters you can alter,as the following topics describe. Try the defaults before experimenting with these.
The ellipsoid boundary has a variety of optimization settings you can alter if you are having problems getting a good fit. Change the display setting to iter or final to see output messages at the command line during the fit, and try different tolerances or numbers of iterations. For details on these settings see optimset in the MATLAB Reference.
The Star-shaped boundary is a more complex model with various settings that determine how your boundary model is calculated. This determination occurs in three stages: determining the center of the data; deciding which points are on the boundary; and interpolating between those points.
Special Points > Center — This setting is not the same as the Center Selection settings for RBFs, instead, the toolbox uses this setting as the method for determining the center of the boundary model sphere. Think of the boundary model as a deformed sphere. You can choose Mean, Median, Mid Range, MinEllipse or User Defined. If you select User Defined, you can enter a value for each input.
Boundary Points — These settings determine how to decide which points are on the boundary.
Interior — Choose this option to specify that not all points should be on the boundary.
Boundary Only — Places all points on the boundary. This setting can save you time, if this is suitable for your data.
Dilation Radius — If you choose Interior points, then Dilation Radius is used to determine which points are on the boundary. The model-fitting calculation expands each point to a sphere until a boundary shape is formed by the intersection of all those spheres. See the next illustration.

Dilation Radius settings:
Auto — This setting selects the dilation radius (how much to expand each point) by checking all the minimum distances between points, and then choosing the largest of those.
Manual — You can manually set the dilation radius in the edit box. The default is 1. This value may seem large as model range is between -1 and 1, but all points are expanded equally so you will still detect the points on the edge. However, very large spheres will intersect and obscure points that should be detected as boundary points.
Ray Casting — The toolbox draws rays from the center of the boundary model to determine which points are on the edge. The last point intersected on each ray is a boundary point. The ray actually intersects a sphere, given that each point has been expanded by the dilation radius, as the the following illustration shows.

Ray casting settings:
From Data — This option uses the same number of rays as there are data points and sends one ray in the direction of each point. If you have very dense data or a very large number of points it might be better to use the Manual setting to choose a smaller number of rays.
Manual — You can set a value in the Number of Rays edit box. This number of rays will then be used in random directions. A good guideline is to use about twice the number of data points, although if you have a large number (many hundreds), the model fit becomes very slow, and you may run out of memory. In most situations, more than 1000 is too many.
Constraint Fit.
Transform — None, Log, or McCallum. The default is None. Depending on the shape of your boundary, you might need to use a transform to prevent self intersections near the center of the model.
RBF Kernel — Radial Basis Function (RBF) settings. You can choose RBF kernels, width and continuity as when setting up models. See Global Model Class: Radial Basis Function for more information. After the boundary points have been determined, each of those points is used as an RBF center and the toolbox obtains the boundary surface by interpolating radial basis functions between all those centers. The width and continuity settings depend on which kernel you choose.
RBF Algorithm
These options control the interpolating RBF model settings. You can leave the defaults unless you have a very large data set (several thousand points). With very large data sets, you can improve the speed and robustness of fitting if you try a different Algorithm setting, such as GMRES, first and then vary the tolerance and number of iterations.
![]() | Local Model Setup | Global Model Setup | ![]() |

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 |