# Numerical solution of the Laplace equation on circular domain

I was solving Laplace equation in MATLAB numerically. However I have problems when the domain is not rectangular.

The equation is as follows:

$$\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2}=0$$

domain is circular

$$x^2 + y^2 < 16$$

and boundary condition $$u(x,y)= x^2y^2$$

Perhaps begin by rewriting the problem in polar coordintates: $$\frac{\partial^{2}u}{\partial r^{2}}+\frac{1}{r}\frac{\partial u}{\partial r}+\frac{1}{r^{2}}\frac{\partial^{2}u}{\partial\theta^{2}}=0$$ $$r^2<16$$ $$\left. u(r,\theta)\right|_D=r^4\cos^2\theta\sin^2\theta$$
But be careful around $r=0$ and that the function is periodic in $\theta$, $u(r,\theta)=u(r,\theta+2\pi)$. –  Daryl Sep 1 '12 at 8:45