Volume 9, Issue 3
Tricks of the Trade
In and Out
Download This Issue
Staff and Contributors
T R O T T ' S C O R N E R
Solving the Eigenvalue Problem
To solve the Helmholtz equation for the drum, we will use a finite difference approximation of the Laplacian. To obtain a sufficient discretization, we subdivide the individual drum squares into rL points in each direction.
The two functions refinePolygon and refineEdge subdivide the squares that form the drum and the outer edges of the drum.
Here are the refined squares and the interior and boundary points of the discretized problem.
We will have to determine the function values for each eigenfunction at 28521 points.
Here is a graphic of the resulting discretized drum.
The following rules for testing and retrieving the boundary and interior points allow us to build the global finite differences easily and quickly. These rules also make it possible to quickly access the node number of a discretization point in the visualization functions to be defined later.
Next, we must approximate the second derivative at the grid points. The function stencilWeightList[leftPoints, rightPoints] gives the list of the weights of the th derivative using the function values at the left and right neighbor points. The function uses the built-in command NDSolve`FiniteDifferenceDerivative. See Advanced Documentation: NDSolve in the Help Browser for more details.
For instance, these are the weights for a stencil of length seven for the second derivative.
Now we assemble the system of coupled linear equations representing the approximations of the derivatives. The function addVertexWeights adds the contributions of the list of finite difference weights vws for each vertex.
For a given stencil of odd length , the function makeNonVanishingDMatrixElements returns a list of the nonvanishing elements of the discretization of the negative of the 2D Laplace operator. We incorporate the Dirichlet boundary conditions through an antisymmetric continuation of the function across the boundary, using an odd stencil length, to make sure that is always easily possible.
The resulting matrix approximates the negative Laplacian. It has 332637 nonvanishing entries.
The matrix is symmetric by construction.
And it is nicely banded.
Now we are in a position to calculate the eigenvalues and eigenfunctions. Here are the first few eigenvalues, which we reorder and scale.
About Mathematica | Download Mathematica Player
© Wolfram Media, Inc. All rights reserved.