Calculate gain and phase margins and associated crossover frequencies
sysdata (LTI system or (mag, phase, omega) sequence) –
- sysStateSpace or TransferFunction
Linear SISO system representing the loop transfer function
- mag, phase, omegasequence of array_like
Input magnitude, phase (in deg.), and frequencies (rad/sec) from bode frequency response data
gm (float) – Gain margin
pm (float) – Phase margin (in degrees)
wcg (float or array_like) – Crossover frequency associated with gain margin (phase crossover frequency), where phase crosses below -180 degrees.
wcp (float or array_like) – Crossover frequency associated with phase margin (gain crossover frequency), where gain crosses below 1.
Margins are calculated for a SISO open-loop system.
If there is more than one gain crossover, the one at the smallest margin
(deviation from gain = 1), in absolute sense, is returned. Likewise the
smallest phase margin (in absolute sense) is returned.
>>> G = ct.tf(1, [1, 2, 1, 0]) >>> gm, pm, wcg, wcp = ct.margin(G)