Skip to content

Commit 57620f1

Browse files
committed
Fix unittest
1 parent 5c85459 commit 57620f1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

control/xferfcn.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,13 @@ def to_zpk(self, var=None):
505505
if abs(polygain) == 0 and abs(dcgain) == 0:
506506
k = 1
507507
else:
508+
if abs(polygain) == 0:
509+
raise ValueError(
510+
f"Transfer function has infinite gain. "
511+
"Please check polynomials.")
508512
k = dcgain/polygain
509513
if not np.isreal(k):
510-
raise ValueError("Transfer function has complex valued gain. "
514+
raise ValueError(f"Transfer function has complex valued gain (k = {k}). "
511515
"Please check polynomials for non-complimentary poles.")
512516

513517
k = np.abs(k)

0 commit comments

Comments
 (0)