0 9

BIT203 ยท 0 ยท 5 marks

Solve the Poisson's equation nabla2 f = xy with f = 2 on boundary by assuming square domain 0 leq x leq 3, 0 leq y leq 3 and h = 1.

Solve the Poisson's equation $\nabla^2 f = xy$ with $f = 2$ on boundary by assuming square domain $0 \leq x \leq 3$, $0 \leq y \leq 3$ and $h = 1$. [5]

Numerical MethodsChapter 10: Partial Differential EquationsPoisson's equation and finite difference methodNumerical: Poisson's equation

Solving Poisson's Equation โˆ‡ยฒf = xy

Given

  • PDE: $\nabla^2 f = xy$, i.e. $g(x,y) = xy$
  • Domain: $0 \le x \le 3$, $0 \le y \le 3$
  • Step size: $h = 1$
  • Boundary condition: $f = 2$ on all boundaries

Solution

Grid

With $h = 1$: nodes at $x = 0,1,2,3$ and $y = 0,1,2,3$.

Interior unknowns:

  • $f_1 = f(1,1)$
  • $f_2 = f(2,1)$
  • $f_3 = f(1,2)$
  • $f_4 = f(2,2)$

All boundary nodes have $f = 2$.

Finite Difference Formula

$$f_{i+1,j} + f_{i-1,j} + f_{i,j+1} + f_{i,j-1} - 4f_{i,j} = h^2, g(x_i,y_j)$$

With $h=1$, RHS $= xy$ at each interior node.

Node Equations

$f_1=f(1,1)$, $g = 1$; neighbors $f_2, 2, f_3, 2$: $$f_2 + 2 + f_3 + 2 - 4f_1 = 1 \Rightarrow -4f_1 + f_2 + f_3 = -3 \quad (1)$$

$f_2=f(2,1)$, $g = 2$; neighbors $2, f_1, f_4, 2$: $$2 + f_1 + f_4 + 2 - 4f_2 = 2 \Rightarrow f_1 - 4f_2 + f_4 = -2 \quad (2)$$

$f_3=f(1,2)$, $g = 2$; neighbors $f_4, 2, 2, f_1$: $$f_4 + 2 + 2 + f_1 - 4f_3 = 2 \Rightarrow f_1 - 4f_3 + f_4 = -2 \quad (3)$$

$f_4=f(2,2)$, $g = 4$; neighbors $2, f_3, 2, f_2$: $$2 + f_3 + 2 + f_2 - 4f_4 = 4 \Rightarrow f_2 + f_3 - 4f_4 = 0 \quad (4)$$

Solve

Equations (2) and (3) are identical, so $f_2 = f_3 = p$.

From (1): $-4f_1 + 2p = -3 \Rightarrow f_1 = \dfrac{2p+3}{4}$

From (4): $2p - 4f_4 = 0 \Rightarrow f_4 = \dfrac{p}{2}$

Substitute into (2): $f_1 - 4p + f_4 = -2$

$$\frac{2p+3}{4} - 4p + \frac{p}{2} = -2$$

Multiply by 4: $$2p + 3 - 16p + 2p = -8$$ $$-12p = -11 \Rightarrow p = \frac{11}{12}$$

Back-substitute:

$$f_1 = \frac{2(11/12)+3}{4} = \frac{11/6 + 18/6}{4} = \frac{29/6}{4} = \frac{29}{24} \approx 1.208$$

$$f_2 = f_3 = \frac{11}{12} \approx 0.917$$

$$f_4 = \frac{p}{2} = \frac{11}{24} \approx 0.458$$

Verification (Eq. 4): $\frac{11}{12} + \frac{11}{12} - 4\cdot\frac{11}{24} = \frac{11}{6} - \frac{11}{6} = 0$ โœ“

Final Results

Node(x,y)f value
$f_1$(1,1)$29/24 \approx 1.208$
$f_2$(2,1)$11/12 \approx 0.917$
$f_3$(1,2)$11/12 \approx 0.917$
$f_4$(2,2)$11/24 \approx 0.458$

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.