% Monday 11/25/19

A = [0, 1; -1 0];
% B = [0; 1];
C = [1, 0];

% Existing poles
eig(A)

% We get to pick 2 poles
p = [-100, -100];

L = acker(A', C', p)'

A2 = A - L*C
eig(A2)

%% Now let's check out the performance of the estimator

x0 = [2; 3];
x0_est = [0; 0]; % Gotta start somewhere

A_combined = [A, zeros(2); L*C, A - L*C];
B_combined = [0; 1; 0; 0];
C_combined = [C, 0, 0; 0, 0, C];
% C_combined = [C, 0, 0
combined = ss(A_combined, B_combined, C_combined, 0);
% error_out = ss(A_combined, B_combined, [0, 0, C], 0);

x0_combined = [x0; x0_est];

initial(combined, x0_combined, 5);
% hold on;
% initial(error_out, x0_combined);

