- #1
pomaranca
- 16
- 0
Homework Statement
I want to numerically compute the eigenfunctions and eigenvalues of Laplace operator on a square with Dirichlet boundary conditions (i.e. [tex]u|_{\partial}=0[/tex]). Exact analytical solutions are well known sinusoidal modes: [tex]u_{m,n}(x,y)=\sin(k_mx)\sin(k_ny) [/tex], where [tex]k_m=m\frac{\pi}{a}[/tex] and .[tex]k_n=n\frac{\pi}{a}[/tex], the length of a square side is [tex]a[/tex].
Homework Equations
We are numerically solving the following equation:
[tex]\nabla^2u(x,y)=\frac{\partial^2u}{\partial x^2}+\frac{\partial^2u}{\partial y^2}=k^2u(x,y)[/tex]
on a square grid of size [tex]N\times N[/tex], where points are separated by [tex]h=a/N[/tex].
The Attempt at a Solution
Two dimensional Laplace operator is replaced with simple finite differences on a square grid.
[tex]\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}[/tex]
The problem thus gets the form:
[tex]u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}-4u_{i,j}=h^2k^2u_{i,j}[/tex]
Which can be written as a typical matrix eigenvalue problem:
[tex]{\bf A}{\bf u}=\lambda{\bf u}[/tex]
The matrix [tex]\bf A[/tex] is square and has the following form for [tex]N=3[/tex]:
[tex]
\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)
[/tex]
We can now use some numerical library to find eigenvalues and eigenfunctions of [tex]\bf A[/tex].
What i don't know is where and how to take the boundary conditions into account.