# Difference Equation - Non Homogeneous need help

• Dec 22nd 2012, 01:51 PM
zzizi
Difference Equation - Non Homogeneous need help
Hi

Can someone help me with this and provide a step by step response?

Suppose I have the following difference equation:

$u_{n}= -u_{n-1}+6u_{n-2} +7$ with
$u_{0} =1, u_{1} =2$

I have solved the characteristic eqn to be $\lambda = 2,-3$

But how do I go about solving the particular solution?

Many thanks in advance!
• Dec 22nd 2012, 03:45 PM
ILikeSerena
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by zzizi
Hi

Can someone help me with this and provide a step by step response?

Suppose I have the following difference equation:

$u_{n}= -u_{n-1}+6u_{n-2} +7$ with
$u_{0} =1, u_{1} =2$

I have solved the characteristic eqn to be $\lambda = 2,-3$

But how do I go about solving the particular solution?

Many thanks in advance!

Hi zzizi! :)

Wiki explains it better than I can:
Recurrence relation - Wikipedia, the free encyclopedia

The equation in the above example was [[homogeneous differential equation|homogeneous]], in that there was no constant term. If one starts with the non-homogeneous recurrence
$b_{n}=Ab_{n-1}+Bb_{n-2}+K$

with constant term ''K'', this can be converted into homogeneous form as follows: The [[steady state]] is found by setting $b_n = b_{n-1} =b_{n-2} = b^*$ to obtain
$b^{*} = \frac{K}{1-A-B}$

Then the non-homogeneous recurrence can be rewritten in homogeneous form as
$[b_n - b^{*}]=A[b_{n-1}-b^{*}]+B[b_{n-2}-b^{*}]$

which can be solved as above.
• Dec 22nd 2012, 06:02 PM
MarkFL
Re: Difference Equation - Non Homogeneous need help
I would use the technique of symbolic differencing to obtain a homogeneous linear recurrence:

$u_{n}=-u_{n-1}+6u_{n-2}+7$

$u_{n+1}=-u_{n}+6u_{n-1}+7$

Subtracting the former from the latter, we obtain:

$u_{n+1}=7u_{n-1}-6u_{n-2}$

The characteristic roots are $r=-3,\,1,\,2$ hence the closed form is:

$u_n=k_1(-3)^n+k_2+k_32^n$

We may use initial conditions to determine the parameters $k_i$:

$u_0=k_1+k_2+k_3=1$

$u_1=-3k_1+k_2+2k_3=2$

$3_2=9k_1+k_2+4k_3=11$

Solving this system, we find:

$k_1=\frac{7}{20},\,k_2=-\frac{7}{4},\,k_3=\frac{12}{5}$ and so we have:

$u_n=\frac{7(-3)^n+3\cdot2^{n+4}-35}{20}$
• Dec 23rd 2012, 04:05 AM
zzizi
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by ILikeSerena
Hi zzizi! :)

Wiki explains it better than I can:
Recurrence relation - Wikipedia, the free encyclopedia

The equation in the above example was [[homogeneous differential equation|homogeneous]], in that there was no constant term. If one starts with the non-homogeneous recurrence
$b_{n}=Ab_{n-1}+Bb_{n-2}+K$

Thank you very much, for your reply.
So I was incorrect to think it was non-homogeneous?
I wasn't aware that it could be solved this way, so I will have to perhaps look into it further.
• Dec 23rd 2012, 04:23 AM
zzizi
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by MarkFL2
I would use the technique of symbolic differencing to obtain a homogeneous linear recurrence:

$u_{n}=-u_{n-1}+6u_{n-2}+7$

$u_{n+1}=-u_{n}+6u_{n-1}+7$

Subtracting the former from the latter, we obtain:

$u_{n+1}=7u_{n-1}-6u_{n-2}$

The characteristic roots are $r=-3,\,1,\,2$ hence the closed form is:

$u_n=k_1(-3)^n+k_2+k_32^n$

We may use initial conditions to determine the parameters $k_i$:

$u_0=k_1+k_2+k_3=1$

$u_1=-3k_1+k_2+2k_3=2$

$3_2=9k_1+k_2+4k_3=11$

Solving this system, we find:

$k_1=\frac{7}{20},\,k_2=-\frac{7}{4},\,k_3=\frac{12}{5}$ and so we have:

$u_n=\frac{7(-3)^n+3\cdot2^{n+4}-35}{20}$

Thank you very much for this solution.

How would I go about checking it? I tried to find u(3) from the original recursion and the closed form but they didn't correlate.
• Dec 23rd 2012, 04:31 AM
MarkFL
Re: Difference Equation - Non Homogeneous need help
From the inhomogeneous recurrence you gave:

$u_2=-2+6+7=11$

$u_3=-11+12+7=8$

Using the closed form I gave:

$u_3=\frac{7(-3)^3+3(2)^7-35}{20}=\frac{160}{20}=8$
• Dec 23rd 2012, 04:39 AM
ILikeSerena
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by zzizi
Thank you very much, for your reply.
So I was incorrect to think it was non-homogeneous?
I wasn't aware that it could be solved this way, so I will have to perhaps look into it further.

You were right. It is non-homogeneous.

In your case you have
Quote:

Originally Posted by zzizi
$u_{n}= -u_{n-1}+6u_{n-2} +7$ with
$u_{0} =1, u_{1} =2$

I have solved the characteristic eqn to be $\lambda = 2,-3$

If you compare that to
$b_{n}=Ab_{n-1}+Bb_{n-2}+K$

you'll see that you have:
$b_n = u_n$
$A = -1$
$B = 6$
$K = 7$
$b^{*} = \frac{K}{1-A-B} = \frac{7}{1-(-1)-6} = - \frac 7 4$

As a result, your solution takes the form:
$u_n = C (-3)^n + D 2^n + b^{*}$

If you fill in your boundary conditions, you get 2 equations with 2 unknowns (C and D), which can be solved with substitution.
• Dec 23rd 2012, 04:49 AM
zzizi
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by MarkFL2
From the inhomogeneous recurrence you gave:

$u_2=-2+6+7=11$

$u_3=-11+12+7=8$

Using the closed form I gave:

$u_3=\frac{7(-3)^3+3(2)^7-35}{20}=\frac{160}{20}=8$

Umm ... I guess I miscounted (Giggle)

Thanks MarkFL2 :D I just saw your response on yahoo answers!!
• Dec 23rd 2012, 04:53 AM
zzizi
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by ILikeSerena
You were right. It is non-homogeneous.

In your case you have

If you compare that to
$b_{n}=Ab_{n-1}+Bb_{n-2}+K$

you'll see that you have:
$b_n = u_n$
$A = -1$
$B = 6$
$K = 7$
$b^{*} = \frac{K}{1-A-B} = \frac{7}{1-(-1)-6} = - \frac 7 4$

As a result, your solution takes the form:
$u_n = C (-3)^n + D 2^n + b^{*}$

If you fill in your boundary conditions, you get 2 equations with 2 unknowns (C and D), which can be solved with substitution.

Thank you very much for your explanation! Much appreciated.
• Dec 23rd 2012, 07:31 AM
zzizi
Re: Difference Equation - Non Homogeneous need help
I have a query;

Is there another way, by substituting values to find the particular solution?
• Dec 23rd 2012, 09:43 AM
zzizi
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by ILikeSerena
You were right. It is non-homogeneous.

In your case you have

If you compare that to
$b_{n}=Ab_{n-1}+Bb_{n-2}+K$

you'll see that you have:
$b_n = u_n$
$A = -1$
$B = 6$
$K = 7$
$b^{*} = \frac{K}{1-A-B} = \frac{7}{1-(-1)-6} = - \frac 7 4$

As a result, your solution takes the form:
$u_n = C (-3)^n + D 2^n + b^{*}$

If you fill in your boundary conditions, you get 2 equations with 2 unknowns (C and D), which can be solved with substitution.

What if I end up with zero for the b* value? I used this method to solve my difference equation but I got zero for the constant. If this happens would the whole solution be complete or do I try another method?
• Dec 23rd 2012, 09:47 AM
ILikeSerena
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by zzizi
What if I end up with zero for the b* value? I used this method to solve my difference equation but I got zero for the constant. If this happens would the whole solution be complete or do I try another method?

The only way that b* can be zero is if the constant K is zero.
In that case the difference equation is a homogeneous difference equation instead of an in-homogeneous one.

But this is not applicable to your current problem statement.....
Am I misunderstanding you?
• Dec 23rd 2012, 10:08 AM
zzizi
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by ILikeSerena
The only way that b* can be zero is if the constant K is zero.
In that case the difference equation is a homogeneous difference equation instead of an in-homogeneous one.

But this is not applicable to your current problem statement.....
Am I misunderstanding you?

You are quite right. I wanted to understand the concept because I have another problem for my homework that I am working which is like this:

$u_{n}= -3u_{n-1}+4u_{n-2}+9$

When I applied the formula I got this:

$b^{*} = \frac{K}{1-A-B} = \frac{9}{1-(-3)-4} = 0$

SO would this be considered a homogeneous D.Eqn?
• Dec 23rd 2012, 10:19 AM
ILikeSerena
Re: Difference Equation - Non Homogeneous need help
Quote:

Originally Posted by zzizi
You are quite right. I wanted to understand the concept because I have another problem for my homework that I am working which is like this:

$u_{n}= -3u_{n-1}+4u_{n-2}+9$

When I applied the formula I got this:

$b^{*} = \frac{K}{1-A-B} = \frac{9}{1-(-3)-4} = 0$

I just wondered what I should do in this situation

I'm afraid you miscalculated b*.

$b^* = \frac 9 0 = \infty$

Either way, it means this method does not work.

Next method in line is the symbolic differentiation method MarkFL2 described.
That one works for this problem.
• Dec 23rd 2012, 10:23 AM
zzizi
Re: Difference Equation - Non Homogeneous need help
Thank you.