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

  1. function [abal,bbal,cbal,g,t] = obalreal(a,b,c)
  2. %
  3. % [ABAL,BBAL,CBAL,G,T] = OBALREAL(A,B,C) produces a balanced 
  4. %    realization using B. C. Moore's  algorithm.
  5. %  
  6. %           G : diagonal of the balanced grammian (ordered)
  7. %           T : balancing transformation
  8. %
  9.  
  10. % R. Y. Chiang & M. G. Safonov 8/85
  11. % Copyright (c) 1988 by the MathWorks, Inc.
  12. % All Rights Reserved.
  13. % ------------------------------------------------------------------
  14.  
  15. p = gram(a,b);
  16. q = gram(a',c');
  17. [up,sp,vp] = svd(p);
  18. sph = diag(diag(sp).^0.5);
  19. t1 = up*sph;
  20. qq = t1'*q*t1;
  21. [uqq,sqq,vqq] = svd(qq);
  22. sq = diag(diag(sqq).^0.25);
  23. t2 = uqq*inv(sq);
  24. t = t1*t2;
  25. abal = t \ a * t;
  26. bbal = t \ b;
  27. cbal = c * t;
  28. g = diag(gram(abal,bbal))';
  29. %
  30. % ----- End of OBALREAL.M --- RYC/MGS 8/85 %