0% found this document useful (0 votes)
348 views72 pages

KOM 3781 Discrete-Time Control Systems: Veysel Gazi

1. This document discusses discrete-time control systems and the z-transform. It provides examples of approximating derivatives and integrals in continuous-time systems when implementing them on digital computers using backward difference approximations. 2. Common approximations include using backward differences to estimate the first derivative and trapezoidal integration to estimate integrals between samples. 3. Higher-order derivatives can also be approximated using backward differences, providing methods to discretize many common continuous-time controllers.

Uploaded by

Fatih Canbolat
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)
348 views72 pages

KOM 3781 Discrete-Time Control Systems: Veysel Gazi

1. This document discusses discrete-time control systems and the z-transform. It provides examples of approximating derivatives and integrals in continuous-time systems when implementing them on digital computers using backward difference approximations. 2. Common approximations include using backward differences to estimate the first derivative and trapezoidal integration to estimate integrals between samples. 3. Higher-order derivatives can also be approximated using backward differences, providing methods to discretize many common continuous-time controllers.

Uploaded by

Fatih Canbolat
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/ 72

KOM 3781

Discrete-Time Control Systems

Veysel Gazi
Lecture 2: Discrete-Time
Systems and the z-Transform
Outline

• Example
• Approximation of derivatives and the integral
• Discrete-Time Systems
• Transform Methods
• Properties of the z-Transform
• Finding z-Transforms
• Solution of Difference Equations
• The Inverse z-Transform
Example
r + e u y
Gc(s) G(s)
Reference Error Control Output
input - input

H(s)

• Consider the above CT control system


• Assume that we have designed the controller Gc(s) using
CT techniques as (a lead compensator)
s+3
Gc ( s ) = 5
s+6
• We would like to implement Gc(s) on a computer
• Let us ignore for now the A/D and the D/A converters.
• Assume that the initial conditions (of controller) are zero.
Example (cont’d)
r + e u y
Gc(s) G(s)
Reference Error Control Output
input - input

H(s) s+3
Gc ( s ) = 5
U ( s ) = Gc ( s ) E ( s ) s+6
s+3
U (s) = 5 E ( s )  ( s + 6)U ( s) = 5( s + 3) E ( s)
s+6
• The s in Laplace (frequency) domain corresponds to
derivative in time domain
d d d
s  u (t ) + 6u (t ) = 5 e(t ) + 15e(t )
dt dt dt
• Assume that the initial conditions (of controller) are zero.
Approximation of the first derivative

y T Backward difference
y(k-1)
approximation of the 1st
derivative (T => sampling period):
y(k)
dy y (k ) − y (k − 1)
k–1 k t =
dt T
(average slope)

• Alternative approximations are also possible.


• Forward difference
• Central difference
Example (cont’d)
d d
u (t ) + 6u (t ) = 5 e(t ) + 15e(t )
dt dt

u (k ) − u (k − 1) e(k ) − e(k − 1)
+ 6u (k ) = 5 + 15e(k )
T T

1
u (k ) = ( u (k − 1) + (5 + 15T )e(k ) − 5e(k − 1) )
(1 + 6T )

• The current control input u(k) can be calculated as a


function of the previous input u(k-1) and the current and
previous errors e(k) and e(k-1).
• Can easily be implemented on a digital computer.
Example
r + e u y
Gc(s) G(s)
Reference Error Control Output
input - input

H(s)

• Consider again the above CT control system


• Assume that we have designed the controller Gc(s) using
CT techniques as (an integrator)
2
Gc ( s ) =
s
• We would like to implement Gc(s) on a computer
• Let us ignore for now the A/D and the D/A converters.
• Assume that the initial conditions (of controller) are zero.
Example
r + e u y
Gc(s) G(s)
Reference Error Control Output
input - input

H(s)
2
U ( s ) = Gc ( s ) E ( s ) Gc ( s ) =
s
• The 1/s in Laplace (frequency) domain corresponds to
integral in time domain
2 1
U (s) = E ( s)
s s
 
t
u (t ) = 2  e( )d
0

• Assume that the initial conditions (of controller) are zero.


Approximation of the integral
(Trapezoidal rule)
The integral (area in yellow) between two
samples may be approximated by various
methods. Δ A(k)

error y(k)
y
y(k-1) A1(k)
Δ A(k)
A(k-1)
y(k-1)×T
T t
k-1 k
y (k ) − y (k − 1) Area of the
A1 (k ) = T
2 trapezoid – area
y (k ) + y (k − 1) between two
A(k )  y (k − 1)  T + A1 (k ) =  T samples.
2
Approximation of the integral
(Trapezoidal rule)
The integral (area in yellow) between two
samples may be approximated by various
methods. Δ A(k)

error y(k)
y
y(k-1) A1(k)
Δ A(k)
A(k-1)
y(k-1)×T
T t
k-1 k

y (k ) + y (k − 1)
A(k ) = A(k − 1) + A(k )  A(k − 1) + T
2
Approximation of the total area up to step k.
Example (cont’d)
t
u (t ) = 2  e( )d
0

e(k ) + e(k − 1)
u (k ) = u (k − 1) + 2T = u (k − 1) + T (e(k ) + e(k − 1))
2
• Once again, the current control input u(k) can be
calculated as a function of the previous input u(k-1) and
the current and previous errors e(k) and e(k-1).
• Can easily be implemented on a digital computer.
• Other, more complicated controllers may be designed
similarly.
• Contains simple (adition/subtraction,
multiplication/division operations.
Approximation of the first derivative
T Backward difference
y y(k-1) approximation of the 1st
derivative (T => sampling period):
y(k) dy y (k ) − y (k − 1)
=  yk
k–1 k t dt T
(average slope - backward)

T Forward difference
y y(k+1) approximation of the 1st
derivative (T => sampling period):
y(k) dy y (k + 1) − y (k )
=  yk
k k+1 t dt T
(average slope – forward)
Approximation of the second derivative
The backward difference approximation of the 2nd
derivative is
y (k ) − y (k − 1) y (k − 1) − y (k − 2)

d y yk − yk −1
2
T T
 =
dt 2 T T
(average change in
y (k ) − 2 y (k − 1) + y (k − 2) slope - backward)
=   2
y k
T2

The forward difference approximation of the 2nd derivative


is
y (k + 2) − y (k + 1) y (k + 1) − y (k )

d 2 y yk +1 − yk T T
 =
dt 2 T T
y (k + 2) − 2 y (k + 1) + y (k ) (average change in
= 2
  yk
2
slope - forward)
T
Approximation of the third derivative
The backward difference approximation of the 3rd
derivative is
y (k ) − 3 y (k − 1) + 3 y (k − 2) − y (k − 3)
 yk =
3

T3

The forward difference approximation of the 3rd


derivative is
y (k + 3) − 3 y (k + 2) + 3 y (k + 1) − y (k )
 yk =
3

T3
• The backward difference approximations are more
suitable since they are based on past values (and not
future values).
• Central difference approximations (not shown) are also
possible.
Approximation of the derivative
• Note that the coefficients in
the derivative are similar to
those in the binomial
expansion!

• The same pattern continues in


the higher ordered
derivatives as well.
Approximation of the integral
(Rectangular rule – left side)
The integral (area in yellow) between two
samples may be approximated by various
methods.
Assume that x(k) holds (i.e.,
the function is constant). for
the whole interval.

A(k + 1)  A(k ) + x(k )  T

Approximation of the
Rectangular rule – left side. total area up to step k+1.
Approximation of the integral
(Rectangular rule – right side)
The integral (area in yellow) between two
samples may be approximated by various
methods.
Assume that x(k+1) holds (i.e.,
the function is constant) for
the preceding interval.

A(k + 1)  A(k ) + x(k + 1)  T

Approximation of the
Rectangular rule – right side. total area up to step k+1.
Approximation of the integral
(Trapezoidal rule)
The integral (area in yellow) between two
samples may be approximated by various
methods. Δ A(k)

error y(k)
y
y(k-1) A1(k)
Δ A(k)
A(k-1)
y(k-1)×T
T t
k-1 k

y (k ) + y (k − 1)
A(k ) = A(k − 1) + A(k )  A(k − 1) + T
2
Approximation of the total area up to step k.
Discrete-Time Systems
r+ e A/D u y
Computer D/A Plant
-
Sensor

• Given an input signal e(t), the analog to digital


converter (A/D) samples the signal at discrete
instances of time, usually with fixed sampling period
T. e(t) e(k)
A/D

e(k)
(k-2)T kT (k+1)T k

(k-1)T
Discrete-Time Systems

e(k)
(k-2)T kT (k+1)T k

(k-1)T

• The discrete signal e(k) is in the form


e(0), e(1T), e(2T), e(3T), …, e((k-1)T), e(kT), e((k+1)T), …
• For simplicity we usually omit T from the expression
e(0), e(1), e(2), e(3), …, e(k-1), e(k), e(k+1), …
• k shows in a sense the index of the sample
Discrete-Time Systems
• Linear constant-coefficient difference equations describe
the behavior of linear time-invariant discrete-time
systems. Consider a system with input, e(k), and output,
u(k).
e(k) u(k)
Discrete-Time
System (DTS)

• The system behavior is described by recurrence


equations (difference equations).
• The compensators for digital control systems are
implemented on microprocessors as difference equations.
• Given an input, e(k), the solution of the difference
equation provides the output, u(k).
Difference Equations
• A generalized difference equation has the form

u (kT ) +  k −1u ((k − 1)T ) + +  k − nu ((k − n)T )


=  k e(kT ) +  k −1e((k − 1)T ) + +  k − n e((k − n)T )

• Omitting the sampling interval, T one obtains


u (k ) +  k −1u (k − 1) + +  k − n u ( k − n)
=  k e(k ) +  k −1e(k − 1) + +  k − n e( k − n )

• The current value u(k) can be expressed as


u (k ) = −  k −1u (k − 1) − −  k − n u ( k − n)
+  k e(k ) +  k −1e(k − 1) + +  k − n e( k − n )
• This is a recurrence equation also referred to as
difference equation.
Difference definitions
• The recurrence equation
u (k ) = −  k −1u (k − 1) − −  k − n u ( k − n)
+  k e(k ) +  k −1e(k − 1) + +  k − n e( k − n )
• Can be expressed in terms of the differences

uk = u (k ) − u (k − 1) Is called the first difference.

 2uk = uk − uk −1 Is called the second difference.

3uk =  2uk −  2uk −1 Is called the third difference.

• This is why it is also called difference equation.


Difference Equations
u (k ) +  k −1u (k − 1) + +  k − n u ( k − n)
=  k e(k ) +  k −1e(k − 1) + +  k − n e( k − n )

• Difference equation might arise as


• Result of measurements
• Description of a compensator
• Approximation to a differential equation
• Difference equations are fundamental to digital control
systems analysis and design.

• We will consider difference equations extensively in this


course.
Iterative Solution of Difference
Equations e(k) DTS u(k)
Example: Consider the 1st order linear difference equation:
u (k ) = e(k ) − e(k − 1) − u (k − 1) k 0
(what makes this 1st order?)
Given: e(k ) = 1 for k even e(k ) = 0 for k odd
e(−1) = 0 u (−1) = 0 e(k) 1
Solution:
5 k
u (k ) = 0 for k  0, and -2 -1 0 1 2 3 4

u (0) = e(0) − e(−1) − u (−1) = 1 − 0 − 0 = 1


u (1) = e(1) − e(0) − u (0) = 0 − 1 − 1 = −2
u (2) = e(2) − e(1) − u (1) = 1 − 0 − (−2) = 3
u (3) = e(3) − e(2) − u (2) = 0 − 1 − 3 = −4
u (k ) = = (−1) k (k + 1)
We can find u(k) for any value of k, but not always in closed form!
Transform Methods
Definition of z-Transform
• Consider operator, sometimes called “delay” z -1
• A complex number or variable z = r ejω (r – real)
• Similar to s in Laplace domain
• Given a sequence of values e(k),

e(k ) –> e(0), e(1), e(2), , e(  )

• The z-transform of e(k) is defined as



E( z) = [{e(k )}] =  e(k ) z − k
k =0

Note that E(z) is expressed as a power series expansion!



E( z) = [{e(k )}] =  e(k ) z − k = e(0) + e(1) z −1 + e(2) z −2 + + e() z −
k =0
Useful Identity


1
 ( x)
k =0
k
=1  x + x  x + x  x +
2 3 4 5
=
1 x
;( for x  1)

Used for expressing power series solutions in closed form!


Example: Find z-transform of the sequence:
 −1 
k
1 1 1 1
e(k ) = 1, − , , − , , ,  
2 4 8 16  2 
 1  −1  1  −2  1  −3
E( z) = 1 −   z +   z −   z +
2 4 8
1 1 1
= 1− + − +
2z ( 2z ) ( 2z )
2 3

 k
 1 
=  − 
k =0  2z 
1 z z 1 −1
= = = ;( for z  1)
 1  z + 1 z + 0.5 2
1+  
 2z  2

1
From:  ( x) k = 1  x + x 2  x3 + x 4  x 5 + = ;( for x  1)
k =0 1 x
Example Transforms
1, k  0 
The z-transform of the step function: u (k ) =  
 0 k  0 
1
u (k ) =  0 u (k ) z =  0 z = 1 + z + z + = -1
 −k  −k -1 -2

1− z
z
= ( for z −1  1)
z −1

The z-transform of the step function in Matlab.


syms k
uk=1^k;
Uz=ztrans(uk)

Uz =
z/(z - 1)
Example Transforms
The z-transform of u(t) = a t
[a t ] = ? ( sampled form is : u (t )t = kT = a kT )

U ( z ) =  0 u (kT ) z = 0 a z = 0 (a z )
 −k  kT −k  T −1 k

= 1+ a z + (a z )
−1 −1 2 1 z
T T
+ = T −1
= ( for aT z −1  1)
1− a z z − aT

The z-transform of x(t) = a t in Matlab.


syms a k T
uk=a^(k*T);
Uz=ztrans(uk)

Uz =
z/(z - a^T)
Example Transforms
Find the z-transform of u(t) = e–at : u(kT) = e–akT
U ( z ) =  0 u (k ) z =  0 e − akT z − k
 −k 

= 0 (e )
 − aT −1 k
z
= 1 + (e − aT z −1 ) + (e − aT z −1 ) 2 +
1 z − aT −1
= − aT −1
= − aT
( for e z  1)
1− e z z −e

The z-transform of u(kT) = e–akT in Matlab.


syms e a k T
uk=e^(-a*k*T);
Uz=ztrans(uk)

Uz =
z/(z - 1/e^(T*a))
Example Transforms
 t , t  0
The z-transform of ramp function: u (t ) =  
 0, t  0 
U ( z ) =  0 u (k ) z =  0 kTz = T  0 kz − k
  
−k −k

= T ( z −1 + 2 z −2 + 3 z −3 + 4 z −4 + ) kT , k  0 
u (k ) =  
z −1 Tz  0, k  0 
=T = ( for z −1  1)
(1 − z −1 ) 2 ( z − 1) 2

The z-transform of unit ramp in Matlab.


syms k T
uk=k*T;
Uz=ztrans(uk)

Uz =
(T*z)/(z - 1)^2
Useful Identity

1
 ( x)
k =0
k
=1  x + x  x + x  x +
2 3 4 5
=
1 x
;( for x  1)

Used for expressing power series solutions in closed form!


d  
k 

k =0
k ( x) = ( x)   ( x)  =
k

dx  k =0 
= ( x)(0  1 + 2 x  3 x 2 + 4 x 3  5 x 4 + )
d  1  x
= ( x)  = ;( for x  1)
dx  1 x  (1 x) 2

Another useful power series identity in closed form!


Properties of the z-Transform
Addition and Subtraction
e1 (k )  e2 (k ) = E1 ( z )  E2 ( z )
Multiplication by a Constant
 ae(k ) = aE ( z )
Real Translation n > 0
 e( k − n )  = z −n
E( z)
Properties of the z-Transform
Initial Value Theorem
e(0) = lim E ( z )
z →

Final Value Theorem


lim e(k ) = lim( z − 1) E ( z )
k → z →1
Properties of the z-Transform
Consider e1(k) = 0 and e2(k) = 0 for k < 0, with
corresponding transforms E1(z) and E2(z).

Addition and Subtraction e1 (k )  e2 (k ) = E1 ( z )  E2 ( z )


Proof: e1 (k )  e2 (k ) =  e1 (k )  e2 (k ) z − k
0

=  e1 (k ) z − k  e2 (k ) z − k 
0
 
=  e1 (k ) z − k    e2 (k ) z − k  = E1 ( z )  E2 ( z )
0 0
Properties of the z-Transform
Consider e(k) = 0 for k < 0, with corresponding transform E(z).

Multiplication by a Constant  ae(k ) = a E ( z )


Proof:
 
 ae(k ) =  ae(k ) z − k = a  e(k ) z − k = aE ( z )
0 0

• The Z transform is a linear operator.


• It satisfies the superposition principle.
Properties of the z-Transform
Consider e(k) = 0 for k < 0, with corresponding transform E(z).

Real Translation (time delay), where n > 0

 e( k − n )  = z − n E ( z )

Proof:
equals zero

 e ( k − n )  = e ( − n ) z 0
+ e ( − n + 1) z −1
+
+ e(0) z − n + e(1) z − n −1 +
= z − n e(0) + e(1) z −1 +  = z − n E ( z )
Example
Real Translation (time delay) 1 z
e − akT  = =
Let x(t) = e-at , x(kT) = e-akT 1 − e − aT z −1 z − e − aT

For x((k − 3)T ) = e − a ( k −3)T u[(k − 3)T ]


 z  1
e − a ( k −3)T u[(k − 3)T ] = z −3  − aT
=
 z 2 ( z − e − aT )
 z − e

from :  e( k − n )  = z − n E ( z )
Properties of the z-Transform
for:  x(k )  = X ( z )
Complex Translation
e akT x(k )  = X ( ze − aT )

Proof from definitions:


e akT x(k )  = x(0) + x(1)e aT z −1 + x(2)e 2 aT z −2 +
= x(0) + x(1)( ze − aT ) −1 + x(2)( ze − aT ) −2 +
= X ( ze − aT )
Properties of the z-Transform
Initial Value Theorem e(0) = lim E ( z ) (if the limit exists)
z →

Proof: equals zero


lim E ( z ) = lim ( e(0) + e(1) z −1 + e(2) z −2 + )
z → z →

lim E ( z ) = e(0)
z →
Example
Find the initial value, if it exists, for

(1 − e −T ) z −1 (1 − e −T )
X ( z) = =
−1 −T −1
(1 − z )(1 − e z ) (1 − z −1 )( z − e −T )

 (1 − e −T )  (1 − e −T )
x(0) = lim X ( z ) = lim  − −  = =0
z → z → (1 − z )( z − e
1 T
)  (1)()

Properties of the z-Transform
Final Value Theorem
lim e(k ) = lim( z − 1) E ( z ) (if the limit exists)
k → z →1

Proof:

e(k ) = E ( z ) =  e(k ) z − k
k =0

e ( k − 1) = z E ( −1
z ) =  e ( k − 1)
k =0
z −k

 

 e( k ) z
k =0
−k
−  e(k − 1) z − k = (1 − z −1 ) E ( z )
k =0

 
−k 
lim   e(k ) z −  e(k − 1) z  = [e(0) − e(−1)] + [e(1) − e(0)] +
−k
=
z →1
 k =0 k =0 
e() = lim e(k ) = lim(1 − z −1 ) E ( z ) = lim( z − 1) E ( z )
k → z →1 z →1
Example
Find the final value of u(k), if it exists, for
T z z +1
U ( z) =
2 z − 0.5 z − 1

T z ( z + 1)   T z ( z + 1) 
lim u (k ) = lim( z − 1)   = lim   = 2T
k → z →1
 2 z − 0.5 ( z − 1)  z →1
 2 ( z − 0.5) 
Finding z-Transforms
z z
1 = e − akT  =
z −1 z − e − aT

Find z-transform of

f (t ) = 1 − e − t f (kT ) = 1 − e − kT

−T
z z z (1 − e )
F ( z) = [1 − e − kT ] = [1] − [e − kT ] = − =
z − 1 z − e −T ( z − 1)( z − e −T )
Finding z-Transforms
z
The z-transform of sin(ωt): e  akT  =
z − e  aT
sin(t ), t  0  e jt = cos(t ) + j sin(t )
u (t ) =  
 0, t  0 e − jt = cos(t ) − j sin(t )

sin(t ) =
2j
( e −e )
1 jt − jt
u (k ) = (
1 j kT
2j
e − e − j kT ) , k  0

U ( z ) =  0 u (k ) z
 −k
=
1
2j
( 0 e
 j kT
z −k
−  0 e − j kT z − k =

)
 1  
jT − jT
1  z z z (e − e )
=  jT − − jT  = 2 j  2 jT − jT 
2 j  z −e z −e   z − z (e + e ) + 1 
z sin(T )
= 2
z − 2 z cos(T ) + 1
Finding z-Transforms
The z-transform of cos(ωt): e  akT  =
z
z − e  aT
cos(t ), t  0  e jt = cos(t ) + j sin(t )
u (t ) =  
 0, t  0  e − jt = cos(t ) − j sin(t )

u (k ) = ( e + e − j kT ) , k  0
1 j kT
cos(t ) = ( e jt + e − jt )
1
2 2

U ( z ) =  0 u (k ) z − k =
 1
2
( 0

e j kT − k
z + 0 e
− j kT − k
z = )
 1  2 z − z (e + e ) 
jT − jT
1 z z 2
=  jT + − jT  = 2  2 jT − jT 
2 z −e z −e   z − z (e + e ) + 1 
z 2 − z cos(T )
= 2
z − 2 z cos(T ) + 1
Calculating the z-Transform from
the Laplace Transform
Example: Given below G(s), find corresponding G(z) for T=0.1:
s 2 + 4s + 3 s 2 + 4s + 3 0.375 0.25 0.375 Expressed as
G (s) = 3 = = + +
s + 6s + 8s s ( s + 2)( s + 4)
2
s s+2 s+4 partial fractions
Laplace Time z-
Substitute corresponding Transform Function Transform
z-Transforms 1 z
e − at
s+a z − e − aT
1 z
z z z 1(t )
G ( z ) = 0.375 + 0.25 + 0.375 s z −1
z −1 z − e −2T z − e −4T

z z z
= 0.375 + 0.25 + 0.375
z −1 z − 0.8187 z − 0.6703

z 3 − 1.658 z 2 + 0.6804 z
= 3 Express as ratio of two polynomials
z − 2.489 z 2 + 2.038 z − 0.5488
z-Transform Example – MATLAB
s 2 + 4s + 3
T=0.1; G (s) = 3
num=[1 4 3]; s + 6 s 2 + 8s
den=[1 6 8 0]; % no repeated poles allowed
n=length(den);
Gs=tf(num,den)
[r,p,k]=residue(num,den); % Get poles & residues
for i=1:1:n-1
pz(i)=exp(p(i)*T) % find poles in z-plane
end
[numzz,denz]=residue(r,pz,k) % substitute z-plane poles
numz=conv(numzz,[1 0]) % multiply by z
Gz=tf(numz,denz,T) % display G(z)

Transfer function:
s^2 + 4 s + 3
-----------------
s^3 + 6 s^2 + 8 s
Transfer function:
z^3 - 1.658 z^2 + 0.6804 z
----------------------------------
z^3 - 2.489 z^2 + 2.038 z - 0.5488
Properties of the z-Transform
z-Transforms of Common Functions
Solution of Difference Equations
Using z-Transform
Example: Second order system e(k) u(k)
DTS

u (k ) + 1.2u (k − 1) + 0.35u (k − 2) = e(k ) − 0.5 e(k -1)


Take z-transform of both sides of the equation
U ( z ) + 1.2 z −1U ( z ) + 0.35 z −2U ( z ) = E ( z ) − 0.5 z −1E ( z )
Solving for U(z) gives:
1 − 0.5 z −1 z ( z − 0.5)
U ( z) = −1 −2
E( z) = 2 E( z)
1 + 1.2 z + 0.35 z z + 1.2 z + 0.35
• As with Laplace, the result is an algebraic equation.
• Given e(k) (or the corresponding E(z)), one can solve for
U(z) (and therefore for u(k)).
Solution of Difference Equations
Using z-Transform
Example: Second order system e(k) u(k)
DTS

1 − 0.5 z −1 z ( z − 0.5)
U ( z) = −1 −2
E ( z ) = E( z)
1 + 1.2 z + 0.35 z z + 1.2 z + 0.35
2

Assume that e(k) is a unit step:


z z 2 ( z − 0.5) Find
Then: E ( z ) = U ( z) = 2
z −1 ( z + 1.2 z + 0.35)( z − 1) u(k)

• From the calculated U(z) one can solve for the


corresponding u(k).
The Inverse z-Transform
• Power Series
• Partial Fraction Expansion
• Inversion Formula
• Discrete Convolution
Power Series Solution for
Inverse z-Transform
Solve the previous example using long division:
z 2 ( z − 0.5) z 3 − 0.5 z 2
U ( z) = 2 = 3
( z + 1.2 z + 0.35)( z − 1) z + 0.2 z 2 − 0.85 z − 0.35

Long division:
U ( z ) = ( z 3 − 0.5 z 2 )  ( z 3 + 0.2 z 2 − 0.85 z − 0.35) = 1 − 0.70 z −1 + 0.99 z −2 −
U ( z ) =  0 u (k ) z − k

From U(z), the corresponding u(k) can be deduced as

u (k ) = {1, − 0.70, 0.99, − 0.443, }


Partial Fraction Expansion
z 2 ( z − 0.5)
U ( z) = 2
( z + 1.2 z + 0.35)( z − 1)
• As with Laplace, the commonly used technique is to
expand in partial fractions.
• Take the partial fraction of U(z)/z (this is a key step
to remember):
U ( z) A B C
= + +
z z − 1 z + 0.7 z + 0.5
This generates elements that are easy to inverse transform.
U ( z) z ( z − 0.5) z ( z − 0.5)
= 2 =
z ( z + 1.2 z + 0.35)( z − 1) ( z − 1)( z + 0.7)( z + 0.5)
 (1)(.5)   (−0.7)(−1.2)   ( −0.5)( −1) 
 (1.7)(1.5)   (−1.7)( −0.2)   ( −1.5)(0.2) 
=   +   +   =
0.196 2.471 1.667
+ −
z −1 z + 0.7 z + 0.5 z − 1 z + 0.7 z + 0.5
Multiplication by z leads to the following:

0.196 z 2.471z 1.667 z


U ( z) = + −
z −1 z + 0.7 z + 0.5

Finally, the inverse transform is:

u (k ) = 0.196 + 2.471(−0.7) k − 1.667(−0.5) k

1
u(k) 0.99

0
k
-0.443
-0.70
MATLAB® residuez command: [r,p,k]=residuez(b,a)
[b,a] = residuez(r,p,k)
z 3 − 0.5 z 2
U ( z) = 3
z + 0.2 z 2 − 0.85 z − 0.35
>> [r,p,k]=residuez([1 -0.5 0 0],[1 0.2 -0.85 -0.35])

r =
0.1961
2.4706
-1.6667 0.1961z 2.4706 z 1.6667 z
p = U ( z) = + −
1.0000 z −1 z + 0.7 z + 0.5
-0.7000
-0.5000
k =
0

T=0.1 % arbitrary choice for this example


Uz=tf([.1961 0],[1 -1],T)+tf([2.4706 0],[1 .7],T)-tf([1.6667 0],[1 .5],T)

Uz =
z^3 - 0.5 z^2 + 2.5e-05 z
-----------------------------
z^3 + 0.2 z^2 - 0.85 z - 0.35
Inverse z-Transform
z 2 ( z − 0.5)
Check answer using MATLAB (ztrans) U ( z) =
( z − 1)( z + 0.7)( z + 0.5)
u (k ) = 0.1961 + 2.4706(−0.7) k − 1.6667(−0.5) k
syms k z
uk=0.1961+2.4706*(-0.7)^k-1.6667*(-0.5)^k;
Uz=ztrans(uk);
pretty(simplify(Uz))

2
z (200000 z - 99994 z + 5)
----------------------------------
10000 (2 z + 1) (10 z + 7) (z - 1)

99,994/200,000 5/200,000 numerical errors

z 2 ( z − 0.49997) + 0.000025 z z 2 ( z − 0.5)


M ( z) = 
( z − 1)( z + 0.7)( z + 0.5) ( z − 1)( z + 0.7)( z + 0.5)
The Inverse z-Transform
1
e( k ) =
2 j  
E ( z )z k −1dz Inversion
Formula
=  [residues of E ( z ) z k −1 ]
poles of E ( z ) z k −1

𝚪 is any closed path in the z-plane that encloses all the


finite poles of E(z)zk-1 . There are two important cases:
k −1
Case 1: E ( z ) z has a simple pole at z = a
 residue of E ( z ) z k −1  = ( z − a) E ( z ) z k −1
z =a z =a

Case 2: E ( z ) z k −1 has a m'th order pole at z = a


1 d m −1
 residue of E ( z ) z k −1  = 
m −1 
( z − a ) m
E ( z ) z k −1

z =a (m − 1)! dz z =a
Inverse z-Transform
z 2 ( z − 0.5)
Example M ( z) =
( z − 1)( z + 0.7)( z + 0.5)

Case 1: M ( z ) z k −1 has simple poles

z ( z − 0.5) z k
(no pole
First find: M ( z ) z k −1 =
( z − 1)( z + 0.7)( z + 0.5) at z = 0)

The residue at z = 1 is
z ( z − 0.5) z k
res  M ( z ) z k −1  = ( z − 1) M ( z ) z k −1  =
z =a z =1 ( z + 0.7)( z + 0.5) z =1
1(0.5)(1k )
= = 1/ 5.1 = 0.196
1.7 *1.5
Inverse z-Transform
z 2 ( z − 0.5)
M ( z) =
The residue at z = −0.7 is ( z − 1)( z + 0.7)( z + 0.5)

z ( z − 0.5) z k
res  M ( z ) z k −1  = ( z − a ) M ( z ) z k −1 =
z =a z =a ( z − 1)( z + 0.5) z =−0.7
−0.7(−0.7 − 0.5)(−0.7) k
= = 2.471(−0.7) k
(−0.7 − 1)(−0.7 + 0.5)

The residue at z = −0.5 is

z ( z − 0.5) z k −0.5(−0.5 − 0.5)(−0.5) k


= = −1.667(−0.5) k
( z − 1)( z + 0.7) z =−0.5
(−0.5 − 1)(−0.5 + 0.7)

Summing the residues:

m(k ) = 0.196 + 2.471(−0.7) k − 1.667(−0.5) k


Inverse z-Transform
1
Example E( z) =
( z − 1)( z − 2)
Case 1: E ( z ) z k −1 has simple poles and a pole at z = 0
k −1
z
E ( z ) z k −1 = , k 0
( z − 1)( z − 2)
Two sub-cases: 1
(1) k = 0 → E ( z ) z k −1 = (three poles )
z ( z − 1)( z − 2)
 1 
e(0) =   res. of 
@ z = 0,1,2  z ( z − 1)( z − 2) 
1 1 1 1 1
= + + = −1+ = 0
( z − 1)( z − 2) z =0 z ( z − 2) z =1 z ( z − 1) z = 2 2 2
Inverse z-Transform
(2) k > 0, no pole at z = 0.
z k −1
res [ E ( z ) z k −1 ] = ( z − 1) = −1
z =1 ( z − 1)( z − 2) z =1
k −1
z
res [ E ( z ) z k −1 ] = ( z − 2) = 2k −1
z =2 ( z − 1)( z − 2) z = 2

e(k ) = −1 + 2k −1 , k  0
e(0) = 0
Inverse z-Transform
1
E( z) =
Using MATLAB ( z − 1)( z − 2)
syms k z
Ez=1/((z-1)*(z-2));
ek=iztrans(Ez,k);
pretty(ek)

ek =
k
2 kroneckerDelta(k, 0)
-- + -------------------- - 1
2 2

e(0) = 0
k −1 The same result
e(k ) = −1 + 2 , k 0
Inverse z-Transform
Case 2: E ( z ) z k −1 has repeated poles at z = a

Example
z
E( z) =
( z − 1) 2
then q −1
1 d
e( k ) = 
q −1 
( z − a ) q
E ( z ) z k −1

(q − 1)! dz z =a

1 d 2−1  z k −1 
= 2 −1 
( z − 1) 2
z 
(2 − 1)! dz  ( z − 1) 2
 z =1
d k
= ( z ) = k z k −1 = k
dz z =1
z =1
Inverse z-Transform
Case 2: Using MATLAB
z
Example E( z) =
( z − 1) 2

syms k z
Ez=z/(z-1)^2;
ek=iztrans(Ez,k)

ek =
k
Discrete Convolution
E1 ( z ) E2 ( z ) E( z) E ( z ) = E1 ( z ) E2 ( z )

Expanding
E ( z ) = [e1 (0) + e1 (1) z −1 + e1 (2) z −2 + ]  [e2 (0) + e2 (1) z −1 + e2 (2) z −2 + ]
Group by powers of z
E ( z ) = e1 (0)e2 (0) + [(e1 (0)e2 (1) + e1 (1)e2 (0))]z −1 +
[e1 (0)e2 (2) + e1 (1)e2 (1) + e1 (2)e2 (0)]z −2 +
= e(0) + e(1) z −1 + e(2) z −2 +
k k
e(k ) =  e1 (n)e2 (k − n) =  e1 (k − n)e2 (n)
n =0 n =0

e k 1
E1 z E2 z e1 k  e2 k

Convolution in discrete time is equivalent to multiplication in


the z-domain!
Discrete Convolution
z 2 ( z − 0.5)
Example E( z) = = E1 ( z ) * E2 ( z )
( z − 1)( z + 0.5)( z + 0.7)
z ( z − 0.5) −5 z 6z
E1 ( z ) = = +
( z + 0.5)( z + 0.7) z + 0.5 z + 0.7
e1 (k ) = −5(−0.5) k + 6(−0.7) k
e1 (0) = 1.00
e1 (1) = −1.70
e1 (2) = 1.69
e1 (3) = −1.433

z
E2 ( z ) = e2 (k ) = {1,1,1, }
z −1
Discrete Convolution
k
e1 (0) = 1.0
e(k ) =  e1 (k − n)e2 (n)
n =0 e1 (1) = −1.70
e1 (2) = 1.69
For k = 3
3
e1 (3) = −1.433
e(3) =  e1 (3 − n)e2 (n) e2 (n) = 1.0
n =0

e(3) = e1 (3)e2 (0) + e1 (2)e2 (1) + e1 (1)e2 (2) + e1 (0)e2 (3)


= (−1.433)(1) + (1.69)(1) − 1.70(1) + 1(1)
= −0.443
Discrete Convolution
Example Discrete Convolution (conv in MATLAB®)
e1 (k ) = −5(−0.5) k + 6(−0.7) k e1 ( k ) = {1.00, –1.70, 1.67, –1.455, ...)
e2 (k ) = {1.00, 1.00, 1.00, 1.00, ...)

for n=1:1:20; % n must be >0, k=n-1, t=(n-1)T = {0,T,2T,…}


e1k(n)=-5*(-.5)^(n-1)+6*(-.7)^(n-1);
e2k(n)=1;
end
ek=conv(e1k,e2k) Value on previous slide
ans =
Columns 1 through 6
1.0000 -0.7000 0.9900 -0.4430 0.6851 -0.1671
Columns 7 through 12
0.4607 0.0056 0.3320 0.0996 0.2642 0.1480

You might also like