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

  1. function [l,m,p,e] = dlqew(a,g,c,j,q,r)
  2. %DLQEW    Discrete linear quadratic estimator design for the system:
  3. %        x[n+1] = Ax[n] + Bu[n] + Gw[n]              {State equation}
  4. %        z[n]   = Cx[n] + Du[n] + Jw[n] + v[n]     {Measurements}
  5. %    with process noise and measurement noise covariances:
  6. %        E{w} = E{v} = 0,  E{ww'} = Q,  E{vv'} = R,  E{wv'} = 0
  7. %
  8. %    L = DLQEW(A,G,C,J,Q,R) returns the gain matrix L such that the 
  9. %    discrete, stationary Kalman filter with time and observation 
  10. %    update equations:
  11. %       _         *               *      _                _
  12. %       x[n+1] = Ax[n] + Bu[n]    x[n] = x[n] + L(z[n] - Cx[n] - Du[n])
  13. %    produces an LQG optimal estimate of x.  The estimator can be
  14. %    formed using DESTIM.
  15. %
  16. %    [L,M,P,E] = DLQEW(A,G,C,J,Q,R) returns the gain matrix L, the
  17. %    Riccati equation solution M, the estimate error covariance after
  18. %    the measurement update:          *    *
  19. %                                 P = E{[x-x][x-x]'}
  20. %    and the closed-loop eigenvalues of the estimator, E=EIG(A-A*L*C).
  21. %
  22. %    See also: DLQE, LQED and DESTIM.
  23.  
  24. %    Clay M. Thompson  7-23-90
  25. %    Copyright (c) 1986-93 by the MathWorks, Inc.
  26.  
  27. error(nargchk(6,6,nargin));
  28.  
  29. rr = r + j*q*j';
  30. nn = q*j';
  31. [l,m,p,e] = dlqe(a,g,c,q,rr,nn);
  32.