@@ -399,25 +399,6 @@ def test_freq_resp(self):
399399 mag , phase , omega = sys .freqresp (true_omega )
400400 np .testing .assert_almost_equal (mag , true_mag )
401401
402- def test__isstatic (self ):
403- A0 = np .zeros ((2 ,2 ))
404- A1 = A0 .copy ()
405- A1 [0 ,1 ] = 1.1
406- B0 = np .zeros ((2 ,1 ))
407- B1 = B0 .copy ()
408- B1 [0 ,0 ] = 1.3
409- C0 = A0
410- C1 = np .eye (2 )
411- D0 = 0
412- D1 = np .ones ((2 ,1 ))
413- assert StateSpace (A0 , B0 , C1 , D1 )._isstatic ()
414- assert not StateSpace (A1 , B0 , C1 , D1 )._isstatic ()
415- assert not StateSpace (A0 , B1 , C1 , D1 )._isstatic ()
416- assert not StateSpace (A1 , B1 , C1 , D1 )._isstatic ()
417- assert StateSpace (A0 , B0 , C0 , D0 )._isstatic ()
418- assert StateSpace (A0 , B0 , C0 , D1 )._isstatic ()
419- assert StateSpace (A0 , B0 , C1 , D0 )._isstatic ()
420-
421402 @slycotonly
422403 def test_minreal (self ):
423404 """Test a minreal model reduction."""
@@ -1158,3 +1139,17 @@ def test_linfnorm_ct_mimo(self, ct_siso):
11581139 gpeak , fpeak = linfnorm (sys )
11591140 np .testing .assert_allclose (gpeak , refgpeak )
11601141 np .testing .assert_allclose (fpeak , reffpeak )
1142+
1143+ @pytest .mark .parametrize ("args, static" , [
1144+ (([], [], [], 1 ), True ), # ctime, empty state
1145+ (([], [], [], 1 , 1 ), True ), # dtime, empty state
1146+ ((0 , 0 , 0 , 1 ), False ), # ctime, unused state
1147+ ((- 1 , 0 , 0 , 1 ), False ), # ctime, exponential decay
1148+ ((- 1 , 0 , 0 , 0 ), False ), # ctime, no input, no output
1149+ ((0 , 0 , 0 , 1 , 1 ), False ), # dtime, integrator
1150+ ((1 , 0 , 0 , 1 , 1 ), False ), # dtime, unused state
1151+ ((0 , 0 , 0 , 1 , None ), False ), # unspecified, unused state
1152+ ])
1153+ def test_isstatic (args , static ):
1154+ sys = ct .StateSpace (* args )
1155+ assert sys ._isstatic () == static
0 commit comments