Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix unittest
  • Loading branch information
henklaak committed Feb 21, 2023
commit 57620f19b742ef40cdeb9b7cc4e4da1977383ddd
6 changes: 5 additions & 1 deletion control/xferfcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,13 @@ def to_zpk(self, var=None):
if abs(polygain) == 0 and abs(dcgain) == 0:
k = 1
else:
if abs(polygain) == 0:
raise ValueError(
f"Transfer function has infinite gain. "
"Please check polynomials.")
k = dcgain/polygain
if not np.isreal(k):
raise ValueError("Transfer function has complex valued gain. "
raise ValueError(f"Transfer function has complex valued gain (k = {k}). "
"Please check polynomials for non-complimentary poles.")
Comment thread
henklaak marked this conversation as resolved.
Outdated

k = np.abs(k)
Expand Down