Is there a simple series representation for following sequence?

78 Views Asked by At

I'm given an odd number defined by the variable $N$. I'm trying to identify a function relating the following sequences;

Given $N=7$

$A = \{1,2,3,4,5,6\}$

NOTE: A = 1:N-1 always

$B = \{6,6,4,4,2,2\}$

$F(N) = B\dots$ what is $F(N)$ ?

No, this is not a homework question. It's related to central difference formulations. $N$ is the "stencil" size, $A$ is the derivative, and $B$ is the order of accuracy. I would like to present this pattern as a simple function and I can't seem to find an explicit relation. Also, if there is one that is more generic to include forward/backward differences, that would be even better. Basically, I want to relate the derivatives, stencil sizes, and orders of accuracy. I'm not looking for an algorithm...just a general formula that I could present on a slide or in a paper instead of writing a full table.


EDIT: Just in case there is something more generic, for forward/backward $N$ need not be odd and the sequences would follow

$A = \{1,2,3,4,5,6\}$

NOTE again: A = 1:N-1 always, but B is different

$B = \{6,5,4,3,2,1\}$ or simply $B = \{N-1:-1:1\}$

EDIT 2: The following additional examples are given to help expose the pattern for B

Given $N=11$

$B = \{10,10,8,8,6,6,4,4,2,2\}$

Given $N=5$

$B = \{4,4,2,2\}$

1

There are 1 best solutions below

0
On BEST ANSWER

For central differences, let's consider the cases when $m \in A$ is odd and even separately.

For odd $m$, we have stencils of the form $$ \frac{\partial^m f}{\partial x^m} \Big|_{x_0} = \frac{1}{\Delta x^m} \sum_{k=1}^{(N-1)/2} c_k^{(m)} (f_k - f_{-k}) + \mathcal{O}\left( \frac{\partial^N f}{\partial x^N} \Big|_{x_0} \frac{\Delta x^N}{\Delta x^m} \right) $$ and thus the order of accuracy is $N-m$.

For even $m$, we have stencils of the form $$ \frac{\partial^m f}{\partial x^m} \Big|_{x_0} = \frac{1}{\Delta x^m} \left\{ c^{(m)}_0 f_0 + \sum_{k=1}^{(N-1)/2} c_k^{(m)} (f_k + f_{-k}) \right\} + \mathcal{O}\left( \frac{\partial^{N+1} f}{\partial x^{N+1}} \Big|_{x_0} \frac{\Delta x^{N+1}}{\Delta x^m} \right) $$ and thus the order of accuracy is $N+1-m$.

The relation you are looking for is thus $$ F(N,m) = \begin{cases} N-m & \text{for odd } m \\ N+1-m & \text{for even } m. \end{cases} $$

In the general case, just write down the truncation error of the stencil to find the relation among the derivative, the stencil size and the order of accuracy.