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

  1. function [mg] = freqrc(Z1,Z2,Z3,Z4,Z5)
  2. %
  3. % Generalized complex frequency response calculation.
  4. %
  5. % [G] = FREQRC(SS_,W) or
  6. % [G] = FREQRC(A,B,C,D,W) produces a matrix G containing
  7. % the complex frequency response :
  8. %                                  -1
  9. %     G(s) = Y(s)/U(s) = C(sI - A)   B + D
  10. %
  11. % of the linear system described in  state space as : 
  12. %             .
  13. %             x = Ax + Bu
  14. %             y = Cx + Du
  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.  
  24. % R. Y. Chiang & M. G. Safonov 5/16/85
  25. % Copyright (c) 1988 by the MathWorks, Inc.
  26. % All Rights Reserved.
  27. % ------------------------------------------------------------------
  28. %
  29.  
  30. inargs = '(a,b,c,d,w)';
  31. eval(mkargs(inargs,nargin,'ss'))
  32.  
  33. [rb,cb] = size(b);
  34. %
  35. % Calculating G(jw) :
  36. %
  37. [p,a] = hess(a);
  38. b = p'*b;
  39. c = c*p;
  40. %
  41. for iu = 1 : cb
  42.     [g] = clxbode(a,b,c,d,iu,w);
  43.     if iu == 1
  44.        mg = g;
  45.     else
  46.        mg = [mg;g];
  47.     end
  48. end
  49. %
  50. % ------ End of FREQRC.M --- RYC/MGS 5/16/85 %