annotate scripts/control/parallel.m @ 3385:10f21f7ccc7f

[project @ 1999-12-15 22:28:26 by jwe]
author jwe
date Wed, 15 Dec 1999 22:28:52 +0000
parents 69b167451491
children 1a8e2c0d627a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
1 ## Copyright (C) 1996 Auburn University. All Rights Reserved.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
2 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
3 ## This file is part of Octave.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
4 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
6 ## under the terms of the GNU General Public License as published by the
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
7 ## Free Software Foundation; either version 2, or (at your option) any
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
8 ## later version.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
9 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but WITHOUT
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
11 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
12 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
13 ## for more details.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
14 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
15 ## You should have received a copy of the GNU General Public License
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
16 ## along with Octave; see the file COPYING. If not, write to the Free
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
18
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
19 ## function sysp = parallel(Asys,Bsys)
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
20 ## Forms the parallel connection of two systems.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
21 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
22 ## ____________________
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
23 ## | ________ |
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
24 ## u ----->|----> | Asys |--->|----> y1
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
25 ## | | -------- |
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
26 ## | | ________ |
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
27 ## |--->|----> | Bsys |--->|----> y2
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
28 ## | -------- |
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
29 ## --------------------
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
30 ## Ksys
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
31
3385
10f21f7ccc7f [project @ 1999-12-15 22:28:26 by jwe]
jwe
parents: 3381
diff changeset
32 function sysp = parallel (Asys, Bsys)
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
33
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
34 ## Written by David Clem August 15, 1994
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
35 ## completely rewritten Oct 1996 a s hodel
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
36 ## SYS_INTERNAL accesses members of system structure
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
37
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
38 if(nargin != 2)
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
39 usage("sysp = parallel(Asys,Bsys)");
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
40 endif
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
41 if(! is_struct(Asys) )
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
42 error("1st input argument is not a system data structure")
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
43 elseif (! is_struct(Bsys) )
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
44 error("2nd input argument is not a system data structure")
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
45 endif
3228
dbcc24961c44 [project @ 1998-12-09 18:42:12 by jwe]
jwe
parents: 3213
diff changeset
46 [Ann,Anz,mA] = sysdimensions(Asys);
dbcc24961c44 [project @ 1998-12-09 18:42:12 by jwe]
jwe
parents: 3213
diff changeset
47 [Bnn,Bnz,mB] = sysdimensions(Bsys);
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
48 if(mA != mB)
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
49 error(["Asys has ",num2str(mA)," inputs, Bsys has ",num2str(mB)," inputs"]);
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
50 endif
3236
98e15955107e [project @ 1999-03-05 07:17:10 by jwe]
jwe
parents: 3229
diff changeset
51
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
52 ## save signal names
3236
98e15955107e [project @ 1999-03-05 07:17:10 by jwe]
jwe
parents: 3229
diff changeset
53 Ain = sysgetsignals(Asys,"in");
98e15955107e [project @ 1999-03-05 07:17:10 by jwe]
jwe
parents: 3229
diff changeset
54
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
55 ## change signal names to avoid warning messages from sysgroup
3236
98e15955107e [project @ 1999-03-05 07:17:10 by jwe]
jwe
parents: 3229
diff changeset
56 Asys = syssetsignals(Asys,"in",sysdefioname(length(Ain),"Ain_u"));
98e15955107e [project @ 1999-03-05 07:17:10 by jwe]
jwe
parents: 3229
diff changeset
57 Bsys = syssetsignals(Bsys,"in",sysdefioname(length(Ain),"Bin_u"));
98e15955107e [project @ 1999-03-05 07:17:10 by jwe]
jwe
parents: 3229
diff changeset
58
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
59 sysp = sysgroup(Asys,Bsys);
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
60 sysD = ss2sys([],[],[],[eye(mA);eye(mA)]);
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
61
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
62 sysp = sysmult(sysp,sysD);
3236
98e15955107e [project @ 1999-03-05 07:17:10 by jwe]
jwe
parents: 3229
diff changeset
63 sysp = syssetsignals(sysp,"in",Ain);
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
64
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
65 endfunction