We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57620f1 commit b36732dCopy full SHA for b36732d
1 file changed
control/xferfcn.py
@@ -502,6 +502,11 @@ def to_zpk(self, var=None):
502
503
polygain = np.prod(num_roots) / np.prod(den_roots)
504
505
+ # Round imaginary part down to zero for values close to
506
+ # precision to prevent small errors to mess up things.
507
+ polygain = complex(polygain.real,
508
+ round(polygain.imag, 12))
509
+
510
if abs(polygain) == 0 and abs(dcgain) == 0:
511
k = 1
512
else:
0 commit comments