Specify Design Variables

This topic shows how to specify design variables for optimization.

Before running the optimization, you must specify the model parameters to optimize. These parameters form the design variables set for optimization. By tuning these parameters, Simulink® Design Optimization™ software attempts to make the signals meet the requirements.

Simulink Design Optimization software optimizes the response signals of the model by varying the tuned parameters so that the response signals lie within the constraint bound segments or closely match a specified reference signal. The design variables can be scalar, vector, matrix, or an expression that evaluates to one of these values.

Add Model Parameters as Variables for Optimization

The software can only optimize variables that are in use by the Simulink model. Create variables for optimization in the MATLAB® or model workspace, and specify your model or block parameters using these variables.

In this figure, the Proportional (P) and Integral (I) gain parameters of a PID Controller block are specified as numerical values.

To optimize the gain parameters, specify them as variables Kp and Ki:

  1. Create the variables Kp and Ki in one of the following ways:

  2. Specify the gain parameters as the variables Kp and Ki in the PID Controller block dialog box.

You can now select Kp and Ki for optimization. See, Specify Design Variables.

 Specify Independent Parameters for Optimization

Specify Design Variables

To specify the parameters to be tuned using the Response Optimization tool:

  1. In the Design Variables Set list, select New.

    A window opens where you specify design variables. All parameters in use by the model are displayed in this window.

  2. Select one or more parameter names and click

    to add the selected parameters to a design variables set.

      Note:   You can add the same parameter to multiple design variable sets.

  3. (Optional) Specify design variable settings.



    The name of the parameter.

    Not an editable field


    Value of the model parameter. This value is used by the optimization method as the initial value and is modified during optimization.

    Current value of the parameter in the model. If you edit this column, click Update model variable values to update the values in the model.


    The minimum value or lower bound for the parameter. You can edit this field to provide an alternate minimum value.



    The maximum value or upper bound for the parameter. You can edit this field to provide an alternate maximum value.



    During optimization, the design variables are scaled, or normalized, by dividing their current value by a scale value. You can edit this field to provide an alternate scaling factor.

    Next power of 2 greater than the current value of the parameter

    The check-box indicates whether the parameter is selected as an design variable in the set. Select it if you want this parameter to be tuned during the optimization. Deselect if you do not want this parameter to be tuned during the optimization but you would like to keep it on the list of tuned parameters (for a subsequent optimization).

    Expand Variable Detail to see the block in the model that contains this parameter.

  4. Click OK to create a design variable set.

Related Examples

Was this topic helpful?