Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Control Design   

Working with Operating Points

Copying Operating Points

In some situations you might want to create and edit a copy of an operating point. To create a copy of an operating point, right-click the operating point in the tree on the left, and select Duplicate from the right-click menu, as shown in the following figure.

The new operating point appears beneath the original one in the tree. Click the new operating point to display its contents in the pane on the right. To change state or input values in the duplicated operating point, edit the values in the right pane. To change the name of the new operating point, right-click the operating point in the tree, select Rename from the right-click menu, and then enter a new name for the operating point.

Note that you cannot copy operating points that were computed from specifications. These operating points contain information related to the success of the optimization which would not be meaningful when the operating point values were changed.

Exporting Operating Points

After creating operating points using the Simulink Control Design software, you can export them from the Control and Estimation Tools Manager to the MATLAB workspace or the model workspace. You can use an exported operating point to perform analysis at the MATLAB command line or to initialize a Simulink model for simulation. To export an operating point, right-click the operating point under Operating Points in the pane on the left and select Export to Workspace. This opens the Export to Workspace dialog box, as shown below:

  1. Click either

    • Base Workspace to export the operating point to the MATLAB workspace where you can use it with Simulink Control Design command-line functions

    • Model Workspace to export the operating point to the Model workspace where you can save it with the model for future use.

  2. Enter a name for the exported operating point.

  3. Select Use the operating point to initialize model when you want to use the operating point values as initial conditions for the states and inputs in the model. The initial values are automatically set in the Data Import/Export pane of the Configuration Parameters dialog box and Simulink uses these initial conditions when simulating the model.

Saving Operating Points

After you have exported the operating point to the MATLAB workspace, you can save it in a MAT-file for later use. To save the operating point Operating_Point in a file named magball_operating_points.mat, enter the following command:

save magball_operating_point Operating_Point

Importing Operating Points

This section continues the example from Example Model: The Magnetic Ball System. At this stage in the example, a linearization project has already been created for the model, and linearization points have been inserted, and operating points have been created from specifications, known values, and simulation.

To import operating points from the MATLAB workspace or from a MAT-file.

  1. To import a new operating point, select the Operating Points node in the project tree and then select the Operating Points tab on the right. Click the Import button at the bottom of the pane. This displays the Operating Point Import dialog box.

  2. Click Workspace or MAT-file as the location to import the operating point from, select an operating point from the list below, and then click Import. For this example, two operating points are loaded into the MATLAB workspace when you open the magball model.

Importing Initial Values

When you want populate the Value column of the operating point specifications by importing initial or known values from another operating point, a Simulink states structure, or a vector of values, click the Import Initial Values button at the bottom of the window. The Operating Point Import dialog box opens, as shown below.

Select where to import the initial values from (a project, the workspace, or a file), then select the operating point from the list of available operating points below (or in the case of MAT-files, browse for a file). Click Import to import the initial values from the selected operating point into the Value column of the operating point specifications.

Constraining Outputs

Operating specifications often include constraints on the values of specific signals in the model. To constrain output signals when determining operating points from specifications, add an output constraint annotation to the model by right-clicking the signal line and choosing Output Constraint from the menu. This adds a small T to the signal line. Then, within the Outputs pane of the Compute Operating Points pane, select the Known check box and enter desired values as well as minimum and maximum values for this signal.

Changing Optimization Settings

To change the settings used when determining operating points by optimization, select Tools > Options and then click the Operating Point Search tab. This opens the Options dialog box.

To get help on each option or setting in the Options dialog box, right-click an option's label and select What's This?.

Additionally, you can refer to the Optimization Toolbox™ documentation and the linoptions reference page for more information about these settings. If you do not have the Optimization Toolbox documentation you can find it at

http://www.mathworks.com/access/helpdesk/help/toolbox/optim/optim.shtml

The methods Gradient descent with elimination, Simplex search, and Nonlinear least squares refer to the optimization methods fmincon, fminsearch, and lsqnonlin respectively. The method Gradient descent refers to the optimization method graddescent, described in the linoptions reference page. The reference page for the Optimization Toolbox function optimset contains documentation for the following operating point search settings (the corresponding optimset parameter values are given in parentheses):

Operating Point Search Option

Parameter in optimset

Large Scale

LargeScale set to 'on'

Medium Scale

LargeScale set to 'off'

Maximum change

DiffMaxChange

Minimum change

DiffMinChange

Function tolerance

TolFun

Constraint tolerance

TolCon

Maximum fun evals

MaxFunEvals

Maximum iterations

MaxIter

Parameter tolerance

TolX

Enable analytic jacobian

Jacobian.
When this option is selected, the Jacobian is computed at each iteration by linearizing the model about the current operating point. This option does not work with models that contain references to other models using the Model block or with models from products based on the Simscape™ platform that are in Trimming mode.

Display results

Display information contained in the output variable of the optimization functions, such as number of iterations, stepsize, etc.

  


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