How to find the particular solution of a second order difference equation

741 Views Asked by At

I am trying to solve the second order difference equation, $$\left(\dfrac{\epsilon}{h^2}+\dfrac{1}{h}\right)Z(x_{i+1})-\left(\dfrac{2\epsilon}{h^2}+\dfrac{1}{h}\right)Z(x_{i})+\dfrac{\epsilon}{h^2}Z(x_{i-1})=2(\epsilon+x_i),$$ where $x_i=ih,h=\dfrac{1}{N}$. For the homogenous equation, I get $$Z(x_{i})=A+B(1+\epsilon^{-1}N^{-1})^{-i}.$$ I cannot figure out the trial solution. The boundary conditions are $Z(x_0)=0,Z(x_N)=1$. I am trying to get the full solution as $Z(x_{i})=x^2_i+N^{-1}\{1-x_i-[(1+\epsilon^{-1}N^{-1})^{-i}-(1+\epsilon^{-1}N^{-1})^{-N}]\times [1-(1+\epsilon^{-1}N^{-1})^{-N}]^{-1}\}$

3

There are 3 best solutions below

2
On BEST ANSWER

For difference equations with constant coefficients, analogous to linear differential equations with constant coefficients,

-- if the right side or inhomogeneity is itself a solution of a homogeneous difference equation (and both have different eigenvalues),

-> then a particular solution can be found that is itself a solution of the second difference equation.

Since $y_i=Ai+B$ is a solution of $y_{i+2}-2y_{i+1}-y_i=0$, one can find a particular solution of the same form.


More details: The eigenvalues of the difference equation include $1$, which is an eigenvalue of the homogeneous difference equation of the right side, so the polynomial degree has to be raised by one. So try $z_i=Ai^2+Bi$ in the difference equation $$ 2ϵ+2ih = \frac{ϵ}{h^2}(z_{i+1}-2z_i+z_{i-1})+\frac1h(z_{i+1}-z_i) =\frac{ϵ}{h^2}(2A)+\frac1h(A(2i+1)+B) $$ Comparing coefficients yields the equations $$ 2ϵ=2A\frac{ϵ}{h^2}+\frac1h(A+B) $$ and $$ 2h = \frac{2A}h $$ so that $A=h^2$ and $B=-A=-h^2$. That is, $$ z_i=h^2i^2-h^2i=x_i^2-hx_i $$ is a particular solution.

0
On

A general technique is to use variation of parameters, i.e., assume a párticular solution of the form: $$ Z_p(x_i) = A_p(x_i) + B_p(x_i) (1 - \epsilon^{-1} N^{-1})^{-i} $$ for functions $A_p$, $B_p$.

But your case (if I understand correctly) has constant coefficients. The forcing function is a linear polynomial, your recurrence is of the second order. So a polynomial of degree $1 + 2 = 3$ should do it.

0
On

Use generating functions. Use $a_i = Z(x_i)$, replace $x_i = i h$, and write the recurrence so there are no subtractions in indices, multiply by $h^2$ to get rid of fractions: $$ (\epsilon + h) a_{i + 2} - (2 \epsilon + h) a_{i + 1} + \epsilon a_i = 2 (\epsilon h^2 + (i + 1) h^3) $$ Define $A(z) = \sum_{i \ge 0} a_i z^i$.

Multiply the resulting recurrence by $z^i$, sum over $i \ge 0$, recognize the sums: \begin{align} \sum_{i \ge 0} a_{i + 1} z^i &= \frac{A(z) - a_0}{z} \\ \sum_{i \ge 0} a_{i + 2} z^i &= \frac{A8z) - a_0 - a_1 z}{z^2} \\ \sum_{i \ge 0} z^i &= \frac{1}{1 -z} \\ \sum_{i \ge 0} i z^i &= z \frac{\mathrm{d}}{\mathrm{d} z} \frac{1}{1 - z} \\ &= \frac{z}{(1 - z)^2} \end{align} giving: $$ (\epsilon + h) \frac{A(z) - a_0 - a_1 z}{z^2} - (2 \epsilon + h) \frac{A(z) - a_0}{z} + \epsilon A(z) = 2(\epsilon h^2 + h^3) \frac{1}{1 - z} + h^3 \frac{z}{(1 - z)^2} $$ Solve for $A(z)$ as partial fractions, you can expand the resulting terms by the generalized binomial theorem: $$ (1 - u)^{-m} = \sum_{i \ge 0} \binom{-m}{i} (-1)^i u^i = \sum_{i \ge 0} \binom{m + i - 1}{m - 1} u^i $$ and just read off the coeficient of $z^i$.

A CAS (like maxima or WolframAlpha) will help enormously in taming the resulting mess.