clear all; close all;
A = [0 1;-6 -5];
b = [0;1];
c = [1 0];
d = 0;
op = [-8;-9];
h = acker(A',c',op)'
Ah = A - h*c;
disp('A-hcの固有値');
eig(A - h * c)
cc = eye(2);
dd = [0;0];
sys = ss(A, b, cc, dd);
e_sys = ss(Ah, b, cc, dd);
t = 0:0.01:10;
x0 = [1;1];
x0_ob = [0;0];
y = initial(sys,x0,t);
e = initial(e_sys,x0_ob - x0,t);
h_x = e + y;
figure(1)
plot(t,y(:,1),t,y(:,2),t,h_x(:,1),t,h_x(:,2));
xlim([0 10]);
ylim([-1.0 3.0]);
grid;
xlabel('time t[s]');
ylabel('state');
legend('x_1(t)','x_2(t)','hat{x}_1(t)','hat{x}_2(t)');
figure(2)
plot(t,e(:,1),t,e(:,2));
xlim([0 10]);
ylim([-2.0 4.0]);
grid;
xlabel('time t[s]');
ylabel('state');
legend('e_1(t)','e_2(t)');
h =
12
6
A-hcの固有値
ans =
-9.0000
-8.0000