root/applications/dual/vahala/kim/ctrlLQ.m
Revision 1435, 255 bytes (checked in by vahalam, 13 years ago) |
---|
Line | |
---|---|
1 | function [u_l, S_l] = ctrlLQ(x, ref_ome, A, B, S, Q, R, iter) |
2 | S_l = S; |
3 | for i = 1:iter |
4 | S_l = A'*(S_l - S_l*B/(B'*S_l*B + R)*B'*S_l)*A + Q; |
5 | end |
6 | L = (B'*S_l*B + R)\B'*S_l*A; |
7 | y = x; |
8 | y(1) = y(1) - ref_ome; |
9 | u_l = -L*[y;1]; |
10 | end |
Note: See TracBrowser
for help on using the browser.