Centered-Difference Scheme to approximate BVP

387 Views Asked by At

I have the following boundary value problem:

$\frac{\partial ^2u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}=0, \; 1<x<2, \;0<y<1;$

$u(x,0)=2\ln x, \; u(x,1)=\ln(x^2+1), \; 1 \leq x \leq 2;$

$u(1,y)=\ln(y^2+1), \; u(2,y)=\ln(y^2+4), \; 0 \leq y \leq 1$

and I need to use the scheme of centered-differences to approximate the second partial derivatives and find the difference scheme for the elliptic equation. Once I have this, I must verify that it's second-order accurate with respect to $\Delta x$ and $\Delta y$.


My ideas:

I know that the following is the centered-difference equation for the first derivative (please correct me if I'm wrong!):

$f'(x) \approx \frac{f(x+h)− f(x−h)}{2h}.$

So I think this would be the formula for the second equation (again, please correct me if I'm wrong):

$f''(x) \approx \frac{f(x+h)− 2f(x)+f(x−h)}{h^2}.$

So how would I apply this to the above BVP? I suppose I'm most confused about when to use the boundary conditions, how to actually derive the equations based off this formula, and how those equations relate to the elliptic equation.

Hopefully verifying the second-order accuracy won't be too bad. I'm guessing that will come in the form of some error term.

Any help would be appreciated!

Thank you in advance.

1

There are 1 best solutions below

1
On BEST ANSWER

As you noted the central difference scheme can be written as $$\frac{\partial^2 u}{\partial x^2}\bigg|_{m,n}=\frac{u_{m+1,n}-2u_{m,n}+u_{m-1,n}}{\Delta x^2}$$ $$\frac{\partial^2 u}{\partial y^2}\bigg|_{m,n}=\frac{u_{m,n+1}-2u_{m,n}+u_{m,n-1}}{\Delta y^2}$$ The finite difference approximation becomes $$\frac{\partial ^2u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}\approx \frac{u_{m+1,n}-2u_{m,n}+u_{m-1,n}}{\Delta x^2}+\frac{u_{m,n+1}-2u_{m,n}+u_{m,n-1}}{\Delta y^2} =0$$ Further if $\Delta x=\Delta y$ the equation becomes $$\frac{\partial ^2u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}\approx u_{m+1,n}-2u_{m,n}+u_{m-1,n}+u_{m,n+1}-2u_{m,n}+u_{m,n-1} =0$$ $$\Rightarrow u_{m,n}=\frac{u_{m+1,n}+u_{m-1,n}+u_{m,n+1}+u_{m,n-1}}4$$

Consider a simple case with $h=\Delta x=\Delta y=\frac 13$. For boundary conditions $$u_{1,1}=\frac{u_{2,1}+u_{0,1}+u_{1,2}+u_{1,0}}4=\frac{u_{2,1}+u_{0,1}+u_{1,2}+u_{1,0}}4$$ where $$u_{0,1}=u(x=1,y=1/3)=\ln(\frac 19+1)$$ $$u_{1,0}=u(x=4/3,y=0)=2\ln(\frac 43)$$