Startpage >> Main >> EigenvalueProblem

Eigenvalue Problem

download example : LapEigenvalues1D.edp

int np=40;
mesh Th = square(np,1,[x,y/50]); //transformation for visualization comfort…
plot(Th,wait=1,aspectratio=1);

fespace Vh(Th,P1);
Vh u,v;
func f=1.;
varf Laplace1d(u,v) = int1d(Th,1)(dx(u)*dx(v))+on(2,3,4,u=0);
varf RHS(u,v) = int1d(Th,1)(u*v);//+on(2,3,4,u=0);
matrix A,B;
A = Laplace1d(Vh,Vh);
B = RHS(Vh,Vh);
int nev=20;
real sigma= 0;
real[int] ev(nev); // to store nev eigein value
Vh[int] eV(nev);   // to store nev eigen vector
int k=EigenValue(A,B,sym=false,sigma=sigma,value=ev,vector=eV,tol=1e-10,maxit=0,ncv=0);

return to 1d examples

Page last modified on September 10, 2014, at 06:30 PM