Digital Control Engineering 2nd Edition Fadali Solution Manual - Doc254405506
Digital Control Engineering 2nd Edition Fadali Solution Manual - Doc254405506
2.1 Derive the discrete-time model of Example 2.1 from the solution of the system differential equation
with initial time kT and final time(k+1)T.
d h h qi
dt C
where = R C is the fluid time constant for the tank. The solution of this equation is
1 t
h(t ) e ( t t 0 ) / h(t 0 ) t e ( t ) / q i ( ) d
C 0
Let qi be constant over each sampling period T, i.e. qi(t) = qi(k) = constant, for t in the interval
[kT, (k+1)T). Then
1
C
( k 1)T
kT
e [( k 1)T ] / d q i (kT ) d : d
T, kT
1
C
e
0
T
/
( d )q ( kT )
i
0, (k 1)T
C
1 e T /
q (kT )
i
h(k 1) e T / h(k ) R 1 e T / q i (k )
2.2 For each of the following equation, determine the order of the equation then test it for
(i) Linearity. (ii) Time-invariance. (iii) Homogeneousness.
1
(e) 2 No Yes No
2.3 Find the transforms of the following sequences using Definition 2.1
(a) {0, 1, 2, 4, 0, 0,...} (b) {0, 0, 0, 1, 1, 1, 0, 0, 0,...}
(c) {0, 20.5 , 1, 20.5 , 0, 0, 0, ... }
From Definition 2.1, {u0, u1 , u2 , ... , uk , ... } transforms to U ( z ) uk z k . Hence:
k 0
2 k 1 , k 0 8 2 k 4 , k 4
where f (k ) g(k )
0, k 0 0, k4
z 8z z3 8
Z 0,1,2,4,0,0,... z 1 z 4 3
z2 z 2 z ( z 2)
1, k 3 1, k 6
where f (k ) g(k )
0, k 3 0, k 6
z z z 3 1
Z 0,0,0,1,1,1,0,0,... z 3 z 6 5
z 1 z 1 z ( z 1)
= {f(k)} + {g(k)}
sin(k 4) , k 0 sin(k 4) , k 4
where f (k ) g(k )
0, k 0 0, k4
2
2.5 Prove the linearity and time delay properties of the z-transform from basic principles.
To prove linearity, we must prove homogeneity and additivity using Definition 2.1,
Z f (0), f (1), f (2),...,f (i ),... f (0) f (1) z 1 f (2) z 2 ... f (i ) z i ...
2.6 Use the linearity of the z-transform and the transform of the exponential function to obtain the
transforms of the discrete-time functions.
(a) sin(kwT) (b) cos(kwT)
e jk wT e jkwT
(a) sin( k wT )
2j
3
e jkwT e jkwT
(b) cos(kwT )
2
Z e kT f (k ) F (e T z )
(a)
Z e kT
sin(kwT )
sin (wT ) e T z
sin (wT )e T z
e T
z 2
2cos(wT ) e T z 1 z 2 2cos(wT )e T z e 2 T
(b)
Z e kT
cos( kwT ) e T
z 2
cos(wT ) e T z
z 2 cos(wT )e T z
e T
z 2
2cos(wT ) e T z 1 z 2 2cos(wT )e T z e 2 T
2.8 Find the inverse transforms of the following functions using Definition 2.1 and, if necessary, long
division
(a) F ( z ) 1 3 z 1 4 z 2 (b) F ( z ) 5 z 1 4 z 5
z z 0 .1
(c) F (z) (d) F ( z)
z 0.3 z 0.02
2
z 0.04 z 0.25
2
(c)
2
z 0.3 z 0.02 z
z 0.3 0.02 z -1
0.3 0.02 z -1
0.3 0.09 z -1
0.006 z 2
1
0.07 z 0.006 z 2
4
z
F ( z) z 1 0.3z 2 0.07 z 3 .....
z 0.3z 0.02
2
{f ( k )} {0,1,0.3,0.07,....}
1
z 0.14 z 2
0.244 z 3
......
(d)
2
z 0.04 z 0.25 z 0.1
z 0.04 0.25 z -1
0.14 0.25 z -1
0.14 0.0056 z -1
0.035z 2
0.244 z 1
0.035z 2
z
F ( z) z 1 0.14 z 2 0.244 z 3 ....
z 0.04 z 0.25
2
{f ( k )} {0,1,0.14,0.244,....}
2.9 For Problems 2.8.(c), (d), find the inverse transforms of the functions using partial fraction expansion
and table look-up.
F ( z) 1 1 1 1
(c) 2 10
z z 0.3z 0.02 z 0.1 z 0.2 z 0.1 z 0.2
z
F ( z ) 10
z
z 0.1 z 0.2
{f ( k )} 10 0.1 0.2
k k
F ( z) z 0.1 0.4 0.4 z 1.016
2
(d)
z 2
z z 0.04 z 0.25 z z 0.04 z 0.25
0.4 z 1.016 z
2
We obtain F ( z ) 0.4 and use the identities
z 2 0.04 z 0.25
e sin(w d ) z
Z e k
sin( kw d )
z 2 2e cos(w d ) z e 2
z[ z e cos(w d )]
Z e k
cos(kw d )
z 2 2e cos(w d ) z e 2
e 0. 25 0.5 cos( w d ) 0. 04 w d 1. 611rad
0.4 z 2 1.016 z
0.4 z 2 0.02 z 1.008z 0.4 z 2 0.02 z 2.018 0.4996 z
z 2 0.04 z 0.25 z 2 0.04 z 0.25 z 2 0.04 z 0.25
0.4
2.057 0.4 2 2.018
2
0.196 sin 1
2.057
sin(A+B) = sin(A) cos(B) + cos(A) sin(B)
5
(c) y(k+1) 0.8 y(k) = 1(k), y(0) = 1
(d) y(k+2) + 0.7 y(k+1) + 0.06 y(k) = (k), y(0)=0, y(1)=2
z-transform
z
zY ( z ) z 0.8Y ( z ) 0 Y ( z ) f ( k ) 0.8 ,k 0,1,2,...
k
z 0.8
z-transform
z z
( z 0.8)Y ( z ) Y ( z)
z 1 ( z 0.8)( z 1)
Y ( z) 1 1 1
5
z ( z 0.8)( z 1) z 1 z 0.8
f (k ) 5 1 0.8 ,k 0,1,2,...
k
The solution is the sum of the solutions from (a) and (b)
f ( k ) 5 1 0.8
k
0.8 ,k 0,1,2,...
k
2.11Find the transfer functions corresponding to the difference equations of Problem 2.2 with input u(k)
and output y(k). If no transfer function is defined, explain why.
(a) and (e) are nonlinear and (b) is homogeneous. They have no transfer functions.
6
2.12 Test the linearity with respect to the input of the systems for which you found transfer functions in
2.11.
z
G( z)
z 15
2.13 If the rational functions of Problems 2.8.(c), (d), are transfer functions of LTI systems, find the
difference equation governing each system.
z
(c) F (z)
z 0.3 z 0.02
2
z 0 .1
(d) F ( z)
z 0.04 z 0.25
2
2.14 We can use z-transforms to find the sum of integers raised to various powers. This is accomplished by
first recognizing that the sum is the solution of the difference equation
where a(k) is the kth term in the summation. Evaluate the following summations using z-transforms
n n
(a) k
k 1
(b) k
k 1
2
f(k) = f(k1) + k
7
Z-transform
z z2 1 z z 1 z
F ( z ) z 1 F ( z )
z 1 2
z 1 3
2 z 1 3
z 1 2
Inverse z-transform
n
n n 1
k
k 1 2
f(k) = f(k 1) + k2
z z 1
F ( z ) z 1 F ( z )
z 1 3
z 2 z 1 z z 2 4 z 1 z z 1 z
F (z)
z 1 4
3 z 1
4
2 z 1
3
6 z 1
2
n
n3 n2 n 1
k2 n n 1 2n 1
k 1 3 2 6 6
Solution
a. We consider the difference equation with the impulse input and the initial
8
Inverse z-transforming gives the impulse response
The above form is identical to the one obtained in part (a) as can be verified by substituting values
of .
2.16 The following identity provides a recursion for the cosine function
integer
To verify its validity, let and rewrite the expression as a difference equation. Show
that the solution of the difference equation is indeed .
Solutions
or equivalently
We z-transform to obtain
integer
Solutions
We write the difference equation corresponding to the identity
9
Substituting for the initial conditions gives
Note that the formula works for negative arguments since the substitution gives
the same identity multiplied by 1.
2.18 Find the impulse response functions for the systems governed by the following difference equations
Equating coefficients, we solve for e and wd then use the tables and the delay theorem
1.12(0.893) k 1 sin 1.515( k 1) , k 1
g (k )
0, k 1
z z
(a) F ( z) (b) F ( z)
z 1.2 z 0.2
2
z 0 .3 z 2
2
z z 1 z 1 1
(a) f 1.25
z 1.2 z 0.2
2
z z 1 z 1 z .2 z 1
0.8
z z
F ( z) 2
z 0.3 z 2 z 2e cos(w d ) z e 2
2
(b)
z
z e jw d
z e jw d
The denominator has complex conjugate poles with magnitude 2 greater than unity.
Therefore the corresponding time sequence is unbounded and the final value theorem does not
apply.
2.20 Find the steady-state response of the systems due to the sinusoidal input u(k) = 0.5 sin(0.4 k)
z z
(a) H ( z) (b) H ( z)
z 0.4 z 0.4 z 0.03
2
10
Sinusoidal input u ( k ) 0.5 sin(0.4 k )
z 1
(a) H ( z)
z 0.4 1 0.4 z 1
H e j 0.4
1
1.537 0.242
1 0.4e j 0.4
z
(b) H ( z)
z 0.4 z 0.03
2
H e j 0.4 j 0.4
1
0.714 0.273
e 0.4 0.03e j 0.4
2.21 Find the frequency response of a noncausal system whose impulse response sequence is given by
K 1
h * (t ) h(l mK ) (t l mK )
l 0 m
K 1
H * ( s) h(l mK )e ( l mK ) s
l 0 m
K 1
H * ( jw ) h(l mK )e j ( l mK )w
l 0 m
w s
sin 2 t kT
u (t ) u (k )
ws
k
t kT
2
Use the convolution theorem to justify the above expression.
By the sampling theorem, the signal can be recovered from its samples using a LPF of bandwidth ws.
Multiplication in the frequency domain is equivalent to convolution with the inverse transform, the
11
sinc function in the time domain. Convolution of the samples and the sinc function yields the
expression.
2.24Obtain the modified z-transforms for the functions of Problems (2.6) and (2.7).
e jkwT e jkwT
For 2.6-(a), sin kwT
2j
jkwT
e jkwT
Zm sin( kwT ) Zm e
2j
1 e jmwT e jmwT sin mw T z sin (1 m)wT
2 j z e jw T
z e jwT z 2 2 cos wT z 1
e jkwT e jkwT
For 2.6-(b), cos kwT
2
e jkwT e jkwT
Zm cos(kwT ) Zm
2
1 e jmwT
e jmwT
cos mwT z cos (1 m)wT
jwT
2 z e jwT
ze z 2 2 cos wT z 1
For 2.7-(a) ,
12
jkwT akT
e jkwT akT
Zm e akT sin(kwT ) Zm e
2j
1 e jmwT maT e jmwT maT
2 j z e jwT aT z e jwT aT
sin mw T z e aT sin (1 m)wT
e maT
z 2 2e aT cos wT z e 2 aT
For 2.7-(b),
Z e e jkwT akT
jkwT akT
Z em
akT
cos( kwT ) m
2
2.25Using the modified z-transform, examine the intersample behavior of the functions h(k) of Problem
2.18. Use delays of (1) 0.3T, (2) 0.5T, and (3) 0.8T. Attempt to obtain the modified z-transform for
Problem 2.19 and explain why it is not defined.
F z 1 1 1 1
z z 1 z .2 0.8 z 1 z 0.2
For 2.18(a)
F ( z , m) 1.25
1
0.2 m
z 1 z 0.2
z z
F ( z)
z 0.3 z 2 z 0.15 j1.406 z 0.15 j1.406
2
For 2.18(b)
z
z 2e j1.677 z 2e j1.677
j j
F (z) 3.5556e 3.5556e
z z 2e j1.677
z 2e j1.677
f (k ) 0.7111 2 k
sin 1.6771k
13
sin mw T z e aT sin (1 m)wT
Zm e akT sin(kwT ) e maT
z 2 2e aT cos wT z e 2 aT
Zm 0.7111 2 k
sin1.6771k 0.7111 2 m sin 1.6771m z 2 sin1.6771(1 m)
z 2 0.3 z 2
2 2 cos1.6771 0.3
z 2 0.3 z 2
(i) m = 0.7
0.7111 2 0.7 0.9223 z 0.6819
z 2 0 .3 z 2
f ( k ,0.7) 0.7111 2 2 0.7 k 1
sin1.6771 k 1 1.1740 , k 1,2,3,.... and zero elsewhere
(iii) m = 0.2
z 2 0.3 z 2
0.7111 2 0.2 0.3528 z 1.4762
z 2 0.3z 2
f ( k ,0.7) 0.7111 2 2
0.2 k 1
sin 1.6771 k 1 0.3354 , k 1,2,3,.... and zero elsewhere
2.19(a) H ( z , m)
0.4 m
z 0 .4
(iv) m = 0.7
H ( z ,0.7)
0.4 0.7
h( k ,0.7) 0.4
0.7
0.4 k 1 , k 1,2,3,.... and zero elsewhere
z 0.4
(v) m = 0.5
H ( z ,0.5)
0.4 0.5 h( k ,0.5) 0.4
0 .5
0.4 k 1 , k 1,2,3,.... and zero elsewhere
z 0.4
(iii) m = 0.2
H ( z ,0.2)
0.4 0 .2
h( k ,0.2) 0.4
0 .2
0.4 k 1 , k 1,2,3,.... and zero elsewhere
z 0.4
z 5z 5z
2.19(b) H ( z)
z 0.4 z 0.03 z 0.1 z 0.3
2
14
0.1 m 0.3 m
H ( z , m ) 5
z 0 .1 z 0 .3
h( k , m) 5 0.1 0.1 0.3 0.3
m k 1 m k 1
, k 1,2,3,....
and zero elsewhere
(0.1) and (0.3)m are complex numbers. Thus, the sequence is not defined between sampling points.
m
2.26The following open-loop systems are to be digitally feedback controlled. Select a suitable sampling
period for each if the closed-loop system is to be designed for the given specifications
1
(a) Gol ( s ) Time Constant = 0.1 s
s3
1
(b) Gol ( s ) Undamped natural frequency = 5 rad/s, Damping ratio = 0.7
s 4s 3
2
2 2
T 0.025s Let T = 25 ms.
ws 70w d
2.27Repeat problem 2.26 if the systems have sensor delays of : (a) 0.025 s (b) 0.03 s
(a) T = 0.025 s (b) T = 0.03 s. (cannot sample faster than the sensor delay)
Computer Exercises
2.28Consider the closed-loop system of Problem 2.26(a)
a. Find the impulse response of the closed-loop transfer function and obtain the impulse
response sequence for a sampled system output.
b. Obtain the z-transfer function by z-transforming the impulse response sequence.
c. Using MATLAB, obtain the frequency response plots for the analog system and for
sampling frequencies ws = k wb, k = 5, 35, 70.
d. Comment on the choices of sampling periods of part (b).
1 10
The closed-loop transfer function is G ( s )
0.1s 1 s 10
(a) The impulse response is
g (t ) 10e 10 t
and the impulse response sequence for a sampled system output is g ( kT ) 10e 10 kT
10 z
G( z)
z e 10T
15
(c) The corresponding frequency response plots for sampling periods T = 0.1, 0.05, 0.02, 0.1 s, as
well as for the analog system can be obtained using the MATLAB commands
G(jw)
1.1
0.8
Slower sampling
0.6
0.4
0.2
Analog System
w
0
0 20 40 60 80 100
Frequency response plots for sampling frequencies w s = k w b, k = 5, 35, 70 and for the
analog system for Problem 2.25.
The frequency response plots are normalized (multiplied by T) to simplify their comparison. The
plots for the discrete time system are closer to the analog frequency response for faster sampling.
16
The discrete time plots are significantly different from the analog plot for T = 0.1 s and almost
indistinguishable for T = 0.1/35 and 0.1/70s. This verifies the rule of thumb for the selection of the
sampling rate.
2.29Repeat Problem 2.28 for the second order closed-loop system of Problem 2.26(b) with plots for
sampling frequencies ws = k wd, k = 5, 35, 70.
25 7.0014 3.5707
The closed-loop transfer function is G (s)
s 2 7 s 25 s 3.5 2 3.5707 2
% Exercise 2_24
clf
hold on
wn=5;zeta=0.7; % Closed-loop data
wd=wn*sqrt(1-zeta^2); % Damped natural frequency
ttt=2*pi/wd; T=[ttt/5,ttt/35, ttt/70]; % Sampling periods
w=[.1:.1:200];
gc=tf(wn^2,[1,2*zeta*wn,wn^2]); % Analog transfer function
% Plot the frequency response for the analog system
w=.1:.1:200;
[mc,ac, w]=bode(gc,w); plot(w,mc(:),'r')
% Calculate and plot discrete frequency responses
for i=1:length(T)
ti=T(i);
% numerator and denominator od z-transfer function
num=[7.0014*exp(-3.5*ti)*sin(3.5707*ti),0];
den=[1,-2*exp(-3.5*ti)*cos(3.5707*ti), exp(-7*ti)];
g=tf(num,den,ti);
[mm,aa,w]= bode(g,w);
plot(w,ti*mm(:))
end
(d) The frequency response show little aliasing in the frequency range of interest for T = 2/(70wd) s,
some aliasing for T = 2/(35wd) s, and unacceptable aliasing T = 2/(5wd) s,. The analog plot (red)
is similar to that of the two faster rates at low frequencies and differs from the T = 2/(35wd) s plot
close to the folding frequency. The results confirm that the rule of thumb gives a reasonable
estimate of the required sampling rate.
17
G(jw) 1
0.8
0.6
0.4
Slow sampling
0.2
w
0
0 20 40 60 80 100 120 140 160 180 200
Frequency response plots for sampling frequencies w s = k w b, k = 5, 35, 70 and for the
analog system for Problem 2.26.
2.30Use SIMULINK with a sampling period of 1s. to verify the results of Problem 2.20. Simulate the
system for 300 s then change the axes to display the last 50 s only.
z
(a) H ( z)
z 0.4
z
(z-0.4)
Sine Wave Discrete Scope
Zero-Pole
Scope 1
Simulation diagram for Problem 2.17(a) using SIMULINK.
18
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
250 255 260 265 270 275 280 285 290 295 300
Sampled sinusoidal input (red) and steady-state sinusoidal (blue) for Problem 2.20(a).
z
(b) H ( z)
z 0.4 z 0.03
2
z
poles(z)
Sine Wave Discrete Scope
Zero-Pole
Scope 1
19
0.5
0.4
0.3
0.2
0.1
-0.1
-0.2
-0.3
-0.4
-0.5
250 255 260 265 270 275 280 285 290 295 300
Sampled sinusoidal input (red) and steady-state sinusoidal (blue) for Problem 2.20(a).
2.31The following difference equation describes the evolution of the expected price of a commodity1
where pe(k) is the expected price after k quarters, p(k) is the actual price after k quarters, and is a
constant.
a) Simulate the system with = 0.5 and a fixed actual price of one unit and plot the actual and
expected prices. Discuss the accuracy of the model prediction
b) Repeat part (a) for an exponentially decaying price p(k) = (0.4)k.
c) Repeat part (a) for an exponentially decaying price p(k) = (0.95)k.
d) Discuss the predictions of the model referring to your simulation results.
The recursion describing the solution can be easily simulated using a discrete state-space block.
Although discrete state-space equations are introduced in Chapter 7, they reduce to the simple
recursion of our model for the case of scalar vector x(k), where x(k) is the price pe(k). We could
also avoid the use of state-space blocks by z-transforming to obtain the corresponding transfer
function.
a) Simulate the system with = 0.5 and a fixed actual price of one unit and plot the actual and
expected prices. Discuss the accuracy of the model prediction.
y(n)=Cx(n)+Du(n)
1
x(n+1)=Ax(n)+Bu(n)
Constant Discrete State -Space Scope
Simulation diagram for constant price using SIMULINK.
20
The model converges to the correct estimate after a few sample points. At k = 5, the error is less
than 5%.. This is a reasonable estimate assuming that the sampling period is small relative to the
time after which the price estimate is used.
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
We use a state space block with unity initial condition and A=0.4.
y(n)=Cx(n)+Du(n) y(n)=Cx(n)+Du(n)
x(n+1)=Ax(n)+Bu(n) x(n+1)=Ax(n)+Bu(n)
Scope1
Simulation diagram for exponentially decaying price using SIMULINK.
The dynamics of the model are too slow to track the exponentially decaying price. The
actual price decays much faster than the model predictions.
21
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
We use a state space block with unity initial condition and A=0.95 and with the same
simulation diagram as part (b).
The dynamics of the model are able to track the exponentially decaying price since the
decay is very slow.
22
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10 12 14 16 18 20
The price estimator dynamics are able to estimate a constant price but are unable to
estimate a decaying exponential if the rate of decay is fast relative to the filter dynamics. If
the price decay is very slow, then the estimator is able to track the price with some error.
23