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

  1. function nmhinf = normhinf(Z1,Z2,Z3,Z4,Z5)
  2. % [NMHINF] = NORMHINF(A,B,C,D,tol) or
  3. % [NMHINF] = NORMHINF(SS_,tol) computes the HINF norm of the given 
  4. %    state-space realization. Implemented here is a binary search 
  5. %    algorithm of imaginary axis eigenvalue(s) of the Hamiltonian
  6. %
  7. %                        -1           -1
  8. %       H(gam) = | A + BR  D'C     -BR  B'        |
  9. %                |       -1                -1     |
  10. %                |C'(I+DR  D')C    -(A + BR  D'C)'|
  11. %
  12. %    where R = gam^2 I - D'D > 0. HINF norm equals to "gam" when H 
  13. %    has imaginary axis eigenvalue(s).
  14. %
  15. %    Inital guesses of the HINF norm upper/lower bounds are
  16. %
  17. %       Upper Bound: max_sigma(D) + 2*sum(Hankel SV(G))
  18. %       Lower Bound: max{max_sigma(D), max_Hankel SV(G)}.
  19. %
  20. %    The search algorithm stops when two adjacent "gam's" have relative
  21. %    error less than "tol". If no "tol" provided, tol = 0.001.
  22.  
  23. % R. Y. Chiang & M. G. Safonov 8/91
  24. % Copyright (c) 1991 by the MathWorks, Inc.
  25. % All Rights Reserved.
  26.  
  27. nag1 = nargin;
  28.  
  29. if nag1 == 5 | nag1 == 2
  30.    inargs='(a,b,c,d,tol)';
  31.    eval(mkargs(inargs,nargin,'ss'))
  32. end
  33.  
  34. if nag1 == 4 | nag1 == 1
  35.   inargs='(a,b,c,d)';
  36.   eval(mkargs(inargs,nargin,'ss'))
  37.   tol = 0.001;
  38. end
  39.  
  40. [rd,cd] = size(d);
  41. dtd = d'*d;
  42. hsv = hksv(a,b,c);
  43.  
  44. n_l = max([max(svd(d)),max(hsv)]);
  45. n_h = max(svd(d)) + 2*sum(hsv);
  46.  
  47. while (n_h-n_l) > 2*tol*n_l
  48.     gam = (n_l+n_h)/2;
  49.     r = gam*gam*eye(cd) - dtd;
  50.     ir = inv(r);
  51.     Ham = [a+b*ir*d'*c  -b*ir*b';
  52.            c'*(eye(rd)+d*ir*d')*c -(a+b*ir*d'*c)'];
  53.     lam = abs(real(eig(Ham)));
  54.     ind = find(lam < sqrt(eps));
  55.     [rind,cind] = size(ind);
  56.     if rind == 0     % no imag. lam
  57.        n_h = gam;
  58.     else             % exists imag. lam
  59.        n_l = gam;
  60.     end
  61. end
  62.  
  63. nmhinf = gam;
  64.  
  65. %
  66. % ----- End of NORMHINF.M  % RYC/MGS %
  67.  
  68.  
  69.