File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414from control .timeresp import *
1515from control .statesp import *
1616from control .xferfcn import TransferFunction , _convertToTransferFunction
17-
17+ from control . dtime import c2d
1818
1919class 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 )
7979
80+ # 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
You can’t perform that action at this time.
0 commit comments