CSC212 · 2080 · 5 marks
Solve the Poisson's equation nabla2 f = xy and f = 2 on boundary by assuming square domain 0 leq x leq 3 and 0 leq y leq 3 and h = 1.
Solve the Poisson's equation $\nabla^2 f = xy$ and $f = 2$ on boundary by assuming square domain $0 \leq x \leq 3$ and $0 \leq y \leq 3$ and $h = 1$. [5]
Poisson's Equation: ∇²f = xy with f = 2 on Boundary
Given
- PDE: $\nabla^2 f = xy$
- Boundary condition: $f = 2$ on all boundaries
- Domain: $0 \le x \le 3$, $0 \le y \le 3$
- Step size: $h = 1$
Grid points at $x = 0,1,2,3$ and $y = 0,1,2,3$. Interior nodes at $(1,1),(2,1),(1,2),(2,2)$.
Solution
Finite difference form
$$f_{i-1,j} + f_{i+1,j} + f_{i,j-1} + f_{i,j+1} - 4f_{i,j} = h^2 (xy)$$
With $h = 1$, RHS $= xy$ at each node.
Grid layout
y=3: 2 2 2 2
y=2: 2 f3 f4 2
y=1: 2 f1 f2 2
y=0: 2 2 2 2
x=0 x=1 x=2 x=3
- $f_1 = (1,1)$, $f_2 = (2,1)$, $f_3 = (1,2)$, $f_4 = (2,2)$
Equations
f1 at (1,1), xy = 1: $$2 + f_2 + 2 + f_3 - 4f_1 = 1 \Rightarrow -4f_1 + f_2 + f_3 = -3 \quad (1)$$
f2 at (2,1), xy = 2: $$f_1 + 2 + 2 + f_4 - 4f_2 = 2 \Rightarrow f_1 - 4f_2 + f_4 = -2 \quad (2)$$
f3 at (1,2), xy = 2: $$2 + f_4 + f_1 + 2 - 4f_3 = 2 \Rightarrow f_1 - 4f_3 + f_4 = -2 \quad (3)$$
f4 at (2,2), xy = 4: $$f_3 + 2 + f_2 + 2 - 4f_4 = 4 \Rightarrow f_2 + f_3 - 4f_4 = 0 \quad (4)$$
Solving
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 + 3 = -8$$ $$-12p = -11 \Rightarrow p = \frac{11}{12} \approx 0.9167$$
Back-substitution
$$f_2 = f_3 = \frac{11}{12} \approx 0.9167$$
$$f_1 = \frac{2(11/12) + 3}{4} = \frac{11/6 + 18/6}{4} = \frac{29/6}{4} = \frac{29}{24} \approx 1.2083$$
$$f_4 = \frac{p}{2} = \frac{11}{24} \approx 0.4583$$
Verification (Eq. 4)
$$f_2 + f_3 - 4f_4 = \frac{11}{12} + \frac{11}{12} - 4\cdot\frac{11}{24} = \frac{22}{12} - \frac{44}{24} = \frac{11}{6} - \frac{11}{6} = 0 \checkmark$$
Final Answers
$$\boxed{f_1 = \frac{29}{24} \approx 1.2083,\quad f_2 = f_3 = \frac{11}{12} \approx 0.9167,\quad f_4 = \frac{11}{24} \approx 0.4583}$$
The complete value is $f_4 = 11/24 \approx 0.4583$.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.