I want to make a Luenberger observer , and this is my code :
G = c2d(G2,0.004);
tf = G;
I = eye(11);
pi = 100000;
U = 1;
x0=[0;0;0;0;0;0;0;0;0;0;0];
x=zeros(11,1250);
x(:,1)=x0;
A = [0.1321 -1.287 -0.03492 -0.5931 0.02748 -0.183 0.1432 -0.07204 0.02407 -0.002951 0.0007733;
1 0 0 0 0 0 0 0 0 0 0;
0 1 0 0 0 0 0 0 0 0 0;
0 0 1 0 0 0 0 0 0 0 0;
0 0 0 1 0 0 0 0 0 0 0;
0 0 0 0 0.5 0 0 0 0 0 0;
0 0 0 0 0 0.125 0 0 0 0 0;
0 0 0 0 0 0 0.0625 0 0 0 0;
0 0 0 0 0 0 0 0.03125 0 0 0;
0 0 0 0 0 0 0 0 0.003906 0 0;
0 0 0 0 0 0 0 0 0 0.0004883 0];
B = [2;
0;
0;
0;
0;
0;
0;
0;
0;
0;
0];
C = [0.3156 -0.04226 0.4169 0.009387 0.197 -0.008443 0.4791 -0.3495 0.1721 -0.3119 0.1723];
p = [1.01 0.95 0.94 1.02 0.8 0.8 0.97 0.7 0.99 0.9 1.003 ];
L = acker(A',C',p);
data = textread('Data 0.003-4.3 [y0].txt');
y = data(:, 3);
u = data(:, 4);
k=1:1:1250;
for i=1:1250
x(:,i+1) = A*x(:,i)+B*u(i)+L'*(y(i)-C*x(:,i));
y1(i) = C*x(:,i);
end
figure(1)
plot(k,y)
figure(2)
plot(k,y1)
but i get this Warning: [Pole locations are more than 10% in error.]
could anybody teach me how to solve this problem. Thanks!