Skip to Main Content Skip to Search
Product Documentation

connect - Block diagram interconnections of dynamic systems

Syntax

sysc = connect(sys1,...,sysN,inputs,outputs)

Description

sysc = connect(sys1,...,sysN,inputs,outputs) connects the block diagram elements sys1,...,sysN based on signal names. The block diagram elements sys1,...,sysN are dynamic system models. These models can include summing junctions you create using sumblk. The connect command interconnects the block diagram elements by matching the input and output signals you specify in the InputName and OutputName properties of sys1,...,sysN. The aggregate model sysc is a dynamic system model having inputs and outputs specified by inputs and outputs respectively.

Input Arguments

sys1,...,sysN

Dynamic system models corresponding to the elements of your block diagram. For example, the elements of your block diagram can include one or more tf or ss model representing plant dynamics. Block diagram elements can also include a pid or ltiblock.pid model representing a controller. You can also include one or more summing junction you create using sumblk. Provide multiple arguments sys1,...,sysN to represent all of the block diagram elements and summing junctions.

inputs

For name-based interconnection, a string or cell array of strings specifying the inputs of the aggregate model sysc. The strings in inputs must correspond to entries in the InputName or OutputName property of one or more of the block diagram elements sys1,...,sysN.

outputs

For name-based interconnection, a string or cell array of strings specifying the outputs of the aggregate model sysc. The strings in outputs must correspond to entries in the OutputName property of one or more of the block diagram elements sys1,...,sysN.

Output Arguments

sysc

Dynamic system model representing the aggregate block diagram having elements sys1,...,sysN, interconnected as specified by name-based interconnection or index-based interconnection.

Examples

SISO Feedback Loop

Create an aggregate model of the following block diagram from r to y.

Create C and G, and name the inputs and outputs.

C = pid(2,1); 
C.u = 'e';  C.y = 'u';
G = zpk([],[-1,-1],1);
G.u = 'u';  G.y = 'y';

The notations C.u and C.y are shorthand expressions equivalent to C.InputName and C.OutputName, respectively. For example, entering C.u = 'e' is equivalent to entering C.InputName = 'e'. The command sets the InputName property of C to the value 'e'.

Create the summing junction.

Sum = sumblk('e = r - y');

Combine C, G, and the summing junction to create the aggregate model from r to y.

T = connect(G,C,Sum,'r','y');

connect automatically joins inputs and outputs with matching names.

 

MIMO Feedback Loop

Create the control system of the previous example where G and C are both 2-input, 2-output models.

C = [pid(2,1),0;0,pid(5,6)];
C.InputName = 'e';  C.OutputName = 'u';
G = ss(-1,[1,2],[1;-1],0);
G.InputName = 'u';  G.OutputName = 'y';

When you specify single names for vector-valued signals, the software automatically performs vector expansion of the signal names. For example, examine the names of the inputs to C.

C.InputName
ans = 

    'e(1)'
    'e(2)'

Create a 2-input, 2-output summing junction.

Sum = sumblk('e = r-y',2);

sumblk also performs vector expansion of the signal names.

Interconnect the models to obtain the closed-loop system.

T = connect(G,C,Sum,'r','y');

The block diagram elements G, C, and Sum are all 2-input, 2-output models. Therefore, connect performs the same vector expansion. connect selects all entries of the two-input signals 'r' and 'y' as inputs and outputs to T, respectively. For example, examine the input names of T.

T.InputName
ans = 

    'r(1)'
    'r(2)'

See Also

append | feedback | lft | parallel | series | sumblk

How To

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS