Recursive application of finite difference approximation

340 Views Asked by At

I'm working with central finite difference formulations, whose coefficients can be found here. I want to approximate the following

$\displaystyle \frac{\partial^3 f}{\partial x^3}$

Assume that I want to solve this using the following approach

$\displaystyle \frac{\partial}{\partial x} \left(\frac{\partial^2 f}{\partial x^2}\right)$

If I choose the following orders of accuracy for each approximation

$\displaystyle \frac{\partial}{\partial x} \rightarrow O(\Delta^4)$

$\displaystyle \frac{\partial^2}{\partial x^2} \rightarrow O(\Delta^2)$

What would be the resulting accuracy of the difference approximation after applying $\displaystyle \frac{\partial}{\partial x} \left(\frac{\partial^2 f}{\partial x^2}\right)$? In other words

$\displaystyle \frac{\partial}{\partial x} \left(\frac{\partial^2 f}{\partial x^2}\right)\rightarrow O(\Delta^?)$

1

There are 1 best solutions below

2
On BEST ANSWER

Assuming "accuracy" refers to the order of $\Delta x$ as it appears in the leading term of the truncation error (like in the Wikipedia article), the resulting scheme is second order accurate. Indeed, applying the approximations in the order indicated in the question, we obtain a stencil with coefficients $$ \left( \frac{1}{12}, -\frac{5}{6}, \frac{17}{12}, 0, -\frac{17}{12}, \frac{5}{6}, -\frac{1}{12} \right). $$ A Taylor expansion reveals that the leading term of the truncation error is given by $$ \frac{1}{12} f^{(5)}(x) \Delta x^2, $$ where $f^{(5)}(x)$ denoted the fifth derivative of $f$ (assuming that it exists).

Update: Let's say that we have a grid $\mathbf{x}^T = (x_0, x_1, \dots, x_{n-1}, x_n)$ where $x_k = x_0 + k \Delta x$. We project the function $f(x)$ onto this grid in the form of a vector $\mathbf{f}^T = (f_0, f_1, \dots, f_{n-1}, f_n)$, where $f_k = f(x_k)$. To find the order of accuracy of our stencil, we operate on $\mathbf{f}$ at the generic point $x_k$ to obtain $$ \frac{1}{\Delta x^3} \left[ \frac{1}{12}f_{k-3} - \frac{5}{6}f_{k-2} + \frac{17}{12}f_{k-1} + 0f_k - \frac{17}{12}f_{k+1} + \frac{5}{6}f_{k+2} - \frac{1}{12}f_{k+3} \right]. \qquad (1) $$ Now, a Taylor expansion of $f_{k+j}$ (where $j$ is a positive or negative integer) around the point $x_k$ gives $$ f_{k+j} = f_k + f^{(1)}_k \frac{j^1}{1!}\Delta x^1 + f^{(2)}_k \frac{j^2}{2!}\Delta x^2 + f^{(3)}_k \frac{j^3}{3!}\Delta x^3 + \dots $$ Inserting this expansion into (1), using $j = -3, -2, \dots, 2, 3$ where appropriate, we find that

  • All terms proportional to $f_k$, $f_k^{(1)}$ and $f_k^{(2)}$ vanish (this is expected since we are approximating, not a zeroth, first or second, but a third derivative)
  • The coefficient in front of $f_k^{(3)}$ is one (meaning that the stencil is a consistent approximation of the third derivative)
  • The coefficient in front of $f_k^{(4)}$ is zero (meaning that the truncation error is not proportional to $\Delta x^1$)
  • The coefficient in front of $f_k^{(5)}$ is non-zero (meaning that the truncation error is proportional to $\Delta x^2$).

What we have shown is thus that the expression in (1) is roughly equal to $$ f_k^{(3)} + C f_k^{(5)} \Delta x^2 $$ where $C$ is some non-zero constant (in this case 1/12 if I did my calculations properly). There are of course non-zero terms proportional to $\Delta x^3$, $\Delta x^4$ etc, however in using finite difference methods it is (usually) implicitly assumed that $\Delta x \ll 1$ such that higher order terms may safely be ignored.