% task31reg.m

% solve the linear regulator, compute the worst case shock as a function of e_t

% note that we already take F = -FF
% so W_t+1 = F*e_t

function [F] = task31reg(alpha,theta,k)

% set parameters

beta = 1;
A = 1;
C = alpha*[1 0];
G = 1;
D = [0,1];
H = 1;

AA = A - k*G;
BB = C - k*D;

Q = H'*H;
R = -theta*eye(2);
W = zeros(1,2);

[F,P] = olrp(beta,AA,BB,Q,R,W);

