Documentation

sdo.requirements.SmoothnessConstraint class

Package: sdo.requirements
Superclasses:

Impose bounds on gradient magnitude of variable

Description

Use the sdo.requirements.SmoothnessConstraint object to impose an upper bound on the gradient magnitude of a variable in a Simulink® model. The variable can be a vector, matrix, or multidimensional array that is a parameter in your model, such as the data of a lookup table. For example, consider a car engine controller whose gain changes under different operating conditions determined by the car speed. You can use a gradient bound constraint to limit the rate at which the controller gain changes per unit change in vehicle speed.

You can use the requirement object as an input to your cost function and then use the evalRequirement command to evaluate whether your test data satisfies the requirement. If the test data is not smooth, the gradient of the test data is greater than the required bound. 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.SmoothnessConstraint creates an sdo.requirements.SmoothnessConstraint 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.SmoothnessConstraint(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.SmoothnessConstraint('GradientBound',2.5) creates an sdo.requirements.SmoothnessConstraint object and specifies the gradient magnitude bound as 2.5.

Properties

expand all

Requirement description, specified as a character vector.

Example: 'Requirement 1 for myModel.'

Data Types: char

Gradient magnitude bound, specified as a nonnegative finite real scalar. When you use the evalRequirement command to evaluate test data, the software checks whether the gradient magnitude of the test data is less than or equal to the specified bound. If the gradient of the test data is greater than the required bound, the test data is not smooth.

Data Types: double

Name of requirement, specified as a character vector.

Example: 'Requirement1'

Data Types: char

Gradient magnitude bound type, specified as lower bound, '<='. When you use the evalRequirement command, the software checks whether the gradient magnitude of the test data is less than or equal to the specified in GradientBound property.

Data Types: char

Methods

evalRequirementEvaluate satisfaction of smoothness constraint requirement

Copy Semantics

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

Examples

expand all

Create a requirement object to impose a bound on the gradient magnitude of a variable. The object has default properties.

Requirement = sdo.requirements.SmoothnessConstraint;

Specify the gradient magnitude bound value.

Requirement.GradientBound = 5;

Alternatively, specify the bound during object creation.

Requirement = sdo.requirements.SmoothnessConstraint('GradientBound',5);

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

Introduced in R2016b

Was this topic helpful?