Finding second-order finite difference stencil

snoken

New member
Joined
Dec 8, 2023
Messages
2
If you have the anisotropic diffusion equation to find u(x,y)

(μx2ux2+μy2uy2)=f(x,y)(1)\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:

μx(ui1,j2ui,j+ui+1,jh2)μy(ui,j12ui,j+ui,j+1h2)=fi,j(2){-\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?
 
Can you please expound on the meaning of stencil according to your class-notes/instruction?
Thanks for the reply! The class notes just mention it like this: Write the second-order finite difference stencil corresponding to this finite difference scheme. I am quite confused about this. The only example we kind of got was for a discretised Laplacian operator
uu(xi+1,yj)+u(xi,yj+1)4u(xi,yj)+u(xi1,yj)+u(xi,yj1)h2\triangle u \approx \frac{u(x_{i+1}, y_j)+u(x_{i}, y_{j+1})-4 u(x_i,y_j) + u(x_{i-1},y_j)+u(x_{i},y_{j-1})}{h^2}for which the local stencil was (it's a 5-point stencil representing the central difference approximation for the Laplacian in 2D):
[010141010]\begin{bmatrix} 0 & -1 & 0 \\ -1 & 4 & -1 \\ 0 & -1 & 0 \end{bmatrix}
 
Last edited:
Top