1 Solution of difference equations using z-transforms
Using z-transforms, in particular the shift theorems discussed at the end of the previous Section, provides a useful method of solving certain types of difference equation. In particular linear constant coefficient difference equations are amenable to the z-transform technique although certain other types can also be tackled. In fact all the difference equations that we looked at in Section 21.1 were linear:
(1st order)
(1st order)
(2nd order)
Other examples of linear difference equations are
(2nd order)
(1st order)
The key point is that for a difference equation to be classified as linear the terms of the sequence arise only to power 1 or, more precisely, the highest subscript term is obtainable as a linear combination of the lower ones. All the examples cited above are consequently linear. Note carefully that the term in our fourth example does not imply non-linearity since linearity is determined by the terms.
Examples of non-linear difference equations are
We shall not consider the problem of solving non-linear difference equations.
The five linear equations listed above also have constant coefficients ; for example:
has the constant coefficients .
The (linear) difference equation
has one variable coefficient viz and so is not classified as a constant coefficient difference equation.
1.1 Solution of first order linear constant coefficient difference equations
Consider the first order difference equation
The equation could be solved in a step-by-step or recursive manner, provided that is known because
and so on.
This process will certainly produce the terms of the solution sequence but the general term may not be obvious. So consider
(1)
with initial condition .
We multiply both sides of (1) by and sum each side over all positive integer values of and zero. We obtain
or
(2)
The three terms in (2) are clearly recognisable as z-transforms.
The right-hand side is the z-transform of the constant sequence which is .
If denotes the z-transform of the sequence that we are seeking then (by the left shift theorem).
Consequently (2) can be written
(3)
Equation (3) is the z-transform of the original difference equation (1). The intervening steps have been included here for explanation purposes but we shall omit them in future. The important point is that (3) is no longer a difference equation. It is an algebraic equation where the unknown, , is the z-transform of the solution sequence .
We now insert the initial condition and solve (3) for :
(4)
The final step consists of obtaining the sequence of which (4) is the z-transform. As it stands (4) is not recognizable as any of the standard transforms that we have obtained. Consequently, one method of ‘inverting’ (4) is to use a partial fraction expansion. (We assume that you are familiar with simple partial fractions. See HELM booklet 3.6) Thus
so
Now, taking inverse z-transforms, the general term is, using the linearity property,
The symbolic notation is common and is short for ‘the inverse z-transform of’.
Task!
Using standard z-transforms write down explicitly, where
(5)
Checking the solution:
From this solution (5)
we easily obtain
These agree with those obtained by recursive solution of the given problem (1):
which yields
More conclusively we can put the solution (5) back into the left-hand side of the difference equation (1).
If
then
and
So, on the left-hand side of (1),
which does indeed equal 4, the given right-hand side, and so the solution has been verified.
Key Point 13
To solve a linear constant coefficient difference equation, three steps are involved:
- Replace each term in the difference equation by its z-transform and insert the initial condition(s).
- Solve the resulting algebraic equation. (Thus gives the z-transform of the solution sequence.)
- Find the inverse z-transform of .
The third step is usually the most difficult. We will consider the problem of finding inverse z-transforms more fully later.
Task!
Solve the difference equation
(6)
where and are constants.
(The solution will give the term of an arithmetic sequence with a constant difference and initial term .)
Start by replacing each term of (6) by its z-transform:
If we obtain the algebraic equation
Note that the right-hand side transform is that of a constant sequence . Note also the use of the left shift theorem. Now insert the initial condition and then solve for :
Finally take the inverse z-transform of the right-hand side. [Hint: Recall the z-transform of the ramp sequence .]
We have
(7)
using the known z-transforms of the ramp and unit step sequences. Equation (7) may well be a familiar result to you – an arithmetic sequence whose ‘zeroth’ term is has general term .
i.e.
This solution is of course readily obtained by direct recursive solution of (6) without need for z-transforms. In this case the general term is readily seen from the form of the recursive solution: (Make sure you really do see it).
N.B. If the term is labelled as the first term (rather than the zeroth) then
,
so in this case the term is
rather than (7).
1.2 Use of the right shift theorem in solving difference equations
The problem just solved was given by (6), i.e.
with
We obtained the solution
Now consider the problem
(8)
with .
The only difference between the two problems is that the ‘initial condition’ in (8) is given at rather than at . Writing out the first few terms should make this clear.
The solution to (8) must therefore be the same as for (6) but with every term in the solution (7) of (6) shifted 1 unit to the left.
Thus the solution to (8) is expected to be
(replacing by in the solution (7)).
Task!
Use the right shift theorem of z-transforms to solve (8) with the initial condition .
-
Begin by taking the z-transform of (8), inserting the initial condition and solving for
:
We have, for the z-transform of (8)
(9)
The second term of has the inverse z-transform .
The first term is less straightforward. However, we have already reasoned that the other term in here should be .
-
Show that the z-transform of
is
. Use the standard transform of the ramp and step:
We have
by the linearity property
as expected.
-
Finally, state
:
Returning to (9) the inverse z-transform is
i.e.
as we expected.
Task!
Earlier in this Section (pages 37-39) we solved
with
Now solve with . (10)
Begin by obtaining the z-transform of :
We have, taking the z-transform of (10),
(using the right shift property and inserting the initial condition.)
Write the second term as and obtain the partial fraction expansion of the bracketed term. Then complete the z-transform inversion.
We now have
so
(11)
Compare this solution (11) to that of the previous problem (5) on page 39:
Solution (11) is just the solution sequence (5) moved 1 unit to the left. We anticipated this since the difference equation (10) and associated initial condition is the same as the difference equation (1) but shifted one unit to the left.