margins (MathScript RT Module Function)
- Updated2023-03-14
- 2 minute(s) read
margins (MathScript RT Module Function)
Owning Class: frqrsp
Requires: Control Design and Simulation Module and MathScript RT Module
Syntax
margins(SysInSISO)
s = margins(SysInSISO)
[gmf, gm] = margins(SysInSISO)
[gmf, gm, pmf] = margins(SysInSISO)
[gmf, gm, pmf, pm] = margins(SysInSISO)
Legacy Name: allmargin
Description
Calculates all gain and phase margins of a single-input single-output (SISO) system model. The gain margins indicate where the frequency response crosses at 0 decibels. The phase margins indicate where the frequency response crosses -180 degrees. Use the margin function to return only the smallest gain and phase margins of a SISO model. If you do not request an output, this function returns the structure described in the S output description that follows.
Inputs
| Name | Description |
|---|---|
| SysInSISO | Specifies a linear time-invariant (LTI) SISO model in transfer function, zero-pole-gain, or state-space form. |
Outputs
| Name | Description |
|---|---|
| s | Returns a structure with the following elements:
|
| gmf | Returns the gain margin frequencies, in radians/second, of the SysInSISO model. A gain margin frequency indicates where the model phase crosses -180 degrees. The i-th element of this vector corresponds to the i-th element of the gm vector. gmf is a real vector. |
| gm | Returns the gain margins of the SysInSISO model. gm is a real vector. |
| pmf | Returns the phase margin frequencies, in radians/second, of the SysInSISO model. A phase margin frequency indicates where the model magnitude crosses 0 decibels. The i-th element of this vector corresponds to the i-th element of the pm vector. pmf is a real vector. |
| pm | Returns the phase margins of SysInSISO. pm is a real vector. |
Details
The following table lists the support characteristics of this function.
| Supported in the LabVIEW Run-Time Engine | Yes |
| Supported on RT targets | Yes |
| Suitable for bounded execution times on RT | Not characterized |
Examples
SysInSISO = tf([1, 1], [1, -1, 3])
[gmf, gm, pmf, pm] = margins(SysInSISO)