Merge pull request #143 from murrayrm/timeresp-discrete-retval-fix · python-control/python-control@e3c0f79

@@ -14,7 +14,7 @@

1414

from control.timeresp import *

1515

from control.statesp import *

1616

from control.xferfcn import TransferFunction, _convertToTransferFunction

17-17+

from control.dtime import c2d

18181919

class TestTimeresp(unittest.TestCase):

2020

def setUp(self):

@@ -77,6 +77,15 @@ def test_step_response(self):

7777

np.testing.assert_array_almost_equal(y_00, youttrue, decimal=4)

7878

np.testing.assert_array_almost_equal(y_11, youttrue, decimal=4)

797980+

# Make sure continuous and discrete time use same return conventions

81+

sysc = self.mimo_ss1

82+

sysd = c2d(sysc, 1) # discrete time system

83+

Tvec = np.linspace(0, 10, 11) # make sure to use integer times 0..10

84+

Tc, youtc = step_response(sysc, Tvec, input=0)

85+

Td, youtd = step_response(sysd, Tvec, input=0)

86+

np.testing.assert_array_equal(Tc.shape, Td.shape)

87+

np.testing.assert_array_equal(youtc.shape, youtd.shape)

88+8089

def test_impulse_response(self):

8190

# Test SISO system

8291

sys = self.siso_ss1