@@ -479,22 +479,27 @@ def test_append_tf(self):
479479
480480 def test_array_access_ss (self ):
481481
482- sys1 = StateSpace ([[1. , 2. ], [3. , 4. ]],
483- [[5. , 6. ], [6. , 8. ]],
484- [[9. , 10. ], [11. , 12. ]],
485- [[13. , 14. ], [15. , 16. ]], 1 )
486-
487- sys1_11 = sys1 [0 , 1 ]
488- np .testing .assert_array_almost_equal (sys1_11 .A ,
482+ sys1 = StateSpace (
483+ [[1. , 2. ], [3. , 4. ]],
484+ [[5. , 6. ], [6. , 8. ]],
485+ [[9. , 10. ], [11. , 12. ]],
486+ [[13. , 14. ], [15. , 16. ]], 1 ,
487+ inputs = ['u0' , 'u1' ], outputs = ['y0' , 'y1' ])
488+
489+ sys1_01 = sys1 [0 , 1 ]
490+ np .testing .assert_array_almost_equal (sys1_01 .A ,
489491 sys1 .A )
490- np .testing .assert_array_almost_equal (sys1_11 .B ,
492+ np .testing .assert_array_almost_equal (sys1_01 .B ,
491493 sys1 .B [:, 1 :2 ])
492- np .testing .assert_array_almost_equal (sys1_11 .C ,
494+ np .testing .assert_array_almost_equal (sys1_01 .C ,
493495 sys1 .C [0 :1 , :])
494- np .testing .assert_array_almost_equal (sys1_11 .D ,
496+ np .testing .assert_array_almost_equal (sys1_01 .D ,
495497 sys1 .D [0 , 1 ])
496498
497- assert sys1 .dt == sys1_11 .dt
499+ assert sys1 .dt == sys1_01 .dt
500+ assert sys1_01 .input_labels == ['u1' ]
501+ assert sys1_01 .output_labels == ['y0' ]
502+ assert sys1_01 .name == sys1 .name + "$indexed"
498503
499504 def test_dc_gain_cont (self ):
500505 """Test DC gain for continuous-time state-space systems."""
@@ -831,7 +836,7 @@ def test_error_u_dynamics_mimo(self, u, sys222):
831836 sys222 .dynamics (0 , (1 , 1 ), u )
832837 with pytest .raises (ValueError ):
833838 sys222 .output (0 , (1 , 1 ), u )
834-
839+
835840 def test_sample_named_signals (self ):
836841 sysc = ct .StateSpace (1.1 , 1 , 1 , 1 , inputs = 'u' , outputs = 'y' , states = 'a' )
837842
@@ -859,14 +864,14 @@ def test_sample_named_signals(self):
859864 assert sysd_newnames .find_output ('x' ) == 0
860865 assert sysd_newnames .find_output ('y' ) is None
861866 assert sysd_newnames .find_state ('b' ) == 0
862- assert sysd_newnames .find_state ('a' ) is None
867+ assert sysd_newnames .find_state ('a' ) is None
863868 # test just one name
864869 sysd_newnames = sysc .sample (0.1 , inputs = 'v' )
865870 assert sysd_newnames .find_input ('v' ) == 0
866871 assert sysd_newnames .find_input ('u' ) is None
867872 assert sysd_newnames .find_output ('y' ) == 0
868873 assert sysd_newnames .find_output ('x' ) is None
869-
874+
870875class TestRss :
871876 """These are tests for the proper functionality of statesp.rss."""
872877
0 commit comments