control.stability_margins

control.stability_margins(sysdata, returnall=False, epsw=0.0)

Calculate stability margins and associated crossover frequencies.

Parameters
  • sysdata (LTI system or (mag, phase, omega) sequence) –

    sysLTI system

    Linear SISO system

    mag, phase, omegasequence of array_like

    Arrays of magnitudes (absolute values, not dB), phases (degrees), and corresponding frequencies. Crossover frequencies returned are in the same units as those in omega (e.g., rad/sec or Hz).

  • returnall (bool, optional) – If true, return all margins found. If False (default), return only the minimum stability margins. For frequency data or FRD systems, only margins in the given frequency region can be found and returned.

  • epsw (float, optional) – Frequencies below this value (default 0.0) are considered static gain, and not returned as margin.

Returns

  • gm (float or array_like) – Gain margin

  • pm (float or array_loke) – Phase margin

  • sm (float or array_like) – Stability margin, the minimum distance from the Nyquist plot to -1

  • wg (float or array_like) – Frequency for gain margin (at phase crossover, phase = -180 degrees)

  • wp (float or array_like) – Frequency for phase margin (at gain crossover, gain = 1)

  • ws (float or array_like) – Frequency for stability margin (complex gain closest to -1)