60
|
1 function zr = tzero (a, b, c, d, bal) |
|
2 |
71
|
3 # Usage: zr = tzero (a, b, c, d, bal) |
|
4 # |
60
|
5 # Compute the transmission zeros of a, b, c, d. |
|
6 # |
|
7 # bal = balancing option (see balance); default is "B". |
|
8 # |
|
9 # Needs to incorporate mvzero algorithm to isolate finite zeros. |
|
10 |
73
|
11 # Written by A. S. Hodel (scotte@eng.auburn.edu) August 1993. |
71
|
12 |
60
|
13 if (nargin == 4) |
|
14 bal = "B"; |
73
|
15 elseif (nargin != 5) |
|
16 error ("tzero: illegal number of arguments"); |
60
|
17 endif |
|
18 |
73
|
19 [n, m, p] = abcddim (a, b, c, d); |
60
|
20 |
73
|
21 if (n > 0 && m > 0 && p > 0) |
|
22 if (m != p) |
|
23 fprintf (stderr "tzero: number of inputs,outputs differ. squaring up"); |
|
24 if (p > m) |
|
25 fprintf (stderr, " by padding b and d with zeros."); |
|
26 b = [b, zeros (n, p-m)]; |
|
27 d = [d, zeros (p, p-m)]; |
|
28 m = p; |
|
29 else |
|
30 fprintf (stderr, " by padding c and d with zeros."); |
|
31 c = [c; zeros (m-p, n)]; |
|
32 d = [d; zeros (m-p, m)]; |
|
33 p = m; |
|
34 endif |
|
35 fprintf (stderr, "This is a kludge. Try again with SISO system."); |
60
|
36 endif |
73
|
37 ab = [-a, -b; c, d]; |
60
|
38 bb = [eye (n), zeros (n, m); zeros (p, n), zeros (p, m)]; |
73
|
39 [ab,bb] = balance (ab, bb); |
|
40 zr = -qzval (ab, bb); |
|
41 else |
|
42 error ("tzero: a, b, c, d not compatible. exiting"); |
60
|
43 endif |
|
44 |
|
45 endfunction |