1 ## Copyright (C) 2009, 2012 Lukas F. Reichlin
3 ## This file is part of LTI Syncope.
5 ## LTI Syncope is free software: you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation, either version 3 of the License, or
8 ## (at your option) any later version.
10 ## LTI Syncope is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>.
19 ## Block diagonal concatenation of two TF models.
20 ## This file is part of the Model Abstraction Layer.
21 ## For internal use only.
23 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
24 ## Created: September 2009
27 function retsys = __sys_group__ (sys1, sys2)
29 if (! isa (sys1, "tf"))
33 if (! isa (sys2, "tf"))
39 retsys.lti = __lti_group__ (sys1.lti, sys2.lti);
41 [p1, m1] = size (sys1);
42 [p2, m2] = size (sys2);
44 empty12 = tfpolyzeros (p1, m2);
45 empty21 = tfpolyzeros (p2, m1);
47 retsys.num = [sys1.num, empty12 ;
50 empty12 = tfpolyones (p1, m2);
51 empty21 = tfpolyones (p2, m1);
53 retsys.den = [sys1.den, empty12 ;
56 if (sys1.tfvar == sys2.tfvar)
57 retsys.tfvar = sys1.tfvar;
58 elseif (sys1.tfvar == "x")
59 retsys.tfvar = sys2.tfvar;
61 retsys.tfvar = sys1.tfvar;
64 if (sys1.inv || sys2.inv)