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)

[math]\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[/math]
and you discretize the problem using second-order finite difference formulas, leading to the discretized form:

[math]{-\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[/math]
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
[math]\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}[/math]for which the local stencil was (it's a 5-point stencil representing the central difference approximation for the Laplacian in 2D):
[math]\begin{bmatrix} 0 & -1 & 0 \\ -1 & 4 & -1 \\ 0 & -1 & 0 \end{bmatrix}[/math]
 
Last edited:
Top