home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS2.DI$ / HINF_ST.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.9 KB  |  89 lines

  1. %
  2. %    [p,r12,r21,fail] = hinf_st(p,nmeas,ncon)
  3. %
  4. %    scale the d12 and d21 matrices to satisfy the formulas
  5. %    and check the rank conditions.
  6. %
  7.  
  8. function [p,r12,r21,fail] = hinf_st(p,nmeas,ncon)
  9.  
  10. fail = 0;
  11. [ap,bp,cp,dp,b1,b2,c1,c2,d11,d12,d21,d22,ndata] = hinf_sp(p,nmeas,ncon);
  12. np1 = ndata(1);
  13. np2 = ndata(2);
  14. nm1 = ndata(3);
  15. nm2 = ndata(4);
  16. %
  17. % determine if   |A-jwI  b2 | has full column rank at w=0
  18. %                |  c1   d12|
  19. %
  20. tmp_col=[ap b2;c1 d12];
  21. [nr,nc]=size(tmp_col);
  22. irank = rank(tmp_col,eps);
  23.    if irank ~= nc
  24.    fprintf('\n')
  25.    disp('  [a b2;c1 d12] does not have full column rank at s=0 ')
  26.    fail = 1;
  27.    return
  28.  end
  29. %
  30. % determine if   |A-jwI  b1 | has full row rank at w=0
  31. %                |  c2   d21|
  32. %
  33. tmp_row=[ap b1;c2 d21];
  34. [nr,nc]=size(tmp_row);
  35. irank = rank(tmp_row,eps);
  36.    if irank ~= nr
  37.    fprintf('\n')
  38.    disp('  [a b1;c2 d21] does not have full row rank at s=0 ')
  39.    fail = 1;
  40.    return
  41.  end
  42. %
  43. %  scale the matrices to    q12*d12*r12 = | 0 |
  44. %                                         | I |
  45. %
  46. [q12,r12] = qr(d12);
  47. %
  48. % determine if d12 has full column rank
  49. %
  50. irank = rank(r12,eps);
  51.  if irank ~= nm2
  52.    disp('  d12 does not have full column rank  ')
  53.    fail = 1;
  54.    return
  55.  end
  56. q12 = [q12(:,(nm2+1):np1),q12(:,1:nm2)]';
  57. r12 = inv(r12(1:nm2,:));
  58. %
  59. %   r21*d21*q21 = [0 I]
  60. %
  61. [q21,r21] = qr(d21');
  62. %
  63. % determine if d21 has full column rank
  64. %
  65.  irank = rank(r21,eps);
  66.  if irank ~= np2
  67.    disp('  d21 does not have full row rank  ')
  68.    fail = 1;
  69.    return
  70.  end
  71. q21 = [q21(:,(np2+1):nm1),q21(:,1:np2)];
  72. r21 = inv(r21(1:np2,:))';
  73. c1 = q12*c1;
  74. c2 = r21*c2;
  75. cp = [c1;c2];
  76. b1 = b1*q21;
  77. b2 = b2*r12;
  78. bp = [b1,b2];
  79. d11 = q12*d11*q21;
  80. d12 = q12*d12*r12;
  81. d21 = r21*d21*q21;
  82. d22 = d22;
  83. dp = [d11 d12;d21 d22];
  84. p = pck(ap,bp,cp,dp);
  85.  
  86. %---------------------------------------------------------------
  87. %
  88. % Copyright MUSYN INC 1991,  All Rights Reserved
  89.