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

  1. function [kerr,serr]=dric(a,b,q,r,k,s)
  2. %DRIC    Discrete Riccati equation residual calculation.
  3. %    [Kerr,Serr] = DRIC(A,B,Q,R,K,S) Computes the error in the solution
  4. %    to the discrete Riccati equation.  Kerr is the error in the gain
  5. %    matrix and Serr is the residual error in the Riccati equation.
  6. %
  7. %                     -1                                     -1
  8. %    Kerr = K-(R+B'SB)  B'SA;  Serr = S - A'SA + A'SB(R+B'SB)  BS'A - Q
  9. %
  10. %    See also: RIC, DLQE, DLQR
  11.  
  12. %    Copyright (c) 1986-93 by the MathWorks, Inc.
  13.  
  14. serr = s - a'*s*a+a'*s*b*((r+b'*s*b)\b'*s'*a)-q;
  15. kerr = k - (r+b'*s*b)\b'*s*a;
  16.  
  17.