SEE701 Assignment#2

Q1_a

From the OM matrix it is clear that the system is completely observable, because the OM is a full rank matrix with rank 4.

OMRank=Rank(OM);

Q1_b

In order to design the suitable state observer the gain matrix L must be derived using the matrices A and C and the desired poles of the system P.

The open loop system has four poles and two of them are at the Zero point which means that the system is unstable. The poles for the open system are:

-0.7500 + 0.9682i, -0.7500 - 0.9682i, 0.0000 + 0.0000i, 0.0000 - 0.0000i.

In order to make the system stable the matrix (A-CL) has to be stable, and to make the matrix A-LC stable, the new system poles should be chosen further in the negative side. Therefore the new system poles will be chosen to be, -3,-4,-5,-6.

Using the MATLAB commands the matrix L will be found,

a= [0 1 0 0; -1 -1 1 1; 0 0 0 1;0.5 0.5 -0.5 -0.5];

c= [1 0 0 0; 0 0 1 0];

P= [-3;-4;-5;-6;];

L=place (a', c', P)';

L=

8.5041 1.6411

13.9554 10.1855

1.6708 7.9959

9.2560 13.5386

From the state observer equations we can find the design of the state observer.

Q_2

Minimum Order state observer

Step_1

In order to design the minimum order state observer to estimate the three state variables of the system, the similarity transformation matrix (S) must be derived. The MATLAB program will be used to derive the similarity transformation matrix (S).

a=[-2,0,1;-4,-3,0;-1,3,-2];

b=[1;1;2];

c=[1 1 1];

S=[null(c) c'*inv(c*c')];

Abar=inv(s)*a*s;

Bbar=inv(s)*b;

Cbar=c*s;

Step_2

In this step the vectors , , sub matrices ,,,, and are obtained, where:

,

,
,

,
Step_3

In this step the matrix will be derived where () is stable matrix. The matrix can be easily derived by using the MATLAB program. Since the pair is observable, then the matrix can be easily derived.

Om=obsv(A_ee,A_re)

Let’s first assumed that the new system’s poles will be located at -4,-5, therefore,

A_ee=[-1.3006 1.5447;2.1220,-3.0327];

A_re=[7.6349,-8.5979];

p=[-4,-5];

k= place(aee',are',p)';

k =

3.6067

2.6600

Step_4

In this step the Matrices N,L and G will be derived

%-- 31/05/2012 1:35 PM --%

a=[0 1 0 0; -1 -1 1 1; 0 0 0 1;0.5 0.5 -0.5 -0.5];

a=[0 1 0 0; -1 -1 1 1; 0 0 0 1;0.5 0.5 -0.5 -0.5]

c=[1 0 0 0; 0 0 1 0]

OM=obsv(a,c)

om1=[ c; c*a; c*a^2; c*a^3]

root(a)

roots(a)

egin(a)

d=roots(a)

roots([a])

pole(a)

eig(a)

P=[-3;-4;-5;-6;];

P=[-3;-4;-5;-6;]

L=place(A', C', P)'

d=[-1 1 0; 0 -2 0; -1 -1 -1 ]

m=[1 0 1]

p=[-3;-4;-5]

l=place(d',m',p)'

P=[-3;-4;-5;-6;]

c=[1 0 0 0]

L=place(A', C', P)'

L=place(a', c', P)'

c=[1 0 0 0; 0 0 1 0]

L=place(a', c', P)'

a=[0 1 0 0; -1 -1 1 1; 0 0 0 1;0.5 0.5 -0.5 -0.5];

a=[0 1 0 0; -1 -1 1 1; 0 0 0 1;0.5 0.5 -0.5 -0.5]

c=[1 0 0 0; 0 0 1 0]

OM=obsv(a,c)

om1=[ c; c*a; c*a^2; c*a^3]

eig(a)

P=[-3;-4;-5;-6;]

L=place(a', c', P)'

rank(om)

n = rank(om)

k = rank(om,tol)

k = rank(OM,tol)

k = rank(OM)

A=[O 1 0 0;-1 -1 1 1;0 0 0 1;0.5 0.5 -0.5 -

8=[0;1;0;0]; C=[O 0 1 0]; D=[0];

L=[-69;534.5;16.5;92.75];

As=[A zeros(4,4);L*C A-L*C]; Bs=[B;B];

Cs=[C zeros(1,4)]; Ds=[O];

Xs0=[0;0;0;0;-1;-0.5;0.5;1];

for i=1:101;

u(i,1)=1; end t=0:0.1:10;

[yy,xx]=lsirn(As,Bs,Cs,Ds,u,t,XsO);

plot(t,u);

plot(t,xx(:,l),t,xx(:,5));

plot(t,xx(:,2),t,xx(:,6));

plot(t,xx(:,3),t,xx(:,7));

plot(t,xx(:,4),t,xx(:,8));

A=[O 1 0 0;-1 -1 1 1;0 0 0 1;0.5 0.5 -0.5 -0.5];

A=[0 1 0 0;-1 -1 1 1;0 0 0 1;0.5 0.5 -0.5 -0.5];

a=[0 1 0 0; -1 -1 1 1; 0 0 0 1;0.5 0.5 -0.5 -0.5]

c=[1 0 0 0; 0 0 1 0]

OM=obsv(a,c)

eig(a)

P=[-3;-4;-5;-6;];

P=[-3;-4;-5;-6;]

L=place(A', C', P)'

l=place(d',m',p)'

L=place(a', c', P)'

a=[0 1 0 0; -1 -1 1 1; 0 0 0 1;0.5 0.5 -0.5 -0.5]

c=[1 0 0 0; 0 0 1 0]

OM=obsv(a,c)

eig(a)

P=[-3;-4;-5;-6;]

L=place(a', c', P)'

b=[0;1;0;0]

aa=[ a zeros(4,4); l*c a-l*c];

ba=[b;b];

ca=[c zeros (2,4)];

x0=[0; 0; 0;0;-1;0.5;-0.5;1];

aa=[ a zeros(4,4); l*c a-l*c];

l*c

c*l

L*c

aa=[ a zeros(4,4); L*c a-L*c];

aa=[ a zeros(4,4); L*c a-L*c]

ba=[b;b];

ba=[b;b]

ca=[c zeros (2,4)]

ca=[c zeros (4,2)]

ca=[c zeros (2,2)]

ca=[c ;zeros (2,2)]

c

ca=[c zeros (2,4)]

ca=[ c zeros(2,4);]

ca=[c zeros (2,4);]

ca=[c zeros(2,4);]

ca=[c zeros(2,4)]

a=[0 1 0 0; -1 -1 1 1; 0 0 0 1;0.5 0.5 -0.5 -0.5]

c=[1 0 0 0; 0 0 1 0]

OM=obsv(a,c)

eig(a)

P=[-3;-4;-5;-6;]

L=place(a', c', P)'

b=[0;1;0;0]

aa=[ a zeros(4,4); l*c a-l*c];

aa=[ a zeros(4,4); L*c a-L*c];

aa=[ a zeros(4,4); L*c a-L*c]

ca=[c zeros(2,4)]

ba=[b;b]

da=[d]

d=[0]

da=[d]

t=0:0.1:20;

for i=1:101;

u(i,1)=0.1*i;

end

for i=101:201;

u(i,1)=10*sin(0.1*i);

end

[y,x]=lsim(aa,ba,ca,da,u,t,x0);

subplot(2,1,1)

plot(t,u);

grid;

subplot(2,1,2)

plot(t,x(:,1),t,x(:,4));

grid;

x0=[0; 0; 0;0;-1;0.5;-0.5;1];

t=0:0.1:20;

for i=1:101;

u(i,1)=0.1*i;

end

for i=101:201;

u(i,1)=10*sin(0.1*i);

end

[y,x]=lsim(aa,ba,ca,da,u,t,x0);

t=0:0.1:20;

for i=1:101;

u(i,)=0.1*i;

u(i,2)=0.1*i;

end

for i=101:201;

u(i,2)=10*sin(0.1*i);

end

[y,x]=lsim(aa,ba,ca,da,u,t,x0);

t=0:0.1:20;

for i=1:101;

u(i,1,2)=0.1*i;

end

for i=101:201;

u(i,1,2)=10*sin(0.1*i);

end

[y,x]=lsim(aa,ba,ca,da,u,t,x0);

1.0000 0.0000 0.0000 0.0000

0.0000 0.0000 1.0000 0.0000

0.0000 1.0000 0.0000 0.0000

0.0000 0.0000 0.0000 1.0000

-1.0000 -1.0000 1.0000 1.0000

0.5000 0.5000 -0.5000 -0.5000

1.5000 0.5000 -1.5000 -0.5000

-0.7500 -0.2500 0.7500 0.2500