Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Optimization   

optimset - Modify optimization settings

Syntax

optimset(proj,'Property1',Value1,'Property2',Value2,...)

Description

optimset(proj,'Property1',Value1,'Property2',Value2,...) modifies the optimization settings within the response optimization project, proj. The value of the optimization setting, Property1, is set to Value1, Property2 is set to Value2, etc.

PropertyDescriptionPossible Settings
MethodThe optimization method used. The following methods are available:
  • fmincon — Optimization Toolbox function fmincon

  • patternsearch — Genetic Algorithm and Direct Search Toolbox function patternsearch

  • fminsearch — Optimization Toolbox function fminsearch

{'fmincon'} | 'patternsearch' | 'fminsearch'
AlgorithmThe algorithm used by the optimization method.

For fmincon optimization method:

  • {'active-set'}

  • 'trust-region-reflective'

  • 'interior-point'

DisplayThe level of information that the optimization displays:
  • off — No output

  • iter — Output at each iteration

  • final — Final output only

  • notify — Output only if the function does not converge

'off' | {'iter'} | 'final' | 'notify'
GradientTypeMethod used to calculate gradients when using 'fmincon' as the Method. Use one of the following finite difference methods for gradient calculation:
  • basic — Default method for computing the gradients

  • refined — Offers a more robust and less noisy gradient calculation method than 'basic'

    The refined method is sometimes more expensive, and does not work with certain models such as SimPowerSystems models.

{'basic'} | 'refined'
MaximallyFeasibleOption to specify that the optimization continue after an initial solution has been found:
  • 0 — Terminate the optimization as soon as an initial solution that satisfies the constraints is found. The resulting response signal may lie very close to the constraint segment.

  • 1 — Continue the optimization after an initial solution is found. The optimization can continue to search for a maximally feasible solution that is typically located further inside the constraint region.

{0} | 1
MaxIterMaximum number of iterations allowedPositive integer value
TolConTermination tolerance on the constraintsPositive scalar value
TolFunTermination tolerance on the function valuePositive scalar value
TolXTermination tolerance on the parameter valuesPositive scalar value
RestartsIn some optimizations, the Hessian may become ill-conditioned, and the optimization does not converge. In these cases, it is sometimes useful to restart the optimization after it stops, using the endpoint of the previous optimization as the starting point for the next one. To automatically restart the optimization, use this option to indicate the number of times you want to restart.Nonnegative integer value
UseParallelParallel computing option for the following optimization methods:
  • fmincon

  • patternsearch

    Note   Parallel Computing Toolbox software must be installed to enable parallel computing for the optimization methods.

When set to 'always', the methods compute the following in parallel:

  • fmincon — Computes finite difference gradients

  • patternsearch — Performs population evaluation

Disable the option by setting to 'never'.

'always' | {'never'}

ParallelPathDependenciesOption to store model path dependencies when using parallel computingCell array of strings
SearchMethodSearch options for use with the patternsearch methodSee Search Options in the Genetic Algorithm and Direct Search Toolbox documentation.

For more information on the possible settings and the values they can take, see the reference page for optimset in the MATLAB documentation.

Example

Create a default response optimization project for the model srotut1.

proj=newsro('srotut1','Kint');

Get the optimization settings for this project.

opt_settings=optimget(proj)

This command returns the following list of optimization settings and their current values.

                  Method: 'fmincon'
                   Algorithm: 'active-set'
                     Display: 'iter'
                GradientType: 'basic'
           MaximallyFeasible: 0
                     MaxIter: 100
                      TolCon: 1.0000e-003
                      TolFun: 1.0000e-003
                        TolX: 1.0000e-003
                    Restarts: 0
                 UseParallel: 'never'
    ParallelPathDependencies: {0x1 cell}
                SearchMethod: []

Use optimset to change the maximum number of iterations to 150.

optimset(proj,'MaxIter',150)

To view the changes to opt_settings, enter the variable name at the MATLAB prompt.

opt_settings

This command returns

               Method: 'fmincon'
                   Algorithm: 'active-set'
                     Display: 'iter'
                GradientType: 'basic'
           MaximallyFeasible: 0
                     MaxIter: 150
                      TolCon: 1.0000e-003
                      TolFun: 1.0000e-003
                        TolX: 1.0000e-003
                    Restarts: 0
                 UseParallel: 'never'
    ParallelPathDependencies: {0x1 cell}
                SearchMethod: []

See Also

optimget, simget, simset

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS