An archived instance of discourse for discussion in undergraduate PDE.

Numerical Laplace on the square

Mark

Consider the Dirichlet problem $u_{xx}+u_{yy}=0$ on the square with boundary conditions
$$
\begin{array}{ll}
u(x,0) = 4x(1-x) && u(x,1) = -4x(1-x) \\
u(0,y) = 0 && u(1,y) = 0.
\end{array}
$$
Suppose we attempt to solve this problem numerically using astandard rectangular grid with $\Delta x=\Delta y= 1/3$:






Write down and solve the resulting system of equations.

kmaclean

From looking at the grid, and from knowing that we have a $\Delta x=\Delta y= 1/3$ over the Laplacian square of length one, that would give us a 2 x 2 square, which gives us four unknowns, which in turn means we will have 4 equations.

We can use the discrete equation for each unknown,
$$\frac{U_{i-1,j}+U_{i+1,j}-4U_{i,j}+U_{i,j-i}+U_{i,j+1}}{h^2}$$

I took the i's to relate to the X's and the j"s to relate to the Y's to get a grid corresponding to this matrix for each point's location (sorry I'm not fancy enough to make a grid like mark).

\begin{bmatrix}
U_{0,3} & U_{1,3} & U_{2,3} & U_{3,3} \\
U_{0,2} & U_{1,2} & U_{2,2} & U_{3,2} \\
U_{0,1} & U_{1,1} & U_{2,1} & U_{3,1} \\
U_{0,0} & U_{1,0} & U_{2,0} & U_{3,0} \\
\end{bmatrix}




Now we can find the four equations for the four unknowns,

$$(U_{1,1})'=\frac{U_{0,1}+U_{2,1}-4U_{1,1}+U_{1,0}+U_{1,2}}{\frac{1}{3}^2}=0$$

$$(U_{2,1})'=\frac{U_{1,1}+U_{3,1}-4U_{2,1}+U_{2,0}+U_{2,2}}{\frac{1}{3}^2}=0
$$

$$(U_{1,2})'=\frac{U_{0,2}+U_{2,2}-4U_{1,2}+U_{1,1}+U_{1,3}}{\frac{1}{3}^2}=0$$

$$(U_{2,2})'=\frac{U_{1,2}+U_{3,2}-4U_{2,2}+U_{2,1}+U_{2,3}}{\frac{1}{3}^2}=0$$

Now if we take into account our boundary conditions, and referring back to the matrix/grid, for $u(0,y)=0$ corresponds to the left side of the grid (1st column of the matrix), $u(1,y)=0$ corresponds to the right side of the grid (4th column of the matrix), $u(x,0)=4x(1-x)$ corresponds to the bottom of the grid (bottom row of the matrix), and $u(x,1)=-4x(1-x)$ corresponds to the top of the grid (top row of the matrix), so now we can plug in some of our knowns into our equations to get,

$$(U_{1,1})'=9(0+U_{2,1}-4U_{1,1}+\frac{8}{9}+U_{1,2})=0$$

$$(U_{2,1})'=9(U_{1,1}+0-4U_{2,1}+\frac{8}{9}+U_{2,2})=0$$

$$(U_{1,2})'=9(0+U_{2,2}-4U_{1,2}+U_{1,1}-\frac{8}{9})=0$$

$$(U_{2,2})'=9(U_{1,2}+0-4U_{2,2}+U_{2,1}-\frac{8}{9})=0$$

As solving these or even needing to go this far, I just couldn't find how to put it in on mathematica, so if anyone wants to take step two from me, I'm passing the baton on.

Mark

Looks good so far!