sdo.requirements.BodeMagnitude

Bode magnitude bound

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.

Creation

Syntax

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

Description

example

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

example

``````bode_req = sdo.requirements.BodeMagnitude(Name=Value)``` specifies one or more properties using name-value arguments. For example, ```bode_req = sdo.requirements.BodeMagnitude(FrequencyUnits="Hz")``` creates an `sdo.requirements.BodeMagnitude` object and specifies the `FrequencyUnits` property as hertz.Before R2021a, use commas to separate each name and value, and enclose `Name` in quotes. For example, ```bode_req = sdo.requirements.BodeMagnitude("FrequencyUnits","Hz")``` creates an `sdo.requirements.BodeMagnitude` object and specifies the `FrequencyUnits` property as hertz.```

Properties

expand all

Frequency values for the gain bound, specified as a vector. Specify the start and end frequencies for all the edges in the piecewise-linear bound. The property must be a `n`-by-2 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.

Magnitude values for the gain bound, specified as a vector. Specify the start and end gain values for all the edges in the piecewise-linear bound. The property must be an `n`-by-2 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.

Requirement description, specified as a character vector.

Example: `'Requirement on signal 1'`

Frequency-axis scaling, specified as `"log"` or `"linear"` and stored as a character vector. Use this property to determine the value of the bound between edge start and end points, specified as one of the following values:

• `"log"` — Logarithmic scaling

• `"linear"` — Linear scaling

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.

Frequency units of the requirement, specified as one of the following. The `sdo.requirements.BodeMagnitude` object stores the value as a character vector.

• `"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"`

Magnitude units of the requirement, specified as either `"db"` (decibels) or `"abs"` (absolute units). The `sdo.requirements.BodeMagnitude` object stores the value as a character vector.

Requirement name, specified as a character vector.

Extend bound in a negative or positive frequency direction, specified as a 1-by-2 logical vector of `true` or `false`. If `true`, the first or last edge of the piecewise linear bound is extended in the negative or positive direction, respectively. Extended bounds go to `–inf` and `+inf`, respectively.

Use this property to bound signals that extend beyond the frequency values specified by the `BoundFrequencies` property.

Magnitude bound type, specified as one of the following and stored as a character vector:

• `"<="` — Upper bound

• `">="` — Lower bound

Use this property to specify whether the piecewise-linear bound is an upper or lower bound.

Object Functions

 `evalRequirement` Evaluate design requirement `copy` Copy design requirement `get` Get design requirement property values `set` Set design requirement property values

Examples

collapse all

Create 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 when you create the object.

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

Alternatives

Use `getbounds` to get the bounds specified in a Bode Plot, Check Bode Characteristics (Simulink Control Design) block.

Version History

Introduced in R2010b