This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

sdo.OptimizeOptions class

Package: sdo

Optimization options


opt = sdo.OptimizeOptions
opt = sdo.OptimizeOptions(Name,Value)


Specify options such as a solver, solver options, and the use of parallel computing during optimization.


opt = sdo.OptimizeOptions creates an sdo.OptimizeOptions object and assigns default values to the properties.

opt = sdo.OptimizeOptions(Name,Value) creates an sdo.OptimizeOptions object with additional options specified by one or more Name,Value pair arguments. Name is a property name and Value is the corresponding value.

Input Arguments

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Use Name,Value arguments to specify properties of sdo.OptimizeOptions object during object creation. For example, opt = sdo.OptimizeOptions('Method','lsqnonlin') creates a sdo.OptimizeOptions object specifying the Method property as lsqnonlin.


expand all

Specify if the cost or constraint function you provide to sdo.optimize returns gradient information, specified as one of the following values:

  • 'off' — The cost or constraint function does not return gradient information. The software uses central differences to compute the gradients.

  • 'on' — The cost or constraint function returns gradient information.

Optimization solver that sdo.optimize uses to solve the optimization problem, specified as one of the following values:

  • 'fmincon'

  • 'fminsearch'

  • 'lsqnonlin'

  • 'patternsearch' (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 optimization options. The options are configured based on the Method property. For information about the available optimization solver options, see:

To change solver options, use dot notation. For example, opt.MethodOptions.StepTolerance = 1.5e-3.

Name of Simulink model to be optimized, specified as a character vector.

This property is used to configure the model for parallel optimization (UseParallel = true).

Example: 'model_demo'

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. For example, {'C:\matlab\work\file1.m','C:\matlab\myProject\file2.m'}. These files are copied to the workers during parallel optimization. Use sdo.getModelDependencies to find the dependencies of a Simulink model.

Paths to dependencies to use during parallel optimization, specified as a cell array of character vector. For example, {'C:\matlab\work','C:\matlab\myProject'}. These path dependencies are temporarily added to the workers during parallel optimization. Use sdo.getModelDependencies to find the dependencies of a Simulink model.

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.

Handling of optimization termination once a feasible solution satisfying constraints is found, specified as one of the following values:

  • 'on' — Terminate as soon 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.

Parallel computing option for fmincon, lsqnonlin, and patternsearch optimization solvers, specified as one of the following:

  • false or 0 — Do not use parallel computing during optimization.

  • true or 1 — 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 gradients

  • lsqnonlin — Finite difference gradients

  • patternsearch — Poll and search set evaluation

    Note:   Parallel computing is not supported for fminsearch.

It is recommended that you also specify values for the OptimizedModel, and ParallelFileDependencies, or ParallelPathDependencies properties, if needed.

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB) in the MATLAB® documentation.


expand all

opt = sdo.OptimizeOptions;
opts = sdo.OptimizeOptions('Method','lsqnonlin');
opt.MethodOptions.TolX = 1.5e-3;
Was this topic helpful?