margin(sys)
[Gm, Pm, Wcg, Wcp] = margin(sys)
[Gm, Pm, Wcg, Wcp] = margin(mag, phase, w)
| Parameter | Description |
|---|---|
| sys | a SISO LTI model. |
| mag | magnitude of the frequency response (absolute values). |
| phase | phase of the frequency response, in degrees. |
| w | frequencies, in rad/s. |
| Parameter | Description |
|---|---|
| Gm | gain margin (absolute value), equal to 1/|G(j*Wcg)|. |
| Pm | phase margin, in degrees. |
| Wcg | phase crossover frequency (rad/s), where the phase equals -180 degrees. |
| Wcp | gain crossover frequency (rad/s), where the magnitude equals 1 (0 dB). |
margin computes the gain margin, the phase margin and the associated crossover frequencies of a SISO open-loop model sys.
The gain margin Gm is returned as an absolute value (not in decibels) and is the factor by which the open-loop gain can be increased before the closed loop becomes unstable.
The phase margin Pm is expressed in degrees and is the additional phase lag required to reach instability.
When a margin is infinite, Gm or Pm is returned as Inf. The associated phase crossover frequency Wcg is Inf when the phase reaches -180 degrees only at infinite frequency (continuous system of relative degree two or more), and NaN when there is no phase crossover at all.
The alternate form margin(mag, phase, w) computes the margins directly from frequency-response data obtained elsewhere.
Called without output arguments, margin(sys) draws the Bode diagram of the system.
H = tf(1, [1 3 2 0]);
[Gm, Pm, Wcg, Wcp] = margin(H)
| Version | Description |
|---|---|
| 1.0.0 | initial version |