EE611

Solution to Homework #26


1a) Draw the simulation diagram for:

Now draw simulation diagram:


b) Determine the stability of if

i)

Therefore system is ASYMPTOTICALLY STABLE!!

ii)

Therefore system is UNSTABLE!!

iii)

Therefore system is UNSTABLE!!


c)

i) :

ii) No overshoot, or z real between 0 and 1:

iii) both i) and ii)

 


d) Find eigenvalues and eigenvectors:


e) Draw a simulation diagram for your system in decoupled form


f)

i) stable eigenvalues are {1/2, -1/2}

ii) controllable eigenvalue is {2}

iii) observable eigenvalues are {1/2, -1/2}


g) The system IS stabilizable, since all uncontrollable eigenvalues are stable!!

The system is NOT detectable, since the unobservable egeinvalue is unstable!!

 


2.

» A=(1/20)*[-4 -9 0 -9 -9;-18 -13 0 -18 -18;18 18 5 18 18;-9 -9 0 -4 -9;-9 -9 0 -9 -4]

A =

-0.2000

-0.4500

0

-0.4500

-0.4500

-0.9000

-0.6500

0

-0.9000

-0.9000

0.9000

0.9000

0.2500

0.9000

0.9000

-0.4500

-0.4500

0

-0.2000

-0.4500

-0.4500

-0.4500

0

-0.4500

-0.2000

» B=(1/5)*[0 -1;5 3;0 2;0 -1; 0 -1]

B =

0

-0.2000

1.0000

0.6000

0

0.4000

0

-0.2000

0

-0.2000

 » C=[1 1 0 1 1;1 2 1 1 1;1 0 1 0 1]

C =

1

1

0

1

1

1

2

1

1

1

1

0

1

0

1

» M = [B A*B A*A*B A*A*A*B A*A*A*A*B]

M =

0

-0.2000

-0.4500

-0.0500

0.7875

-0.0125

-1.6031

-0.0031

3.1992

-0.0008

1.0000

0.6000

-0.6500

0.1500

1.6375

0.0375

-3.1906

0.0094

6.4023

0.0023

0

0.4000

0.9000

0.1000

-1.5750

0.0250

3.2063

0.0063

-6.3984

0.0016

0

-0.2000

-0.4500

-0.0500

0.7875

-0.0125

-1.6031

-0.0031

3.1992

-0.0008

0

-0.2000

-0.4500

-0.0500

0.7875

-0.0125

-1.6031

-0.0031

3.1992

-0.0008

» rank(M)

ans =

2

» Tccf = [M(:,1:2) [0;0;1;0;0] [0;0;0;1;0] [0;0;0;0;1]]

Tccf =

0

-0.2000

0

0

0

1.0000

0.6000

0

0

0

0

0.4000

1.0000

0

0

0

-0.2000

0

1.0000

0

0

-0.2000

0

0

1.0000

» Accf = inv(Tccf)*A*Tccf

Accf =

-2.0000

0.0000

0

-2.2500

-2.2500

2.2500

0.2500

0

2.2500

2.2500

0

0

0.2500

0

0

0

0

0

0.2500

0

0

0

0

0

0.2500

» Ac = Accf(1:2,1:2)

Ac =

-2.0000

0.0000

     

2.2500

0.2500

     

» Ac_bar = Accf(3:5,3:5)

Ac_bar =

0.2500

0

0

   

0

0.2500

0

   

0

0

0.2500

   

» Bccf = inv(Tccf)*B

Bccf =

1

0

     

0

1

     

0

0

     

0

0

     

0

0

     

» Bc = Bccf(1:2,:)

Bc =

1

0

0

1

» eig(Ac)

ans =

-2.0000

0.2500

» %a) Controllable eigenvalues are {-2, 0.25}!!

» eig(Ac_bar)

ans =

0.2500

0.2500

0.2500

» %b) System is stabilizable!!

c) Design a feedback regulator

» %A is cyclic, so pick Ks:

» Ks = [1;1]

Ks =

1

1

» bs = Bc*Ks

bs =

1

1

» %check controllability of (Ac,bs):

» Ms = [bs Ac*bs]

Ms =

1.0000

-2.0000

1.0000

2.5000

» rank(Ms)

ans =

2

» %put in PV form:

» poly(Ac)

ans =

1.0000

1.7500

-0.5000

» Apv = [0 1;-ans(3) -ans(2)]

Apv =

0

1.0000

 

0.5000

-1.7500

 

» eig(Apv)

ans =

0.2500

-2.0000

» bpv =[0;1]

bpv =

0

1

» Mpv = [bpv Apv*bpv];

» poly_desired = poly([.1,.1])

poly_desired =

1.0000

-0.2000

0.0100

» Kpv = [poly_desired(3)+Apv(2,1) poly_desired(2)+Apv(2,2)]

Kpv =

0.5100

-1.9500

 

» Tpv_inverse = Mpv*inv(Ms)

Tpv_inverse =

-0.2222

0.2222

 

0.9444

0.0556

 

» Kc = Ks*Kpv*Tpv_inverse

Kc =

-1.9550

0.0050

 

-1.9550

0.0050

 

» eig(Ac-Bc*Kc)

ans =

0.1000

0.1000

» K = [Kc [0 0 0;0 0 0]]*inv(Tccf)

K =

-5.8900

-1.9550

0

0

0

-5.8900

-1.9550

0

0

0

» eig(A-B*K)

ans =

0.2500

0.1000

0.1000

0.2500

0.2500

» %settling time depends on eigenvalue closest to the unit circle:

» T=1/100;

d)

» ts = -4/((1/T)*log(.25))

ts =

0.0289

e)

» y_ref = [6;-4]

y_ref =

6

-4

» inv([[C(1:2,:) [0 0;0 0]];[A-eye(5,5) B]])*[1 0;0 1;0 0;0 0;0 0;0 0;0 0]

ans =

0.4000

-0.2000

-0.2000

0.6000

-0.8000

0.4000

0.4000

-0.2000

0.4000

-0.2000

3.0000

0.0000

-3.7500

0.7500

» Nx = ans(1:5,:)

Nx =

0.4000

-0.2000

-0.2000

0.6000

-0.8000

0.4000

0.4000

-0.2000

0.4000

-0.2000

» Nu = ans(6:7,:)

Nu =

3.0000

0.0000

-3.7500

0.7500

f)

g)

» t = [0:.01:2];

» a=A-B*K;

» u=[(Nu+K*Nx)*y_ref*ones(1,length(t))]';

» [y,x]=dlsim(a,B,C,0,u);

» u0=[(0+K*Nx)*y_ref*ones(1,length(t))]';

» [y0,x0]=dlsim(a,B,C,0,u0);

» figure(1)

» plot(t,y(:,1:2))

» grid

» title('1h) Plot of y1 and y2.')

» xlabel('Time (sec.)')

» ylabel('Output')

» figure(2)

» plot(t,y0(:,1:2))

» grid

» title('1i) Plot of y1 and y2, Nu=0')

» xlabel('Time (sec.)')

» ylabel('Output')

h) zero steady state error, ts is about .05 seconds

i) For Nu = 0: