| Model-Based Calibration Toolbox™ | ![]() |
| On this page… |
|---|
Overview of the Optimization Parameters Dialog Box foptcon Optimization Parameters |
The settings in the Optimization Parameters dialog box are algorithm specific.
If you edit these settings and later want to return to the defaults, select Optimization > Reset Parameters. If you add parameters to user-defined optimization scripts, you may need to use this reset option to make all new parameters appear in the dialog box.
The foptcon optimization algorithm in CAGE uses the MATLAB fmincon algorithm from the Optimization Toolbox product. foptcon wraps up the fmincon function so that you can use the function for maximizing as well as minimizing. For more information, see the fmincon reference page in the Optimization Toolbox documentation, fmincon.

Display — choose none, iter, or final. This setting determines the level of diagnostic information displayed in the MATLAB workspace.
none — No information is displayed.
iter — Displays statistical information every iteration.
final — Displays statistical information at the end of the optimization.
Maximum iterations — Choose a positive integer.
Maximum number of iterations allowed
Maximum function evaluations — Choose a positive integer.
Maximum number of function evaluations allowed
Variable tolerance — Choose a positive scalar value.
Termination tolerance on the free variables
Function tolerance — Choose a positive scalar value.
Termination tolerance on the function value
Constraint tolerance — Choose a positive scalar value.
Termination tolerance on the constraint violation
Minimum/maximum change in variables for gradient
Choose a positive scalar to control the input step size that is taken when gradients are being calculated. The default settings should work for the majority of problems.
Number of start points — Choose a positive integer, N. (N-1) start points per run are generated in addition to the starting value specified in the Input Variable Values pane.
The optimization runs from each of the N start points (possibly subject to feasibility, see Run from feasible start points only option) and the best solution is chosen.
The N-1 extra start points are generated as follows:
Generate a 10000 point Halton set design, D, over the free variables.
Evaluate the objectives and constraints over D.
Return the N-1 feasible points with the lowest objective value.
If there are not N-1 feasible points, fill the remaining starting values with the points with the lowest maximum constraint violation.
Run from feasible start points only — Select this option to terminate all runs that start with an initial value that does not satisfy the constraints. If this condition is not met this is reported in Output message, in the Solution Information pane of the Optimization Output view.
Interface version — This option is only enabled when a user-defined optimization script does not specify a version to use. Some existing user-defined optimization scripts may require setting the interface version as 2 or 3, according to the toolbox version. Version 3 is preferable, but may not work with all old scripts. See setRunInterfaceVersion for details.
The example following shows the NBI options in the Optimization Parameters dialog box.

To understand the options for the NBI algorithm, some limited understanding of the algorithm is required. For more information on the NBI algorithm, see the NBI home page at the following URL:
http://www.caam.rice.edu/~indra/NBIhomepage.html
The NBI algorithm is performed in two steps. The first step is to find the global of each objective individually. This is called the shadow minima problem, and is a single-objective problem for each objective function. The MATLAB routine fmincon is used to find these . Once these are found, they can be plotted against each other. For example, consider an NBI optimization that simultaneously maximizes TQ and minimizes NOX emissions. A plot of the against each other might resemble the following.

The second step is to find the "best" set of tradeoff solutions between your objectives. To do this, the NBI algorithm spaces Npts start points in the (n-1) hypersurface, S, that connects the shadow . In the above example, S is the straight line that connects the points N and T. For each of the Npts points on S, the algorithm tries to maximize the distance along the normal away from this surface (this distance is labeled L in the following figure). This is called the NBI subproblem. For each of the points, the NBI subproblem is a single-objective problem and the algorithm uses the MATLAB fmincon routine to solve it. This is illustrated below for the TQ-NOX example.

The figure above shows spacing of the points between the along the (n-1) surface. The algorithm tries to maximize the distance L along the normal away from the surface. The following figure shows the final solution found by the NBI algorithm.

Tradeoff points per objective pair (Np)
The number of tradeoff solutions between your objectives that you want to find, Npts, is determined by the following formula:
![]()
where
Np is the number of points per objective pair.
n is the number of objective functions.
Note the following:
For problems with two objectives (n = 2),
![]()
For problems with three objectives (n = 3),
![]()
Shadow minima options and NBI subproblem options
The NBI algorithm uses the MATLAB fmincon algorithm to solve the shadow minima problem and the NBI subproblems, the options available are similar to those for the foptcon library function. For more information on these options, see the previous section, foptcon Optimization Parameters.
The NBI algorithm provides exit messages that can be seen in the Optimization output view, in the Solution Information pane, for the currently selected run. Check these messages to check for problems with your optimization.
All possible exit flags and messages are shown in the following table.
| Exit flag | Message |
|---|---|
| 6 | The shadow minima do not differ from one another. This suggests that all objectives can be minimized simultaneously. Check that the objectives are competing or alter tolerances. |
| 1 | All shadow and NBI subproblems converged to a solution. |
| 0 | At least one of the NBI subproblems is infeasible. |
| 0 | The maximum number of function evaluations was reached in at least one of the shadow or NBI subproblems. |
| -1 | Optimization terminated prematurely by the user. |
| -2 | At least one of the shadow problems is infeasible. |
| -7 | At least one of the Pareto solutions is dominated. |
The ga optimization algorithm in CAGE uses the MATLAB ga algorithm from Genetic Algorithm and Direct Search Toolbox product. In CAGE, ga wraps up the ga function from this toolbox so that you can use the function for maximizing as well as minimizing. If you have Genetic Algorithm and Direct Search Toolbox product installed, see Getting Started with the Genetic Algorithm.

Display — choose none, iter, final, or diagnose. This setting determines the level of diagnostic information displayed in the MATLAB workspace.
none — No information is displayed.
iter — Displays statistical information every iteration.
final — Displays statistical information at the end of the optimization.
diagnose — Displays information at each iteration. In addition, the diagnostic lists some problem information and the options that have been changed from the defaults.
Crossover function — Choose a function to use to generate new population members from the existing GA population by crossover. For more information on each function, see the Crossover Options section in the Genetic Algorithm and Direct Search Toolbox documentation. It is recommended not to use a heuristic crossover function for nonlinearly constrained problems.
Crossover fraction — Choose a scalar in the range [0 1]. This parameter specifies the fraction of the next generation, other than elite children, that is produced by crossover.
Mutation function — Choose a function to use to generate new population members from the existing GA population by mutation. The fraction of the next generation, other than elite children, that is produced by mutation is (1 minus Crossover fraction). Also, for nonlinearly constrained problems, the mutation function must be set to adaptfeasible.
Selection function — Choose a function to use to select the population members that will be used as the parents for the crossover and selection functions.
Population size — Choose a positive integer value. Number of population members used by the algorithm. See the Genetic Algorithm and Direct Search Toolbox documentation for guidelines on setting the population size.
Generations – Choose a positive integer value. The algorithm stops when the number of generations reaches the value of Generations.
Hybrid function — Choose an optimization function that will run after the GA has terminated to try to improve the value of the objective function. Note that if the algorithm has nonlinear constraints, the hybrid function cannot be fminunc or fminsearch. If either of these algorithms is selected in this case, the hybrid algorithm switches to fmincon.
Stall generations — Choose a positive integer value. The algorithm stops when the weighted average change in the objective function over Stall generations is less than Function tolerance.
Stall time limit – Choose a positive scalar value. The algorithm stops if there is no improvement in the objective function during an interval of time in seconds equal to Stall time limit.
Function tolerance — Choose a positive scalar value. The algorithm runs until the weighted average change in the fitness function value over Stall generations is less than Function tolerance.
Constraint tolerance – Choose a positive scalar value. This tolerance determines whether a population member is feasible with respect to the nonlinear constraints.
Time limit – Choose a positive scalar value. The algorithm stops after running for an amount of time in seconds equal to Time limit.
The patternsearch optimization algorithm in CAGE uses the MATLAB patternsearch algorithm from Genetic Algorithm and Direct Search Toolbox product. In CAGE, patternsearch wraps up the patternsearch function from this toolbox so that you can use the function for maximizing as well as minimizing. If you have the Genetic Algorithm and Direct Search Toolbox product installed, see Getting Started with Direct Search.

Display — Choose none, iter, final, or diagnose. This setting determines the level of diagnostic information displayed in the MATLAB workspace.
none — No information is displayed.
iter — Displays statistical information at every iteration.
final — Displays statistical information at the end of the optimization.
diagnose — Displays information at each iteration. In addition, the diagnostic lists some problem information and the options that have been changed from the defaults.
Time limit – Choose a positive scalar value. The algorithm stops after running for an amount of time in seconds equal to Time limit.
Maximum number of iterations — Choose a positive scalar value. This parameter specifies the maximum number of iterations performed by the algorithm.
Maximum function evaluations — Choose a positive integer value. The algorithm stops if the number of function evaluations reaches this value.
Variable tolerance — Choose a positive scalar value. The algorithm stops if the distance between two consecutive free variable values is less than the variable tolerance.
Function tolerance — Choose a positive scalar value. The algorithm stops if the distance between two consecutive objective function values and the mesh size are both less than Function tolerance.
Constraint tolerance – Choose a positive scalar value. Determine feasibility with respect to the nonlinear constraints.
Mesh tolerance — Choose a positive scalar value. The algorithm stops if the mesh size is smaller than Mesh tolerance.
Initial mesh size — Choose a positive scalar value. Sets the initial size of the mesh for the pattern search algorithm. Do not set this value too small, as insufficient size may lead to the algorithm getting trapped in local optima.
Poll method – Choose a poll method from the drop-down list. This parameter sets the polling strategy that will be used by the pattern search algorithm. Generally, the GPSPositiveBasis2N and MADSPositiveBasis2N methods will be slower than the GPSPositiveBasisNp1 and MADSPositiveBasisNp1 methods. However, the former methods perform a more thorough search. For more information on these methods, consult the Genetic Algorithm and Direct Search Toolbox documentation.
Search method — Choose a search method from the drop-down list. This parameter selects a function that will perform a search in addition to that performed by the pattern search algorithm. For automotive problems, searchlhs tends to perform well. For more information on the possible search methods, consult the Genetic Algorithm and Direct Search Toolbox documentation.
The Optimization menu contains the option to Scale Optimization Items — Select this to toggle scaling on and off. When you select scaling on, objective and constraint evaluations are (approximately) scaled onto the range [-1 1]. With scaling off, when you run the optimization the objective and constraint evaluations return their raw numbers.
Try running your optimization with scaling off, which is the default setting, to see if it converges to a satisfactory solution (check the output flags and the contour view). If your optimization solution is unsatisfactory, check to see if the objective and constraint functions have vastly different scales. In this case, try turning scaling on, because these optimization problems may benefit from objective and constraint evaluations being scaled to a common scale.
The output view always shows the solutions in raw, unscaled values, whether or not you use scaling to evaluate the problem.
![]() | Running Optimizations | Optimization Output Views | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |