Skip to content

Commit a359e8b

Browse files
committed
fix rounding error issue showing up in NumPy 2.3.1
1 parent ffcc2a6 commit a359e8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

control/xferfcn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ def _c2d_matched(sysC, Ts, **kwargs):
13501350
zpoles[idx] = z
13511351
pregainden[idx] = 1 - z
13521352
zgain = np.multiply.reduce(pregainnum) / np.multiply.reduce(pregainden)
1353-
gain = sysC.dcgain() / zgain
1353+
gain = sysC.dcgain() / zgain.real
13541354
sysDnum, sysDden = zpk2tf(zzeros, zpoles, gain)
13551355
return TransferFunction(sysDnum, sysDden, Ts, **kwargs)
13561356

0 commit comments

Comments
 (0)