Discrete Time Systems Discrete Time Systems & Difference Equations
Discrete Time Systems Discrete Time Systems & Difference Equations
Dr. AbdullaIsmail
Professor of Electrical Engineering
[email protected]
Digital Control
Introduction
Digital control involves systems whose control is updated
at discrete time instants.
Discrete-time models provide mathematical relations
between the system variables at these time instants.
Here, we develop the mathematical properties of discretetime models.
Difference Equations are used to model Discrete Time
Dynamical Systems.
Digital Control
Digital Control
6
Digital Control
The term H is a constant and its derivative is zero, and the term Q
cancels so that the remaining terms only involve perturbations.
Substituting for the outflow q0 from the linearized valve equation into
the volumetric fluid balance gives the analog mathematical model
where = RC is the fluid time constant for
7
Digital
Control
the tank.
h(t ) e
( t t 0 ) /
1 t ( t ) /
h(t 0 ) e
qi ( )d
C t0
h( k 1) e T / h( k ) R 1 e T / qi ( k )
where the variables at time kT are denoted by the argument k.
This is the desired discrete time model describing the system with
piecewise constant control.
8
Digital Control
Difference Equations
Digital Control
Difference Equations
We further assume that the coefficients ai, bi, i = 0, 1, 2, . . .
, are constant.
The difference equation is then referred to as linear time
invariant, or LTI.
If the forcing function or input u(k) is equal to zero, the
equation is said to be homogeneous.
Difference equations can be solved using iterations.
Alternatively, Z-transform method provide a convenient
approach for solving LTI difference equations, as discussed
in the next section.
Digital Control
10
Difference Equations
Example
Determine the order of the equation.
Is the equation (a) linear ?
(b) time-invariant ? (c) homogeneous ?
(i)
y k 2 0.8 y k 1 .07 y k u k
(ii)
(iii)
y k 1 0.1 y 2 k
Digital Control
11
Difference Equations
y k 2 0.8 y k 1 .07 y k u k
Second order.
All terms linear and have constant coefficients
LTI.
A forcing function appears in the equation
nonhomogeneous.
Digital Control
12
Difference Equations
Fourth order.
Second coefficient is time-dependent but all the terms
are linear linear time varying.
No forcing function homogeneous.
Digital Control
13
Difference Equations
y k 1 0.1 y k
2
First order.
RHS is a nonlinear function of y(k) nonlinear.
No forcing function homogeneous.
No terms depending explicitly on time time invariant.
Digital Control
14
Digital Control
15
Difference Equations
Example 1
The DT input(sequence) x[k] = 2ku[k] is applied to the
discrete time system described by the following difference
equation:
Digital Control
DTS
y[k]
16
Difference Equations
Example 1 .. Solution
Express y[k + 1] 0.4y[k] = x[k] as follows:
y[k] = 0.4y[k 1] + x[k 1]
= 0.4y[k 1] + 2(k 1) u(k 1)
which can alternatively be expressed as
DTS
Input sequence x[k]
Digital Control
17
Difference Equations
Example 1 .. Solution
By iterating from k = 0, the output response is computed
as follows:
DTS
Input sequence x[k]
Digital Control
18
Difference Equations
The output response y[k] can be expressed as
Difference Equations
Example 2
Repeat Example1 to calculate
(i)the zero-input response yzi[k],
(ii)(ii) the zero-state response yzs[k], and
(iii)(iii) the overall output response y[k] for 0 k 5.
y[k + 1] 0.4y[k] = x[k].
x[k] = 2ku[k]
20
Digital Control
Difference Equations
Example 2 .. Solution
(i) The zero-input response of the system is obtained by
solving the following difference equation:
y[k + 1] 0.4y[k] = x[k],
with input x[k] = 0 and initial condition y[1] = 4.
The difference equation reduces to
with initial condition yzi[1] = 4.
Iterating for k = 0, 1, 2, 3, 4, and 5 yields
21
Digital Control
Difference Equations
Example 2 .. Solution
(ii) The zero-state response of the system is calculated by
solving the following difference equation:
Digital Control
Difference Equations
Example 2 .. Solution
(iii) Adding the zero-input and zero-state components
obtained in parts (i) and (ii), yields
Digital Control
Digital Control
24
Digital Control
25
Digital Control
26
27
28
29
or
or
Digital Control
31
Digital Control
Digital Control
Digital Control
and
Applying the principle of superposition, the overall
response to the input sequence x[k] is given by
y[k] = h[k 1] + 3h[k 2] + 2h[k 6].
Digital Control
Impulse response
h[k] of the LTID system
Digital Control
MATLAB APPLICATION
EXAMPLE 1
The DT sequence x[k] = 2ku[k] is applied at the input of an
LTID system described by the following difference equation:
y[k + 1] 0.4 y[k] = x[k], with the initial condition y[1] = 4.
Compute the output response y[k] of the LTID system for 0
k 50 using MATLAB.
Digital Control
MATLAB APPLICATION
EXAMPLE 1
Digital Control
MATLAB APPLICATION
EXAMPLE 2
The DT sequence x[k] = 0.5ku[k] is applied at the input of
an LTID system described by the following second-order
difference equation:
y[k + 2] + y[k + 1] + 0.25y[k] = x[k + 2],
with initial conditions y[1] = 1 and y[2] = 2.
Compute the output response y[k] of the LTID system for
0 k 50 using MATLAB.
Digital Control
MATLAB APPLICATION
EXAMPLE 2 .. Solution
Digital Control
MATLAB APPLICATION
EXAMPLE 2 .. Solution
Digital Control
MATLAB APPLICATION
EXAMPLE 2 .. Solution
Digital Control
42
Exercise Problems
1. Consider the input sequence x[k]=2u[k] applied to a DT system modeled
with the following inputoutput relationship:
y[k + 1] 2y[k] = x[k], and initial condition y[1] = 2.
2. Repeat Problem 1 for the applied input x[k] = (0.5)k u[k] and the input
output relationship y[k + 2] y[k + 1] + 0.5y[k] = x[k], with initial
conditions y[1] = 0 and y[2] = 1.
3. Repeat Problem 1 for the applied input x[k] = (1)k u[k] and the input
output relationship y[k + 2] 0.75y[k + 1] + 0.125y[k] = x[k], with ancillary
conditions y[1] = 1 and y[2] = 1.
Digital Control
43
Exercise Problems
4. The MATLAB function impz can be used to determine the impulse
response of an LTID system from its difference equation
representation. Determine the first 50 samples of the impulse
response of the LTID systems with the difference equations specified
in Problems 1-3.
Digital Control
44