Skip to content

Is there a problem in InterconnectedSystem with the signal input  #621

Description

@maye1115

QQ截图20210510093008

F = control.tf([1], [1, 1])
G = control.tf([100], [1, 5, 100])
C = control.tf([20, 20, 1200], [1, 40, 400, 0])
S = control.tf([10], [1, 10])

f_io = control.tf2io( F, name='f', inputs="r",outputs="uf")
g_io = control.tf2io(G, name='g', inputs="u", outputs="ym")
c_io = control.tf2io(C, name='c', inputs="e", outputs="uc")
s_io = control.tf2io(S, name='s', inputs="si", outputs="y")

Q =(
        ('g.u','f.uf','c.uc'),
        ('s.si','g.ym'),
        ('c.e','f.r','-s.y')
)

sys=control.InterconnectedSystem((f_io,g_io,c_io,s_io),
          connections=Q,inplist=('f.r'),inputs=('sys_in'),outlist=('g.ym'),outputs=('sys_out'))

IndexError: index 4 is out of bounds for axis 1 with size 4
bug in here: ('c.e','f.r','-s.y')
I think 'f.r' can not be connections's outputlist ,because it is f_io's input. But how to make it.Thank you.

release 0.8.3

Activity

  1. bnavigator commented on May 10, 2021

    @bnavigator
    Contributor

    I think 'f.r' can not be connections's outputlist ,because it is f_io's input.

    Correct. 'f.r' and 'c.e' are subsystem inputs. You have to connect them to the system input with inplist or create another subsystem in front of them:

    Q =(
            ('g.u','f.uf','c.uc'),
            ('s.si','g.ym'),
            ('c.e','-s.y')
    )
    
    sys=control.InterconnectedSystem((f_io,g_io,c_io,s_io),
              connections=Q,
              inputs=('sys_in'), inplist=[['f.r', 'c.e']],
              outputs=('sys_out'), outlist=['g.ym'])
    I = control.tf([1],[1])
    i_io = control.tf2io(I, name='i', inputs='ii', outputs='ir')
    
    Q2 =(
            ('g.u','f.uf','c.uc'),
            ('s.si','g.ym'),
            ('c.e','-s.y','i.ir'),
            ('f.r', 'i.ir'),
    )
    
    sys2=control.InterconnectedSystem((f_io,g_io,c_io,s_io,i_io),
              connections=Q2,
              inputs=('sys_in'), inplist=['i.ii'],
              outputs=('sys_out'), outlist=['g.ym'])
  2. locked and limited conversation to collaborators on May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions