Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Verifier   

Defining Parameter Configurations

This section describes how to define parameter configurations and outlines the required syntax for their definition.

  1. Define parameter configurations in an M-file function.

    The Simulink Design Verifier software provides an annotated template for an M-file function that you can use as a starting point (see Template for Parameter Configurations).

  2. Specify parameter configurations using a structure whose fields share the same names as the parameters that you treat as input variables.

    For example, suppose you wish to constrain the Gain and Constant value parameters, m and b, which appear in the following model:

    In your parameter configuration file, use the following names for the fields of the structure:

    params.m
    params.b
  3. Constrain parameters by assigning values to the fields of the structure.

    Specify points using the Sldv.Point constructor, which accepts a single value as its argument. Specify intervals using the Sldv.Interval constructor, which requires two input arguments, i.e., a lower bound and an upper bound for the interval. Optionally, you can provide one of the following strings as a third input argument that specifies inclusion or exclusion of the interval endpoints:

    • '()' — Defines an open interval.

    • '[]' — Defines a closed interval.

    • '(]' — Defines a left-open interval.

    • '[)' — Defines a right-open interval.

      Note   By default, the Simulink Design Verifier software considers an interval to be closed if you omit its two-character string.

    The following example constrains m to 3 and b to any value in the closed interval [0, 10]:

    params.m = Sldv.Point(3);
    params.b = Sldv.Interval(0, 10);

    If the parameters are scalar, you can omit the constructors and instead specify single values or two-element vectors. For instance, you can alternatively specify the previous example as:

    params.m = 3;
    params.b = [0 10];

      Note   To indicate no constraint for an input parameter, specify params.m = {} or params.m = [] in the M-file function, or omit the declaration. The Simulink Design Verifier software treats this parameter as free input and uses random parameter values.

  4. Use cell arrays to specify multiple constraints for a single parameter.

    You can specify multiple constraints for a single parameter by using a cell array. In this case, the Simulink Design Verifier software combines the constraints using a logical OR operation during its analysis.

    The following example constrains m to either 3 or 5, and it constrains b to any value in the closed interval [0, 10]:

    params.m = {3, 5};
    params.b = [0 10];
  5. Use a 1-by-n structure to specify n sets of parameters.

    You can specify several sets of parameters by expanding the size of your structure.

    For instance, the following example uses a 1-by-2 structure to define two sets of parameters:

    params(1).m = {3, 5};
    params(1).b = [0 10];
    
    params(2).m = {12, 15, Sldv.Interval(50, 60, '()')};
    params(2).b = 5;

    The first parameter set constrains m to either 3 or 5, and it constrains b to any value in the closed interval [0, 10]. The second parameter set constrains m to either 12, 15, or any value in the open interval (50, 60), and it constrains b to 5.

  


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