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 |
71
|
11 # Written by A. S. Hodel (scotte@eng.auburn.edu) August 1993 |
|
12 |
60
|
13 if (nargin == 4) |
|
14 bal = "B"; |
|
15 elseif (nargin ~= 5) |
|
16 error("tzero: illegal number of arguments") |
|
17 endif |
|
18 |
|
19 [n, m, p] = abcdchk (a, b, c, d); |
|
20 |
|
21 if(m != p) |
|
22 |
|
23 disp("warning: tzero: number of inputs,outputs differ -- squaring up") |
|
24 |
|
25 if (p > m) |
|
26 disp (" by padding b, d with zeros") |
|
27 b = [b, zeros (n, p-m)]; |
|
28 d = [d, zeros (p, p-m)]; |
|
29 m = p; |
|
30 else |
|
31 disp (" by padding c,d with zeros") |
|
32 c = [c; zeros (m-p, n)]; |
|
33 d = [d; zeros (m-p, m)]; |
|
34 p = m; |
|
35 endif |
|
36 |
|
37 disp ("This is a kludge. Try again with SISO system.") |
|
38 |
|
39 endif |
|
40 |
|
41 if (n != -1) |
|
42 ab = [-a -b; c d]; |
|
43 bb = [eye (n), zeros (n, m); zeros (p, n), zeros (p, m)]; |
|
44 [ab, bb] = balance (ab, bb); |
|
45 zr = qzval (ab, bb); |
|
46 endif |
|
47 |
|
48 endfunction |