Skip to content

Commit 87ec281

Browse files
committed
fix empty transmission zero bug for state space systems
1 parent 7b04c01 commit 87ec281

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

control/statesp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,11 @@ def zero(self):
525525
out = ab08nd(self.A.shape[0], self.B.shape[1], self.C.shape[0],
526526
self.A, self.B, self.C, self.D)
527527
nu = out[0]
528-
return sp.linalg.eigvals(out[8][0:nu,0:nu], out[9][0:nu,0:nu])
528+
if nu == 0:
529+
return np.array([])
530+
else:
531+
return sp.linalg.eigvals(out[8][0:nu,0:nu], out[9][0:nu,0:nu])
532+
529533
except ImportError: # Slycot unavailable. Fall back to scipy.
530534
if self.C.shape[0] != self.D.shape[1]:
531535
raise NotImplementedError("StateSpace.zero only supports "

0 commit comments

Comments
 (0)