Eigenvalues of Ordinary Differential Equations Jake Blanchard University of Wisconsin.
-
Upload
polly-riley -
Category
Documents
-
view
221 -
download
4
Transcript of Eigenvalues of Ordinary Differential Equations Jake Blanchard University of Wisconsin.
Eigenvalues of Ordinary Differential EquationsJake BlanchardUniversity of Wisconsin
IntroductionFinite Difference TechniquesMatlab
Model ProblemA simple eigenvalue problem
Solution
d y
dxy
2
22 0
y y( ) ( )0 1 0
n n ,
y A n xn n sin( )
Finite Difference Solution
y y y
hyi i ii
1 1
222
0
y h y yi i i 12 2
12 0( )
Choosing a MeshDivide range 0<x<1 into 8
regionsThis produces 9 mesh pointsBoundary conditions eliminate
two unknownsWe’re left with 7 unknowns (the 7
internal mesh points)
Matrix Equation
2 1 0 0 0 0 0
1 2 1 0 0 0 0
0 1 2 1 0 0 0
0 0 1 2 1 0 0
0 0 0 1 2 1 0
0 0 0 0 1 2 1
0 0 0 0 0 1 2
02 2y h y
i ih e2 2
Coden=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);figuresemilogy(myint,myerr)
Results – n=7
1 2 3 4 5 6 70
1
2
3
4
5
6
7
Results (error) – n=7
1 2 3 4 5 6 710
-3
10-2
10-1
100
Results – n=2000
0 200 400 600 800 1000 1200 1400 1600 1800 20000
200
400
600
800
1000
1200
1400
1600
1800
2000
Results (error) – n=2000
0 200 400 600 800 1000 1200 1400 1600 1800 200010
-7
10-6
10-5
10-4
10-3
10-2
10-1
100