bode (MathScript RT Module Function)
- Updated2023-03-14
- 3 minute(s) read
bode (MathScript RT Module Function)
Owning Class: frqrsp
Requires: Control Design and Simulation Module and MathScript RT Module
Syntax
bode(SysIn)
bode(SysIn, attributes)
bode(SysIn, attributes, [wmin wmax])
bode(SysIn, attributes, wlist)
mag = bode(SysIn)
mag = bode(SysIn, [wmin wmax])
mag = bode(SysIn, wlist)
[mag, phase] = bode(SysIn)
[mag, phase] = bode(SysIn, [wmin wmax])
[mag, phase, wout] = bode(SysIn)
[mag, phase, wout] = bode(SysIn, wlist)
[mag, phase, wout] = bode(SysIn, [wmin wmax])
Description
Creates the Bode magnitude and Bode phase plots of a system model. You also can use this function to return the magnitude and phase values of a model at frequencies you specify. If you do not specify an output, this function creates a plot.
Inputs
| Name | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SysIn | Specifies a linear time-invariant (LTI) system model in transfer function, zero-pole-gain, or state-space form. | ||||||||||||||||||||||||||||||||
| attributes | Specifies valid plot attributes. Order the plot attributes by color, point-style, and line-style. For example, 'bo-' specifies that the plot is blue, marks points with circles, and uses solid lines. attributes is a string that can take a combination of the following values:
|
||||||||||||||||||||||||||||||||
| wmin | Specifies the initial frequency, in radians/second, this function uses to calculate the frequency response of the SysIn model. The default value is 0.001. You also can use the wlist input to specify exact frequencies instead of a range. wmin is a real scalar. | ||||||||||||||||||||||||||||||||
| wmax | Specifies the final frequency, in radians/second, this function uses to calculate the frequency response of the SysIn model. The default value is 1000. You also can use the wlist input to specify exact frequencies instead of a range. wmax is a real scalar. | ||||||||||||||||||||||||||||||||
| wlist | Specifies the frequency values, in radians/second, at which this function calculates the singular values. If you specify only two elements for this input, this function treats those elements as wmin and wmax. Therefore, you must specify at least three elements for the wlist input. wlist is a real vector consisting of three or more elements. |
Outputs
| Name | Description |
|---|---|
| mag | Returns the magnitude(s) of the SysIn model. The n-th element of this parameter corresponds to the n-th element of the phase and wout parameters. mag is a real matrix. |
| phase | Returns the phase(s), in degrees, of the SysIn model. phase is a real matrix. |
| wout | Returns the frequencies, in radians/second, at which this function calculates the magnitude and phase. wout is a real vector. |
Details
The following table lists the support characteristics of this function.
| Supported in the LabVIEW Run-Time Engine | Yes (if you request output) |
| Supported on RT targets | Yes (if you request output) |
| Suitable for bounded execution times on RT | Not characterized |
Examples
z = 1
p = [-1, -2]
k = 0.5
SysIn = zpk(z, p, k)
bode(SysIn, 'r')