Finding second-order finite difference stencil

57 Views Asked by At

If you have the anisotropic diffusion equation to find $u(x,y)$

$$\left(\mu_{x}\frac{\partial^{2}u}{\partial x^{2}}+\mu_{y}\frac{\partial^{2}u}{\partial y^{2}}\right)=f(x,y) \tag 1$$

and you discretize the problem using second-order finite difference formulas, leading to the discretized form:

$${-\mu}_{x} \left(\frac{u_{i-1,j} - 2u_{i,j} + u_{i+1,j}}{h^2}\right) - {\mu}_{y} \left(\frac{u_{i,j-1} - 2u_{i,j} + u_{i,j+1}}{h^2}\right) = f_{i,j} \tag 2$$

How do you calculate the finite difference stencil $S$ corresponding to this finite difference scheme?

$ S = \begin{bmatrix} s_{11}&s_{12}&s_{13}\\ s_{21}&s_{22}&s_{23}\\ s_{31}&s_{32}& s_{33} \end{bmatrix} \tag 3$