summaryrefslogtreecommitdiffstats
path: root/templates/LQR.m
diff options
context:
space:
mode:
Diffstat (limited to 'templates/LQR.m')
-rw-r--r--templates/LQR.m7
1 files changed, 0 insertions, 7 deletions
diff --git a/templates/LQR.m b/templates/LQR.m
index c05237d..2a79da9 100644
--- a/templates/LQR.m
+++ b/templates/LQR.m
@@ -16,18 +16,11 @@ classdef LQR
function obj = LQR(Q,R,params)
% YOUR CODE HERE
% obj.K = ... (save feedback matrix for use in eval function)
- A = params.model.A;
- B = params.model.B;
- % [X, L, G] = dare(A,B,Q,R);
- [K,S,e] = dlqr(A,B,Q,R)
- % obj.K = -inv(B'*P_inf*B+R)*B'*P_inf*A;
- obj.K = -K;
end
function [u, ctrl_info] = eval(obj,x)
% YOUR CODE HERE
% u = ...
- u = obj.K*x;
ctrl_info = struct('ctrl_feas',true);
end
end