control.stability_margins

control.stability_margins(sysdata, returnall=False, epsw=1e-10)

Calculate stability margins and associated crossover frequencies.

Parameters:

sysdata: LTI system or (mag, phase, omega) sequence

sys : LTI system

Linear SISO system

mag, phase, omega : sequence 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 one margin is found and returned.

epsw: float, optional

Frequencies below this value (default 1e-10) 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

Gain margin crossover frequency (where phase crosses -180 degrees)

wp: float or array_like

Phase margin crossover frequency (where gain crosses 0 dB)

ws: float or array_like

Stability margin frequency (where Nyquist plot is closest to -1)