3432
|
1 ## Copyright (C) 1993 Auburn University. All rights reserved. |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by the |
|
7 ## Free Software Foundation; either version 2, or (at your option) any |
|
8 ## later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 ## for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
|
17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. |
|
18 |
|
19 ## -*- texinfo -*- |
3500
|
20 ## @deftypefn {Function File} {} tzero2 (@var{a}, @var{b}, @var{c}, @var{d}, @var{bal}) |
3432
|
21 ## Compute the transmission zeros of a, b, c, d. |
|
22 ## |
|
23 ## bal = balancing option (see balance); default is "B". |
|
24 ## |
|
25 ## Needs to incorporate @code{mvzero} algorithm to isolate finite zeros; use |
|
26 ## @code{tzero} instead. |
|
27 ## @end deftypefn |
|
28 |
|
29 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> |
|
30 ## Created: August 1993 |
|
31 |
|
32 function zr = tzero2 (a, b, c, d, bal) |
|
33 |
|
34 if (nargin == 4) |
|
35 bal = "B"; |
|
36 elseif (nargin != 5) |
|
37 error ("tzero: invalid number of arguments"); |
|
38 endif |
|
39 |
|
40 [n, m, p] = abcddim (a, b, c, d); |
|
41 |
|
42 if (n > 0 && m > 0 && p > 0) |
|
43 if (m != p) |
|
44 fprintf (stderr, "tzero: number of inputs,outputs differ. squaring up"); |
|
45 if (p > m) |
|
46 fprintf (stderr, " by padding b and d with zeros."); |
|
47 b = [b, (zeros (n, p-m))]; |
|
48 d = [d, (zeros (p, p-m))]; |
|
49 m = p; |
|
50 else |
|
51 fprintf (stderr, " by padding c and d with zeros."); |
|
52 c = [c; (zeros (m-p, n))]; |
|
53 d = [d; (zeros (m-p, m))]; |
|
54 p = m; |
|
55 endif |
|
56 fprintf (stderr, "This is a kludge. Try again with SISO system."); |
|
57 endif |
|
58 ab = [-a, -b; c, d]; |
|
59 bb = [(eye (n)), (zeros (n, m)); (zeros (p, n)), (zeros (p, m))]; |
|
60 [ab,bb] = balance (ab, bb); |
|
61 zr = -qz (ab, bb); |
|
62 else |
|
63 error ("tzero: a, b, c, d not compatible. exiting"); |
|
64 endif |
|
65 |
|
66 endfunction |