Numerical Solution of difference equation

763 Views Asked by At

I am trying to solve a nonlinear difference equation of the form:

$x_{i+1} = f(x_i, x_{i-1})$

for $i = 0,\ldots,N-1$ with given boundary conditions $x_0 = a$ and $x_N = g(x_{N-1})$ where $f$ and $g$ are some arbitrary functions. What sort of numerical methods are available which I could use? I am not very familiar with recurrences and have tried searching for books on numerical methods for difference equations. If anyone could recommend any methods or books that could help me find a numerical solution to this problem I would be very grateful.

1

There are 1 best solutions below

4
On

In general case (for functions $f$ and $g$ in arbitrary form) you can try shooting method. The elementary algorithm is following:

  1. Let us choose approximation $a=x_1$. For this approximation you can calculate $x_N$, denote its value as $F(a)$.
  2. Using constructed function $F$ solve numerically the equation $F(a)-x_N=0$ by any appropriate method, for example bisection method or more effective golden section method. In the latter case you find the minimum of function $G(a)=(F(a)-x_N)^2$, which equals $0$ in the solution.