This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Vibration Of a Circular Membrane Using The MATLAB eigs Function

This example shows the calculation of the vibration modes of a circular membrane. The calculation of vibration modes requires the solution of the eigenvalue partial differential equation (PDE). In this example the solution of the eigenvalue problem is performed using both the PDE Toolbox™ solvepdeeig solver and the core MATLAB™ eigs eigensolver.

The main objective of this example is to show how eigs can be used with PDE Toolbox. Generally, the eigenvalues calculated by solvepdeeig and eigs are practically identical. However, sometimes, it is simply more convenient to use eigs than solvepdeeig. One example of this is when it is desired to calculate a specified number of eigenvalues in the vicinity of a user-specified target value. solvepdeeig requires that a lower and upper bound surrounding this target value be specified. eigs requires only that the target eigenvalue and the desired number of eigenvalues be specified.

Create a pde entity for a PDE with a single dependent variable

numberOfPDE = 1;
pdem = createpde(numberOfPDE);

Geometry And Mesh

The geometry for a circle can easily be defined as shown below.

radius = 2;
g = decsg([1 0 0 radius]','C1',('C1')');
% Create a geometry object and append it to the PDE Model

% Plot the geometry and display the edge labels for use in the boundary
% condition definition.
axis equal
title 'Geometry With Edge Labels Displayed';

Define the PDE Coefficients and Boundary Conditions

c = 1e2;
a = 0;
f = 0;
d = 10;
% Solution is zero at all four outer edges of the circle
bOuter = applyBoundaryCondition(pdem,'dirichlet','Edge',(1:4),'u',0);

Generate Mesh


Solve the eigenvalue problem using eigs

Use assembleFEMatrices to calculate the global finite element mass and stiffness matrices with boundary conditions imposed using nullspace approach.

FEMatrices = assembleFEMatrices(pdem,'nullspace');
K = FEMatrices.Kc;
B = FEMatrices.B;
M = FEMatrices.M;
sigma = 1e2;
numberEigenvalues = 5;
[eigenvectorsEigs,eigenvaluesEigs] = eigs(K,M,numberEigenvalues,sigma);
% Reshape the diagonal eigenvaluesEigs matrix into a vector.
eigenvaluesEigs = diag(eigenvaluesEigs);
% Find the largest eigenvalue and its index in the eigenvalues vector.
[maxEigenvaluesEigs, maxIndex] = max(eigenvaluesEigs);
% Transform the eigenvectors with constrained equations removed to the full
% eigenvector including constrained equations.
eigenvectorsEigs = B*eigenvectorsEigs;

Solve the eigenvalue problem using solvepdeeig

%Set the range for |solvepdeeig| to be slightly larger than the range from
r = [min(eigenvaluesEigs)*.99 max(eigenvaluesEigs)*1.01];
result = solvepdeeig(pdem,r);
eigenvectorsPde = result.Eigenvectors;
eigenvaluesPde = result.Eigenvalues;
              Basis= 10,  Time=   0.07,  New conv eig=  0
              Basis= 19,  Time=   0.08,  New conv eig=  2
              Basis= 28,  Time=   0.09,  New conv eig=  7
End of sweep: Basis= 28,  Time=   0.09,  New conv eig=  7
              Basis= 17,  Time=   0.13,  New conv eig=  0
End of sweep: Basis= 17,  Time=   0.13,  New conv eig=  0

Compare the solutions computed by eigs and solvepdeeig

eigenValueDiff = sort(eigenvaluesPde) - sort(eigenvaluesEigs);
fprintf('Maximum difference in eigenvalues from solvepdeeig and eigs: %e\n', ...
% As can be seen, both functions calculate the same eigenvalues. For any
% eigenvalue, the eigenvector can be multiplied by an arbitrary scalar.
% eigs and solvepdeeigs choose a different arbitrary scalar for normalizing
% their eigenvectors as shown in the figure below.
h = figure;
h.Position = [1 1 2 1].*h.Position;
axis equal
pdeplot(pdem,'XYData', eigenvectorsEigs(:,maxIndex),'Contour','on');
title(sprintf('eigs eigenvector, eigenvalue: %12.4e', eigenvaluesEigs(maxIndex)));
axis equal
title(sprintf('solvepdeeig eigenvector, eigenvalue: %12.4e',eigenvaluesPde(end)));
Maximum difference in eigenvalues from solvepdeeig and eigs: 8.526513e-14

Was this topic helpful?