| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Model-Based Calibration |
| Contents | Index |
| Learn more about Model-Based Calibration |
Some features of the output node are specific to sum optimizations. Using the Example Problem (see Example Problem to Demonstrate Controls for Sum Optimizations) for reference these features are described in the following sections:
| On this page… |
|---|
As in the Input Variable Values pane in the Optimization view, in the output view, the index of the operating point within a run is denoted by the number in brackets. The following figures provide examples.

In the Optimization Results table, the index of the operating point within the run is shown in brackets. In the Free Variable Values table and graphical displays, the input variable at the i-th operating point within a run is denoted by InputVariableName(i), for example, S(4) is the spark value at the 4th operating point, EXH(1) is the value of exhaust cam phasing at the first operating point.
Features of the Optimization Results table are labeled in the following figure.

Key to Optimization Results Table
A: The run index — Index into the set of operating points that is being displayed.
B: The quantity index.
For fixed and free variables this index corresponds to the index of the operating point within the run.
For objectives this corresponds to the index of the output for the specific labeled objective.
For constraints this corresponds to the index of the output for the specific labeled constraint.
C: Optimal Free Variable Settings — The optimal settings in this case of S, EXH and INT at each operating point in the run. For example, the optimal settings of S, EXH and INT at the third operating point in this run 1 are S=18.565°, EXH= 24.801°, INT= 41.214°
D: Fixed Variable Settings — These settings define the operating points for the run and other fixed variables (such as weights) required for objectives and constraints. These values were set up before the optimization was run. For information on the set up of these values, see Using Variable Values Length Controls.
E: Optimal objective outputs — The optimal values of any objective outputs are displayed here, e.g., the optimized value of the weighted sum of TQ (115.002 Nm) over the 5 operating points shown in this case.
F,G: Constraint outputs at optimized control parameter settings — The value of constraint outputs are displayed here. For the example problem, the model constraint outputs are displayed in the section labeled F. Note that the number of constraint outputs matches the number of operating points. The table gradient constraint outputs are displayed in the section labeled G. The number of values returned by the table gradient constraint is dependent on the internal settings of that constraint (see information see Table Gradient Constraint Output). For more information on the number of values returned by objectives and constraints, see Algorithm Restrictions.
The objective graphs for sum objective problems show the objective cross section plots as in the point case. However, plots are now displayed against each control parameter at each point in the set of operating points within each run. In the following figure, the weighted sum of TQ is plotted against the spark values at the first four operating points in run 1.

The objective contour plot for sum objective problems shows the contours of the objective as in the point case. However, plots can now be displayed against any pair of control parameters chosen from all the control parameters at each point in the set of operating points within each run. In the following figure, a contour plot of the weighted sum of TQ is plotted against the value of exhaust valve timing for the third operating point, EXH(3) and the value of intake valve timing for the third operating point, INT(3).

The constraint graphs for sum objective problems show the cross section plots of the left side of the constraints as in the point case. However, in the sum case there are several more inputs and outputs that can be plotted. Specifically, each constraint can return several outputs (see Algorithm Restrictions for more detail) and these can be displayed against each control parameter at each point in the set of operating points within each run.

In the example problem, the exhaust temperature and residual fraction constraints have 5 outputs, one for each operating point. In the graphs shown, one output of the exhaust temperature and residual fraction constraints is displayed against four free variables. Specifically, the exhaust temperature model evaluated at the fifth operating point in run 1 (Constraint1(5)) and the residual fraction model evaluated at the first operating point in run 1 (Constraint2(1)) is plotted against the values of exhaust valve timing at operating points 4 and 5 (EXH(4) and EXH(5)) plus the values of intake valve timing at operating points 1 and 2 (INT(1) and INT(2)).
See also Table Gradient Constraint Output.
The constraint summary for sum optimizations shows a summary of all the constraint outputs for each constraint at the optimized control parameter settings for the selected run. The constraint summary table for the Example problem is shown in the following figure.

A summary of the first constraint, EXTEMP <= 1290°C at each operating point (Constraint1), is shown in the first five rows of the table. In this case, each of the rows corresponds to an evaluation of the constraint at each operating point within the run. For example, the second row of Constraint1 details an evaluation of EXTEMP <= 1290°C at the second operating point in the set of operating points in the run, as indicated in the Description: EXTEMP(S(2), N(2), EXH(2), INT(2))<= 1290.
The summary for the table gradients (Constraint3 and Constraint4) is shown. For a detailed explanation of table gradient outputs, see the next section, Table Gradient Constraint Output.
The table gradient constraint output is best explained using an example problem.
Control parameters/free variables: SPK, EXH, INT
Fixed variables: N, L
Objective: Maximize Weighted sum of TQ(SPK, EXH, INT, N, L) over the points shown in the following table (with unit weights at each point):
| N | L |
|---|---|
| 3000 | 0.5 |
| 3000 | 0.6 |
| 4000 | 0.5 |
| 4000 | 0.6 |
Table Gradient Constraint: Maximum change in EXH is bounded by the following specifications:
No more than 5° per 1000rpm change in N
No more than 4° per 0.1 change in L
Over the following 2-by-2 table: N breakpoints = [3000 4000]; L breakpoints =[0.5 0.6]
In this case, the optimization operating points are the same as the selected table breakpoints for the table gradient constraint, but these are not necessarily always the same.
When the optimization has run, the following optimal values of EXH are returned from the optimizer, as shown in the following tables.
| N/L | L(1) | L(2) |
|---|---|---|
| N(1) | EXH(1) | EXH(2) |
| N(2) | EXH(3) | EXH(4) |
The values for all these items are shown in the following table.
| N/L | 0.5 | 0.6 |
|---|---|---|
| 3000 | 2.225 | 0 |
| 4000 | -2.775 | –5 |
Table gradient constraints calculate the gradient between the values of specified free variable at the specified table points specified by the constraint. In the example problem, the table gradient constraint returns a set of constraint values as follows.
The table gradient constraint takes the values of EXH from the optimizer, and then determines the value of EXH at the grid points defined in the table gradient constraint. In this case, those grid points are the same, so this is identical to the preceding table. In cases where the grid points in the optimization do not match those in the table gradient constraint, a radial basis function interpolant is used to estimate the constrained variable on the table gradient grid points.
The table gradient constraint takes the grid of EXH values and calculates row and column gradients. Row gradients in the direction of increasing N, rginc, are calculated on the grid as follows:
rg1inc = (EXH(3)–EXH(1))/(N(2)–N(1))
= (–2.775–2.225)/1000
= –0.005
rg2inc = (EXH(4)–EXH(2))/(N(2)–N(1))
= (–5–0)/1000
= –0.005
The table gradient constraint restricts the row and column gradients in each direction. Row gradients in the direction of decreasing N, rgdec, are calculated on the grid as follows:
rg1dec = –rg1inc = 0.005
rg2dec = –rg2inc = 0.005
Column gradients in the direction of increasing L, cginc, are calculated on the grid as follows:
cg1inc = (EXH(2)–EXH(1))/(L(2)–L(1))
= (0–2.225)/0.1
= –22.25
cg2inc = (EXH(4)–EXH(3))/(L(2)–L(1))
= (–5–(–2.775))/0.1
= –22.25
Similarly, column gradients in the direction of decreasing N, rgdec, are calculated on the grid as follows:
cg1dec = –cg1inc = 22.25
cg2dec = –cg2inc = 22.25
The table gradient constraint implements the following:

This equation can be rewritten as Left Value <= Right Value. In each row the Left Value must be smaller than the Right Value to meet the constraint.
The Constraint Value numbers returned to the optimizer are calculated as follows: Constraint Value = Left Value – Right Value.

These constraint values are shown in the Optimization Results table. Negative constraint values mean the constraint is feasible, and infeasible constraints are highlighted yellow. In the following figure, these values appear in the Constraint4 column. The Optimization Results pane also shows the fixed variable settings, the optimal free variable settings, and the evaluation of objectives and constraints at the optimal free settings.

The constraint graphs for a table gradient constraint show how the Left Value of each output of a table gradient constraint depends on the free variables in the optimization. These graphs for the example problem appear in the following figure.

The Left Value is compared with a plot of the Right Value output on the same axes. This comparison is illustrated for the table gradient example problem. Consider the top-left graph in the figure shown. Constraint4(1) is the first Left Value (rg1inc) of the table gradient constraint in the example problem. Recall that this can be written as
rg1inc = (EXH(3)–EXH(1))/(N(2)–N(1))
The top left graph shows a plot of rg1inc against EXH(1) with all other free variables set to their optimal values, i.e.,
rg1inc = (2.775–EXH(1))/1000
which is the blue line shown in the top left graph. The horizontal red line shows the Right Value (i.e., the upper bound on rg1inc). Because this value is an upper bound on the allowable gradient, the yellow region above the line shows where the table gradient constraint is infeasible. The vertical orange line shows the optimal value of the free variable, EXH(1). The blue marker on the Constraint4(1) axis marks the Left Value (the value of rg1inc) at the intersection of the optimal EXH(1) value and the blue line.
The graph of Constraint4(1) against EXH(2) shows a flat line. The flat line indicates that there is no dependence of rg1inc on EXH(2), as it is calculated as (EXH(3)–EXH(1))/(N(2)–N(1)).
The other constraint graphs can be analyzed in a similar way.
Note If you are using table gradient constraints the solution may appear infeasible upon inspection of the objective and constraint graphs (the graphs may appear to be entirely yellow). There are cases when the solution is actually feasible in this case. This appearance of infeasibility often arises in sum problems which have tight table gradient constraints. In such cases, you should check the Solution Information pane and the Constraint Summary Table to check whether a feasible solution has been found. |
A summary of the table gradient constraint output is shown in the Constraint Summary table, as shown following.

The maximum gradient in the row and column direction (if it is a 2-D table gradient constraint) is shown in the table. In the example shown, observe the maximum column gradient of EXH. Recall previously that the cg (column gradient) values were calculated to be –22.25, –22.25, 22.25 and 22.25. The maximum column gradient is 22.25, shown in the Left Value column in the Constraint Summary table. The bound at the maximum value of the column gradient is 40, shown in the Right Value column in the table. The Constraint Value column shows the value of Left Value minus Right Value, which is –17.75, so the constraint has been met.
The Constraint Value gives a measure of the distance to the constraint boundary for each constraint output. If the Left Value > Right Value and greater than the tolerance for any of the constraint outputs, the constraint value is bold and the row is highlighted yellow. By default this tolerance is taken from the optimization constraint tolerance. You can control the value used for this highlighting by selecting View > Edit Constraint Tolerance. The highlighting indicates that this constraint distance should be checked to see if the constraint is feasible at that point.
![]() | Analyzing Point Optimization Output | Writing User-Defined 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 |