You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs for cont2discrete say that it takes an instance of the lti class as a possible argument. I could not make this work with a system created via TransferFunction.
Example:
import scipy.signal as sig
g = sig.TransferFunction([1], [1, 1])
print(isinstance(g, sig.lti))
gd = sig.cont2discrete(g, dt=0.01)
This snippet prints True and then raises TypeError: object of type 'TransferFunctionContinuous' has no len().
My current workaround is using the to_discrete member function instead:
gd = g.to_discrete(dt=0.01)
The exception occurs at the first line in cont2discrete, which checks for len(system) == 1, seemingly to determine if it's an instance of lti. Maybe this could simply be replaced with an isinstance call? Looks like dt should also be passed on in the line after.
The text was updated successfully, but these errors were encountered:
The docs for cont2discrete say that it takes an instance of the lti class as a possible argument. I could not make this work with a system created via TransferFunction.
Example:
This snippet prints True and then raises
TypeError: object of type 'TransferFunctionContinuous' has no len()
.My current workaround is using the to_discrete member function instead:
The exception occurs at the first line in cont2discrete, which checks for
len(system) == 1
, seemingly to determine if it's an instance of lti. Maybe this could simply be replaced with an isinstance call? Looks like dt should also be passed on in the line after.The text was updated successfully, but these errors were encountered: