120 likes | 274 Views
Eigenvalues of Ordinary Differential Equations. Jake Blanchard University of Wisconsin. Introduction. Finite Difference Techniques Matlab. Model Problem. A simple eigenvalue problem Solution. Finite Difference Solution. Choosing a Mesh. Divide range 0<x<1 into 8 regions
E N D
Eigenvalues of Ordinary Differential Equations Jake Blanchard University of Wisconsin
Introduction • Finite Difference Techniques • Matlab
Model Problem • A simple eigenvalue problem • Solution
Choosing a Mesh • Divide range 0<x<1 into 8 regions • This produces 9 mesh points • Boundary conditions eliminate two unknowns • We’re left with 7 unknowns (the 7 internal mesh points)
Code • n=7; • h=1/(n+1); • voffdiag=ones(n-1,1); • mymat=-2*eye(n)+diag(voffdiag,1)+diag(voffdiag,-1); • D=sort(eig(mymat),'descend'); • lam=sqrt(-D)/h; • check=lam/pi; • myint=(1:n)'; • plot(myint,check,myint,myint) • myerr=abs(check-myint)./(myint); • figure • semilogy(myint,myerr)