# pdeeig

Solve eigenvalue PDE problem

## Syntax

`[v,l] = pdeeig(model,c,a,d,r)[v,l] = pdeeig(b,p,e,t,c,a,d,r)[v,l] = pdeeig(K,B,M,r)`

## Description

`[v,l] = pdeeig(model,c,a,d,r)` produces the solution to the FEM formulation of the scalar PDE eigenvalue problem

or the system PDE eigenvalue problem

with geometry, boundary conditions, and mesh specified in `model`, a `PDEModel` object. See Solve Problems Using PDEModel Objects.

`r` is a two-element vector, indicating an interval on the real axis. (The left-hand side can be `-Inf`.) The algorithm returns all eigenvalues in this interval in `l`, up to a maximum of 99 eigenvalues.

`v` is an eigenvector matrix. For the scalar case each column in `v` is an eigenvector of solution values at the corresponding node points from `p`. For a system of dimension N with np node points, the first np rows of `v` describe the first component of v, the following np rows of `v` describe the second component of v, and so on. Thus, the components of v are placed in blocks `v` as N blocks of node point rows.

 Note:   Eigenvectors are determined only up to multiple by a scalar, including a negative scalar.

The eigenvalue PDE problem is a homogeneous problem, i.e., only boundary conditions where g = 0 and r = 0 can be used. The nonhomogeneous part is removed automatically.

The coefficients `c`, `a`, `d` of the PDE problem can be given in a wide variety of ways. In the context of `pdeeig` the coefficients cannot depend on `u` nor `t`, the time. For a complete listing of all options, see Scalar PDE Coefficients and Coefficients for Systems of PDEs.

`[v,l] = pdeeig(b,p,e,t,c,a,d,r)` solves the problem using a mesh described by `p`, `e`, and `t`, with boundary conditions given by `b`.

`b` describes the boundary conditions of the PDE problem. For the recommended way of specifying boundary conditions, see Specify Boundary Conditions Objects. For all methods of specifying boundary conditions, see Forms of Boundary Condition Specification.

The geometry of the PDE problem is given by the mesh data `p`, `e`, and `t`. For details on the mesh data representation, see Mesh Data.

`[v,l] = pdeeig(K,B,M,r)` produces the solution to the generalized sparse matrix eigenvalue problem

K ui = λB´MBui
u = Bui

with Real(λ) in the interval in r.

## Examples

collapse all

### Eigenvalues and Eigenvectors of the L-Shaped Membrane

Compute the eigenvalues that are less than 100, and compute the corresponding eigenmodes for

–∇u = λu

on the geometry of the L-shaped membrane.

```model = createpde; geometryFromEdges(model,@lshapeg); applyBoundaryCondition(model,'Edge',1:model.Geometry.NumEdges,'u',0); generateMesh(model,'Hmax',0.02); c = 1; a = 0; d = 1; r = [-Inf 100]; [v,l] = pdeeig(model,c,a,d,r); l(1) % first eigenvalue```
```ans = 9.6481```

Display the first eigenmode, and compare it to the built-in `membrane` plot.

`pdeplot(model,'xydata',v(:,1),'zdata',v(:,1));`

```figure membrane(1,20,9,9) % the MATLAB function```

Compute the sixteenth eigenvalue, and plot the sixteenth eigenmode.

`l(16) % sixteenth eigenvalue`
```ans = 92.4658```
```figure pdeplot(model,'xydata',v(:,16),'zdata',v(:,16)); % sixteenth eigenmode```

## Caution

In the standard case c and d are positive in the entire region. All eigenvalues are positive, and 0 is a good choice for a lower bound of the interval. The cases where either c or d is zero are discussed next.

• If d = 0 in a subregion, the mass matrix M becomes singular. This does not cause any trouble, provided that c > 0 everywhere. The pencil (K,M) has a set of infinite eigenvalues.

• If c = 0 in a subregion, the stiffness matrix `K` becomes singular, and the pencil (K,M) has many zero eigenvalues. With an interval containing zero, `pdeeig` goes on for a very long time to find all the zero eigenvalues. Choose a positive lower bound away from zero but below the smallest nonzero eigenvalue.

• If there is a region where both c = 0 and d = 0, we get a singular pencil. The whole eigenvalue problem is undetermined, and any value is equally plausible as an eigenvalue.

Some of the awkward cases are detected by `pdeeig`. If the shifted matrix is singular, another shift is attempted. If the matrix with the new shift is still singular a good guess is that the entire pencil (K,M) is singular.

If you try any problem not belonging to the standard case, you must use your knowledge of the original physical problem to interpret the results from the computation.

collapse all

### Algorithms

`pdeeig` calls `sptarn` to calculate eigenvalues. For details of the algorithm, see the `sptarn` reference pages.