Skip to content

Commit c17a389

Browse files
committed
fix MIMO interconnect test case after rebase
1 parent a175588 commit c17a389

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

control/tests/interconnect_test.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ def test_interconnect_implicit(dim):
8181
outputs=[f'u[{i}]' for i in range(dim)])
8282

8383
# same but static C2
84-
C2 = ct.tf(random.uniform(1, 10), 1,
85-
inputs='e', outputs='u', name='C2')
84+
C2 = ct.tf2io(kp * random.uniform(1, 10), name='C2',
85+
inputs=[f'e[{i}]' for i in range(dim)],
86+
outputs=[f'u[{i}]' for i in range(dim)])
8687

8788
# Block diagram computation
8889
Tss = ct.feedback(P * C, np.eye(dim))
@@ -113,7 +114,7 @@ def test_interconnect_implicit(dim):
113114

114115
# test whether signal names work for static system C2
115116
Tio_sum2 = ct.interconnect(
116-
[C2, P, sumblk], inputs='r', outputs='y')
117+
[C2, P, sumblk], inplist='r', outlist='y')
117118

118119
np.testing.assert_almost_equal(Tio_sum2.A, Tss2.A)
119120
np.testing.assert_almost_equal(Tio_sum2.B, Tss2.B)
@@ -139,17 +140,6 @@ def test_interconnect_implicit(dim):
139140
np.testing.assert_almost_equal(Tio_sum.C, Tss.C)
140141
np.testing.assert_almost_equal(Tio_sum.D, Tss.D)
141142

142-
# TODO: interconnect a MIMO system using implicit connections
143-
# P = control.ss2io(
144-
# control.rss(2, 2, 2, strictly_proper=True),
145-
# input_prefix='u', output_prefix='y', name='P')
146-
# C = control.ss2io(
147-
# control.rss(2, 2, 2),
148-
# input_prefix='e', output_prefix='u', name='C')
149-
# sumblk = control.summing_junction(
150-
# inputs=['r', '-y'], output='e', dimension=2)
151-
# S = control.interconnect([P, C, sumblk], inplist='r', outlist='y')
152-
153143
# Make sure that repeated inplist/outlist names work
154144
pi_io = ct.interconnect(
155145
[kp_io, ki_io], inplist=['e'], outlist=['u'])

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy