Skip to content

Commit 91517f9

Browse files
committed
Minor change to fix logic to find minimum across DGM, DPM numpy vectors
1 parent cffc3e5 commit 91517f9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

control/margins.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,12 @@ def disk_margins(L, omega, skew = 0.0, returnall = False):
697697
# Worst-case disk margin, gain margin and phase margin
698698
if DGM.shape[0] and not np.isinf(DGM).all():
699699
with np.errstate(all='ignore'):
700-
gmidx = np.where(np.abs(DGM) == np.min(np.abs(DGM)))
700+
gmidx = np.where(DGM == np.min(DGM))
701701
else:
702702
gmidx = -1
703+
703704
if DPM.shape[0]:
704-
pmidx = np.where(np.abs(DPM) == np.amin(np.abs(DPM)))[0]
705+
pmidx = np.where(DPM == np.min(DPM))
705706

706707
return ((not DM.shape[0] and float('inf')) or np.amin(DM),
707708
(not gmidx != -1 and float('inf')) or DGM[gmidx][0],

0 commit comments

Comments
 (0)