Chapter 2 Solutions 2.1 Derive the discrete-time discrete-time model of Example Example 2.1 from the solution solution of the system differential differential equation with initial time kT and and final time(k time( k +1)T +1)T. he volumetric fluid !alance "ives the analo" mathematical model
d h d t
h
qi C
where # R # R C is the fluid time constant constant for the tan$. he solution of this this equation is ( t t % ) & h(t ) e h(t % )
1
C
t
t %
e (t
) &
qi ( )d
'et qi !e constant over each samplin" period T i.e. qi(t ) # qi(k ) # constant for t in in the interval kT, (k +1)T +1)T ). ). hen (i)
'et t % # kT t # # (k (k + + 1)T 1)T
(ii) *implify *implify the inte"ral inte"ral as follows follows with + (k 1)T
1
C
( k 1)T
kT
C 1 e C
1
e ( k 1)T , & qi (kT )d
( k 1) T
kT %
&
T
C
e
1 e
( k 1)T , &
d q i (kT )
( d ) q i ( kT )
T &
q
i
d + d
T %
kT
(k 1)T
( kT )
e thus reduce the differential equation to the difference equation
h(k 1) e T & h( k ) R 1 e T & qi (k ) 2.2 or each of the followin" equation equation determine determine the order of the the equation then test it for (i) 'inearity. (ii) i ime-invariance. (iii) /omo"eneousness. (a) (!) (c) (d) (e)
y($+2) # y # y((k +1) y +1) y((k ) + u(k ) y(k +0) +0) + 2 y 2 y((k ) # % y(k +) +) + y + y((k -1) -1) # u(k ) y(k +) +) # y # y((k +) +) + u(k +1) +1) u(k ) y($+2) # y # y((k ) u(k )
he results are summari3ed !elow 4ro!lem (a) (!) (c) (d)
5rder 2 0
'inear 6o 7es 7es 7es
1
ime-invariant 7es 7es 7es 7es
/omo"eneous 6o 7es 6o 6o
(e)
2
6o
7es
6o
2.0 ind the transforms of the followin" followin" sequences usin" Definition Definition 2.1 (a) 8% 1 2 % %...9 (!) 8% % % 1 1 1 % % %...9 %. %. (c) 8% 2 1 2 % % % ... 9
rom Definition 2.1 8 8u u% u1 u2 ... uk ... 9 transforms to U ( z ) uk z k . /ence k %
Z %12%%... z 1 2 z 2 z 0
(a)
(!)
Z %%%111%%... z 0 z z
Z %2 %. 12 %. %%... 2 %. z 1 z 2 2 %. z 0
(c)
2. 5!tain closed forms forms of the transforms transforms of 4ro!lem 4ro!lem 2.0 usin" usin" the ta!le of 3-transforms and and the time delay property. Each sequence can !e written in terms of transforms of standard functions (a)
8% 1 1 2 %% %%.. ...9 .9 # 8% 8% 1 2 : 1;.. 1;...9 .9 8% % % % : 1;...9#8f($)9 8"($)9
2 k 1 where f ( k ) %
: 2 k k " (k ) k %
k % k %
Z %12%%... z
z
1
(!)
z 2
z
z : 0
: z z 2
z ( z 2) 0
8% % % 1 1 1 1 % %...9 %...9 # 8% 8% % % 1 1 1 1 1 1...9 1...9 8% % % % % % 1 1 1 1...9 # 8f($)9 8"($)9 k 0
1 where f (k ) %
k ;
1 "(k ) %
k 0
Z %%%111%%... z
0
z
k ;
;
z 1
z
z z 1
z 0 1 z ( z 1)
(c) 8%2-%.12-%.%%...9 # 8%2 -%.12-%.%-2-%.-1-2-%.%...9+ 8%%%%2 -%.12-%.%-2-%.-1-2-%.%...9 # 8f($)9 + 8"($)9
sin(k )
k %
%
k %
where f (k )
Z %2
%.
12
%.
%%%...
sin( k ) " ( k ) %
sin( ) z z 2 2 cos( ) z 1
2
z
k k
sin( ) z z 2 2 cos( ) z 1
2
%.
z
1
z 0 z 2 2%. z
2. 4rove the linearity and time delay properties of the 3-transform from !asic principles. o prove linearity we must prove homo"eneity and additivity usin" Definition 2.1 (i)
Z f (k ) Z f (k )
/omo"eneity
Z f (%) f (1) f ( 2)... f (i )... f (%) f (1) z 1 f (2) z 2 ... f (i ) z i ... Z
(ii)
f (i) z i %
f (%) f (1) f (2)... f (i )... f (%) f (1) z 1 f (2) z 2 ... f (i ) z i ...
Z f (k ) "(k ) Z f (k ) Z "(k )
Z f ( k ) " (k ) Z f (%) " (%) f (1) " (1) f ( 2) " ( 2)... f (i ) " (i )...
f ( %) " ( %) f (1) " (1) z 1 f ( 2) " ( 2) z 2 ... f (i ) " (i ) z i ...
f (i ) z " (i ) z i Z f ( k ) Z " ( k ) i
i %
i%
o prove the time delay property we write the transform of the delayed sequence
Z % f (%) f (1) f ( 2)... f (i )... f (%) z 1 f (1) z 2 f ( 2) z 0 ... f (i ) z i 1 ...
z
1
f (i ) z i %
i
z 1 Z f ( k )
2.; =se the linearity of the 3-transform and the transform of the exponential function to o!tain the transforms of the discrete-time functions. ) ) (a) sin(k wT (!) cos(k wT
(a)
i
e jk wT e jk w T sin( k w T ) 2 j
1
e jk T Z e jk T Z sin(k w T ) Z w
w
j2
1 z z j T j T j2 z e z e 1 e j T e j T z sin(w T z) 2 j T j T 2 j2 z e e z 1 z 2cos(w T z) 1 w
w
w
w
w
w
0
e
(!) cos(k w T )
1
jk w T
e jk w T 2
e jk T Z e jk T Z cos(k w T ) Z w
w
2
1 z z j T j T 2 z e z e w
w
2 z e e z 1 z 2cos( T z) 1 2 2 j T j T 1 z2 e e z z cos(w T z) w
w
2 jw T j w T
2
w
2.> =se the multiplication !y exponential property to o!tain the transforms of the discrete-time functions. ) ) (a) ekT sin(k wT (!) ekT cos(k wT he multiplication !y exponential property with a k e T
k
e kT "ives
Z e kT f ( k ) F (e T z ) (a)
Z e
kT
Z e
kT
sin (k w T )
sin (w T ) e
e
T
z
T
z
2cos(w T ) e T z 1
2
sin (w T )e
T
z
z 2 2cos(w T )e T z e 2 T
(!)
cos( k w T )
e e
T
z
T
cos(w T ) e T z
2cos(w T ) e T z 1
2
z
2
2 z cos(w T )e 2 z 2cos(w T )e
2.: ind the inverse transforms of the followin" functions usin" Definition 2.1 and if necessary lon" division F ( z ) 1 0 z 1 z 2 F ( z ) z 1 z (a) (!) (c)
F ( z )
z
F ( z )
(d)
z %.0 z %.%2 2
z %.1 2 z %.% z %.2
=se Definition 2.1 to o!tain (a)
Z 1 0 z 1 z 2 810 %%%..9 (!) Z z 1 z 8%% %%%%..9 1
2
(c)
z
% .0
z
z z z
2
% .0
% .%2
% .%>
0
......
z z z z z z z z
% .0
% .0
% .0
% .%2
% .% 2
% .%?
% .%>
1
1
1
1
% .%% ;
% .%% ;
2
2
T
T
z
z e
2 T
z
F ( z )
z 1 %.0 z 2 %.%> z 0 .....
z %.0 z %.%2 8f ( k )9 8%1 %.0% .%> ....9 2
1
2
z
(d)
% .%
z
% .2
z z z
z z z z
% .2
z z %.% z %.2 2
1
1
% .2
% .% % ; 1
% .2
0
% .2
z
% .%
% .1
F ( z )
2
% .1
% .1
% .1
1
......
z z z % .%0
% .%0
2
2
z 1 %.1 z 2 %.2 z 0 ....
8f ( k )9 8%1 % .1 %.2....9
2.? or 4ro!lems 2.:.(c) (d) find the inverse transforms of the functions usin" partial fraction expansion and ta!le loo$-up.
F ( z )
(c)
z
1
z %.0 z %.%2 2
1 ! 1 1% z %.1 z %.2 z %.1 z %.2 1
z ! z F ( z ) 1% z %.1 z %.2
F ( z )
(d)
z
z %.1
z z %.% z %.2 2
8f ( k )9 1% %.1
%. z
k
%.2 k
%. z 1.%1; z %.% z %.2
%. z 1.%1; z
2
2
e o!tain F ( z )
Z e Z e e
k
k
%.
sin(k w d )
cos(k w d )
2 z %.% z %.2
e z 2e 2
z %.% z %.2 2
z 2e 2
sin(w d ) z cos(w d ) z e
z z e
2
cos(w d ),
cos(w d ) z e
2
cos(w d ) %. % " w d 1. ;11rad
%. 2 %.
%. z 2 1.%1; z
and use the identities
%. z 2 %.%2 z 1.%%: z
z %.% z %.2 2
8f ( k )9 %.# ( k ) %.
%. z 2 %.%2 z 2.%1: %.??; z
z %.% z %.2 2
%. cos(1.;11k ) 2.%1: sin(1.;11k ) k %.# ( k ) 2.%> %. sin(1.;11k %.1?;)
2.%>
%. 2 2.%1: 2
k
) %. & $ ( 2.%> %
%.1?; sin 1 '
sin(<+@) # sin(<) cos(@) + cos(<) sin(@) 2.1%*olve the followin" difference equations (a) y(k +1) %.: y(k ) # % (!) y(k +1) %.: y(k ) # 1(k )
y(%) # 1 y(%) # %
(c) (d)
y(k +1) %.: y(k ) # 1(k ) y(k +2) + %.> y(k +1) + %.%; y(k ) # #(k )
(a)
y(k +1) %.: y(k ) # %
y(%) # 1 y(%)#% y(1)#2
y(%) # 1
3-transform
z
zY ( z ) z %.:Y ( z ) % " Y ( z ) (!)
y(k +1) %.: y(k ) # 1(k )
f ( k ) %.: k %1 2... k
z %.:
y(%) # %
3-transform
( z %.:)Y ( z )
Y ( z ) z
z z 1
" Y ( z )
z ( z %.:)( z 1)
1 1 ( z %.:)( z 1) z 1 z %.: 1
f ( k ) 1 %.:
k
k %12...
(c) y(k +1) %.: y(k ) # 1(k )
y(%) # 1
he solution is the sum of the solutions from (a) and (!)
f ( k ) 1 %.:
k
%.: k k %12...
(d) y(k +2) + %.> y(k +1) + %.%; y(k ) # #(k ) 3-transform
y(%)#% y(1)#2
( z 2 %.> z %.%;)Y ( z ) 1 2 z " Y ( z )
Y ( z ) z
2 z 1 ( z %.1)( z %.;)
2 z 1 1;.;;> 1; %.;;> z ( z %.1)( z %.;) z z %.1 z %.;
Y ( z ) 1; .;;>
1; z % .;;> z z %.1 z % .;
y ( k ) 1;.;;># ( k ) 1; %.1
%;;> %.;
k
k
2.11ind the transfer functions correspondin" to the difference equations of 4ro!lem 2.2 with input u(k ) and output y(k ). Af no transfer function is defined explain why. (a) and (e) are nonlinear and (!) is homo"eneous. hey have no transfer functions. (c)
y(k +) + y(k 1) # u(k ) B-transform ( z z 1 )Y ( z ) U ( z )
(d)
G( z )
y(k +) # y(k +) + u(k +1) u(k ) 3-transform ( z z )Y ( z ) ( z 1)U ( z )
;
G ( z )
z z 1
z 1 z z
1 z
2.12 est the linearity with respect to the input of the systems for which you found transfer functions in 2.11. (c) y(k +) + y(k 1) # u(k ) he transfer function of the system is
G( z )
z z 1
or inputs u1(k ) and u2(k ) we have outputs
Y i ( z ) G( z )U i ( z )
z z 1
U i ( z ) i 12
e now as input try the linear com!ination
u (k ) u1 (k ) * u2 (k ) Y ( z ) G ( z )U ( z )
z
z 1 Y 1 ( z ) * Y 2 ( z )
U 1 ( z ) *
z z 1
U 2 ( z )
(d) y(k +) # y(k +) + u(k +1) u(k ) Cepeat a!ove steps usin" the transfer function of (d). 2.10 Af the rational functions of 4ro!lems 2.:.(c) (d) are transfer functions of 'A systems find the difference equation "overnin" each system.
F ( z )
(c)
z z %.0 z %.%2 2
y(k +2 + %.0 y($+1) + %.%2 y($) # u(k +1) (d)
F ( z )
z %.1 z %.% z %.2 2
y(k +2 + %.% y($+1) + %.2 y($) # u(k +1) %.1 u(k ) 2.1 e can use 3-transforms to find the sum of inte"ers raised to various powers. his is accomplished !y first reco"ni3in" that the sum is the solution of the difference equation f (k ) # f (k 1) + a($) where a(k ) is the k th term in the summation. Evaluate the followin" summations usin" 3-transforms n
(a)
k
n
(!)
k 1
k
2
k 1
(a) e consider the difference equation f (k ) # f (k 1) + k
>
B-transform
F ( z ) z F ( z )
2
z
1
z 1 2
z
z 1 0
1 z z 1
2 z 1 0
z 1 2 z
Anverse 3-transform n
n n 1
k 1
2
k
(!) e consider the difference equation f (k ) # f (k 1) + k 2 1
F ( z ) z F ( z ) z z 1
z z 1
z 1 0
2
F ( z )
z 1
z z 1
z z z 1 2
0 z 1
2 z 1
0
z ; z 1
2
n0 n2 n 1 n n 1 2n 1 k 0 2 ; ; k 1 n
2
2.1 iven the discrete-time system
fnd the impulse response o the system
:
a. From the dierence equaon b. Using z-transormaon *olution
a.
We consider the dierence equaon with the impulse input condions
and the inial
ubstung in the dierence equaon! we ha"e
An "eneral we have the impulse response
b. We #-transorm the dierence equaon to obtain the transer uncon
:
Anverse 3-transformin" "ives the impulse response
he a!ove form is identical to the one o!tained in part (a) as can !e verified !y su!stitutin" values of . 2.1; he followin" identity provides a recursion for the cosine function inte"er o verify its validity let
and rewrite the expression as a difference equation. *how
that the solution of the difference equation is indeed
.
*olutions e write the difference equation correspondin" to the identity or equivalently
e 3-transform to o!tain then solve for
*u!stitutin" for the initial conditions
"ives
rom
Cepeat 4ro!lem 2.1; for the identity inte"er *olutions e write the difference equation correspondin" to the identity
?
*u!stitutin" for the initial conditions
"ives
rom
"ives
the same identity multiplied !y 1.
2.1: ind the impulse response functions for the systems "overned !y the followin" difference equations (a) (!) (a)
y(k +1) %. y(k ) # u(k ) y(k +2) %.1 y(k +1) + %.: y(k ) # u(k ) y(k +1) %. y(k ) # u(k )
G ( z ) (!)
1
z
z %.
(%.2) k 1 g (k ) %
z
1
z %.
k , 1 k + 1
y(k +2) %.1 y(k +1) + %.: y(k ) # u(k )
G ( z )
1
z
1
z 2 %.1 z %.:
z
z 2 %.1 z %.:
Ae sin(w d ) z z 2 2e cos(w d ) z e 2
Equatin" coefficients we solve for e and w d then use the ta!les and the delay theorem
1.12(%.:?0) k 1 sin1.1(k 1) g ( k ) k + 1 %
k , 1
2.1? ind the final value for the functions if it exists (a)
(a)
F ( z )
z 2 z 1.2 z %.2
f
F ( z ) (!)
z z 1.2 z %.2 2
z z %.0 z 2 2
F ( z )
(!)
z 1 z
z -1
z z %.0 z 2 2
z 1
z 1 z .2
z -1
1 %.:
1.2
z z 2e 2
cos(w d ) z e
2
z
z e
jw d
z e
jw d
he denominator has complex conu"ate poles with ma"nitude 2 "reater than unity. herefore the correspondin" time sequence is un!ounded and the final value theorem does not apply. 2.2% ind the steady-state response of the systems due to the sinusoidal input u(k ) # %. sin(%. k ) (a)
H ( z )
z z %.
(!)
H ( z )
1%
z z 2 %. z %.%0
u ( k ) % . sin(%. k )
*inusoidal input
(a)
z
H ( z )
z %.
H e
j %.
1
1 %. z 1
1 1 %.e
j %.
1.0>. %.22
u(k ) #%. 1.0> sin(%. k %.22) # %.>;? sin(%.k %.22) (!)
z
H ( z )
z %. z %.%0 1 j %. j %. %.>1. %.2>0 H e %. %.%0e j %. e
2
u(k ) #%. %.>1 sin(%. k %.2>0) # %.0> sin(%. k %.2>0) 2.21 ind the frequency response of a noncausal system whose impulse response sequence is "iven !y
h(k ) h(k ) h(k K ) k ... Hint: Express the periodic impulse response sequence with period K as
h (t ) F
K 1
h(l mK )# (t l mK ) l % m
hen 'aplace transform it. 'aplace transform the sequence then let s # jw
H ( s ) F
K 1
h(l mK )e
( l mK ) s
l % m
H ( jw ) F
K 1
h(l mK )e
j ( l mK )w
l % m
2.22 he well $nown *hannon reconstruction theorem states that
w s
u (t )
u(k )
sin
2
w
k
s
2
t kT
t kT
=se the convolution theorem to ustify the a!ove expression. @y the samplin" theorem the si"nal can !e recovered from its samples usin" a '4 of !andwidth w s. Gultiplication in the frequency domain is equivalent to convolution with the inverse transform the
11
sinc function in the time domain. Honvolution of the samples and the sinc function yields the expression. 2.205!tain the convolution of the two sequences 81119 and 81209 (a) Directly (!) =sin" 3-transformation. Honvolution of the two sequences 8f(k )9#81 1 19 and 8"(k )9#81 2 09 (a)
Directly
y(%) # f(%)."(%)# 11#1 y(1) # f(1)."(%) + f(%)."(1) # 1 1+12#0 y(2) # f(2)."(%) + f(1)."(1) + f(%)."(2) # 1 1+12 + 10 # ; y(0) # f(2)."(1) + f(1)."(2) # 12 + 10 # y() # f(2)."(2) # 10 # 0 y(k ) # % k I
(!)
=sin" 3-transformation ( z ) # 1 + 3 -1 + 3-2
( z ) # 1 + 23-1 + 03-2
7( z ) # ( z ).( z ) # 1+ 03-1 + ; 3-2 + 3-0 + 03- 8y(k )9 # 81 0 ; 0 % % ...9 2.25!tain the modified 3-transforms for the functions of 4ro!lems (2.;) and (2.>). or 2.;-(a)
e jk w T e jk w T
sin k w T
2 j
e jk T e jk T ! 2 j jm T jm T ! sin mw T z sin (1 m)w T 1 e e j T j T 2 j z e z e z 2 2 cosw T z 1 w
w
Zm sin( k w T ) Zm
w
w
w
w
jk w T
or 2.;-(!)
cos k w T
e
e jk w T 2
e jk w T e jk w T ! 2
Zm cos(k w T ) Zm
1 e jmw T
e jmw T !
2 z e jw T z e jw T
cos mw T z cos (1 m)w T z 2 2 cosw T z 1
or 2.>-(a)
12
Zm e
e jk T akT e jk T akT ! sin(k w T ) Zm 2 j jm T maT jm T maT ! 1 e e j T aT j T aT 2 j z e z e w
akT
w
w
w
w
e
maT
w
sin mw T z e aT sin (1 m )w T z 2 2e aT cos w T z e 2 aT
or 2.>-(!)
e jk w T akT e jk w T akT ! 2
Zm e akT cos( k w T ) Zm 1 e
jmw T maT
2 z e jw T aT
e
jmw T maT
z e
cos mw T z e
e maT
z 2e 2
aT
jw T aT
aT
!
sin (1 m)w T
cos w T z e
2 aT
2.2=sin" the modified z -transform examine the intersample !ehavior of the functions h(k ) of 4ro!lem 2.1:. =se delays of (1) %.0T (2) %. T and (0) %.:T .
*olution for 2.1:
F z z
1
z 1 z .2
or 2.1:(a)
1 1 1 %.: z 1 z %.2
1 %.2 m z 1 z %.2
F ( z m) 1.2
or any value m
1 % .2 m F ( z m) 1.2 z 1 z %.2 " F ( k m) 1.21 %.2 m %.2 k 1 k 120.... and ze!" elsehe!e (i) %.0T m # %.> (ii) %.T m # %. and (iii) %.:T, m # %.2.
F ( z ) or 2.1:(!)
F ( z ) z
0.;e z
2e
f (k ) %.>111
j
j1.;>>
2
k
z z %.0 z 2 2
z
z %.1 j1.%; z %.1 j1.%;
z
z
j1.;>>
2e
0.;e z
2e
z
j
j1.;>>
sin 1.;>>1k
=se the results of pro!lem 2.21 to o!tain the answer.
10
2e j1.;>>
Zm e
akT
sin(k w T ) e
2
Zm %.>111
k
maT
sin mw T z e z 2e 2
aT
aT
sin (1 m)w T
cos w T z e
2
sin1.;>>1k %.>111
m
2 aT
sin 1.;>>1m z
2 sin1.;>>1(1 m)
2 z %.0 z 2
2 2 cos1.;>>1 %.0
(i)
m # %.>
f (k %.>) %.>111
(ii)
2
%.>
%.>
sin 1.1>% z
%.>111 2
%.>
z 2 %.0 z 2 %.?220 z %.;:1?
2
k 1
z 2 %.0 z 2
sin1.;>>1 k 1 1.1>% k 120.... and ze!" elsehe!e
m # %. *imilarly
2
%.
%.>111 2
%.
F ( z %.) %.>111
f ( k %.>) %.>111
(iii)
2
% .
2
2 sin %.%01
2
F ( z %.>) %.>111
k 1
sin %.:0:; z
2
z 2 %.0 z 2
%.:: z
2
z 2 %.0 z 2
sin1.;>>1 k 1 %.:0:; k 120.... and ze!" elsehe!e
m # %.2
2
%.2
sin %.00 z
%.>111 2
%.2
z 2 %.0 z 2 %.02: z 1.>;2
F ( z %.2) %.>111
f ( k %.>) %.>111
2
2 sin %.%:0?
z 2 %.0 z 2
%.2
2
k 1
sin1.;>>1 k 1 %.00 k 120.... and ze!" elsehe!e
*olution for 2.1? 2.1?(a)
H ( z m)
%. m z %. (iv)
H ( z %.>)
% .
m # %.>
%.>
z %.
" h(k %.>) %.
%.>
%. k 1 k 120.... and ze!" elsehe!e
(v)
H ( z %.)
% .
%.
z %.
m # %.
" h( k %.) %. %. %. k 1 k 120.... and ze!" elsehe!e (iii) m # %.2
H ( z %.2) 2.1?(!)
%.
%.2
z %.
H ( z )
" h(k %.2) %. %.2 %. k 1 k 120.... and ze!" elsehe!e z
z 2 %. z %.%0
z
z
z %.1 z %.0
1
%.1 m %.0 m H ( z m) z z %.0 % . 1 " h( k m ) %.1 m %.1 k 1
! %.0 m %.0 k 1 k 120....
and ze!" elsehe!e (%.1) and (%.0)m are complex num!ers. hus the sequence is not defined !etween samplin" points. m
5!tain H ( z m) for m # %.> %. %.2 as in (a). 2.2;he followin" open-loop systems are to !e di"itally feed!ac$ controlled. *elect a suita!le samplin" period for each if the closed-loop system is to !e desi"ned for the "iven specifications (a)
G"l ( s)
(!)
G"l ( s)
1
ime Honstant # %.1 s
s 0 1
=ndamped natural frequency # rad&s Dampin" ratio # %.>
s s 0 2
(a)
or a time constant # %.1 s let T # %.1&% # %.%%2 s
(!)
or w n # rad&s / # %.> we have w d # 0.> rad&s
T
2 w s
2 %.%2 s 'et T # 2 ms. >%w d
2.2>Cepeat pro!lem 2.2; if the systems have sensor delays of (a) %.%2 s (a)
T # %.%2 s
(!)
(!) %.%0 s
T # %.%0 s. (cannot sample faster than the sensor delay)
Computer Exercises 2.2:Honsider the closed-loop system of 4ro!lem 2.2;(a) a. !. c. d.
ind the impulse response of the closed-loop transfer function and o!tain the impulse response sequence for a sampled system output. 5!tain the 3-transfer function !y 3-transformin" the impulse response sequence. =sin" G<'<@ o!tain the frequency response plots for the analo" system and for samplin" frequencies w s # k w # k # 0 >%. Homment on the choices of samplin" periods of part (!).
he closed-loop transfer function is G ( s )
1 1% %.1 s 1 s 1%
(a) he impulse response is g (t ) 1% e 1% t
and the impulse response sequence for a sampled system output is
(!) he 3-transform of the impulse response is
G ( z )
1% z z e 1%T
1
g ( kT ) 1% e 1% kT
(c) he correspondin" frequency response plots for samplin" periods T # %.1 %.% %.%2 %.1 s as well as for the analo" system can !e o!tained usin" the G<'<@ commands
% Exercise 2.22 Digital control text clf tau=0.1;% 1/wb=time constant T=tau*1/!" 1/#!" 1/$0; num=10"0; w=.1&.0!&100; for i=1 'en=1"(ex)(10*Ti++; g=tfnum"'en" Ti++; mag"ang= bo'eg"w+; % ,re-uenc res)onse mm=mag&+; % ange mag to ector )lotw"Ti+*mm+ ol' on en' nc=1; 'c=.1" 1; w=.1&.0!&100; mc"ac" w=bo'enc"'c"w+; )lotw"mc"r+
G( jw ) 1.1 1
0.8 Slower sampling 0.6
0.4
0.2 Analog System
0 0
w 20
40
60
Frequency response plots for sampling frequencies analog system for Prolem !"!5"
80
= k
s
100
, k = 5, 35, 70 and for the
b
he frequency response plots are normali3ed (multiplied !y T ) to simplify their comparison. he plots for the discrete time system are closer to the analo" frequency response for faster samplin".
1;
he discrete time plots are si"nificantly different from the analo" plot for T # %.1 s and almost indistin"uisha!le for T # %.1&0 and %.1&>%s. his verifies the rule of thum! for the selection of the samplin" rate. 2.2?Cepeat 4ro!lem 2.2: for the second order closed-loop system of 4ro!lem 2.2;(!) with plots for samplin" frequencies w s # k w d k # 0 >%.
he closed-loop transfer function is
G( s)
2 s > s 2 2
>.%%1 0.>%>
s 0. 2 0.>%> 2
(a) he impulse response is g (t ) > .%%1 sin(0 .>%>t ) e 0. t
and the impulse response sequence for a sampled system output is g ( kT ) >.%%1 sin(0.>%> kT )e 0. kT
(!) he 3-transform of the impulse response is
G( z )
>.%%1e z 2e 2
0.T
0.T
sin(0.>%>T ) z
cos(0.>%>T ) z e
>T
(c) he correspondin" frequency response plots for samplin" periods T # 2&(k wd )s k # 0 >% as well as for the analo" system can !e o!tained usin" the G<'<@ commands
% Exercise 2324 clf ol' on wn=!;5eta=0.$; % lose'(loo) 'ata w'=wn*s-rt1(5eta62+; % Dam)e' natural fre-uenc ttt=2*)i/w'; T=ttt/!"ttt/#!" ttt/$0; % 7am)ling )erio's w=.1&.1&200; gc=tfwn62"1"2*5eta*wn"wn62+; % 8nalog transfer function % 9lot te fre-uenc res)onse for te analog sstem w=.1&.1&200; mc"ac" w=bo'egc"w+; )lotw"mc&+"r+ % alculate an' )lot 'iscrete fre-uenc res)onses for i=1&lengtT+ ti=Ti+; % numerator an' 'enominator o' 5(transfer function num=$.0014*ex)(#.!*ti+*sin#.!$0$*ti+"0; 'en=1"(2*ex)(#.!*ti+*cos#.!$0$*ti+" ex)($*ti+; g=tfnum"'en"ti+; mm"aa"w= bo'eg"w+; )lotw"ti*mm&++ en' (d) he frequency response show little aliasin" in the frequency ran"e of interest for T # 2&(>%w d ) s some aliasin" for T # 2&(0w d ) s and unaccepta!le aliasin" T # 2&(w d) s. he analo" plot (red) is similar to that of the two faster rates at low frequencies and differs from the T # 2&(0w d ) s plot close to the foldin" frequency. he results confirm that the rule of thum! "ives a reasona!le estimate of the required samplin" rate.
1>
G( jw )
1
0.8
0.6
0.4
Slow sampling
0.2
w 0 0
20
40
60
80
100
120
140
Frequency response plots for sampling frequencies analog system for Prolem !"!#"
160
= k
s
180
200
, k = 5, 35, 70 and for the
b
2.0%=se *AG='A6J with a samplin" period of 1s. to verify the results of 4ro!lem 2.2%. *imulate the system for 0%% s then chan"e the axes to display the last % s only. (a)
H ( z )
z z %. !-0.4"
Sine Wave
Discrete Zero-Pole
Scope
Scope 1 $imulation diagram for Prolem !"%7&a' using $()*+("
4ro!lem 2.2%(a) "ives the steady-state response u(k ) # %.>;? sin(%.k %.22)
1:
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8 2#0
2##
260
26#
2$0
2$#
280
28#
2%0
2%#
&00
$ampled sinusoidal input &red' and steady-state sinusoidal &lue' for Prolem !"!0&a'"
(!)
H ( z )
z z 2 %. z %.%0
poles!" Sine Wave
Discrete Zero-Pole
Scope
Scope 1 $imulation diagram for Prolem !"!0&' using $()*+("
4ro!lem 2.2%(!) "ives the steady-state response u(k ) # %.0> sin(%. k %.2>0)
1?
0.#
0.4
0.&
0.2
0.1
0
-0.1
-0.2
-0.&
-0.4
-0.# 2#0
2##
260
26#
2$0
2$#
280
28#
2%0
2%#
&00
$ampled sinusoidal input &red' and steady-state sinusoidal &lue' for Prolem !"!0&a'"
2.01he followin" difference equation descri!es the evolution of the expected price of a commodity1 $e(k +1) # (1 0 ) $e(k ) + 0 $(k ) where $e(k ) is the expected price after k quarters $(k ) is the actual price after k quarters and 0 is a constant. a) *imulate the system with 0 # %. and a fixed actual price of one unit and plot the actual and expected prices. Discuss the accuracy of the model prediction !) Cepeat part (a) for an exponentially decayin" price $(k ) # (%.)k . c) Cepeat part (a) for an exponentially decayin" price $(k ) # (%.?)k . d) Discuss the predictions of the model referrin" to your simulation results. he recursion descri!in" the solution can !e easily simulated usin" a discrete state-space !loc$. they reduce to the simple recursion of our model for the case of scalar vector x(k ) where x(k ) is the price $e(k ). e could also avoid the use of state-space !loc$s !y 3-transformin" to o!tain the correspondin" transfer function. a)
*imulate the system with 0 # %. and a fixed actual price of one unit and plot the actual and expected prices. Discuss the accuracy of the model prediction.
1
y!n"'()!n"*D+!n" )!n*1"'A)!n"*,+!n"
(onstant
Discrete State -Space
$imulation diagram for constant price using $()*+("
1 D. 6. uarate %asi&
'&"n"met!i&s Gcraw /ill 67 1?:: pp. >.
2%
Scope
he model conver"es to the correct estimate after a few sample points.
0.%
0.8
0.$
0.6
0.#
0.4
0.&
0.2
0.1
0 0
1
2
&
4
#
6
$
8
%
10
.ime response of price estimator for a constant price"
!)
Cepeat part (a) for an exponentially decayin" price $(k ) # (%.)k . e use a state space !loc$ with unity initial condition and A#%.. y!n"'()!n"*D+!n" )!n*1"'A)!n"*,+!n"
y!n"'()!n"*D+!n" )!n*1"'A)!n"*,+!n"
Discrete State-Space1
Discrete State-Space
Scope
Scope1
$imulation diagram for e/ponentially decaying price using $()*+("
he dynamics of the model are too slow to trac$ the exponentially decayin" price. he actual price decays much faster than the model predictions.
21
1
0.%
0.8
0.$
0.6
0.#
0.4
0.&
0.2
0.1
0 0
1
2
&
4
#
6
$
8
%
10
.ime response of price estimator for a fast e/ponentially decaying price"
c)
Cepeat part (a) for an exponentially decayin" price $(k ) # (%.?)k .
e use a state space !loc$ with unity initial condition and A#%.? and with the same simulation dia"ram as part (!). he dynamics of the model are a!le to trac$ the exponentially decayin" price since the decay is very slow.
22
1
0.%
0.8
0.$
0.6
0.#
0.4
0.&
0.2
0.1
0 0
2
4
6
8
10
12
14
16
18
20
.ime response of price estimator for a slo e/ponentially decaying price"
d)
Discuss the predictions of the model referrin" to your simulation results. he price estimator dynamics are a!le to estimate a constant price !ut are una!le to estimate a decayin" exponential if the rate of decay is fast relative to the filter dynamics. Af the price decay is very slow then the estimator is a!le to trac$ the price with some error.
20