Intermediate finite difference method

124 Views Asked by At

why sometimes do we use intermediate finite difference method

\begin{equation} \frac{\partial y}{\partial x}=\frac{y_{i+1/2}-y_{i-1/2}}{\Delta x} \end{equation}

instead of \begin{equation} \frac{\partial y}{\partial x}=\frac{y_{i+1}-y_{i}}{\Delta x} \end{equation}

or other similar differences such as backward or central differences

1

There are 1 best solutions below

3
On

For a single field it does not make much a difference, the advantage comes when you have coupled fields. Imagine you have the wave equation

\begin{eqnarray} \frac{\partial u}{\partial x} &=& v \\ \frac{\partial v}{\partial x} &=& -u \end{eqnarray}

And the fields look like the left hand side of the figure below

enter image description here

If you were to try to solve using finite differences you'd see that both $u$ and $v$ turn out to be zero, which is not the case. You may think that just reducing $\Delta x$ would solve the problem, but that comes at the price of running time, in this example, you would need to decrease $\Delta x$ by two, which implies your code will run twice as slow.

Here is another option, solve $u$ in the regular grid, and for $v$ shift the grid by $\Delta x/2$, clearly the execution time stays the same, but now you can resolve features twice smaller than before!

So for almost the same time computational price, you roughly get twice the spatial resolution!