eigenvalues and eigenmodes of l-凯发k8网页登录
this example shows how to calculate eigenvalues and eigenvectors. the eigenvalue problem is . this example computes all eigenmodes with eigenvalues smaller than 100.
create a model and include this geometry. the geometry of the l-shaped membrane is described in the file lshapeg
.
model = createpde(); geometryfromedges(model,@lshapeg);
set zero dirichlet boundary conditions on all edges.
applyboundarycondition(model,"dirichlet", ... "edge",1:model.geometry.numedges, ... "u",0);
specify the coefficients for the problem: d
= 1 and c
= 1. all other coefficients are equal to zero.
specifycoefficients(model,"m",0,"d",1,"c",1,"a",0,"f",0);
set the interval [0 100]
as the region for the eigenvalues in the solution.
r = [0 100];
create a mesh and solve the problem.
generatemesh(model,"hmax",0.05);
results = solvepdeeig(model,r);
basis= 10, time= 0.12, new conv eig= 0 basis= 11, time= 0.16, new conv eig= 0 basis= 12, time= 0.17, new conv eig= 0 basis= 13, time= 0.18, new conv eig= 0 basis= 14, time= 0.19, new conv eig= 0 basis= 15, time= 0.21, new conv eig= 0 basis= 16, time= 0.21, new conv eig= 0 basis= 17, time= 0.22, new conv eig= 0 basis= 18, time= 0.22, new conv eig= 1 basis= 19, time= 0.23, new conv eig= 1 basis= 20, time= 0.23, new conv eig= 1 basis= 21, time= 0.24, new conv eig= 2 basis= 22, time= 0.26, new conv eig= 3 basis= 23, time= 0.27, new conv eig= 3 basis= 24, time= 0.28, new conv eig= 3 basis= 25, time= 0.30, new conv eig= 3 basis= 26, time= 0.31, new conv eig= 3 basis= 27, time= 0.32, new conv eig= 3 basis= 28, time= 0.32, new conv eig= 4 basis= 29, time= 0.33, new conv eig= 4 basis= 30, time= 0.33, new conv eig= 4 basis= 31, time= 0.34, new conv eig= 5 basis= 32, time= 0.34, new conv eig= 5 basis= 33, time= 0.35, new conv eig= 5 basis= 34, time= 0.36, new conv eig= 5 basis= 35, time= 0.36, new conv eig= 6 basis= 36, time= 0.63, new conv eig= 6 basis= 37, time= 0.66, new conv eig= 6 basis= 38, time= 0.67, new conv eig= 7 basis= 39, time= 0.70, new conv eig= 7 basis= 40, time= 0.71, new conv eig= 7 basis= 41, time= 0.72, new conv eig= 7 basis= 42, time= 0.73, new conv eig= 7 basis= 43, time= 0.75, new conv eig= 8 basis= 44, time= 0.77, new conv eig= 8 basis= 45, time= 0.78, new conv eig= 9 basis= 46, time= 0.79, new conv eig= 11 basis= 47, time= 0.81, new conv eig= 11 basis= 48, time= 0.83, new conv eig= 11 basis= 49, time= 0.85, new conv eig= 11 basis= 50, time= 1.03, new conv eig= 13 basis= 51, time= 1.08, new conv eig= 13 basis= 52, time= 1.11, new conv eig= 14 basis= 53, time= 1.13, new conv eig= 14 basis= 54, time= 1.16, new conv eig= 14 basis= 55, time= 1.18, new conv eig= 14 basis= 56, time= 1.19, new conv eig= 14 basis= 57, time= 1.21, new conv eig= 14 basis= 58, time= 1.22, new conv eig= 14 basis= 59, time= 1.23, new conv eig= 15 basis= 60, time= 1.24, new conv eig= 15 basis= 61, time= 1.40, new conv eig= 15 basis= 62, time= 1.44, new conv eig= 16 basis= 63, time= 1.46, new conv eig= 16 basis= 64, time= 1.48, new conv eig= 16 basis= 65, time= 1.50, new conv eig= 17 basis= 66, time= 1.53, new conv eig= 17 basis= 67, time= 1.54, new conv eig= 18 basis= 68, time= 1.56, new conv eig= 18 basis= 69, time= 1.58, new conv eig= 18 basis= 70, time= 1.60, new conv eig= 19 basis= 71, time= 1.62, new conv eig= 20 basis= 72, time= 1.63, new conv eig= 21 basis= 73, time= 1.65, new conv eig= 21 basis= 74, time= 1.65, new conv eig= 22 end of sweep: basis= 74, time= 1.65, new conv eig= 22 basis= 32, time= 1.67, new conv eig= 0 basis= 33, time= 1.69, new conv eig= 0 basis= 34, time= 1.70, new conv eig= 0 basis= 35, time= 1.71, new conv eig= 0 basis= 36, time= 1.72, new conv eig= 0 basis= 37, time= 1.73, new conv eig= 0 basis= 38, time= 1.74, new conv eig= 0 basis= 39, time= 1.74, new conv eig= 0 basis= 40, time= 1.74, new conv eig= 0 basis= 41, time= 1.75, new conv eig= 0 basis= 42, time= 1.75, new conv eig= 0 end of sweep: basis= 42, time= 1.75, new conv eig= 0
there are 19 eigenvalues smaller than 100.
length(results.eigenvalues)
ans = 19
plot the first eigenmode and compare it to the matlab's membrane
function.
u = results.eigenvectors; pdeplot(model,"xydata",u(:,1),"zdata",u(:,1));
figure membrane(1,20,9,9)
eigenvectors can be multiplied by any scalar and remain eigenvectors. this explains the difference in scale that you see.
membrane
can produce the first 12 eigenfunctions for the l-shaped membrane. compare the 12th eigenmodes.
figure pdeplot(model,"xydata",u(:,12),"zdata",u(:,12));
figure membrane(12,20,9,9)