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

  1. % function [x1,x2,fail,reig_min] = ric_schr(ham,epp)
  2. %
  3. %  Solves the eigenvalue problem associated with the
  4. %  stabilizing solution (A+R*X stable) of the Riccati equation
  5. %
  6. %               A'*X + X*A + X*R*X - Q = 0.
  7. %
  8. %  A real Schur decomposition is used to obtain the stable
  9. %  invariant subspace of the Hamiltonian matrix, HAM,
  10. %  which contains the above variables in the following format:
  11. %
  12. %       HAM = [A  R; Q  -A'].
  13. %
  14. %  If HAM has no jw-axis eigenvalues, there exists n x n matrices
  15. %  x1 and x2 such that [ x1 ; x2 ] spans the n-dimensional
  16. %  stable-invariant subspace of HAM. IF x1 is invertible, then
  17. %  X := x2/x1 satisfies the Riccati equation, and results in A+RX being
  18. %  stable. the output flag FAIL is nominally 0. if there are jw-axis
  19. %  eigenvalues, FAIL is set to 1. if there are an unequal
  20. %  number of positive and negative eigenvalues, FAIL is set
  21. %  to 2. if both conditions occur, FAIL = 3.
  22. %
  23. %  RIC_SCHR calls CSORD to produce an ordered complex Schur 
  24. %  form. This is converted to a real Schur form, and yields
  25. %  the desired stable, invariant subspace of the Hamiltonian.
  26. %  The minimum absolute value of the  real parts
  27. %  of the eigenvalues is output to REIG_MIN.
  28. %
  29. %  See also: CSORD, HAMCHK, RIC_EIG, and SCHUR.
  30.  
  31. function [r1,r2,fail,reig_min] = ric_schr(ham,epp)
  32.   if nargin <= 0
  33.     disp('usage: [x1,x2] = ric_schr(ham,epp)')
  34.     return
  35.   end
  36.   [mtype,mrows,mcols,mnum] = minfo(ham);
  37.   if mtype ~= 'cons'
  38.     error(['RIC_SCHR is valid only with CONSTANT matrices'])
  39.     return
  40.   end
  41.   if nargin == 1
  42.     epp = 1e-10;
  43.   end
  44.   np = mrows/2;
  45.   fail = 0;
  46.   [nr,nc] = size(ham);
  47.   [qn,tn,fail,reig_min] = csord(ham,epp,1,1,1);
  48. %
  49. % produce a real block-ordered decomposition of a real matrix, HAM
  50. %
  51. %      v' ham v = t = | t11  t12 |
  52. %                     |  0   t22 |
  53. %      
  54. %      t11 = t(1:np,1:np)
  55. %      t22 = t(np+1:n,np+1,2*nps) 
  56. %    
  57. %
  58. % find the orthonormal basis
  59. %
  60.   if fail == 0
  61.     qord = [real(qn(:,1:np)) imag(qn(:,1:np))];
  62.     [v,r] = qr(qord);
  63.     t = v' * ham * v;
  64.     r1 = v(1:np,1:np);
  65.     r2 = v((np+1):2*np,1:np);
  66.   else
  67.   end
  68. %
  69. % Copyright MUSYN INC 1991,  All Rights Reserved
  70.