# Eigenfunctions of Laplace operator on a squere with finite differences

1. Apr 6, 2009

### pomaranca

1. The problem statement, all variables and given/known data

I want to numerically compute the eigenfunctions and eigenvalues of Laplace operator on a square with Dirichlet boundary conditions (i.e. $$u|_{\partial}=0$$). Exact analytical solutions are well known sinusoidal modes: $$u_{m,n}(x,y)=\sin(k_mx)\sin(k_ny)$$, where $$k_m=m\frac{\pi}{a}$$ and .$$k_n=n\frac{\pi}{a}$$, the length of a square side is $$a$$.

2. Relevant equations

We are numerically solving the following equation:
$$\nabla^2u(x,y)=\frac{\partial^2u}{\partial x^2}+\frac{\partial^2u}{\partial y^2}=k^2u(x,y)$$
on a square grid of size $$N\times N$$, where points are separated by $$h=a/N$$.

3. The attempt at a solution

Two dimensional Laplace operator is replaced with simple finite differences on a square grid.
$$\nabla^2u(x,y)=\frac{u_{i,j}-2u_{i,j}+u_{i-1,j}}{h^2}+\frac{u_{i,j+1}-2u_{i,j}+u_{i,j-1}}{h^2}$$
The problem thus gets the form:
$$u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}-4u_{i,j}=h^2k^2u_{i,j}$$
Which can be written as a typical matrix eigenvalue problem:
$${\bf A}{\bf u}=\lambda{\bf u}$$
The matrix $$\bf A$$ is square and has the following form for $$N=3$$:
$$\left( \begin{array}{ccccccccc} -4 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 1 & -4 & 1 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & -4 & 1 & 0 & 1 & 0 & 0 & 0 \\ 1 & 0 & 1 & -4 & 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 & -4 & 1 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 1 & -4 & 1 & 0 & 1 \\ 0 & 0 & 0 & 1 & 0 & 1 & -4 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 1 & -4 & 1 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & -4 \end{array} \right)$$
We can now use some numerical library to find eigenvalues and eigenfunctions of $$\bf A$$.

What i don't know is where and how to take the boundary conditions into account.