# Intermediate finite difference method

why sometimes do we use intermediate finite difference method

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

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

or other similar differences such as backward or central differences

• Central differencing is one order more accurate than forward or backward differencing. – velut luna Oct 2 '17 at 8:40

## 1 Answer

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

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!

• Many thanks, a clear answer. Could you please introduce me a text book which explain more about this type of differencing? – armin Oct 2 '17 at 9:44
• @armin You can try with this one – caverac Oct 2 '17 at 9:53
• @armin welcome to MSE. please upvote answers that are helpful and accept one of the given answers if you find it satisfactory. (+1) – Mathemagical Oct 2 '17 at 10:08