Skip to content

Commit 1ccbbfd

Browse files
add DT test for bandwidth function
1 parent a709dd6 commit 1ccbbfd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

control/tests/lti_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ def test_bandwidth(self):
109109
np.testing.assert_allclose(sys1.bandwidth(), 0.099762834511098)
110110
np.testing.assert_allclose(bandwidth(sys1), 0.099762834511098)
111111

112+
# test a first-order discrete-time system, compared with matlab
113+
sysd1 = tf([0.1, 0], [1, -0.9], 1)
114+
np.testing.assert_allclose(sysd1.bandwidth(), 0.105207775532932)
115+
np.testing.assert_allclose(bandwidth(sysd1), 0.105207775532932)
116+
112117
# test a second-order system, compared with matlab
113118
wn2 = 1
114119
zeta2 = 0.001

0 commit comments

Comments
 (0)