FUNCTION REFERENCE

allmargin

All gain, phase and delay margins of a loop transfer.

All gain, phase and delay margins of a loop transfer.

Syntax

S = allmargin(sys)

Syntax

S = allmargin(sys, 'Focus', [fmin fmax])

Syntax

S = allmargin(mag, phase, w[, ts])

S has the fields GainMargin, GMFrequency, PhaseMargin, PMFrequency, DelayMargin, DMFrequency and Stable. Every -180 degree (modulo 360) phase crossing gives a gain margin 1/|L| at GMFrequency; every unity-gain crossing gives a phase margin in degrees (phase + 180, in [-180, 180)) at PMFrequency, and a delay margin (PM mod 360)*pi/180/w: seconds for continuous models, sample periods for discrete ones; DMFrequency repeats PMFrequency. Each field is a 1-by-k row sorted by frequency, 1-by-0 when there is no such crossing. Stable is 1 when the loop closed by unit negative feedback is stable, 0 when not, NaN when the closed loop is ill-posed or for frequency data. The crossings are those margin finds (same grid, bisection refinement), so margin returns the dominant entries of allmargin. A square MIMO loop gives an M-by-1 struct array: loop j with every other loop closed by unit negative feedback. 'Focus' keeps crossings with fmin <= w <= fmax.

Example

S = allmargin(tf(1,[1 3 3 1]))   % GainMargin 8 at sqrt(3)

Example

S = allmargin(tf(0.5,[1 0.2 1])); S.PMFrequency

Differences from MATLAB: grid bracketing can miss tangential or closely spaced crossings and a crossing exactly at zero frequency; delayed closed-loop stability may be undefined. Model arrays and non-square MIMO loops are unsupported.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.