SHARE
TWEET

Untitled

a guest Feb 18th, 2020 138 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. A = [0 1;2 0];
  2. B = [0;1];
  3. Q = [1 0;0 1];
  4. R = 0.1;
  5. [K,S,E]=lqr(A,B,Q,R)
  6.  
  7. syms k11 k12 k22
  8. K=[k11 k12;k12 k22];
  9.  
  10. riccati = -K*A-A'*K+K*B*(1/R)*B'*K-Q
  11. riccati = solve(riccati);
  12.  
  13. double(riccati.k11);
  14. double(riccati.k12);
  15. double(riccati.k22);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top