sdo.requirements.BodeMagnitude class

Package: sdo.requirements

Bode magnitude bound

Syntax

bode_req = sdo.requirements.BodeMagnitude
bode_req = sdo.requirements.BodeMagnitude(Name,Value)

Description

Specify frequency-dependent piecewise-linear upper and lower magnitude bounds on a linear system. You can then optimize your model to meet the requirements using sdo.optimize.

You can specify upper or lower bounds, include multiple linear edges, and extend them to + or –infinity..

You must have Simulink® Control Design™ software to specify bode magnitude requirements.

Construction

bode_req = sdo.requirements.BodeMagnitude creates an sdo.requirements.BodeMagnitude object and assigns default values to its properties.

bode_req = sdo.requirements.BodeMagnitude(Name,Value) uses 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.

'BoundFrequencies'

Frequency values for the gain bound.

Specify the start and end frequencies for all the edges in the piecewise-linear bound. The property must be a nx2 array of finite doubles, where each row specifies the start and end frequencies of an edge in the piecewise-linear bound. The start and end frequencies must define a positive length. The number of rows must match the number of rows of the BoundMagnitudes property.

Use set to set this and the BoundMagnitudes properties simultaneously.

Use the FrequencyUnits property to specify the frequency units.

Default: [1 10]

'BoundMagnitudes'

Magnitude values for the gain bound.

Specify the start and end gain values for all the edges in the piecewise-linear bound. The property must be a nx2 array of finite doubles where each row specifies the start and end gains of an edge in the piecewise-linear bound. The number of rows must match the number of rows of the BoundFrequencies property.

Use set to set this and the BoundFrequencies properties simultaneously.

Use the MagnitudeUnits property to specify the magnitude units.

Default: [0 0]

'Description'

Requirement description. Must be a string.

Default: ''

'FrequencyScale'

Frequency-axis scaling.

Use this property to determine the value of the bound between edge start and end points. Must be one of the following strings:

  • 'linear'

  • 'log'

For example, if bound edges are at frequencies f1 and f2, and the bound is to be evaluated at f3, the edges are interpolated as a straight lines. The x-axis is either linear or logarithmic.

Default: 'log'

'FrequencyUnits'

Frequency units of the requirement. Must be one of the following strings:

  • 'Hz'

  • 'rad/s'

  • 'rpm'

  • 'kHz'

  • 'MHz'

  • 'GHz'

  • 'rad/nanosecond'

  • 'rad/microsecond'

  • 'rad/millisecond'

  • 'rad/minute'

  • 'rad/hour'

  • 'rad/day'

  • 'rad/week'

  • 'rad/month'

  • 'rad/year'

  • 'cycles/nanosecond'

  • 'cycles/microsecond'

  • 'cycles/millisecond'

  • 'cycles/hour'

  • 'cycles/day'

  • 'cycles/week'

  • 'cycles/month'

  • 'cycles/year'

Default: 'rad/s'

'MagnitudeUnits'

Magnitude units of the requirement. Must be:

  • 'db' (decibels)

  • 'abs' (absolute units)

Default: 'db'

'Name'

Requirement name. Must be a string.

Default: ''

'OpenEnd'

Extend bound in a negative or positive frequency direction.

Specify whether the first and last edge of the bound extends to –inf and +inf respectively. Use to bound signals that extend beyond the frequency values specified by the BoundFrequencies property.

Must be a 1x2 logical array of true or false. If true, the first or last edge of the piecewise linear bound is extended in the negative or positive direction.

Default: [0 0]

'Type'

Magnitude bound type. Must be:

  • '<=' — Upper bound

  • '>=' — Lower bound

Use to specify whether the piecewise-linear bound is an upper or lower bound. Use for upper bound and for lower bound.

Properties

BoundFrequencies

Frequency values for the gain bound.

Specify the start and end frequencies for all the edges in the piecewise-linear bound. The property must be a nx2 array of finite doubles, where each row specifies the start and end frequencies of an edge in the piecewise-linear bound. The start and end frequencies must define a positive length. The number of rows must match the number of rows of the BoundMagnitudes property.

Use set to set this and the BoundMagnitudes properties simultaneously.

Use the FrequencyUnits property to specify the frequency units.

Default: [1 10]

BoundMagnitudes

Magnitude values for the gain bound.

Specify the start and end gain values for all the edges in the piecewise-linear bound. The property must be a nx2 array of finite doubles where each row specifies the start and end gains of an edge in the piecewise-linear bound. The number of rows must match the number of rows of the BoundFrequencies property.

Use set to set this and the BoundFrequencies properties simultaneously.

Use the MagnitudeUnits property to specify the magnitude units.

Default: [0 0]

Description

Requirement description. Must be a string.

Default: ''

FrequencyScale

Frequency-axis scaling.

Use this property to determine the value of the bound between edge start and end points. Must be one of the following strings:

  • 'linear'

  • 'log'

For example, if bound edges are at frequencies f1 and f2, and the bound is to be evaluated at f3, the edges are interpolated as a straight lines. The x-axis is either linear or logarithmic.

Default: 'log'

FrequencyUnits

Frequency units of the requirement. Must be one of the following strings:

  • 'Hz'

  • 'rad/s'

  • 'rpm'

  • 'kHz'

  • 'MHz'

  • 'GHz'

  • 'rad/nanosecond'

  • 'rad/microsecond'

  • 'rad/millisecond'

  • 'rad/minute'

  • 'rad/hour'

  • 'rad/day'

  • 'rad/week'

  • 'rad/month'

  • 'rad/year'

  • 'cycles/nanosecond'

  • 'cycles/microsecond'

  • 'cycles/millisecond'

  • 'cycles/hour'

  • 'cycles/day'

  • 'cycles/week'

  • 'cycles/month'

  • 'cycles/year'

Default: 'rad/s'

MagnitudeUnits

Magnitude units of the requirement. Must be:

  • 'db' (decibels)

  • 'abs' (absolute units)

Default: 'db'

Name

Requirement name. Must be a string.

Default: ''

OpenEnd

Extend bound in a negative or positive frequency direction.

Specify whether the first and last edge of the bound extends to –inf and +inf respectively. Use to bound signals that extend beyond the frequency values specified by the BoundFrequencies property.

Must be a 1x2 logical array of true or false. If true, the first or last edge of the piecewise linear bound is extended in the negative or positive direction.

Default: [0 0]

Type

Magnitude bound type. Must be:

  • '<=' — Upper bound

  • '>=' — Lower bound

Use to specify whether the piecewise-linear bound is an upper or lower bound. Use for upper bound and for lower bound.

Methods

evalRequirementEvaluate Bode magnitude bound for linear system

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects in the MATLAB® documentation.

Examples

Construct a Bode magnitude requirements object and specify bound frequencies and magnitudes.

r = sdo.requirements.BodeMagnitude;
set(r,'BoundFrequencies', [0.1 10; 10 100],...
'BoundMagnitudes',[1 1; 0.1 0.1])

Alternatively, you can specify the frequency and magnitude during construction.

r = sdo.requirements.BodeMagnitude(...
    'BoundFrequencies', [1 10; 10 100], ...
    'BoundMagnitudes', [1 1; 1 0]);

Alternatives

Use getbounds to get the bounds specified in a Check Bode Characteristics block.

Was this topic helpful?