@@ -56,7 +56,7 @@ def test_linear_iosys(self, tsys):
5656 for x , u in (([0 , 0 ], 0 ), ([1 , 0 ], 0 ), ([0 , 1 ], 0 ), ([0 , 0 ], 1 )):
5757 np .testing .assert_array_almost_equal (
5858 np .reshape (iosys ._rhs (0 , x , u ), (- 1 , 1 )),
59- np . dot ( linsys .A , np .reshape (x , (- 1 , 1 ))) + np . dot ( linsys .B , u ) )
59+ linsys .A @ np .reshape (x , (- 1 , 1 )) + linsys .B * u )
6060
6161 # Make sure that simulations also line up
6262 T , U , X0 = tsys .T , tsys .U , tsys .X0
@@ -152,11 +152,13 @@ def test_nonlinear_iosys(self, tsys):
152152
153153 # Create a nonlinear system with the same dynamics
154154 nlupd = lambda t , x , u , params : \
155- np .reshape (np .dot (linsys .A , np .reshape (x , (- 1 , 1 )))
156- + np .dot (linsys .B , u ), (- 1 ,))
155+ np .reshape (linsys .A @ np .reshape (x , (- 1 , 1 ))
156+ + linsys .B @ np .reshape (u , (- 1 , 1 )),
157+ (- 1 ,))
157158 nlout = lambda t , x , u , params : \
158- np .reshape (np .dot (linsys .C , np .reshape (x , (- 1 , 1 )))
159- + np .dot (linsys .D , u ), (- 1 ,))
159+ np .reshape (linsys .C @ np .reshape (x , (- 1 , 1 ))
160+ + linsys .D @ np .reshape (u , (- 1 , 1 )),
161+ (- 1 ,))
160162 nlsys = ios .NonlinearIOSystem (nlupd , nlout , inputs = 1 , outputs = 1 )
161163
162164 # Make sure that simulations also line up
@@ -905,12 +907,12 @@ def test_params(self, tsys):
905907 def test_named_signals (self , tsys ):
906908 sys1 = ios .NonlinearIOSystem (
907909 updfcn = lambda t , x , u , params : np .array (
908- np . dot ( tsys .mimo_linsys1 .A , np .reshape (x , (- 1 , 1 ) )) \
909- + np . dot ( tsys .mimo_linsys1 .B , np .reshape (u , (- 1 , 1 ) ))
910+ tsys .mimo_linsys1 .A @ np .reshape (x , (- 1 , 1 )) \
911+ + tsys .mimo_linsys1 .B @ np .reshape (u , (- 1 , 1 ))
910912 ).reshape (- 1 ,),
911913 outfcn = lambda t , x , u , params : np .array (
912- np . dot ( tsys .mimo_linsys1 .C , np .reshape (x , (- 1 , 1 ) )) \
913- + np . dot ( tsys .mimo_linsys1 .D , np .reshape (u , (- 1 , 1 ) ))
914+ tsys .mimo_linsys1 .C @ np .reshape (x , (- 1 , 1 )) \
915+ + tsys .mimo_linsys1 .D @ np .reshape (u , (- 1 , 1 ))
914916 ).reshape (- 1 ,),
915917 inputs = ['u[0]' , 'u[1]' ],
916918 outputs = ['y[0]' , 'y[1]' ],
@@ -1138,8 +1140,8 @@ def test_named_signals_linearize_inconsistent(self, tsys):
11381140 def updfcn (t , x , u , params ):
11391141 """2 inputs, 2 states"""
11401142 return np .array (
1141- np . dot ( tsys .mimo_linsys1 .A , np .reshape (x , (- 1 , 1 ) ))
1142- + np . dot ( tsys .mimo_linsys1 .B , np .reshape (u , (- 1 , 1 ) ))
1143+ tsys .mimo_linsys1 .A @ np .reshape (x , (- 1 , 1 ))
1144+ + tsys .mimo_linsys1 .B @ np .reshape (u , (- 1 , 1 ))
11431145 ).reshape (- 1 ,)
11441146
11451147 def outfcn (t , x , u , params ):
@@ -1413,11 +1415,13 @@ def test_linear_interconnection():
14131415 outputs = ('y[0]' , 'y[1]' ), name = 'sys2' )
14141416 nl_sys2 = ios .NonlinearIOSystem (
14151417 lambda t , x , u , params : np .array (
1416- np .dot (ss_sys2 .A , np .reshape (x , (- 1 , 1 ))) \
1417- + np .dot (ss_sys2 .B , np .reshape (u , (- 1 , 1 )))).reshape ((- 1 ,)),
1418+ ss_sys2 .A @ np .reshape (x , (- 1 , 1 )) \
1419+ + ss_sys2 .B @ np .reshape (u , (- 1 , 1 ))
1420+ ).reshape ((- 1 ,)),
14181421 lambda t , x , u , params : np .array (
1419- np .dot (ss_sys2 .C , np .reshape (x , (- 1 , 1 ))) \
1420- + np .dot (ss_sys2 .D , np .reshape (u , (- 1 , 1 )))).reshape ((- 1 ,)),
1422+ ss_sys2 .C @ np .reshape (x , (- 1 , 1 )) \
1423+ + ss_sys2 .D @ np .reshape (u , (- 1 , 1 ))
1424+ ).reshape ((- 1 ,)),
14211425 states = 2 ,
14221426 inputs = ('u[0]' , 'u[1]' ),
14231427 outputs = ('y[0]' , 'y[1]' ),
0 commit comments