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