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

  1. function [k,s,e] = lqry(a,b,c,d,q,r)
  2. %LQRY    Linear quadratic regulator design with output weighting
  3. %    for continuous-time systems.
  4. %
  5. %    [K,S,E] = LQRY(A,B,C,D,Q,R) calculates the optimal feedback
  6. %    gain matrix K such that the feedback law  u = -Kx  minimizes
  7. %    the cost function:
  8. %
  9. %       J = Integral {y'Qy + u'Ru} dt
  10. %
  11. %    subject to the constraint equation: 
  12. %       .
  13. %       x = Ax + Bu,  y = Cx + Du
  14. %                
  15. %    Also returned is S, the steady-state solution to the associated 
  16. %    algebraic Riccati equation and the closed loop eigenvalues
  17. %    E = EIG(A-B*K).
  18. %
  19. %    The controller can be formed using REG.
  20. %
  21. %    See also: LQR, LQR2 and REG.
  22.  
  23. %    J.N. Little 7-11-88
  24. %    Revised: 7-18-90 Clay M. Thompson
  25. %    Copyright (c) 1986-93 by the MathWorks, Inc.
  26.  
  27. error(nargchk(6,6,nargin));
  28. qq = c'*q*c;
  29. rr = r + d'*q*d;
  30. nn = c'*q*d;
  31. [k,s,e] = lqr(a,b,qq,rr,nn);
  32.