3279
|
1 # Copyright (C) 1993 Auburn University. All Rights Reserved |
3213
|
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 |
3284
|
17 # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. |
3213
|
18 |
|
19 function zr = tzero2 (a, b, c, d, bal) |
|
20 |
|
21 # Usage: zr = tzero2 (a, b, c, d, bal) |
|
22 # |
|
23 # Compute the transmission zeros of a, b, c, d. |
|
24 # |
|
25 # bal = balancing option (see balance); default is "B". |
|
26 # |
|
27 # Needs to incorporate mvzero algorithm to isolate finite zeros. |
|
28 |
|
29 # Written by A. S. Hodel (scotte@eng.auburn.edu) August 1993. |
|
30 |
|
31 if (nargin == 4) |
|
32 bal = "B"; |
|
33 elseif (nargin != 5) |
|
34 error ("tzero: illegal number of arguments"); |
|
35 endif |
|
36 |
|
37 [n, m, p] = abcddim (a, b, c, d); |
|
38 |
|
39 if (n > 0 && m > 0 && p > 0) |
|
40 if (m != p) |
|
41 fprintf (stderr, "tzero: number of inputs,outputs differ. squaring up"); |
|
42 if (p > m) |
|
43 fprintf (stderr, " by padding b and d with zeros."); |
3279
|
44 b = [b, (zeros (n, p-m))]; |
|
45 d = [d, (zeros (p, p-m))]; |
3213
|
46 m = p; |
|
47 else |
|
48 fprintf (stderr, " by padding c and d with zeros."); |
3279
|
49 c = [c; (zeros (m-p, n))]; |
|
50 d = [d; (zeros (m-p, m))]; |
3213
|
51 p = m; |
|
52 endif |
|
53 fprintf (stderr, "This is a kludge. Try again with SISO system."); |
|
54 endif |
|
55 ab = [-a, -b; c, d]; |
3279
|
56 bb = [(eye (n)), (zeros (n, m)); (zeros (p, n)), (zeros (p, m))]; |
3213
|
57 [ab,bb] = balance (ab, bb); |
|
58 zr = -qz (ab, bb); |
|
59 else |
|
60 error ("tzero: a, b, c, d not compatible. exiting"); |
|
61 endif |
|
62 |
|
63 endfunction |