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

  1. function [a11h,b1h,c1h,d1h,a22h,b2h,c2h,d2h] = slowfast(Z1,Z2,Z3,Z4,Z5)
  2. % [SS_1,SS_2] = SLOWFAST(SS_,CUT) or
  3. % [A11H,B1H,C1H,D1H,A22H,B2H,C2H,D2H] = SLOWFAST(A,B,C,D,CUT) produces
  4. %     a decomposition of G(s) into the sum of a slow part Gs(s) and a 
  5. %     fast part Gf(s) 
  6. %
  7. %                 G(s) = Gs(s) + Gf(s)
  8. %     where
  9. %                 Gs(s):= ss_1 = mksys(a11h,b1h,c1h,d1h);
  10. %                 cut = no. of modes in Gs(s)
  11. %                 Gf(s):= ss_2 = mksys(a22h,b2h,c2h,d2h);
  12. %
  13. %   The regular state-space can be recovered by "branch".
  14.  
  15. % R. Y. Chiang & M. G. Safonov 4/4/86
  16. % Copyright (c) 1988 by the MathWorks, Inc.
  17. % All Rights Reserved.
  18. % -----------------------------------------------------------------------
  19.  
  20. inargs = '(a,b,c,d,cut)';
  21. eval(mkargs(inargs,nargin,'ss'))
  22.  
  23. %
  24. % ----- Real Schur Decomposition :
  25. %
  26. [ra,ca] = size(a);
  27. [u,t,m] = blkrsch(a,6,cut);
  28. %
  29. a11h = t(1:cut,1:cut); 
  30. a22h = t(cut+1:ra,cut+1:ra);
  31. a12h = t(1:cut,cut+1:ra);
  32. v1 = u(:,1:cut); v2 = u(:,cut+1:ra);
  33. %
  34. x = lyap(a11h,-a22h,a12h);
  35. %
  36. t1 = v1;
  37. t2 = v1 * x + v2;
  38. s1 = v1' - x * v2';
  39. s2 = v2';
  40. b1h = s1 * b;
  41. b2h = s2 * b;
  42. c1h = c * t1;
  43. c2h = c * t2;
  44. d1h = 0.5*d;
  45. d2h = 0.5*d;
  46. %
  47. if xsflag
  48.    a11h = mksys(a11h,b1h,c1h,d1h);
  49.    b1h = mksys(a22h,b2h,c2h,d2h);
  50. end
  51. %
  52. % ------ End of SLOWFAST.M ---- RYC/MGS ---- %