- #1
- 1,798
- 33
Hi,
Recently I had to find a derivative on a uniform grid. Being naive I tried the following scheme:
[tex]f'(x_{n})=Af(x_{n+2})+Bf(x_{n+1})+Cf(x_{n})+Df(x_{n-1})+Ef(x_{n-2})[/tex]
Then write the [itex]f(x_{n\pm i})[/itex] in terms of [itex]f^{(n)}(x_{n})[/itex] by use of Taylor's theorem. This lead to a system of linear equations for the A,B,C,D,E which required inverting a Vandermonde matrix.
I tried it out a couple of times and it worked okay for the first derivative but when I applied it to higher derivatives it became unstable. Does anyone know what is going wrong?
I also tried a seven point stencil in the same way and that bizarrely was even worse.
Mat
Recently I had to find a derivative on a uniform grid. Being naive I tried the following scheme:
[tex]f'(x_{n})=Af(x_{n+2})+Bf(x_{n+1})+Cf(x_{n})+Df(x_{n-1})+Ef(x_{n-2})[/tex]
Then write the [itex]f(x_{n\pm i})[/itex] in terms of [itex]f^{(n)}(x_{n})[/itex] by use of Taylor's theorem. This lead to a system of linear equations for the A,B,C,D,E which required inverting a Vandermonde matrix.
I tried it out a couple of times and it worked okay for the first derivative but when I applied it to higher derivatives it became unstable. Does anyone know what is going wrong?
I also tried a seven point stencil in the same way and that bizarrely was even worse.
Mat