Skip to content

Commit 9380700

Browse files
committed
DOC: margin parameters and returns
It's hard to understand what input is expected and follow which return is which from existing docstring. Format of stability_margins docstring is better.
1 parent 0b26e06 commit 9380700

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

control/margins.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -278,24 +278,28 @@ def phase_crossover_frequencies(sys):
278278
def margin(*args):
279279
"""Calculate gain and phase margins and associated crossover frequencies
280280
281-
Function ``margin`` takes either 1 or 3 parameters.
282-
283281
Parameters
284282
----------
285-
sys : StateSpace or TransferFunction
286-
Linear SISO system
287-
mag, phase, w : array_like
288-
Input magnitude, phase (in deg.), and frequencies (rad/sec) from
289-
bode frequency response data
283+
sysdata: LTI system or (mag, phase, omega) sequence
284+
sys : StateSpace or TransferFunction
285+
Linear SISO system
286+
mag, phase, omega : sequence of array_like
287+
Input magnitude, phase (in deg.), and frequencies (rad/sec) from
288+
bode frequency response data
290289
291290
Returns
292291
-------
293-
gm, pm, Wcg, Wcp : float
294-
Gain margin gm, phase margin pm (in deg), gain crossover frequency
295-
(corresponding to phase margin) and phase crossover frequency
296-
(corresponding to gain margin), in rad/sec of SISO open-loop.
297-
If more than one crossover frequency is detected, returns the lowest
298-
corresponding margin.
292+
gm : float
293+
Gain margin
294+
pm : float
295+
Phase margin (in degrees)
296+
Wcg : float
297+
Gain crossover frequency (corresponding to phase margin)
298+
Wcp : float
299+
Phase crossover frequency (corresponding to gain margin) (in rad/sec)
300+
301+
Margins are of SISO open-loop. If more than one crossover frequency is
302+
detected, returns the lowest corresponding margin.
299303
300304
Examples
301305
--------

0 commit comments

Comments
 (0)