EE422

Solution to Homework #11

 

1a) Take Laplace transform of state and output equations, and solve for Y(s)/W(s)!! Remember, the initial conditions are always zero for transfer functions:

So, for our problem:

 

 

We can check this result on Matlab:

» a=[-2 -4;-4 -2]

a =

-2 -4

-4 -2

 

» b=[0;2]

b =

0

2

 

» c=[1 0]

c =

1 0

 

» d=0

d =

0

 

» [num,den]=ss2tf(a,b,c,d,1)

num =

0 0.0000 -8.0000

 

 

den =

1.0000 4.0000 -12.0000

 

Our answer is correct!!

 

1b)

 

Check Answers on Matlab:

 

» a=[-2 -4;-4 -2]

 

a =

 

-2 -4

-4 -2

 

» [P,S]=eig(a)

 

P =

 

-0.7071 -0.7071

0.7071 -0.7071

 

 

S =

 

2.0000 0

0 -6.0000

 

» sqrt(2)*P

 

ans =

 

-1 -1

1 -1

 

» -1*ans

 

ans =

 

1 1

-1 1

These are the same eigenvalues and eigenvectors that we found analytically.

 

 

1c ) Unstable because s2 = 2 is in the RHP!!

1d) ,

Letting k=0,1,2, and 3 we find:

From Matlab:

» a=[-2 -4;-4 -2]

 

a =

 

-2 -4

-4 -2

 

» a^0

 

ans =

 

1 0

0 1

 

» a^1

 

ans =

 

-2 -4

-4 -2

 

 

»

» a^2

 

ans =

 

20 16

16 20

 

» a^3

 

ans =

 

-104 -112

-112 -104

 

The Same Answers!!!

 

e) Now find eAt = PeStP-1

f) Next, in the state model let w=0 solve for x(t)= eAtx(0).

2a) Check your answer to 1f) by using Laplace transforms to solve for x(t)

(Same Answer!!)

 

b) Use Matlab's eig() function to find the eigenvalues and eigenvectors for the following 4th-order circuit model:

 

 

» A=[-3 -1 -1 0;-2 -1 2 4;-1 1 -2 1;2 -3 -3 -7]

 

A =

 

-3 -1 -1 0

-2 -1 2 4

-1 1 -2 1

2 -3 -3 -7

 

» eig(A)

 

ans =

 

-2.0000

-4.0000 + 1.0000i

-4.0000 - 1.0000i

-3.0000

 

» [P,S]=eig(A)

 

P =

 

-0.5774 0.0987 + 0.4902i 0.0987 - 0.4902i 0.0000

0.0000 0.5888 + 0.3915i 0.5888 - 0.3915i 0.7071

0.5774 0.0000 + 0.0000i 0.0000 - 0.0000i -0.7071

-0.5774 -0.4902 + 0.0987i -0.4902 - 0.0987i 0.0000

 

 

S =

 

-2.0000 0 0 0

0 -4.0000 + 1.0000i 0 0

0 0 -4.0000 - 1.0000i 0

0 0 0 -3.0000

 

 

c) Recall that we defined settling time for a system modelled by a transfer function as, ts = -4/Re[pi]max where Re[pi]max is the real part of the transfer function pole closest to the jw axis. Let us define settling time for a state variable model as ts = -4/Re[si]max where Re[si]max is the real part of the eigenvalue closest to the jw -axis. What is the settling time for the system in 2b)?

 

ts = -4/Re[pi]max = -4/(-2) = 2 seconds

 

d) If eigenvalues are analogous to transfer function poles, would you say that the system in part 2b) is asymptotically stable, marginally stable, or unstable?

 

All eigenvalues are in the LHP, therefore the system is asymptotically stable.

 

e) Use Matlab's expm() function to find eAt for t=0,1,2,3, and 4 seconds. Does the system seem stable?

 

» t=0

 

t =

 

0

 

» expm(A*t)

 

ans =

 

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

 

» t=1

 

t =

 

1

 

» expm(A*t)

 

ans =

 

0.1199 -0.1100 -0.1100 -0.0946

-0.0553 0.0806 0.0308 0.0861

-0.0855 0.0855 0.1353 0.0855

0.1254 -0.1409 -0.1409 -0.1310

 

» t=2

 

t =

 

2

 

» expm(A*t)

 

ans =

 

0.0180 -0.0182 -0.0182 -0.0178

-0.0029 0.0031 0.0006 0.0035

-0.0158 0.0158 0.0183 0.0158

0.0185 -0.0188 -0.0188 -0.0189

 

» t=3

 

t =

 

3

 

» expm(A*t)

 

ans =

 

0.0025 -0.0025 -0.0025 -0.0025

-0.0001 0.0001 0.0000 0.0001

-0.0024 0.0024 0.0025 0.0024

0.0025 -0.0025 -0.0025 -0.0025

 

» t=4

 

t =

 

4

 

» expm(A*t)

 

ans =

 

1.0e-003 *

 

0.3355 -0.3356 -0.3356 -0.3357

-0.0061 0.0060 -0.0002 0.0060

-0.3293 0.3293 0.3355 0.3293

0.3355 -0.3355 -0.3355 -0.3355

 

»

 

Yes, the system seems to be stable as eAt is going to zero as t becomes large

 

f) Again use Matlab to find x(t) at t=0,1,2,3, and 4 seconds (hint: x at t seconds is expm(A*t)*x0 where x0 is the initial state). Has x(t) "settled" by the settling time?

 

 

» x0=[1;2;3;4]

 

x0 =

 

1

2

3

4

 

» t=0

 

t =

 

0

 

» x_0=expm(A*t)*x0

 

x_0 =

 

1

2

3

4

 

» t=1

 

t =

 

1

 

» x_1=expm(A*t)*x0

 

x_1 =

 

-0.8087

0.5429

0.8337

-1.1026

 

» t=2

 

t =

 

2

 

» x_2=expm(A*t)*x0

 

x_2 =

 

-0.1441

0.0192

0.1341

-0.1509

 

» t=3

 

t =

 

3

 

» x_3=expm(A*t)*x0

 

x_3 =

 

-0.0199

0.0007

0.0192

-0.0199

 

» t=4

 

t =

 

4

 

» x_4=expm(A*t)*x0

 

x_4 =

 

-0.0027

0.0000

0.0027

-0.0027

 

»

 

The states have not truly settled by t=2 seconds. That is, they are not all within 2% of their initial values. We will see why in a few days. Stay tuned!!