This post presents the asymmetric finite-difference scheme build in staggered grid. This asymmetric scheme works well for processing boundary points.
$f’(x)$ in 2nd order accuracy
point 0
To calculate the first order derivates in the $\color{blue}{blue}$ grid points, values in $\color{red}{red}$ points are expanded.
thus, $f’(x)$ are:
add these $f’(x)$ proportionally:
In order to have second order accuracy, $C^2_{0j}$ must satisfy the equation of:
$f’(x)$ in 2Nth order accuracy
point 0
thus, $f’(x)$ are:
add these $f’(x)$ proportionally:
To have 2Nth order accuracy, , $C^{2N}_{0j}$ must satisfy the equation:
point k $(k=0,1,2,3…,N-1)$
thus, $f’(x)$ are:
add these $f’(x)$ proportionally:
to have 2Nth order accuracy: $C^{2N}_{kj}$ must satisfy equation:
Conclusion
For 2Nth order accuracy, for point k in the boundary region, value of $f’(x)$ is:
while $C^{2N}_{kj}$ is solution of equation $\eqref{LA}$.
Or, in the form of:
Examples
FD scheme corresponding to accuracy orders of 2,4,6,8,10,12 are implemented to $f(x)=sin(x)$, their FD results are ploted versus theoretical first order derivative of $f’(x)=cos(x)$, as well as their error.