This example shows how to control the accuracy of your operating point search by configuring the optimization algorithm. Typically, you adjust the optimization settings based on the operating point search report, which is automatically created after each search.
You can change your optimization settings when computing operating points
interactively using the Steady State Manager or Model
Linearizer, or programmatically using the
You can configure the optimization settings for interactively computing operating points using the Steady State Manager or Model Linearizer using the same trimming options dialog box interface.
In Steady State Manager, on the Specification tab, click Trim Options. Then, in the Trim Options dialog box, specify your optimization settings.
In Model Linearizer, on the Linear Analysis tab, in the Operating Point drop-down list, click Trim Model. Then, in the Trim the model dialog box, on the Options tab, specify your optimization settings.
You can specify the Optimization Method and corresponding optimization options such as the options shown in the following table.
|Optimization Status||Option to Change||Comment|
|Optimization ends before completing (too few iterations)||Maximum iterations||Increase the number of iterations.|
|State derivative or error in output constraint is too large||Function tolerance or Constraint tolerance (depending on selected algorithm)||Decrease the tolerance value.|
You can get help on each option by right-clicking the option label and selecting What's This?.
You can also specify custom cost and constraint functions for optimization, using the Custom Optimization Functions parameters. For more information, see Compute Operating Points Using Custom Constraints and Objective Functions.
To configure the optimization settings for computing operating points using
findop function, create a
findopOptions option set. For example, create an
option set and specify a nonlinear least-squares optimization method.
options = findopOptions('OptimizerType','lsqnonlin');
To specify options for each optimization method, set the
OptimizationOptions parameter of the options set to
a corresponding structure created using the
To specify custom cost and constraint functions for optimization, create an
operspec object and specify the
CustomMappingFcn properties. For more information,
see Compute Operating Points Using Custom Constraints and Objective Functions.