connect(sys, Q, inputv, outputv)¶
Index-based interconnection of an LTI system.
The system sys is a system typically constructed with append, with multiple inputs and outputs. The inputs and outputs are connected according to the interconnection matrix Q, and then the final inputs and outputs are trimmed according to the inputs and outputs listed in inputv and outputv.
NOTE: Inputs and outputs are indexed starting at 1 and negative values correspond to a negative feedback interconnection.
- sys (StateSpace Transferfunction) – System to be connected
- Q (2D array) – Interconnection matrix. First column gives the input to be connected second column gives the output to be fed into this input. Negative values for the second column mean the feedback is negative, 0 means no connection is made. Inputs and outputs are indexed starting at 1.
- inputv (1D array) – list of final external inputs
- outputv (1D array) – list of final external outputs
sys – Connected and trimmed LTI system
>>> sys1 = ss([[1., -2], [3., -4]], [[5.], ], [[6, 8]], [[9.]]) >>> sys2 = ss([[-1.]], [[1.]], [[1.]], [[0.]]) >>> sys = append(sys1, sys2) >>> Q = [[1, 2], [2, -1]] # negative feedback interconnection >>> sysc = connect(sys, Q, , [1, 2])