control.matlab.connect

control.matlab.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.

Parameters
  • sys (StateSpace or TransferFunction) – System to be connected

  • Q (2D array) – Interconnection matrix. First column gives the input to be connected. The second column gives the index of an output that is to be fed into that input. Each additional column gives the index of an additional input that may be optionally added to that input. Negative values mean the feedback is negative. A zero value is ignored. Inputs and outputs are indexed starting at 1 to communicate sign information.

  • inputv (1D array) – list of final external inputs, indexed starting at 1

  • outputv (1D array) – list of final external outputs, indexed starting at 1

Returns

sys – Connected and trimmed LTI system

Return type

LTI system

Examples

>>> sys1 = ss([[1., -2], [3., -4]], [[5.], [7]], [[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, [2], [1, 2])

Notes

The interconnect() function in the input/output systems module allows the use of named signals and provides an alternative method for interconnecting multiple systems.