From: <re...@us...> - 2014-07-06 17:06:56
|
Revision: 303 http://sourceforge.net/p/python-control/code/303 Author: repa Date: 2014-07-06 17:06:44 +0000 (Sun, 06 Jul 2014) Log Message: ----------- Slightly increase the epsilon value for margin computation frequency, many type 2 systems (on Windows, 32 bit pythonxy, but not on 64 bit Linux which I tested on) got cross over margins calculated at frequencies around 1e-11 Modified Paths: -------------- trunk/src/margins.py Modified: trunk/src/margins.py =================================================================== --- trunk/src/margins.py 2014-06-16 08:38:23 UTC (rev 302) +++ trunk/src/margins.py 2014-07-06 17:06:44 UTC (rev 303) @@ -80,13 +80,14 @@ # idea for the frequency data solution copied/adapted from # https://github.com/alchemyst/Skogestad-Python/blob/master/BODE.py # Rene van Paassen <ren...@gm...> -def stability_margins(sysdata, deg=True, returnall=False, epsw=1e-12): +def stability_margins(sysdata, deg=True, returnall=False, epsw=1e-10): """Calculate gain, phase and stability margins and associated crossover frequencies. Usage ----- - gm, pm, sm, wg, wp, ws = stability_margins(sysdata, deg=True) + gm, pm, sm, wg, wp, ws = stability_margins(sysdata, deg=True, + returnall=False, epsw=1e-10) Parameters ---------- @@ -101,7 +102,7 @@ returnall=False: boolean If true, return all margins found. Note that for frequency data or FRD systems, only one margin is found and returned. - epsw=1e-12: float + epsw=1e-10: float frequencies below this value are considered static gain, and not returned as margin. @@ -114,7 +115,7 @@ one crossover frequency is detected, returns the lowest corresponding margin. When requesting all margins, the return values are array_like, - and all margins are returns for linear systems not equal to FRD + and all margins are returned for linear systems not equal to FRD """ try: |