@@ -252,14 +252,14 @@ def test_forced_response(self):
252252 # first system: initial value, second system: step response
253253 u = np .array ([[0. , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ],
254254 [1. , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ]])
255- x0 = np .matrix ( ".5; 1; 0; 0" )
255+ x0 = np .array ([[ .5 ], [ 1 ], [ 0 ], [ 0 ]] )
256256 youttrue = np .array ([[11. , 8.1494 , 5.9361 , 4.2258 , 2.9118 , 1.9092 ,
257257 1.1508 , 0.5833 , 0.1645 , - 0.1391 ],
258258 [9. , 17.6457 , 24.7072 , 30.4855 , 35.2234 , 39.1165 ,
259259 42.3227 , 44.9694 , 47.1599 , 48.9776 ]])
260260 _t , yout , _xout = forced_response (self .mimo_ss1 , t , u , x0 )
261261 np .testing .assert_array_almost_equal (yout , youttrue , decimal = 4 )
262-
262+
263263 # Test discrete MIMO system to use correct convention for input
264264 sysc = self .mimo_ss1
265265 dt = t [1 ]- t [0 ]
@@ -270,6 +270,17 @@ def test_forced_response(self):
270270 np .testing .assert_array_equal (youtc .shape , youtd .shape )
271271 np .testing .assert_array_almost_equal (youtc , youtd , decimal = 4 )
272272
273+ # Test discrete MIMO system without default T argument
274+ u = np .array ([[0. , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ],
275+ [1. , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ]])
276+ x0 = np .array ([[.5 ], [1 ], [0 ], [0 ]])
277+ youttrue = np .array ([[11. , 8.1494 , 5.9361 , 4.2258 , 2.9118 , 1.9092 ,
278+ 1.1508 , 0.5833 , 0.1645 , - 0.1391 ],
279+ [9. , 17.6457 , 24.7072 , 30.4855 , 35.2234 , 39.1165 ,
280+ 42.3227 , 44.9694 , 47.1599 , 48.9776 ]])
281+ _t , yout , _xout = forced_response (sysd , U = u , X0 = x0 )
282+ np .testing .assert_array_almost_equal (yout , youttrue , decimal = 4 )
283+
273284 def test_lsim_double_integrator (self ):
274285 # Note: scipy.signal.lsim fails if A is not invertible
275286 A = np .mat ("0. 1.;0. 0." )
0 commit comments