Documentation

sdo.requirements.MonotonicVariable class

Package: 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

requirement = 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.

requirement = sdo.requirements.MonotonicVariable(Name,Value) creates the requirement object with additional options specified by one or more Name,Value pair arguments. Name is a property name and Value is the corresponding value. Name must appear inside single quotes (''). You can specify several name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Input Arguments

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Use Name,Value arguments to specify properties of the requirement object during object creation. For example, requirement = 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

evalRequirementEvaluate satisfaction of monotonic variable requirement

Copy Semantics

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

Examples

expand 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.

Introduced in R2016b

Was this topic helpful?