0% found this document useful (0 votes)
71 views12 pages

ECE382 s04 Hw3soln

This document provides solutions to homework problems 3.14, 3.18, and 3.26 from an ECE/ME course. Problem 3.14 derives the state space representation of a system from its transfer function. Problem 3.18 finds the transfer function of a given state space system. Problem 3.26 determines the state transition matrix Φ(s) and Φ(t) for a system.

Uploaded by

minyahil negash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views12 pages

ECE382 s04 Hw3soln

This document provides solutions to homework problems 3.14, 3.18, and 3.26 from an ECE/ME course. Problem 3.14 derives the state space representation of a system from its transfer function. Problem 3.18 finds the transfer function of a given state space system. Problem 3.26 determines the state transition matrix Φ(s) and Φ(t) for a system.

Uploaded by

minyahil negash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 1

Solution to HW3
P3.14 Find a state space representation of the system given by
Y (s) s2 + 7s + 2
= 3 . (1)
R(s) s + 9s2 + 26s + 24
Following the method of the notes from lecture 5 (after correcting a couple of typos in
the notes, sorry) we proceed as follows. Inverse Laplace transforming, the given transfer
function corresponds to the differential equation
y (3) + 9ÿ + 26ẏ + 24y = r̈ + 7ṙ + 2r (2)
so we have coefficients a1 = 0, a2 = 26, a3 = 24, b0 = 0, b1 = 1, b2 = 7, and b3 = 2. We
then have
x1 = y (3)
x2 = x˙1 + 9y − r (4)
x3 = x˙2 + 26y − 7r (5)
ẋ3 = −24y + 2r (6)
which we can rearrange, (substituting x 1 for y in the second through fourth of these
equations) to obtain
   
−9 1 0 −1
ẋ =  −26 0 1  x +  −7  r (7)
   
−24 0 0 2
y = [1 0 0]x. (8)
Since the state space representation is not unique, your answer may differ if you used a
different method to obtain it.
P3.18 Find the transfer function G(s) = Y (s)/X(s) for the system
   
1 1 −1 0
ẋ =  4 3 0 x +  0 u (9)
   
−2 1 10 1
y = [20 30 10]x. (10)
As discussed in section 3.6, pp. 136–138, the transfer function is given by
G(s) = C (sI − A)−1 B
so since, using the formula for the inverse or a mathematical software package we have
 
s2 − 13s + 30 s − 11 −(s − 3)
1  2
(sI − A)−1 = 4(s − 10) s − 11s + 8 −4 , (11)

∆(s)

−2(s − 5) (s − 3) s2 − 4s − 1
where ∆ = s3 − 14s + 37s + 20, we find
10 s2 − 6s − 7

G(s) = 3 . (12)
s − 14s + 37s + 20
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 2

P3.26 For the system given by " # " #


−1 0 0
ẋ = x+ (13)
2 −3 1
determine Φ(s) and Φ(t).
Solution: First we calculate Φ(s) from

Φ(s) = (sI − A)−1 (14)

to be " #
1 s+3 0
Φ(s) = . (15)
(s + 1)(s + 3) 2 s+1

Then, as explained in section 3.7, pp. 138–142, we find

Φ(t) = L−1 {Φ(s)} . (16)

Three of the elements of Φ(t) are apparent by inspection. To find the (2,1) element
requires the use of the partial fraction expansion to determine that 2/(s 2 + 4s + 3) =
1/(s + 1) − 1/(s + 3). The answer is then
" #
e−t 0
Φ(t) = . (17)
e − e−3t e−3t
−t

AP3.1 For the system shown in Figure AP3.1 on p. 169 of the text, find the matrix differential
equation and the transfer function X(s)/V (s). The state variable to be used is z =
[x ẋ i]T . We are instructed to use a Taylor series approximation for the magnetic force
f.
Solution: A force balance on the ball yields

ẍ = g − f /m. (18)

An analysis of the electromagnet circuit (a voltage source across a resistor in series with
an inductor) yields
v = Ldi1 /dt + i1 R. (19)
We are given that the current is i1 = I0 + i where I0 is a fixed operating point. I0 being
fixed, di1 /dt = di/dt.
We linearize f , as described in section 2.3 pp. 38-40. Given
!2 2
i1 I0 + i

f =k =k (20)
xg X0 + x

we use (2.11), p. 40, to find an approximation near the operating point x 0 = [X0 0 I0 ]T ,
namely
∂f ∂f
f (x) ≈ f0 + (i1 − I0 ) + (xg − X0 ) (21)

∂i1 x = x0 ∂xg x = x0
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 3

where f0 = f (x0 ) is the force required to counteract the gravitational force. We find

∂f 2k(I0 + i)
= (22)
∂i1 (X0 + x)2

and
∂f −2k(I0 + i)2
= (23)
∂xg (X0 + x)3
at the operating point we have

∂f 2kI0
(i1 − I0 ) = i (24)

∂i1 x = x 0 (X0 )2

and
∂f −2kI02
(xg − X0 ) = x. (25)

∂xg x = x 0 (X0 )3

Now we can write the linearized matrix equations

ż = Az + Bu.

The input variable is the voltage v applied to the electromagnet, so combining equations
(18), (19), (24), and (25) we have
 
0 1 0
 2kI02 
A=
 mX03
0 −2kI0
mX02

 (26)
0 0 −R/L

and B = [0 0 1/L]T .
We are interested in the transfer function from v to x so we apply the method of section
3.6, pp. 136-138 with C = [1 0 0] to select the position x as our system output. The
transfer function will then be

G(s) = C(sI − A)−1 B.

Let’s define variables a, b, and c, so that we can write


 
s −1 0
sI − A =  a 0 b . (27)
 
0 0 s+c

Then using formula (E.37) or any other method that has been verified to work (Matlab
gave me the wrong answer so I used Maple) we obtain
s 1
 −b

s2 +a s2 +a s3 +cs2 +as+c
s
(sI − A)−1 =  −a −bs
. (28)
 
s2 +a s2 +a s3 +cs2 +as+c
1
0 0 s+c
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 4

Substituting into the expression for G(s) we obtain


s 1
  
s2 +a s2 +a
−b
s3 +cs2 +as+c 0
s −b/L
G(s) = [1 0 0]  −a −bs
 0  = (29)
  
s2 +a s2 +a s3 +cs2 +as+c s3 + cs2 + as + c
1 1
0 0 s+c L

which upon substituting values into the expressions for a, b, c, and L, yields
−36.38
G(s) = . (30)
s3 + 45.67s2 − 4493s + 45.67
DP3.2 A system has the state variable matrix equation
" # " #
0 1 0
ẋ = x+ u(t) (31)
−a −b d

with y = 10x1 . Determine a, b, and d so that a coordinate transform yields the diagonalized
system " # " #
−3 0 1
ż = x+ u(t) (32)
0 −1 1
with y = [−5 5]z.
Solution: This problem is quite easy if addressed as discussed below and quite difficult
otherwise. We will use the formula

G(s) = C(sI − A)−1 B

to obtain transfer functions for each of the two representations of the state space system
and equate the transfer functions. Let’s define matrix variables A i , Bi , and Ci , so that
our first representation is ẋ = A1 x + B1 u and y1 = C1 x, and the second is ż = A2 z + B2 u
and y2 = C2 z. Now
" #" #
s+b 1
s2 +bs+a s2 +bs+a 0 10d
G1 (s) = C1 (sI − A1 )−1 B1 = [10 0] s = (33)
−a
s2 +bs+a s2 +bs+a
d s2 + bs + a
and " #" #
1
s+3 0 1 20
G2 (s) = C2 (sI − A2 )−1 B2 = [−5 5] 1 = . (34)
0 s+1 1 s2 + 4s + 3
Accordingly, a = 3, b = 4, and d = 2.
DP3.3 Consider the aircraft arresting gear used on aircraft carriers, which is shown in Figure
DP3.3, p. 170. Select the constant K D to halt the airplane within 30 m after engaging
the arresting cable with landing speed 60 m/s
Solution: We assume no deviation of the aircraft heading so that the forces on the cables
will be symmetric. The equations of motion are then obtained from force balances on the
three masses:

0 = m3 ẍ3 + KD ẋ3 + K2 (x3 − x2 ) (35)


0 = m2 ẍ2 + K2 (x2 − x3 ) + K1 (x2 − x1 ) (36)
0 = m1 ẍ1 + 2 sin(tan −1
(x1/h))K2 (x1 − x2 ) (37)
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 5

with initial conditions x1 (0) = x2 (0) = x3 (0) = 0, and ẋ2 (0) = ẋ3 (0) = 0 and ẋ1 (0) = 60.
Using the approaches we have learned so far, we can try to obtain a rough approximation
of the system behavior by linearizing about x = [30 0 0 0 0 0] T . This is unlikely
to yield a good approximation for two reasons.
√ First, since it can be seen that the value
of sin(tan (x1/h)) varies from zero to 2/ 2 as x1 goes from zero to 30, i.e. we are not
−1

studying system behavior only near the operating point. Second, these equations imply
that the cable attaching the airplane to the arresting system are rigid, i.e. that they could
push the airplane forward as well as pulling it back. This is also not the case.
Ignoring these detail, for the moment, let’s continue, for the sake of reinforcing the tech-
niques we’ve learned.
The state space representation requires 6 states. We’ll use state vector
x = [x1 ẋ1 x2 ẋ2 x3 ẋ3 ]T .
The state-space representation is then
0 1 0 0 0 0
 
 −2k2
√ 0 √2k2 0 0 0 
 2m1 2m1 
0 0 0 0 1 0
 
 
ẋ =  k1 −(k1 +k2 ) k2
x (38)

 m2 0 m2 0 m2 0 

0 0 0 0 0 1
 
 
k2
0 0 m3 0 −k2
m3
−KD
m3
y = [1 0 0 0 0 0 0] x. (39)
We compute the ZIR to the initial condition x = [0 60 0 0 0 0] T using (3.24), p. 125,
and y = [1 0 0 0 0 0 0] x. We can try various values of k D (using Matlab) to attempt
to obtain a satisfactory response. (I did not, in fact, find one. I think that the linearization
approach is a poor one for this problem.)
MP3.4 We are given the system
   
0 1 0 0
ẋ =  0 0 1 x +  0 u (40)
   
−3 −2 −5 1
y = [1 0 0] x (41)
and asked to find the transfer function, plot the ZIR to the initial condition x(0) =
[0 − 1 1]T over the time interval [0,10], then compute the state transition matrix and use
it to compute the same ZIR and compare the results.
Solution: Since the system is of order 3, we can compute the transfer function analytically
in order to verify that we have obtained the correct answer from Matlab. We find that
  −1  
0 s −1 0 0
1
G(s) = [1 0 0]  0   0 s −1   0 = 3 (42)
    
2
s + 5s + 2s + 3
1 3 2 s+5 1
We obtain the required plot and determine that the value of the ZIR at t = 10 is x =
[−0.2545 0.0418 0.1500] regardless of which method we use to compute it, as shown in
the following Matlab session transcript.
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 6

>> A = [0 1 0; 0 0 1; -3 -2 -5]; B = [0 0 1]’; C = [1 0 0];


>> D = 0;
>> sys = ss(A,B,C,D);
>> stf = tf(sys)

Transfer function:
1
---------------------
s^3 + 5 s^2 + 2 s + 3

>> x0 = [0 -1 1]’;
>> t = [0:0.1:10]’;
>> u = 0*t;
>> [y,t,x] = lsim(sys,u,t,x0);
>> plot(t,x(:,1),t,x(:,2),’:’,t,x(:,3),’-’);
>> xlabel(’Time (s)’); ylabel(’x(t)’),grid
>> xlabel(’Time (s)’); ylabel(’x(t)’); grid
>> legend(’x_1(t)’,’x_2(t)’,’x_3(t)’);
>> title(’ZIR for MP3.4’)
>>
>> delta_t = 10;
>> Phi = expm(A*delta_t)

Phi =

0.0853 0.3183 0.0637


-0.1911 -0.0421 -0.0003
0.0010 -0.1905 -0.0405

>> xf = Phi*x0

xf =

-0.2545
0.0418
0.1500

>> size(x)

ans =

101 3

>> x(101,:)

ans =
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 7

-0.2545 0.0418 0.1500

Here’s the plot.

ZIR for MP3.4


1
x1(t)
x (t)
2
0.8 x3(t)

0.6

0.4

0.2
x(t)

−0.2

−0.4

−0.6

−0.8

−1
0 1 2 3 4 5 6 7 8 9 10
Time (s)

MP3.6 Use Matlab to determine the state space representation of the closed-loop control
system shown in Figure MP3.6, p. 172, then determine the state-space representation of
the closed-loop system and plot its impulse response.
Solution First, we determine the state-space representations analytically so that we can
check our work. For the controller, the transfer function X(s)/U (s) = 1/(s + 2) yields
(s + 2)X(s) = U (s), so the differential equation is ẋ + 2x = u, so in the state space
representation we have A = 2, B = 1, C = 1, and D = 0. Similarly, for the plant,
(x2 + 2s + 4)X(s) = U (s) corresponds to ẍ + 2ẋ + 4x = u. Letting x 1 = x and x2 = ẋ, we
then have ẋ2 + 2x2 + 4x1 = u so the state-space representation is
" # " #
0 1 0
ẋ = x+ u. (43)
−4 −2 1
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 8

(If you used a different method to obtain the state-space representation, you may have
obtained a different result. As noted in the text and lecture, the state-space representation
is not unique. In particular, we will find that Matlab returns a different representation.)
We can similarly determine the state-space representation of the closed-loop system by
applying appropriate block diagram transformations to determine that the closed-loop
transfer function is
1
(s+2)(s2 +2s+4) 1
G(s) = = (44)
1 + (s+2)(s21+2s+4) s3 + 4s2 + 8s + 9

and letting x1 = x, x2 = ẋ, and x3 = ẍ, we then have


   
0 1 0 0
ẋ =  0 0 1 x +  0 u (45)
   
−4 −8 −8 1
h i
y = 1 0 0 x (46)

Now using Matlab (see transcript below) we determine that the state space representa-
tions of the plant and controller and the closed-loop system. Notice that the closed-loop
transfer function matches that calculated above. The difference between the state-space
representations can be attributed to the choice of the state vector. Note that the C
matrices differ, indicating that the orders in which the states appear in the state vector
differs.

>> numc = 1; denc = [1 2]; nump = 1; denp = [1 2 4];


>> sysc = tf(numc,denc)

Transfer function:
1
-----
s + 2

>> sysp = tf(nump,denp)

Transfer function:
1
-------------
s^2 + 2 s + 4

>> ss_sysc = ss(sysc)

a =
x1
x1 -2
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 9

b =
u1
x1 1

c =
x1
y1 1

d =
u1
y1 0

Continuous-time model.
>> ss_sysp = ss(sysp)

a =
x1 x2
x1 -2 -1
x2 4 0

b =
u1
x1 0.5
x2 0

c =
x1 x2
y1 0 0.5

d =
u1
y1 0

Continuous-time model.
>> sys = series(ss_sysc,ss_sysp)

a =
x1 x2 x3
x1 -2 -1 0.5
x2 4 0 0
x3 0 0 -2
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 10

b =
u1
x1 0
x2 0
x3 1

c =
x1 x2 x3
y1 0 0.5 0

d =
u1
y1 0

Continuous-time model.
>> clsys = feedback(sys,1)

a =
x1 x2 x3
x1 -2 -1 0.5
x2 4 0 0
x3 0 -0.5 -2

b =
u1
x1 0
x2 0
x3 1

c =
x1 x2 x3
y1 0 0.5 0

d =
u1
y1 0

Continuous-time model.
>> systf = tf(clsys)
ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 11

Transfer function:
1
---------------------
s^3 + 4 s^2 + 8 s + 9
>> clf % clear current figure
>> impulse(clsys)

MP3.7 Plot the step response for the following system


" # " #
0 1 0
ẋ = x+ u (47)
−2 −3 1
y = [1 0] x (48)

with initial condition x0 = [1 0]T .


Solution: The transcript of the Matlab session follows.

>> A = [0 1; -2 -3]; B = [0; 1]; C = [1 0]; D=0;


>> sys = ss(A,B,C,D);
>> x0 = [1;0];
>> t = [0:.01:10]; u = 0*t;
>> [y,t,x] = lsim(sys,u,t,x0);
>> plot(t,x(:,1),’:’,t,x(:,2),’-’)
>> legend(’x_1(t)’,’x_2(t)’);
>> title(’Step Response for MP3.7’)
>> xlabel(’Time (s)’); ylabel(’x(t)’);
>> grid
>> print -deps mp3_7.eps

Here’s the plot of the step response.


ECE382/ME482 Spring 2004 Homework 3 Solution February 5, 2004 12

Step Response for MP3.7


1
x (t)
1
x2(t)

0.5
x(t)

−0.5
0 1 2 3 4 5 6 7 8 9 10
Time (s)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy