Skip to content

Commit 2b82eef

Browse files
committed
incorporated fix enabled by github #568
1 parent 368b0d1 commit 2b82eef

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

control/margins.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,14 @@ def stability_margins(sysdata, returnall=False, epsw=0.0, method='best'):
330330
sys = frdata.FRD(sys, omega_sys)
331331
else:
332332
omega_sys = omega_sys[omega_sys < np.pi / sys.dt]
333-
sys = frdata.FRD(sys(np.exp(1j*sys.dt*omega_sys)), omega_sys,
334-
smooth=True)
333+
sys = frdata.FRD(sys, omega_sys, smooth=True)
335334
elif method == 'best':
336335
# convert to FRD if anticipated numerical issues
337336
if isinstance(sys, xferfcn.TransferFunction) and not sys.isctime():
338337
if _numerical_inaccuracy(sys):
339338
omega_sys = freqplot._default_frequency_range(sys)
340339
omega_sys = omega_sys[omega_sys < np.pi / sys.dt]
341-
sys = frdata.FRD(sys(np.exp(1j*sys.dt*omega_sys)), omega_sys,
342-
smooth=True)
340+
sys = frdata.FRD(sys, omega_sys, smooth=True)
343341
elif method != 'poly':
344342
raise ValueError("method " + method + " unknown")
345343

0 commit comments

Comments
 (0)