Difference equations and z transforms.

  • Thread starter Thread starter cdotter
  • Start date Start date
  • Tags Tags
    Difference
cdotter
Messages
305
Reaction score
0

Homework Statement


y[n+2]-y[n+1]-6y[n]=n; y[0]= 0, y[1]= -1
Solve using method of undetermined coefficients and z transforms to verify the answers are the same.

Homework Equations



The Attempt at a Solution



Undetermined coefficients:

Let y=r^n
r^{n+2}-r^{n+1}-6r^n=0
r^n(r^2-r-6)=0 \Rightarrow r=3, r=2
So the homogeneous solution is y_h[n]=c_1 3^n - c^2 2^n.

For the particular solution:
[PLAIN]http://img199.imageshack.us/img199/8694/giflatex.gif
(For some reason it says there's an error in my code when I try to use the embedded Latex system...)
Solving for coefficients c_1 and c_2 with the initial values, I get c_1=-31/36 and c_2=-8/9.
So y[n]=-\frac{31}{36}3^n+\frac{8}{9}2^n-\frac{1}{6}n-\frac{1}{36}.

Z transform
Taking the z transform of both sides of y[n+2]-y[n+1]-6y[n]=n gives
(z^2yz-z^2 \cdot 0 - z \cdot -1)-(z(yz-0))-6(yz)=\frac{z}{(z-1)^2}
yz(z^2-z-6)+z=\frac{z}{(z-1)^2}
y[n]=\frac{z}{(z-1)^2(z+2)(z-3)}-\frac{z}{(z+2)(z-3)}
Taking the inverse z transform in Maple gives me
-\frac{3}{20}3^n-\frac{8}{45}2^n-\frac{1}{6}n-\frac{1}{36}

So where did I go wrong? I've redone this problem a few times now and I keep coming up with the same incorrect answer.
 
Last edited by a moderator:
Physics news on Phys.org
Maybe my z transform table is wrong? I have

n=\frac{z}{(z-1)^2}
y[n+1]=z(yz-y[0])
y[n+2]=z^2yz-z^2y[0]-zy[1]
 
I think I figured it out. I must have misunderstood my professor's notes. For anyone who cares I'll write it up.
 
Taking the z transform:
z^2X(z)-zX(z)-6X(z)=\frac{z}{(z-1)^2}
X(z)=\frac{z}{(z-1)^2(z+2)(z-3)}
Take the inverse z transform of this gives me:
-c_1 (-2)^n+c_2 3^n-\frac{1}{36}-\frac{1}{6}n
Plugging in the initial values and conditions I get:
c_1=-\frac{8}{9}, c_2=-\frac{31}{36}
Or:
y[n]=-\frac{31}{36}3^n+\frac{8}{9}(-2)^n-\frac{1}{6}n-\frac{1}{36} which mirrors my first solution.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top