Difference approximation of poission equation, find coefficients

51 Views Asked by At

Question: Assume we want to solve the poisson equation

$$ \Delta u = f(x,y), \quad (x,y) \in \Omega $$ $$ u = g(x,y), \quad (x,y) \in \delta \Omega $$

using the five-point method. Modify the method to create an unsymmetric grid where $\alpha, \beta$ are chosen so that the molecule fits the boundary points correctly (not quadratically). Derive the coefficients $a,b,c,d,e$ (they will depend on $\alpha, \beta$) in the difference approximation below

$$ \Delta u(x_i, y_j) = \frac{au_{i,j-1}+bu_{i-1,j}+cu_{i,j}+du_{i+1,j}+eu_{i,j+1}}{h^2} + O(h^p) $$

Solution: To solve this, I derive difference approximations for the $x$ and $y$ directions separately (of the poisson equation), then add them together. Starting with the $x$ direction, I get the difference approximation

$$ \frac{\partial^2 u}{\partial x^2} \approx \frac{bu(x-h,y)+cu(x,y)+du(x+\alpha h,y)}{h^2} $$

The reason I only add $\alpha$ in one direction is because I want an unsymmetric grid.

Now I use taylor expansion to get a linear system of equations which can help me derive an expression for the coefficients

$$ bu(x-h,y) = b \big[ u(x,y) - hu'(x,y) + \frac{h^2 u''(x,y)}{2} + O(h^3) \big] $$ $$ cu(x,y) = cu(x,y) $$ $$ du(x+\alpha h,y) = d\big[ u(x,y) + \alpha h u' + \frac{\alpha ^2 h^2 u'' (x,y)}{2} + O(h^3) \big] $$

From here, I get a bit lost (so I checked the solution). What they do now to solve this is to say that these three equations below are true. There's 3 unknown variables and 3 equations so from there it should be easily solvable.

$$ b+c+d=0, \quad -bh + d\alpha h = 0, \quad \frac{b(h^2/2)+\alpha ^2 d(h^2/2)}{h^2} =1 $$

I believe the LHS of the first equation comes from the fact that after taylor expansion, $b,c,d$ all has 1 term of $u(x,y)$. The second equation corresponds to $u'(x,y)$, and the third equation corresponds to $u''(x,y)$. What I don't understand is, why is the first and second equation equal to zero and the third equal to one, and also why are we dividing the third equation by $h^2$? So basically I understand how I should start the procedure, but I have no intuition of what is happening. Any help on this front would be greatly appreciated.

If I can answer the question above, then I would repeat the procedure for the $y$ direction and add the two derivatives together to get my final answer.

I tried getting help from this question Finite Difference Approximation of Derivative but couldn't really decipher/translate it to what I want to understand.

1

There are 1 best solutions below

1
On BEST ANSWER

Actually, all three of your equations have a denominator of $h^2$, but since the first two have $0$ on the right, we can clear the $h^2$ by multiplying.

Recall that you are solving $$ \frac{\partial^2 u}{\partial x^2} \approx \frac{bu(x-h,y)+cu(x,y)+du(x+\alpha h,y)}{h^2} $$ Let's rewrite that left-hand side with the exact versions of the terms you used in your Taylor expansion. $$ 0 \cdot u + 0 \cdot \frac{\partial u}{\partial x} + 1 \cdot \frac{\partial^2 u}{\partial x^2} \approx \frac{bu(x-h,y)+cu(x,y)+du(x+\alpha h,y)}{h^2} \text{.} $$

You've written the Taylor expansions of the right-hand side. Collecting the $u$s, we have zero $u$s on the left and $b+c+d$ $u$s on the right, so $$ 0 \approx \frac{b+c+d}{h^2} \text{.} $$ Collecting and comparing the coefficient of $u'$s, $$ 0 \approx \frac{bh + 0 + d \alpha h}{h^2} \text{.} $$ Finally, collecting and comparing the coefficient of $u''$s, $$ 1 \approx \frac{bh^2/2 + 0 + d \alpha^2 h^2/2}{h^2} \text{.} $$

Then, we can multiply through the first two equations by $h^2$ to clear their denominators.

To summarize: the $h^2$s are present in all the equations, but can be silently cleared from the first two because their left-hand sides are zero. The $0$s and $1$s come from the approximate equation you are solving; it has zero $u$s, zero $u'$s, and one $u''$ on the one side and you have expanded the other side by Taylor series. Having done so, collect the coefficients of $u$, $u'$ and $u''$ to make the three equations you have.