home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 7.ddi / ROBUST.DI$ / DFREQRC.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.3 KB  |  50 lines

  1. function [mg] = dfreqrc(Z1,Z2,Z3,Z4,Z5,Z6)
  2. %
  3. % Generalized complex frequency response calculation.
  4. %
  5. % [G] = DFREQRC(SS_,W,TS) or
  6. % [G] = DFREQRC(A,B,C,D,W,TS) produces a matrix G containing
  7. % the complex frequency response :
  8. %                                  -1
  9. %     G(z) = Y(z)/U(z) = C(zI - A)   B + D
  10. %
  11. % of the linear system described in  state space as : 
  12. %             
  13. %             x(k+1) = Ax(k) + Bu(k)
  14. %             y(k) = Cx(k) + Du(k)
  15. %
  16. % when evaluated at the frequencies in complex vector W.
  17. % Returned in G is a matrix where each column corresponds to a 
  18. % frequency point in W, and each row corresponds to a paticular
  19. % U-Y pair. The first ny rows, where ny is the size of the Y vector,
  20. % correspond to the responses from the first input. And so on up to 
  21. % ny * nu where nu is the size of the U vector.
  22.  
  23. % R. Y. Chiang & M. G. Safonov 5/16/85
  24. % Copyright (c) 1988 by the MathWorks, Inc.
  25. % All Rights Reserved.
  26. %-------------------------------------------------------------------
  27. %
  28.  
  29. inargs = '(a,b,c,d,w,Ts)';
  30. eval(mkargs(inargs,nargin,'ss'))
  31.  
  32. [rb,cb] = size(b);
  33. %
  34. % Calculating G(z) :
  35. %
  36. [p,a] = hess(a);
  37. b = p'*b;
  38. c = c*p;
  39. %
  40. for iu = 1 : cb
  41.     [g] = dclxbode(a,b,c,d,iu,w,Ts);
  42.     if iu == 1
  43.        mg = g;
  44.     else
  45.        mg = [mg;g];
  46.     end
  47. end
  48. %
  49. % ------- End of DFREQRC.M --- RYC/MGS 5/16/85 %
  50.