@@ -108,12 +108,12 @@ def stability_margins(sysdata, returnall=False, epsw=0.0):
108
108
Linear SISO system
109
109
mag, phase, omega : sequence of array_like
110
110
Arrays of magnitudes (absolute values, not dB), phases (degrees),
111
- and corresponding frequencies. Crossover frequencies returned are
111
+ and corresponding frequencies. Crossover frequencies returned are
112
112
in the same units as those in `omega` (e.g., rad/sec or Hz).
113
113
returnall: bool, optional
114
- If true, return all margins found. If false (default), return only the
115
- minimum stability margins. For frequency data or FRD systems, only one
116
- margin is found and returned.
114
+ If true, return all margins found. If False (default), return only the
115
+ minimum stability margins. For frequency data or FRD systems, only
116
+ margins in the given frequency region can be found and returned.
117
117
epsw: float, optional
118
118
Frequencies below this value (default 0.0) are considered static gain,
119
119
and not returned as margin.
@@ -127,11 +127,11 @@ def stability_margins(sysdata, returnall=False, epsw=0.0):
127
127
sm: float or array_like
128
128
Stability margin, the minimum distance from the Nyquist plot to -1
129
129
wg: float or array_like
130
- Gain margin crossover frequency (where phase crosses -180 degrees)
130
+ Frequency for gain margin (at phase crossover, phase = -180 degrees)
131
131
wp: float or array_like
132
- Phase margin crossover frequency (where gain crosses 0 dB )
132
+ Frequency for phase margin (at gain crossover, gain = 1 )
133
133
ws: float or array_like
134
- Stability margin frequency (where Nyquist plot is closest to -1)
134
+ Frequency for stability margin (complex gain closest to -1)
135
135
"""
136
136
137
137
try :
@@ -340,18 +340,22 @@ def margin(*args):
340
340
Gain margin
341
341
pm : float
342
342
Phase margin (in degrees)
343
- Wcg : float
344
- Gain crossover frequency (corresponding to phase margin )
345
- Wcp : float
346
- Phase crossover frequency (corresponding to gain margin) (in rad/sec )
343
+ wg : float
344
+ Frequency for gain margin (at phase crossover, phase = -180 degrees )
345
+ wp : float
346
+ Frequency for phase margin (at gain crossover, gain = 1 )
347
347
348
- Margins are of SISO open-loop. If more than one crossover frequency is
349
- detected, returns the lowest corresponding margin.
348
+ Margins are calculated for a SISO open-loop system.
349
+
350
+ If there is more than one gain crossover, the one at the smallest
351
+ margin (deviation from gain = 1), in absolute sense, is
352
+ returned. Likewise the smallest phase margin (in absolute sense)
353
+ is returned.
350
354
351
355
Examples
352
356
--------
353
357
>>> sys = tf(1, [1, 2, 1, 0])
354
- >>> gm, pm, Wcg, Wcp = margin(sys)
358
+ >>> gm, pm, wg, wp = margin(sys)
355
359
356
360
"""
357
361
if len (args ) == 1 :
0 commit comments