@@ -252,14 +252,14 @@ def test_forced_response(self):
252
252
# first system: initial value, second system: step response
253
253
u = np .array ([[0. , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ],
254
254
[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 ]] )
256
256
youttrue = np .array ([[11. , 8.1494 , 5.9361 , 4.2258 , 2.9118 , 1.9092 ,
257
257
1.1508 , 0.5833 , 0.1645 , - 0.1391 ],
258
258
[9. , 17.6457 , 24.7072 , 30.4855 , 35.2234 , 39.1165 ,
259
259
42.3227 , 44.9694 , 47.1599 , 48.9776 ]])
260
260
_t , yout , _xout = forced_response (self .mimo_ss1 , t , u , x0 )
261
261
np .testing .assert_array_almost_equal (yout , youttrue , decimal = 4 )
262
-
262
+
263
263
# Test discrete MIMO system to use correct convention for input
264
264
sysc = self .mimo_ss1
265
265
dt = t [1 ]- t [0 ]
@@ -270,6 +270,17 @@ def test_forced_response(self):
270
270
np .testing .assert_array_equal (youtc .shape , youtd .shape )
271
271
np .testing .assert_array_almost_equal (youtc , youtd , decimal = 4 )
272
272
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
+
273
284
def test_lsim_double_integrator (self ):
274
285
# Note: scipy.signal.lsim fails if A is not invertible
275
286
A = np .mat ("0. 1.;0. 0." )
0 commit comments