8000 added test needed to pass · python-control/python-control@1fc4cc1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fc4cc1

Browse files
committed
added test needed to pass
1 parent 2d7aad0 commit 1fc4cc1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

control/tests/bdalg_test.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import control as ctrl
1010
from control.xferfcn import TransferFunction
1111
from control.statesp import StateSpace
12-
from control.bdalg import feedback
12+
from control.bdalg import feedback, append, connect
1313
from control.lti import zero, pole
1414

1515
class TestFeedback(unittest.TestCase):
@@ -23,7 +23,9 @@ def setUp(self):
2323
# Two random SISO systems.
2424
self.sys1 = TransferFunction([1, 2], [1, 2, 3])
2525
self.sys2 = StateSpace([[1., 4.], [3., 2.]], [[1.], [-4.]],
26-
[[1., 0.]], [[0.]])
26+
[[1., 0.]], [[0.]]) # 2 states, SISO
27+
self.sys3 = StateSpace([[-1.]], [[1.]], [[1.]], [[0.]]) # 1 state, SISO
28+
2729
# Two random scalars.
2830
self.x1 = 2.5
2931
self.x2 = -3.
@@ -270,6 +272,13 @@ def test_feedback_args(self):
270272
sys = ctrl.feedback(1, frd)
271273
self.assertTrue(isinstance(sys, ctrl.FRD))
272274

275+
def testConnect(self):
276+
sys = append(self.sys2, self.sys3) # two siso systems
277+
278+
# feedback interconnection -3 is out of bounds
279+
Q1 = [[1, 2], [2, -3]]
280+
self.assertRaises(IndexError, connect(sys, Q1, [2], [1, 2]))
281+
273282

274283
if __name__ == "__main__":
275284
unittest.main()

0 commit comments

Comments
 (0)
0