Connexions

You are here: Home » Content » m17 - Solution of Difference Equations using the Z-Transform
Content Actions

m17 - Solution of Difference Equations using the Z-Transform

Module by: C. Sidney Burrus

Summary: The z transform will convert a linear, constant coefficient difference equation into an algebraic equation. This is the same as the Laplace transform converting a differential equation into an algebraic equation.

Solution of Difference Equations using the Z-Transform

The z-transform can be used to convert a difference equation into an algebraic equation in the same manner that the Laplace converts a differential equation in to an algebraic equation. The one-sided transform is particularly well suited for solving initial condition problems. The two unilateral shift properties explicitly use the initial values of the unknown variable.
A difference equation DE contains the unknown function x ( n ) x ( n ) and shifted versions of it such as x ( n 1 ) x ( n 1 ) or x ( n + 3 ) x ( n + 3 ) . The solution of the equation is the determination of x ( t ) x ( t ) . A linear DE has only simple linear combinations of x ( n ) x ( n ) and its shifts. An example of a linear second order DE is
a x ( n ) + b x ( n 1 ) + c x ( n 2 ) = f ( n ) a x ( n ) + b x ( n 1 ) + c x ( n 2 ) = f ( n ) (1)
A time invariant or index invariant DE requires the coefficients not be a function of n n and the linearity requires that they not be a function of x ( n ) x ( n ) . Therefore, the coefficients are constants.
This equation can be analyzed using classical methods completely analogous to those used with differential equations. A solution of the form x ( n ) = K λ n x ( n ) = K λ n is substituted into the homogeneous difference equation resulting in a second order characteristic equation whose two roots give a solution of the form x h ( n ) = K 1 λ 1 n + K 2 λ 2 n x h ( n ) = K 1 λ 1 n + K 2 λ 2 n . A particular solution of a form determined by f ( n ) f ( n ) is found by the method of undetermined coefficients, convolution or some other means. The total solution is the particular solution plus the solution of the homogeneous equation and the three unknown constants K i K i are determined from three initial conditions on x ( n ) x ( n ) .
It is possible to solve this difference equation using z-transforms in a similar way to the solving of a differential equation by use of the Laplace transform. The z-transform converts the difference equation into an algebraic equation. Taking the ZT of both sides of the DE gives
a X ( z ) + b [ z 1 X ( z ) + x ( 1 ) ] + c [ z 2 X ( z ) + z 1 x ( 1 ) + x ( 2 ) ] = Y ( z ) a X ( z ) + b [ z 1 X ( z ) + x ( 1 ) ] + c [ z 2 X ( z ) + z 1 x ( 1 ) + x ( 2 ) ] = Y ( z ) (2)
solving for X ( z ) X ( z ) gives
X ( z ) = z 2 [ Y ( z ) b x ( 1 ) x ( 2 ) ] z c x ( 1 ) a z 2 + b z + c X ( z ) = z 2 [ Y ( z ) b x ( 1 ) x ( 2 ) ] z c x ( 1 ) a z 2 + b z + c (3)
and inversion of this transform gives the solution x ( n ) x ( n ) . Notice that two initial values were required to give a unique solution just as the classical method needed two values.
These are very general methods. To solve an n n th order DE requires only factoring an n n th order polynomial and performing a partial fraction expansion, jobs that computers are well suited to. There are problems that crop up if the denominator polynomial has repeated roots or if the transform of y ( n ) y ( n ) has a root that is the same as the homogeneous equation, but those can be handled with slight modifications giving solutions with terms of the from n λ n n λ n just as similar problems gave solutions for differential equations of the form t e s t t e s t .
The original DE could be rewritten in a different form by shifting the index to give
a x ( n + 2 ) + b x ( n + 1 ) + c x ( n ) = f ( n + 2 ) a x ( n + 2 ) + b x ( n + 1 ) + c x ( n ) = f ( n + 2 ) (4)
which can be solved using the second form of the unilateral z-transform shift property.

Comments, questions, feedback, criticisms?

Send feedback