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

  1. function [l,p,e] = lqe(a,g,c,q,r,t)
  2. %LQE    Linear quadratic estimator design. For the continuous-time system:
  3. %        .
  4. %        x = Ax + Bu + Gw            {State equation}
  5. %        z = Cx + Du + v             {Measurements}
  6. %    with process noise and measurement noise covariances:
  7. %        E{w} = E{v} = 0,  E{ww'} = Q,  E{vv'} = R, E{wv'} = 0
  8. %
  9. %    L = LQE(A,G,C,Q,R) returns the gain matrix L such that the 
  10. %    stationary Kalman filter:
  11. %          .
  12. %          x = Ax + Bu + L(z - Cx - Du)
  13. %
  14. %    produces an LQG optimal estimate of x. The estimator can be formed
  15. %    with ESTIM.
  16. %
  17. %    [L,P,E] = LQE(A,G,C,Q,R) returns the gain matrix L, the Riccati
  18. %    equation solution P which is the estimate error covariance, and 
  19. %    the closed loop eigenvalues of the estimator: E = EIG(A-L*C).
  20. %
  21. %    [L,P,E] = LQE(A,G,C,Q,R,N) solves the estimator problem when the
  22. %    process and sensor noise is correlated: E{wv'} = N.
  23. %
  24. %    See also: LQEW, LQE2, and ESTIM.
  25.  
  26. %    J.N. Little 4-21-85
  27. %    Revised Clay M. Thompson  7-16-90
  28. %    Copyright (c) 1986-93 by the MathWorks, Inc.
  29.  
  30. error(nargchk(5,6,nargin));
  31.  
  32. % Calculate estimator gains using LQR and duality:
  33. if nargin==5
  34.   [k,s,e] = lqr(a',c',g*q*g',r);
  35. else
  36.   [k,s,e] = lqr(a',c',g*q*g',r,g*t);
  37. end  
  38. l=k';
  39. p=s';
  40.  
  41.