Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5158a39

Browse files
authored
Merge pull request#198 from murrayrm/fix_margins_doc
Fix margin() documentation to address issue#195
2 parents077a8bc +1593391 commit5158a39

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

‎control/margins.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ def stability_margins(sysdata, returnall=False, epsw=0.0):
108108
Linear SISO system
109109
mag, phase, omega : sequence of array_like
110110
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
112112
in the same units as those in `omega` (e.g., rad/sec or Hz).
113113
returnall: bool, optional
114-
If true, return all margins found. Iffalse (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. IfFalse (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.
117117
epsw: float, optional
118118
Frequencies below this value (default 0.0) are considered static gain,
119119
and not returned as margin.
@@ -127,11 +127,11 @@ def stability_margins(sysdata, returnall=False, epsw=0.0):
127127
sm: float or array_like
128128
Stability margin, the minimum distance from the Nyquist plot to -1
129129
wg: float or array_like
130-
Gain margin crossover frequency (where phasecrosses -180 degrees)
130+
Frequency for gain margin (at phasecrossover, phase = -180 degrees)
131131
wp: float or array_like
132-
Phase margin crossover frequency (where gaincrosses 0 dB)
132+
Frequency for phase margin (at gaincrossover, gain = 0 dB)
133133
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)
135135
"""
136136

137137
try:
@@ -340,18 +340,22 @@ def margin(*args):
340340
Gain margin
341341
pm : float
342342
Phase margin (in degrees)
343-
Wcg: float
344-
Gain crossover frequency (corresponding tophasemargin)
345-
Wcp: float
346-
Phase crossover frequency (corresponding togainmargin) (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= 0 dB)
347347
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=0dB), in absolute sense, is
352+
returned. Likewise the smallest phase margin (in absolute sense)
353+
is returned.
350354
351355
Examples
352356
--------
353357
>>> sys = tf(1, [1, 2, 1, 0])
354-
>>> gm, pm,Wcg, Wcp = margin(sys)
358+
>>> gm, pm,wg, wp = margin(sys)
355359
356360
"""
357361
iflen(args)==1:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp