예제 #1
0
 def test_shape(self, states, outputs, inputs):
     """Test that drss outputs have the right state, input, and output size."""
     sys = drss(states, outputs, inputs)
     assert sys.nstates == states
     assert sys.ninputs == inputs
     assert sys.noutputs == outputs
     assert sys.dt is True
예제 #2
0
 def test_strictly_proper(self, strictly_proper):
     """Test that the strictly_proper argument returns a correct D."""
     for i in range(100):
         # The probability that drss(..., strictly_proper=False) returns an
         # all zero D 100 times in a row is 0.5**100 = 7.89e-31
         sys = drss(1, 1, 1, strictly_proper=strictly_proper)
         if np.all(sys.D == 0.) == strictly_proper:
             break
     assert np.all(sys.D == 0.) == strictly_proper
예제 #3
0
 def test_pole(self, states, outputs, inputs):
     """Test that the poles of drss outputs have less than unit magnitude."""
     sys = drss(states, outputs, inputs)
     p = sys.pole()
     for z in p:
         assert abs(z) < 1