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

  1. function [l,p] = lqe2(a,g,c,q,r,t)
  2. %LQE2    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 = LQE2(A,G,C,Q,R) returns the gain matrix L such that the 
  10. %    stationary Kalman filter:   .
  11. %                                   x = Ax + Bu + L(z - Cx - Du)
  12. %    produces an LQG optimal estimate of x. The estimator can be formed
  13. %    with ESTIM.
  14. %
  15. %    [L,P] = LQE2(A,G,C,Q,R) returns the gain matrix L and the Riccati
  16. %    equation solution P which is the estimate error covariance.
  17. %
  18. %    [L,P] = LQE2(A,G,C,Q,R,N) solves the estimator problem when the
  19. %    process and sensor noise is correlated: E{wv'} = N.
  20. %
  21. %    LQE2 uses the SCHUR algorithm and is more numerically reliable 
  22. %    than LQE, which uses eigenvector decomposition.
  23. %
  24. %    See also: LQEW, LQE, and ESTIM.
  25.  
  26. %    Clay M. Thompson  7-23-90
  27. %    Copyright (c) 1986-93 by the MathWorks, Inc.
  28.  
  29. error(nargchk(5,6,nargin));
  30.  
  31. % Calculate estimator gains using LQR2 and duality:
  32. if nargin==5
  33.   [k,s] = lqr2(a',c',g*q*g',r);
  34. else
  35.   [k,s] = lqr2(a',c',g*q*g',r,g*t);
  36. end  
  37. l=k';
  38. p=s';
  39.  
  40.