3213
|
1 # Copyright (C) 1993 John W. Eaton |
|
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, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
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. |
3229
|
30 # $Revision: 2.0.0.2 $ |
3213
|
31 |
|
32 if (nargin == 4) |
|
33 bal = "B"; |
|
34 elseif (nargin != 5) |
|
35 error ("tzero: illegal number of arguments"); |
|
36 endif |
|
37 |
|
38 [n, m, p] = abcddim (a, b, c, d); |
|
39 |
|
40 if (n > 0 && m > 0 && p > 0) |
|
41 if (m != p) |
|
42 fprintf (stderr, "tzero: number of inputs,outputs differ. squaring up"); |
|
43 if (p > m) |
|
44 fprintf (stderr, " by padding b and d with zeros."); |
|
45 b = [b, zeros (n, p-m)]; |
|
46 d = [d, zeros (p, p-m)]; |
|
47 m = p; |
|
48 else |
|
49 fprintf (stderr, " by padding c and d with zeros."); |
|
50 c = [c; zeros (m-p, n)]; |
|
51 d = [d; zeros (m-p, m)]; |
|
52 p = m; |
|
53 endif |
|
54 fprintf (stderr, "This is a kludge. Try again with SISO system."); |
|
55 endif |
|
56 ab = [-a, -b; c, d]; |
|
57 bb = [eye (n), zeros (n, m); zeros (p, n), zeros (p, m)]; |
|
58 [ab,bb] = balance (ab, bb); |
|
59 zr = -qz (ab, bb); |
|
60 else |
|
61 error ("tzero: a, b, c, d not compatible. exiting"); |
|
62 endif |
|
63 |
|
64 endfunction |