control.connect

control.connect(sys, Q, inputv, outputv)

Index-base interconnection of 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: to have this work, inputs and outputs start counting at 1!!!!

Parameters:
  • 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
  • inputv (1d array) – list of final external inputs
  • outputv (1d array) – list of final external outputs
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 = sp.mat([ [ 1, 2], [2, -1] ]) # basically feedback, output 2 in 1
>>> sysc = connect(sys, Q, [2], [1, 2])