Main Content

sdo.requirements.MonotonicVariable Class

Namespace: sdo.requirements
Superclasses:

Impose monotonic constraint on variable

Description

Use the sdo.requirements.MonotonicVariable object to impose a monotonic constraint on a variable in your Simulink® model. The variable can be a vector, matrix, or multidimensional array that is a parameter in your model, such as the breakpoints of a lookup table. You create the requirement object, and specify the type of monotonic requirement the variable needs to satisfy. For example, for a 2-D array variable, you can specify the elements of the first dimension as monotonically increasing and the elements of the second dimension as monotonically decreasing.

You can use the requirement object as an input to your cost function and use the evalRequirement command to evaluate whether your test data satisfies the specified requirement. You can then use the cost function and sdo.optimize to perform response optimization, subject to satisfaction of the specified requirement. If you are performing sensitivity analysis, after you generate parameter samples, you can use the cost function and sdo.evaluate to evaluate the requirement for each generated sample.

Construction

mono_req = sdo.requirements.MonotonicVariable creates an sdo.requirements.MonotonicVariable requirement object and assigns default values to its properties. Use dot notation to customize the properties. Use the evalRequirement command to evaluate whether test data satisfies the specified requirement.

mono_req = sdo.requirements.MonotonicVariable(Name=Value) specifies one or more properties using name-value arguments. For example, mono_req = sdo.requirements.MonotonicVariable(Type=">") creates an sdo.requirements.MonotonicVariable object and specifies the Type property as monotonically decreasing.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes. For example, mono_req = sdo.requirements.MonotonicVariable("Type",">") creates an sdo.requirements.MonotonicVariable object and specifies the Type property as monotonically decreasing.

Properties

expand all

Requirement description, specified as a character vector.

Example: 'Requirement 1 for myModel.'

Data Types: char

Name of requirement, specified as a character vector.

Example: 'Requirement1'

Data Types: char

Monotonicity type for each dimension of the variable, specified as a cell array of character vectors. The size of the cell array equals the dimensions of the variable. Specify the required monotonic relation between the elements in each dimension as one of the following:

  • '<' — Each element of the variable is less than the next element in that dimension. That is, the elements are monotonically increasing.

  • '<=' — Each element of the variable is less than or equal to the next element in that dimension.

  • '>' — Each element of the variable is greater than the next element in that dimension. That is, the elements are monotonically decreasing.

  • '>=' — Each element of the variable is greater than or equal to the next element in that dimension.

  • 'unconstrained' — No constraint exists between the elements of the variable in that dimension. When the requirement is evaluated for test data using evalRequirement, the output corresponding to that dimension is —Inf, indicating the requirement is satisfied.

For example, for a two-dimensional variable, if you require the elements in the first dimension of the variable to be monotonically increasing while having no restriction on the elements of the second dimension, specify Type as {'<','unconstrained'}.

Data Types: cell

Methods

copyCopy design requirement
getGet design requirement property values
setSet design requirement property values
evalRequirementEvaluate design requirement

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects.

Examples

collapse all

Create a requirement object with default properties.

Requirement = sdo.requirements.MonotonicVariable;

Specify the requirement type for a 1-dimensional variable as monotonically decreasing.

Requirement.Type = {'>'};

You can now use the evalRequirement command to evaluate if test data satisfies the requirement.

Create a requirement object, and specify the monotonicity for a 3-dimensional variable.

Requirement = sdo.requirements.MonotonicVariable('Type',{'<','>','>='});

The object requires the elements in the first dimension of the variable to be monotonically increasing and the elements in the second dimension to be monotonically decreasing. Each element in the third dimension of the variable can be greater than or equal to the next element in that dimension.

Version History

Introduced in R2016b