Skip to content

Commit 0b85e3b

Browse files
committed
suggested fix to unit test
1 parent dec1455 commit 0b85e3b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

control/tests/timeresp_test.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,15 @@ def test_impulse_response(self):
204204
np.testing.assert_array_almost_equal(
205205
yy, np.vstack((youttrue, np.zeros_like(youttrue))), decimal=4)
206206

207-
# discrete time
208-
self.siso_tf1
207+
def test_discrete_time_impulse(self):
208+
# discrete time impulse sampled version should match cont time
209209
dt = 0.1
210-
sysdt = self.siso_tf1.sample(dt, 'impulse')
211210
t = np.arange(0, 3, dt)
212-
np.testing.assert_array_almost_equal(control.impulse_response(sys, t)[1],
213-
control.impulse_response(sysdt, t)[1])
214-
211+
sys = self.siso_tf1
212+
sysdt = sys.sample(dt, 'impulse')
213+
np.testing.assert_array_almost_equal(impulse_response(sys, t)[1],
214+
impulse_response(sysdt, t)[1])
215+
215216
def test_initial_response(self):
216217
# Test SISO system
217218
sys = self.siso_ss1

0 commit comments

Comments
 (0)