sdo.OptimizeOptions
Optimization option set for sdo.optimize
function
Description
Use an sdo.OptimizeOptions
object to specify options for solving
a design optimization problem using the sdo.optimize
function. You can specify options such as a solver method, solver
options, and the use of parallel computing during optimization.
Creation
Description
creates a default
option set for solving a design optimization problem using the opt
= sdo.OptimizeOptionssdo.optimize
function. To modify the properties of this option set for your
specific application, use dot notation.
creates an option set with properties
specified using one or more name-value arguments.opt
= sdo.OptimizeOptions(Name,Value
)
Properties
Optimization solver that sdo.optimize
uses to solve the optimization
problem, specified as one of the following values:
'fmincon'
— Default for design optimization, derivative based method, allows nonlinear constraints and parameter bounds.'fminsearch'
— Derivative-free method.'lsqnonlin'
— Default for parameter estimation. This method works with gradient of residual between model output and data. This method allows nonlinear constraints (since R2023b) and parameter bounds.'patternsearch'
— Derivative-free method. This method allows nonlinear constraints and parameter bounds. Pattern search requires Global Optimization Toolbox software.'paretosearch'
— This method searches iteratively for nondominated points to solve multiobjective optimization problems. It requires Global Optimization Toolbox software. For more information, seeparetosearch
(Global Optimization Toolbox).'surrogateopt'
— Surrogate-based method. This method allows nonlinear constraints and discrete-valued parameters. The method requires parameter bounds. Using surrogate-based optimization requires Global Optimization Toolbox software.
See the Optimization Toolbox™ and Global Optimization Toolbox documentation for more information on these solvers.
Optimization solver options, specified as an optimization options object, created
using optimoptions
. The options are configured based on the
Method
property. Because 'fmincon'
is the
default optimization solver method, the default value for this property is an
optimoptions
object for fmincon
solver. For
information about the available optimization solver options, consult the options table
for your solver based on the Method
specified:
To modify the solver options, use dot notation. For example,
opt.MethodOptions.StepTolerance = 1.5e-3
.
Some of the default values for patternsearch
and
paretosearch
options are different from those in their respective
pages. They are:
Option | Method | Default |
---|---|---|
ConstraintTolerance | patternsearch ,
paretosearch | 1e-3 |
Display | patternsearch ,
paretosearch | 'iter' |
MaxIterations | patternsearch ,
paretosearch | 100 |
FunctionTolerance | patternsearch | 1e-3 |
MaxFunctionEvaluations | patternsearch | Inf |
StepTolerance | patternsearch | 1e-3 |
UseCompleteSearch | patternsearch | true |
MeshTolerance | paretosearch | 1e-3 |
ParetoSetChangeTolerance | paretosearch | 1e-3 |
ParetoSetSize | paretosearch | 30 |
Number of times to restart optimization if convergence criteria are not satisfied, specified as a nonnegative integer. At each restart, the initial values of the tunable parameters are set to the final value of the previous optimization run.
Option to stop optimization once a feasible solution satisfying constraints is found, specified as one of the following values:
'on'
— Terminate as soon as a feasible solution is found.'off'
— Continue to search for solutions that are typically located further inside the constraint region.
The software ignores this option when you track a reference signal or your problem has a cost.
Option to specify that the cost or constraint function you provide to
sdo.optimize
provides gradient information, specified as one of
the following values:
'off'
— Your cost or constraint function does not provide gradient information. The software uses central differences to compute the gradients.'on'
— Your cost or constraint function provides gradient information as one of its output arguments.
Parallel computing option for fmincon
,
lsqnonlin
, and patternsearch
optimization
solvers, specified as one of the following:
false
or0
— Do not use parallel computing during optimization.true
or1
— Use parallel computing during optimization.
Parallel Computing Toolbox™ software must be installed to enable parallel computing for the optimization methods.
When set to true
, the methods compute the following in parallel:
fmincon
— Finite difference gradientslsqnonlin
— Finite difference gradientspatternsearch
— Poll and search set evaluation
Note
Parallel computing is not supported for fminsearch
.
For parallel computing, specify a simulation scenario for the Simulink® model to optimize as an sdo.SimulationTest
object in the OptimizedModel
property. You can specify model file dependencies in the
ParallelFileDependencies
property, or you can specify paths to
dependencies in the ParallelPathDependencies
property, if
needed.
File dependencies to use during parallel optimization, specified as a cell array of
character vectors. Each character vector can specify either an absolute or relative path
to a file. These files are copied to the workers during parallel optimization. Use
sdo.getModelDependencies
to find the
dependencies of a Simulink model.
Example: opt.ParallelFileDependencies =
{'C:\matlab\work\file1.m','C:\matlab\myProject\file2.m'}
Paths to dependencies to use during parallel optimization, specified as a cell array
of character vectors. If you do not want to copy the files to workers, use this property
instead of the ParallelFileDependencies
property. These path
dependencies are temporarily added to the workers during parallel optimization. Use
sdo.getModelDependencies
to find the
dependencies of a Simulink model.
Example: opt.ParallelPathDependencies =
{'C:\matlab\work','C:\matlab\myProject'}
Name of Simulink model to optimize, specified as either an sdo.SimulationTest
object or a character vector with the name of the
model.
Specify OptimizedModel
as an sdo.SimulationTest
object when using both parallel optimization
(UseParallel = true
) and fast restart.
Parallel Computing Toolbox software must be installed to enable parallel optimization.
Example: Simulator =
sdo.SimulationTest('model_demo')
Name of the .mat
backup file, specified as a string. If you
specify a filename, the software saves the parameter iteration data to the file during
estimation or optimization. If MATLAB® crashes due to a computer shutdown during estimation or optimization, you
can retrieve the data using this backup file. If the estimation or optimization
completes without any interruption, the software automatically deletes the file.
Object Functions
sdo.optimize | Solve design optimization problem |
Examples
Create a default sdo.OptimizeOptions
option set.
opt = sdo.OptimizeOptions;
Specify options using dot notation.
opt.Method = 'lsqnonlin'; opt.GradFcn = 'on';
Any property values you do not specify remain at their default values.
Create an option set object that specifies nonlinear least-squares optimization solver as its solving method.
opt = sdo.OptimizeOptions('Method','lsqnonlin')
opt = OptimizeOptions with properties: Method: 'lsqnonlin' MethodOptions: [1×1 optim.options.Lsqnonlin] Restarts: 0 StopIfFeasible: 'on' GradFcn: 'off' UseParallel: 0 ParallelPathDependencies: {} ParallelFileDependencies: {} OptimizedModel: '' BackupFilename: ''
You can modify solver options using dot notation. For example, set the solver algorithm to the Levenberg-Marquardt method.
opt.MethodOptions.Algorithm = 'levenberg-marquardt';
View the method options.
opt.MethodOptions
ans = lsqnonlin options: Options used by current Algorithm ('levenberg-marquardt'): (Other available algorithms: 'interior-point', 'trust-region-reflective') Set properties: Algorithm: 'levenberg-marquardt' Display: 'iter' FunctionTolerance: 1.0000e-03 MaxFunctionEvaluations: Inf MaxIterations: 100 SpecifyObjectiveGradient: 1 StepTolerance: 1.0000e-03 Default properties: FiniteDifferenceStepSize: 'sqrt(eps)' FiniteDifferenceType: 'forward' OutputFcn: [] PlotFcn: [] TypicalX: 'ones(numberOfVariables,1)' UseParallel: 0 Show options not used by current Algorithm ('levenberg-marquardt')
Any property values you do not specify remain at their default values.
Version History
Introduced in R2011aYou can now obtain the pareto-optimal designs by specifying the
Method
property of sdo.OptimizeOptions
as
'paretosearch'
.
For information on the paretosearch
algorithm, see paretosearch Algorithm (Global Optimization Toolbox).
You can now save the parameter iteration data while solving a parameter estimation or
design optimization problem in a .mat
file by specifying the
BackupFilename
property. If the computer shuts down during estimation
or optimization, you can retrieve the data using this .mat
file.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)