@@ -496,30 +496,37 @@ <h3 class="d-inline-block mr-2">
496496 </ div >
497497 < div class ="card-body ">
498498< dl >
499- < dt > < u > Function File:</ u > < var > sys </ var > = < b > connect</ b > < i > (< var > sys1</ var > , < var > sys2</ var > , …, < var > sysN</ var > , < var > inputs </ var > , < var > outputs </ var > )</ i > </ dt >
500- < dt > < u > Function File:</ u > < var > sys </ var > = < b > connect</ b > < i > (< var > sys</ var > , < var > cm</ var > , < var > inputs </ var > , < var > outputs </ var > )</ i > </ dt >
499+ < dt > < u > Function File:</ u > < var > csys </ var > = < b > connect</ b > < i > (< var > sys1</ var > , < var > sys2</ var > , …, < var > sysN</ var > , < var > in </ var > , < var > out </ var > )</ i > </ dt >
500+ < dt > < u > Function File:</ u > < var > csys </ var > = < b > connect</ b > < i > (< var > sys</ var > , < var > cm</ var > , < var > in </ var > , < var > out </ var > )</ i > </ dt >
501501</ dl >
502- < p > Name-based or index-based interconnections between the inputs and outputs of < acronym > LTI</ acronym > models.
503- </ p > < div class ="ms-5 ">
504502
503+ < p > Name-based or index-based interconnections between the outputs and inputs of < acronym > LTI</ acronym > models.
504+ </ p >
505+ < div class ="ms-5 ">
505506< p > < strong > Inputs</ strong >
506507 </ p > < dl compact ="compact ">
507508< dt > < var > sys1, …, sysN</ var > </ dt >
508509</ dl >
509- < p > < acronym > LTI</ acronym > models to be connected. The properties ’inname’ and ’outname’
510- of each model should be set according to the desired input-output connections.
510+ < p > < acronym > LTI</ acronym > models to be connected by named-based connection.
511+ The properties ’inname’ and ’outname’ of each model should be set according
512+ to the desired input-output connections.
513+ </ p > </ dd >
514+ < dt > < var > sys</ var > </ dt >
515+ </ dl >
516+ < p > < acronym > LTI</ acronym > model where the outputs are connected to the inputs by
517+ index-based connection.
511518 </ p > </ dd >
512- < dt > < var > inputs </ var > </ dt >
519+ < dt > < var > in </ var > </ dt >
513520</ dl >
514521< p > For name-based interconnections, string or cell of strings containing the names
515522 of the inputs to be kept. The names must be part of the properties ’ingroup’ or
516523 ’inname’. For index-based interconnections, vector containing the indices of the
517524 inputs to be kept.
518525 </ p > </ dd >
519- < dt > < var > outputs </ var > </ dt >
526+ < dt > < var > out </ var > </ dt >
520527</ dl >
521528< p > For name-based interconnections, string or cell of strings containing the names
522- of the outputs to be kept. The names must be part of the properties ’outgroup’
529+ of the outputs to be kept. The names must be part of the properties ’outgroup’
523530 or ’outname’. For index-based interconnections, vector containing the indices of
524531 the outputs to be kept.
525532 </ p > </ dd >
@@ -537,20 +544,73 @@ <h3 class="d-inline-block mr-2">
537544< p > will sum input u(2) with outputs y(3) and y(4) as
538545 </ p > < table > < tr > < td > </ td > < td > < pre class ="example "> u(2) + y(3) - y(4).
539546 </ pre > </ td > </ tr > </ table >
540- </ dd >
547+ < p > If several systems are cinnected as in the name-based case, they have
548+ to be stacked by < code > append</ code > before using < code > connect</ code > .
549+ </ p > </ dd >
541550</ dl >
542551
543552< p > < strong > Outputs</ strong >
544553 </ p > < dl compact ="compact ">
545- < dt > < var > sys </ var > </ dt >
554+ < dt > < var > csys </ var > </ dt >
546555</ dl >
547- < p > Resulting interconnected system with outputs < var > outputs </ var > and
548- inputs < var > inputs </ var > .
556+ < p > Resulting interconnected system with outputs < var > out </ var > and
557+ inputs < var > in </ var > .
549558 </ p > </ dd >
550559</ dl >
551560
561+ < p > < strong > Example</ strong >
562+ </ p >
563+ < p > Consider the control loop with reference r, disturbances d1, d2
564+ and an additional output which represents the output of the controller
565+ </ p > < table > < tr > < td > </ td > < td > < pre class ="example "> </ pre > < pre class ="example ">
566+ d1 --+ d2 --+
567+ | |
568+ e +--------+ v u +--------+ v
569+ r --->o---->| K(s) |--+->o---->| G(s) |--->o--+----> y
570+ ^ - +--------+ | +--------+ |
571+ | | |
572+ | +------------------------------> yc
573+ | |
574+ +-------------------------------------------+
575+ </ pre > < pre class ="example "> </ pre > </ td > </ tr > </ table >
576+
577+ < p > Name-based interconnections:
578+ </ p > < table > < tr > < td > </ td > < td > < pre class ="example "> </ pre > < pre class ="example "> G.inname = 'u';
579+ G.outname = 'y1';
580+ K.inname = 'e';
581+ K.outname = 'yc';
582+ s1 = sumblk ('e = r - y');
583+ s2 = sumblk ('u = yc + d1');
584+ s3 = sumblk ('y = y1 + d2');
585+ in = {'r', 'd1', 'd2'};
586+ out = {'y', 'yc'};
587+ G_cl1 = tf (connect (K, G, s1, s2, s3, in, out))
588+ </ pre > < pre class ="example "> </ pre > </ td > </ tr > </ table >
589+
590+ < p > Index-based interconnections (without changing < code > G</ code > and < code > K</ code > ):
591+ </ p > < table > < tr > < td > </ td > < td > < pre class ="example "> </ pre > < pre class ="example "> G1 = tf (1); # static gains with r, d1, d2, y as outputs
592+ G_all = append (G1, G1, G1, K, G, G1);
593+ cm = [4, 1, -6; 5, 4, 2; 6, 5, 3];
594+ in = [1, 2, 3];
595+ out = [6, 4];
596+ G_cl2 = connect (G_all, cm, in, out)
597+ </ pre > < pre class ="example "> </ pre > </ td > </ tr > </ table >
598+
599+ < p > Index-based interconnections (changing < code > G</ code > and < code > K</ code > ):
600+ </ p > < table > < tr > < td > </ td > < td > < pre class ="example "> </ pre > < pre class ="example "> [A,B,C,D] = ssdata(K);
601+ K = ss (A, [B -B], C, [D -D]); # compare s1 above
602+ [A,B,C,D] = ssdata(G);
603+ G = ss (A, [B B 0*B], C, [D D 1]); # compare s2 and s3 above
604+ G_all = append (K, G);
605+ cm = [2, 2; 3, 1];
606+ in = [1, 3, 5];
607+ out = [2, 1];
608+ G_cl3 = tf (connect (G_all, cm, in, out))
609+ </ pre > < pre class ="example "> </ pre > </ td > </ tr > </ table >
610+
552611< p > < strong > See also: </ strong >
553- < a href ="sumblk.html "> sumblk</ a >
612+ < a href ="sumblk.html "> sumblk</ a > ,
613+ < a href ="append.html "> append</ a >
554614</ p >
555615< p > < strong > Source Code: </ strong >
556616 < a href ="https://github.com/gnu-octave/pkg-control/tree/main/inst/@lti/connect.m "> @lti/connect</ a >
0 commit comments