matlab中的connect什么意思,matlab中connect函数用法

匿名用户

1级

2012-09-15 回答

connect Block-diagram interconnections of dynamic systems.

connect computes an aggregate model for a block diagram interconnection

of dynamic systems. You can specify the block diagram connectivity in

two ways:

Name-based interconnection

In this approach, you name the input and output signals of all blocks

SYS1, SYS2,... in the block diagram, including the summation blocks.

The aggregate model SYS is then built by

SYS = connect(SYS1,SYS2,...,INPUTS,OUTPUTS)

where INPUTS and OUTPUTS are the names of the block diagram external

I/Os (specified as strings or string vectors).

Example 1: Given SISO models C and G, you can construct the closed-loop

transfer T from r to y using

e u

r --->O-->[ C ]---[ G ]-+---> y

- | |

+

C.InputName = 'e'; C.OutputName = 'u';

G.InputName = 'u'; G.OutputName = 'y';

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

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

Example 2: If C and G above are two-input, two-output models instead,

you can form the MIMO transfer T from r to y using

C.u = 'e'; C.y = 'u';

G.u = 'u'; G.y = 'y';

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

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

Note that C.u,C.y is shorthand for C.InputName,C.OutputName and that

'r','y' select all entries of the two-entry vector signals r and y.

Example 3: If you already have specified I/O names for C and G, you

can build the closed-loop model T using:

Sum = sumblk('%e = r - %y',C.u,G.y);

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

See SUMBLK for more details on using aliases like %e and %y.

Index-based interconnection

In this approach, first combine all system blocks into an aggregate,

unconnected model BLKSYS using APPEND. Then construct a matrix Q

where each row specifies one of the connections or summing junctions

in terms of the input vector U and output vector Y of BLKSYS. For

example, the row [3 2 0 0] indicates that Y(2) feeds into U(3), while

the row [7 2 -15 6] indicates that Y(2) - Y(15) + Y(6) feeds into U(7).

The aggregate model SYS is then obtained by

SYS = connect(BLKSYS,Q,INPUTS,OUTPUTS)

where INPUTS and OUTPUTS are index vectors into U and Y selecting the

block diagram external I/Os.

Example: You can construct the closed-loop model T for the block

diagram above as follows:

BLKSYS = append(C,G);

% U = inputs to C,G. Y = outputs of C,G

% Here Y(1) feeds into U(2) and -Y(2) feeds into U(1)

Q = [2 1; 1 -2];

% External I/Os: r drives U(1) and y is Y(2)

T = connect(BLKSYS,Q,1,2)

Note:

* connect always returns a state-space or FRD model SYS

* States that do not contribute to the I/O transfer from INPUTS to

OUTPUTS are automatically discarded. To prevent this, set the

"Simplify" option to FALSE:

OPT = connectOptions('Simplify',false);

SYS = connect(...,OPT)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值