0% found this document useful (0 votes)
12 views5 pages

11.2 Linear Constant-Coefficient Difference Equations

Uploaded by

Ritesh Kumar
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)
12 views5 pages

11.2 Linear Constant-Coefficient Difference Equations

Uploaded by

Ritesh Kumar
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/ 5

CHAPTER 11 z-TRANSFORM APPLICATIONS

11.2 Linear Constant-Coefficient Difference Equations

This section demonstrates sequence generation and closed-form solutions to a second-order difference
equation. The difference equation is solved by z-transforming the equation and solving for the transform of
the solution sequence. You provide:

 a and b, the coefficients of the difference equation


 s0 and s1, the initial values of the sequence
 n, the number of samples

Background

For difference equations with constant coefficients, you can obtain the solution in closed form by
transforming the equation, and solving for the transform of the solution sequence. Then find the inverse
transform of the solution by expanding in partial fractions, as shown in Section 11.1: z-Transform and
Inverse Transform.

For example, the general second-order difference equation


a⋅s +b⋅s =s
n n+1 n+2

can be expressed as a sum of sequences of the form


n n
a⋅r and b⋅n⋅r
Mathcad Implementation

Iterative Sequence Generation

Given constants a, b and initial values s0, s1, Mathcad can generate the beginning of the difference sequence
by iteration. The range variable m starts at 2, so that m - 1 and m - 2 will be defined as index variables. Fig.
11.2.1 shows this calculated solution sequence, which has a sinusoidal appearance.
n ≔ 2 ‥ 100 i ≔ 0 ‥ 100
a ≔ −1 b ≔ 1.9
s ≔1 s ≔ −.1 s ≔b⋅s +a⋅s
0 1 n n−1 n−2

s
i

Fig. 11.2.1 Generated sequence

Example 11.2.2 z-Transform Closed-Form Solution

You can use z-transforms to obtain a solution in closed form. A closed form solution is often more useful,
since it allows you to find the amplitude at large n without calculating all the intermediate values, and shows
how the solution behaves over all time. First, transform the equation; shifting the sequence forward
corresponds to subtracting the first term of the sequence from the transform and multiplying by z. Thus Y, the
solution of the transform, satisfies the following equation:
a ⋅ Y + b ⋅ ⎛Y − s ⎞ ⋅ z = ⎛ ⎛Y − s ⎞ ⋅ z − s ⎞ ⋅ z
⎝ 0⎠ ⎝⎝ 0⎠ 1⎠ b = 1.9

Using the symbolic processor, we can solve for Y symbolically. Copy the above equation. Place the cursor
on the right side of the equation, and insert the symbolic keyword solve, then enter a comma, then enter Y.
Mathcad Ribbon: Symbolics panel: Keyword solve. Assign the solution for Y to a function of z.

solve , Y 1.9 ⋅ z − z ⋅ (z − 0.1)


Y (z) ≔ a ⋅ Y + b ⋅ Y − s ⋅ z = Y − s ⋅ z − s ⋅ z →− 2

⎝ 0⎠ ⎝⎝ 0⎠ 1⎠
z − 1.9 ⋅ z + 1
The numerical inverse transform is the sequence given by:
r≔2
n 2⋅π
r
x (n , X) ≔ ―― ⋅⌠
⌡ X (r ⋅ exp (1j ⋅ θ)) ⋅ exp (n ⋅ θ ⋅ 1j) d θ
2⋅π 0

where r is the radius of a circle in the complex plane that includes all the poles of F.

The inverse transform of Y gives the solution sequence. For example, the fifth term of the solution is
−15
x (5 , Y) = −3.379 + 6.432j ⋅ 10 s = −3.379
5

To find the corresponding time sequence in closed form, expand Y in partial fractions. The partial-fraction
expansion of Y depends on the roots of the denominator. If the discriminant
b ≔ 1.9
2
D ≔ b + 4 ⋅ a = −0.39

is nonzero, the denominator of Y has two distinct roots r1 and r2, and Y can be expanded in partial fractions
as follows:

⎛ ⎛ ⎞⎞
r1 ≔ .5 ⋅ ⎝b + if ⎝b > 0 , ‾‾
D , − ‾‾
D ⎠⎠ = 0.95 + 0.312j

−a
r2 ≔ ―― = 0.95 − 0.312j
r1

The numerator coefficients are given by


−1 ⎡ s ⎤
⎡A⎤ ⎡ 1 1 ⎤ ⎢ 0
⎥ = ⎡ 0.5 + 1.681j ⎤
≔ ⋅
⎢⎣ B ⎥⎦ ⎢⎣ r2 r1 ⎦⎥ ⎢ −s + b ⋅ s ⎥ ⎢⎣ 0.5 − 1.681j ⎥⎦
⎣ 1 0⎦

The closed-form solution sequence is


n n
S (n) ≔ A ⋅ r1 + B ⋅ r2

For example,

S (5) = −3.379 S (3000) = 1.65


The plotted solution matches the solution found above by direct iteration.

20 100
4

3.2

2.4

1.6

0.8

0
S (i) -0.8

-1.6

-2.4

-3.2

-4

0 10 20 30 40 50 60 70 80 90 100
i
Fig. 11.2.2 Closed-form sequence
In real terms, the solution is
S (n) ≔ 2 ⋅ |A| ⋅ cos (n ⋅ arg (r1) + arg (A))
so the solution sequence oscillates with amplitude
2 ⋅ |A| = 3.508
and period
2⋅π
――― = 19.786
arg (r1)
To examine other choices for the coefficients and initial values, modify the definitions above and recalculate.
The calculations will be correct as long as Y has two distinct poles, that is, as long as D is nonzero.

Example 11.2.3 Decaying Sequence

In this last example, the coefficients and initial values for the difference equation have been chosen so that the
roots of the denominator of the z-transform are equal and nonzero (that is, D is zero):
a ≔ −.81 b ≔ 1.8 s ≔1 s ≔ .5 s ≔b⋅s +a⋅s
1 0 n n−1 n−2

s
i

Fig. 11.2.3 Generated sequence


Y can be expanded in partial fractions as
A⋅z B⋅z
Y (z) ≔ ―― + ―――
z−r 2
(z − r)

The root is:


b
r≔― = 0.9
2

The coefficients A and B are b⋅s


0
A ≔ s = 0.5 B ≔ s − ―― = 0.55
0 1 2
The discrete-time series is

⎛ B ⎞ n
S (n) ≔ ⎜A + ―⋅ n⎟ ⋅ r
⎝ r ⎠

As a check:
s = 2.1 S (5) = 2.1
5

You might also like