Chapter 1 Z Transform
Chapter 1 Z Transform
The signals r, e and c are analog but the signal f is digital. For signal matching, analog
to digital (A/D) converter and digital to analog (D/A) converter must be used as shown
in Fig. 2.
*
y y
9 12
1 3 5 7 9 11 t (sec) 1 3 6 t (sec)
T = 1 sec
*
y
9 12
3 6 t (sec)
T = 3 sec
3 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
If we define z = eTs
∞
𝑌 ∗ (𝑠) = ∑ 𝑦(𝑘𝑇)𝑧 −𝑘
𝑘=0
This will be explained later as z transforms.
3. Digital to Analog (D/A) Converter:
D/A converter process is simple and instantaneous. The weighted voltages are summed
together to yield the analog output. For example, in Fig. 4, three weighted voltages are
summed. The three-bit binary code is represented by electronic switches. Thus, if the
binary number is 110, the center and bottom switches are on, and the analog output is
6 volts.
In order to eliminate the zero value between sampling interval, a Holder device is used.
* m (t)
m (kT)
0 t 0 t
1T 3T 5T 7T 1T 3T 5T 7T
4. Modelling of Sampler
The objective at this point is to derive a mathematical model for the digital computer
as represented by a sampler and zero-order hold. Consider the sampling model shown
in Fig. 6, where the sampler S(t) is represented by two step functions (one +ve and
another −ve) as shown in figure 6:
5 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
6 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
sampling interval T and just write x(0), x(1), x(2), … , x(k), since the sample interval is
the same for all of the discrete samples.
7 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
𝐵
−
𝑚
𝐾
−
𝑚
8 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
𝐵
−
𝑚
𝐾
−
𝑚
𝑦(𝑘) 𝑦(𝑘 + 1)
Z
𝑦(𝑘) 𝑦(𝑘 − 1)
Z−1
Example:
Consider the difference equation given below
𝑦(𝑘 + 3) + 2𝑦(𝑘 + 2) + 4𝑦(𝑘 + 1) − 𝑦(𝑘) = 𝑢(𝑘 + 1) + 3𝑢(𝑘)
What is the order of this difference equation? Is this equation linear or nonlinear, time
variant or time invariant, homogenous or non-homogenous?
The above equation is 3rd order due to the (k+3) term,
The above equation is Linear and Time invariant, because all coefficients are constants
(1, 2, 4 and −1),
The above equation is non-homogenous, as the coefficients regarding the input (u) are
nonzero
9 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
6. Z-Transform
For discrete signals Laplace transform can’t be used. Laplace transform is used with
analog signals. For discrete signals, Laplace transform is replaced by another related
transform called the z-transform. The z-transform will be used for discrete signals.
As Laplace transform converts the differential equations into algebraic terms with
respect to s, z-transform converts the difference equations into algebraic terms with
respect to z. Both transformations are matching a complex quantity to the points of a
region of the complex plane.
It should be noted that the z-plane (i.e., the domain of z-transform) is organized in a
polar form, while the s-plane (i.e., the domain of Laplace transform) is in a Cartesian
form as shown in Fig. 11.
10 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
12 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
𝛿(𝑧) = 1
6.1.2 Unit Step
1, 𝑘≥0
𝑢(𝑘) = {
0, 𝑘<0
∞
−1 −2 −3 −𝑘
𝑈(𝑧) = 1 + 𝑧 +𝑧 +𝑧 + ⋯+ 𝑧 = ∑ 𝑧 −𝑘
𝑘=0
……
𝑘
0 1 2 3
𝑟(𝑘) = 𝑘 1
𝑚
𝑑 𝑚
𝑧{𝑘 𝑓(𝑘)} = (−𝑧 ) 𝐹(𝑧), 𝑚=1
𝑑𝑧
1
𝑑
𝑧{𝑘1 𝑓(𝑘)} = (−𝑧 ) 𝐹(𝑧)
𝑑𝑧
𝑍
𝑓(𝑘) = 1, 𝑡ℎ𝑒𝑛 𝑓(𝑧) =
𝑍−1
𝑧
𝑅(𝑧) =
(𝑧 − 1)2
In general, for a sampling time (T) rather than unity,
𝑇𝑧
𝑅(𝑧) =
(𝑧 − 1)2
6.1.4 Polynomial function
𝑎𝑘 , 𝑘≥0
𝑢(𝑘) = {
0, 𝑘<0
14 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
15 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
−4
𝑇𝑧 𝑇𝑧 −3 𝑧 −3
𝑧 = = (𝑎𝑠 𝑇 = 1)
(𝑧 − 1)2 (𝑧 − 1)2 (𝑧 − 1)2
0.25 𝑧 0.25 𝑧 −3 0.25𝑧(1 + 𝑧 −4 )
𝑋(𝑧) = + =
(𝑧 − 1)2 (𝑧 − 1)2 (𝑧 − 1)2
16 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
6.2.1 Linearity
Suppose we have two functions along with their respective Z transforms:
𝑥1 [𝑘] ↔ 𝑋1 (𝑧) 𝑎𝑛𝑑 𝑥2 [𝑘] ↔ 𝑋2 (𝑧)
The property of linearity means that
𝒵(𝑎 𝑥1 [𝑘] + 𝑏 𝑥2 [𝑘]) = 𝑎 𝑋1 (𝑧) + 𝑏 𝑋2 (𝑧)
Where a and b are constants.
Example:
𝑓(𝑘) = 2 × 1(𝑘) + 4 × 𝛿(𝑘), 𝑘 = 0,1,2, …
𝐹(𝑧) = 𝒵{2 × 1(𝑘) + 4 × 𝛿(𝑘)}
𝐹(𝑧) = 2 × 𝒵{1(𝑘)} + 4 × 𝒵{𝛿(𝑘)}
𝑧 6𝑧 − 4
𝐹(𝑧) = 2 × +4=
𝑧−1 𝑧−1
17 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
Example:
Using the time advance property, find the z-transform of the causal sequence
𝑓(𝑘) = {4, 8, 16, 32, … }
The sequence can be written as
𝑓(𝑘) = 2𝑘+2 = 𝑦(𝑘 + 2) 𝑤ℎ𝑒𝑟𝑒 𝑦(𝑘) = 2𝑘
𝑍
𝑌(𝑧) =
𝑍−2
18 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
19 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
20 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
Example:
Find the z-transform of the following function
𝑦[𝑘] = 𝑒 −𝑘 𝑢[𝑘]
Recall that the z-transform of a sampled step is
𝑍 1
𝑒1𝑍 𝑍
𝑋(𝑍) = → 𝑋(𝑒 𝑍) = 1 =
𝑍−1 𝑒 𝑍 − 1 𝑍 − 𝑒 −1
Therefore,
𝑍
𝑌(𝑍) = 𝑋(𝑒 1 𝑍) =
𝑍 − 𝑒 −1
Example:
Find the z transform of the following function
𝑥(𝑛) = 𝑒 −0.1𝑛 cos(0.25𝜋𝑛) 𝑢(𝑛)
As we know, the z transform of cos(0.25n) is
𝑧 (𝑧 − cos(0.25𝜋))
𝑧 2 − 2𝑧 cos(0.25𝜋) + 1
Replace each Z by Ze0.1
𝑧𝑒 0.1 (𝑧𝑒 0.1 − cos(0.25𝜋))
𝑋(𝑧) =
(𝑧𝑒 0.1 )2 − 2𝑧𝑒 0.1 cos(0.25𝜋) + 1
Dividing num and den by (e0.1)2
𝑧 (𝑧 − 𝑒 −0.1 cos(0.25𝜋)) 𝑧(𝑧 − 0.6398)
𝑋(𝑧) = 2 =
𝑧 − 2𝑧𝑒 −0.1 cos(0.25𝜋) + (𝑒 −0.1 )2 𝑧 2 − 1.2796𝑧 + 0.8187
6.2.7 Convolution
Suppose we have two functions along with their respective Z transforms:
𝑥1 [𝑘] ↔ 𝑋1 (𝑧) 𝑎𝑛𝑑 𝑥2 [𝑘] ↔ 𝑋2 (𝑧)
The convolution property means that
𝒵(𝑥1 [𝑘] ∗ 𝑥2 [𝑘]) = 𝑋1 (𝑧) ∗ 𝑋2 (𝑧)
6.2.8 Differentiation in z-Domain (Complex Differentiation)
Suppose we have a function with its Z transform:
𝑥[𝑘] ↔ 𝑋(𝑧)
Then
21 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
𝑑𝑋(𝑧)
𝑘 𝑥[𝑘] ↔ −𝑧
𝑑𝑧
We used this property to proof the Z-transform of ramp function.
Example:
Calculate the z-transform of the following function:
𝑦[𝑘] = 𝑘. 2𝑘 𝑢[𝑘]
𝑍 𝑑𝑋(𝑧) (𝑍 − 2) × 1 − 𝑍(1) −2
𝑥[𝑘] = 2𝑘 𝑢[𝑘] → 𝑋(𝑍) = → = =
𝑍−2 𝑑𝑧 (𝑍 − 2)2 (𝑍 − 2)2
𝑑𝑋(𝑧) 2𝑍
𝑌(𝑍) = −𝑍 =
𝑑𝑧 (𝑍 − 2)2
Example:
Calculate the z-transform of the following function:
1 𝑘
𝑦[𝑘] = 𝑘. ( ) 𝑢[𝑘 − 2]
2
As we know:
1 𝑘−2 −2
𝑍 𝑍 −1 1
𝑥[𝑘] = ( ) 𝑢[𝑘 − 2] ↔ 𝑋(𝑧) = 𝑍 = , |𝑍| >
2 1 1 2
𝑍− 𝑍−
2 2
2 𝑘−2 2
1 1 1 1 𝑍 −1 1
𝑔[𝑘] = ( ) ( ) 𝑢[𝑘 − 2] = ( ) 𝑥[𝑘] ↔ 𝐺(𝑧) = , |𝑍| >
2 2 2 4𝑍 − 1 2
2
Also, we know that:
𝑑𝐺(𝑧)
𝑦[𝑘] = 𝑘. 𝑔[𝑘] ↔ 𝑌(𝑧) = −𝑧
𝑑𝑧
1 −2 −1
𝑑𝐺(𝑧) 1 (𝑍 − 2) (−𝑍 ) − 𝑍 (1)
=
𝑑𝑧 4 1 2
(𝑍 − 2)
−1 1 1 −1
1 𝑍 (𝑍 − 2) + 1 1 2 − 2 𝑍
𝑌(𝑧) = =
4 1 2 4 1 2
(𝑍 − 2) (𝑍 − 2)
22 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
Example:
Obtain the Z-transform of the following transfer function considering T=1
1
𝑋(𝑠) =
𝑆(𝑆 + 1)
Using partial fraction
1 1
𝑋(𝑠) = −
𝑆 𝑆+1
23 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
Example:
Obtain the Z-transform of the following transfer function considering T=1
1
𝑋(𝑠) =
(𝑆 + 2)(𝑆 + 1)2
Using partial fraction
2 1 2
𝑋(𝑠) = − −
𝑆 + 1 (𝑆 + 1)2 𝑆 + 2
Taking inverse Laplace
𝑥(𝑡) = 2𝑒 −𝑡 − 𝑡𝑒 −𝑡 − 2𝑒 −2𝑡
Taking the Z-transform
2𝑍 𝑑 𝑍 2𝑍
𝑋(𝑧) = − {−𝑧 ( )} −
𝑍 − 𝑒 −1 𝑑𝑧 𝑍 − 𝑒 −1 𝑍 − 𝑒 −2
we obtain the z transform from Laplace directly
2𝑍 𝑍𝑒 −1 2𝑍
𝑋(𝑧) = − −
𝑍 − 𝑒 −1 (𝑍 − 𝑒 −1 )2 𝑍 − 𝑒 −2
2𝑍 2 − 3𝑍𝑒 −1 2𝑍
𝑋(𝑧) = −
(𝑍 − 𝑒 −1 )2 𝑍 − 𝑒 −2
2𝑍 2 − 1.1036𝑍 2𝑍
𝑋(𝑧) = −
(𝑍 − 0.3679)2 𝑍 − 0.13534
7. Z-Transform Table
𝑋(𝑧) = ∑ 𝑥[𝑘]. 𝑍 −𝑘
𝑘=−∞
We can use the following table:
24 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
8. Inverse Z-Transform
The implementation of z-transform results in the transformation from the discrete-time
domain to z-domain. The opposite procedure is implemented with the aid of the inverse
z-transform. The inverse z-transform is defined by
1
𝑥[𝑛] = 𝒵 −1 {𝑋(𝑧)} = ∮ 𝑋(𝑧)𝑧 𝑛−1 𝑑𝑧
2𝜋𝑗 𝑐
Where c is the closed contour within the region of convergence of X(z).
There are 3 methods for calculating the inverse transform of a function X(z)
25 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
𝑋(𝑧) = 2𝑧 −1 + 2𝑧 −2 + 𝑧 −3 − 𝑧 −5 + ⋯
𝑥[𝑛] = {0, 2, 2, 1, 0, −1, … }
26 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
Example:
Find the first 5 coefficients of the function x[n] when
𝑍2 − 1
𝑋(𝑧) = 3
𝑍 + 2𝑍 + 4
By long division:
𝑋(𝑧) = 𝑧 −1 − 3𝑧 −3 − 4𝑧 −4 + ⋯
𝑥[𝑛] = {0, 1, 0, −3, −4, … }
Example:
Consider the sequence
𝑓(𝑘) = {1, 3, 2, 0, 4, 0, 0, 0}
Find F(z).
∞
𝐹(𝑧) = ∑ 𝑓(𝑘) 𝑧 −𝑘
𝑘=0
0 −1 −2
𝐹(𝑧) = [1 × 𝑧 + 3 × 𝑧 +2×𝑧 + 4 × 𝑧 −4 ] = 1 + 3𝑧 −1 + 2𝑧 −2 + 4𝑧 −4
Example:
Compute the inverse z-transform of the function
𝑍
𝐹(𝑧) =
(𝑍 + 0.1)(𝑍 + 0.2)(𝑍 + 0.3)
Dividing both sides by (Z):
𝐹(𝑧) 1
=
𝑍 (𝑍 + 0.1)(𝑍 + 0.2)(𝑍 + 0.3)
Using partial fraction:
27 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
𝐹(𝑧) 𝐴 𝐵 𝐶
= + +
𝑍 𝑍 + 0.1 𝑍 + 0.2 𝑍 + 0.3
A = 50, B = −100 and C = 50
50𝑍 100𝑍 50𝑍
𝐹(𝑍) = − +
𝑍 + 0.1 𝑍 + 0.2 𝑍 + 0.3
Using Inverse Z-Transform
𝑓[𝑘] = 50(−0.1)𝑛 𝑢(𝑛) − 100(−0.2)𝑛 𝑢(𝑛) + 50(−0.3)𝑛 𝑢(𝑛), 𝑘>0
Example:
Compute the inverse z-transform of the function
𝑍 −2 + 𝑍 −1 + 1
𝑋(𝑧) =
0.2𝑍 −2 + 0.9𝑍 −1 + 1
Convert all powers of Z to +ve powers
𝑍 2 + 𝑍1 + 1 𝑍 2 + 𝑍1 + 1
𝑋(𝑧) = 2 =
𝑍 + 0.9𝑍 + 0.2 (𝑍 + 0.4)(𝑍 + 0.5)
Divide both sides by Z
𝑋(𝑧) 𝑍 2 + 𝑍1 + 1
=
𝑍 𝑍(𝑍 + 0.4)(𝑍 + 0.5)
Using partial fraction:
𝑋(𝑧) 𝑍 2 + 𝑍1 + 1 𝐴 𝐵 𝐶
= = + +
𝑍 𝑍(𝑍 + 0.4)(𝑍 + 0.5) 𝑍 𝑍 + 0.4 𝑍 + 0.5
𝑍 2 + 𝑍1 + 1 = 𝐴(𝑍 + 0.4)(𝑍 + 0.5) + 𝐵𝑍(𝑍 + 0.5) + 𝐶𝑍(𝑍 + 0.4)
At Z=0 1 = 0.2 A → A=5
At Z=−0.4 0.76 = −0.04 B → B= −19
At Z=−0.5 0.75 = 0.05 C → C= 15
𝑋(𝑧) 5 19 15
= − +
𝑍 𝑍 𝑍 + 0.4 𝑍 + 0.5
19𝑍 15𝑍
𝑋(𝑧) = 5 − +
𝑍 + 0.4 𝑍 + 0.5
Taking inverse Z transform:
28 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
Example:
Compute the inverse z-transform of the function
𝑍 3 + 2𝑍 + 1
𝑋(𝑧) =
(𝑍 − 0.1)(𝑍 2 + 𝑍 + 0.5)
As the quadratic term (in denominator) gives complex roots, no need to factorize it.
Divide both sides by Z:
𝑋(𝑧) 𝑍 3 + 2𝑍 + 1
=
𝑍 𝑍(𝑍 − 0.1)(𝑍 2 + 𝑍 + 0.5)
Using partial fractions:
𝑋(𝑧) 𝑍 3 + 2𝑍 + 1 𝐴 𝐵 𝐶𝑍 + 𝐷
= = + +
𝑍 𝑍(𝑍 − 0.1)(𝑍 2 + 𝑍 + 0.5) 𝑍 𝑍 − 0.1 𝑍 2 + 𝑍 + 0.5
A = −20
B = 19.689
C = 1.311
D = − 1.557
20𝑍 19.689𝑍 1.311𝑍 2 − 1.557𝑍
𝑋(𝑍) = − + +
𝑍 𝑍 − 0.1 𝑍 2 + 𝑍 + 0.5
𝒛 [𝒛 − 𝒂 𝐜𝐨𝐬(𝒃)]
𝒂𝒏 𝐜𝐨𝐬(𝒃𝒏) 𝒖(𝒏) →
𝒛𝟐 − [𝟐𝒂 𝐜𝐨𝐬(𝒃)]𝒛 + 𝒂𝟐
[𝒂 𝐬𝐢𝐧(𝒃)] 𝒛
𝒂𝒏 𝐬𝐢𝐧(𝒃𝒏) 𝒖(𝒏) →
𝒛𝟐 − [𝟐𝒂 𝐜𝐨𝐬(𝒃)]𝒛 + 𝒂𝟐
1.311𝑍(𝑍 − 1.1876) 1.311𝑍(𝑍 − 0.7071 × (−0.7071) − 1.6876)
= 2
𝑍 2 + 𝑍 + 0.5 𝑍 − 2 × 0.7071 × (−0.7071)𝑍 + (0.7071)2
1.311𝑍(𝑍 − 0.7071 × (−0.7071)) 2.2124𝑍
−
𝑍 2 − 2 × 0.7071 × (−0.7071)𝑍 + (0.7071)2 𝑍 2 − 2 × 0.7071 × (−0.7071)𝑍 + (0.7071)2
2.2124𝑍 4.4248 × 0.7071 × 0.7071𝑍
=
𝑍 2 − 2 × 0.7071 × (−0.7071)𝑍 + (0.7071)2 𝑍 2 − 2 × 0.7071 × (−0.7071)𝑍 + (0.7071)2
29 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
3𝜋
𝑥[𝑛] = −20𝛿(𝑛) + 19.689(0.1)𝑛 𝑢(𝑛) + 1.311(0.7071)𝑛 cos ( 𝑛) 𝑢(𝑛)
4
3𝜋
− 4.4248(0.7071)𝑛 sin ( 𝑛) 𝑢(𝑛)
4
Example:
For the discrete-time system shown below, if x[n]=n u(n), calculate the output y(n).
𝑍
𝑋(𝑧) =
(𝑍 − 1)2
𝑍 4𝑍 2
𝑌(𝑧) = 𝑋(𝑍)𝐻(𝑍) =
(𝑍 − 1)2 𝑍 2 − 0.25
𝑌(𝑧) 1 4𝑍 2 4𝑍 2
= =
𝑍 (𝑍 − 1)2 𝑍 2 − 0.25 (𝑍 − 0.5)(𝑍 + 0.5)(𝑍 − 1)2
𝑌(𝑧) 4𝑍 2 𝐴 𝐵 𝐶 𝐷
= = + + +
𝑍 (𝑍 − 0.5)(𝑍 + 0.5)(𝑍 − 1)2 𝑍 − 0.5 𝑍 + 0.5 𝑍 − 1 (𝑍 − 1)2
A= 4, B= −4/9, C= −32/9 and D = 16/3
4 32 16
4𝑍 𝑍 𝑍 𝑍
𝑌(𝑧) = − 9 − 9 + 3 2
𝑍 − 0.5 𝑍 + 0.5 𝑍 − 1 (𝑍 − 1)
4 32 16
𝑦[𝑛] = 4(0.5)𝑛 𝑢(𝑛) − (−0.5)𝑛 𝑢(𝑛) − 𝑢(𝑛) + 𝑛 𝑢(𝑛)
9 9 3
8. Solving Difference Equation
Example:
Solve the following linear difference equation,
3 1
𝑥(𝑘 + 2) − 𝑥(𝑘 + 1) + 𝑥(𝑘) = 1(𝑘)
2 2
5
With initial conditions 𝑥(0) = 1, 𝑥(1) =
2
31 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
32 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
−0.5556 𝑧 1.5556 𝑧
𝑦(𝑛) = 𝑍 −1 (𝑌(𝑧)) = 𝑍 −1 ( ) + 𝑍 −1 ( )
(𝑧 + 0.5) (𝑧 − 0.4)
𝑧 𝑧
= (−0.5556)𝑍 −1 ( ) + (1.5556)𝑍 −1 ( )
(𝑧 − (−0.5)) (𝑧 − 0.4)
= (−0.5556)(−0.5)𝑛 𝑢(𝑛) + (1.5556)(0.4)𝑛 𝑢(𝑛)
Thus the output signal is
𝒚(𝒏) = (−𝟎. 𝟓𝟓𝟓𝟔)(−𝟎. 𝟓)𝒏 𝒖(𝒏) + (𝟏. 𝟓𝟓𝟓𝟔)(𝟎. 𝟒)𝒏 𝒖(𝒏)
Example:
Solve for x(k) of the difference equation:
𝑥(𝑘 + 2) − 1.3679𝑥(𝑘 + 1) + 0.3679𝑥(𝑘) = 0.3679𝑢(𝑘 + 1) + 0.2642𝑢(𝑘)
Known that: u(k) = 0 for k 0, u(0) = 1, u(1) = 0.2142, u(2) = −0.2142, u(k) = 0 k=3,4,…
Also x(k) = 0 for k 0
From the given values of the input function, we can get an expression for U(z)
𝑈(𝑧) = 1 + 0.2142𝑧 −1 − 0.2142𝑧 −2
Taking the Z transform for both sides of the difference equation
[𝑧 2 𝑋(𝑧) − 𝑧 2 𝑥(0) − 𝑧 𝑥(1)] − 1.3679[𝑧 𝑋(𝑧) − 𝑧 𝑥(0)] + 0.3679𝑋(𝑧)
= 0.3679[𝑧 𝑈(𝑧) − 𝑧 𝑢(0)] + 0.2642𝑈(𝑧)
In the above equation x(0) = 0, u(0) = 1
𝑧 2 𝑋(𝑧) − 𝑧 𝑥(1) − 1.3679𝑧 𝑋(𝑧) + 0.3679𝑋(𝑧)
= 0.3679𝑧 𝑈(𝑧) − 0.3679𝑧 + 0.2642𝑈(𝑧)
It is clear that x(1) is unknown. To calculate its value, we substitute k= −1 in the given
difference equation
𝑥(1) − 1.3679𝑥(0) + 0.3679𝑥(−1) = 0.3679𝑢(0) + 0.2642𝑢(−1)
𝑥(1) = 0.3679
𝑋(𝑧)(𝑧 2 − 1.3679𝑧 + 0.3679) − 0.3679𝑧 = 𝑈(𝑧)(0.3679𝑧 + 0.2642) − 0.3679𝑧
𝑋(𝑧)(𝑧 2 − 1.3679𝑧 + 0.3679) = 𝑈(𝑧)(0.3679𝑧 + 0.2642)
0.3679𝑧 + 0.2642
𝑋(𝑧) = 𝑈(𝑧)
𝑧 2 − 1.3679𝑧 + 0.3679
33 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
To verify the above result, we calculate the inverse z-transform of F(z)= z/(z - 2);
syms k, z
F = z/(z - 2);
iztrans(F)
ans = 2^k
References:
34 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein
Benha University Electrical Engineering Department
Faculty of Engineering at Shubra Dr. Ahmed Mustafa Hussein
[1] M. Sami Fadali, Antonio Visioli. Digital Control Engineering: Analysis and Design, Academic
Press (Elsevier), 3rd Edition, 2020
[2] Anastasia Veloni, Nikolaos Miridakis. Digital Control Systems: Theoretical Problems and
Simulation Tools, CRC Press, Taylor & Francis Group, 2018
[3] Katsuhiko Ogata. Discrete-Time Control Systems, 2nd ed. Prentice Hall, 1995.
[4] Nise, N. S. Control System Engineering, 6th ed. John Wiley & Sons Ltd., UK, 2011.
[5] Dorf, R. C. Modern Control Systems, 5th ed. Addison-Wesley, Reading, MA, 1989.
35 Chapter One: Introduction to Digital Control Systems Dr. Ahmed Mustafa Hussein