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
ValueError: System does not define that many inputs.
Traceback (most recent call last):
File "<ipython-input-36-e3c064c647e9>", line 6, in <module>
t2,y2 = signal.step(sys, T=T, X0=X0)
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\signal\ltisys.py", line 2269, in step
vals = lsim(sys, U, T, X0=X0, interp=False)
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\signal\ltisys.py", line 1989, in lsim
raise ValueError("System does not define that many inputs.")
ValueError: System does not define that many inputs.
Hi @TobiasGlaubach . Thanks for taking the time to report this. Currently we have a number of missing features regarding MIMO systems, off the top of my head #2862, #4675 and #4794. I'll try to see whether this can be fixed without a major surgery. In the meantime you can use python-control or harold while we fix these.
from scipy import signal
A = np.array([[-1,-1],[6.5,0]])
B = np.array([[1,1],[1,0]])
C = np.array([[1,0],[0,1]])
D = np.array([[0,0],[0,0]])
signal.step((A,B,C,D))
Error
ValueError Traceback (most recent call last)
~/.../example_malfunction.py in <module>
7 D = np.array([[0,0],[0,0]])
8
----> 9 signal.step((A,B,C,D))
/usr/local/lib/python3.6/site-packages/scipy/signal/ltisys.py in step(system, X0, T, N)
2407 T = asarray(T)
2408 U = ones(T.shape, sys.A.dtype)
-> 2409 vals = lsim(sys, U, T, X0=X0, interp=False)
2410 return vals[0], vals[1]
2411
/usr/local/lib/python3.6/site-packages/scipy/signal/ltisys.py in lsim(system, U, T, X0, interp)
2103
2104 if U.shape[1] != n_inputs:
-> 2105 raise ValueError("System does not define that many inputs.")
2106
2107 if not interp:
ValueError: System does not define that many inputs.
Notes
It looks like the n_states = A.shape[0] (line 2054, scipy/signal/ltisys.py) value is not incorporated
in the handling of the U array.
I attempted to fix by defining U (line 2408,scipy/signal/ltisys.py) as
the step function in scipy.signal does not work when the passed system is a MIMO system with integrator.
Reproducing code example:
Consider a simple control system plant in state space form which has 2 inputs, 2 outputs and 3 states.
(Coupled electro mechanical system)
where all given Parameters are real numbers.
Test the dimensions by calculationg with test vectors:
which works. Now however, when we transform the system to a lti state space system and try to use the step method:
Error message:
ValueError: System does not define that many inputs.
Scipy/Numpy/Python version information:
1.1.0 1.15.4 sys.version_info(major=3, minor=6, micro=7, releaselevel='final', serial=0)The text was updated successfully, but these errors were encountered: