Numerical solution for differential equation

12 Views Asked by At

I have to find solution for this Dirichlet problem $$-a\frac{\partial^2 u}{\partial x^2}-b\frac{\partial^2 u}{\partial y^2}=f(x,y) \: inside \: D.$$ $$ D=[0,1]^2$$ $$u|_{\Gamma }=\phi(x,y) \:on \: \partial D$$ By reducing it to a system of linear equations, using 5-point scheme: $$-a\frac{u_{j-1, l} -2u_{j,l}+u_{j+6,l}}{h^2}-b\frac{u_{j, l-1} -2u_{j,l}+u_{j,l+1}}{h^2}=f(j,l) \: inside \: D$$ $$u_{j,l} = \phi_{j, l} \: on \: \partial D$$ System mast be $(A^{h}u)_{j,l}=f_{j,l}$. How can I get this matrix $A^h$? I'm confused by the index $j+6$.