Sturm Liou Ville 3
Sturm Liou Ville 3
Contents
1 The Mathieu Differential Equation 2
6 Known Eigenvalues 3
1
1 The Mathieu Differential Equation
This example addresses the solution of the truncated hydrogen differential equation, a Sturm-
Liouville equation. This is a boundary value problem with an LNP singular condition at y(0). A
series of eigenvalues are known for this problem, they will be used here to evaluate the quality of
the eigenvalues computed numerically.
2 1
−ÿ + − = λ y with y(0) = LN P and y(1000) = 0 (1)
x2 x
2
14 Bc = dopConstrain( C, B );
Truncate the constrained basis functions to avoide aliasing
15 Bc = Bc(:,1:noBfs);
6 Known Eigenvalues
Some of the eigenvalues are known for this differential equation [2, 1]
23 L0Known = -6.250000000000E-2;
24 L9Known = -2.066115702478E-3;
25 L17Known = -2.5757359232E-4;
26 L18Known = 2.873901310E-5;
Display the relative error in the numerically computed eigenvalues with respect to the known
eigenvalues.
27 disp( [’L_’,int2str(0),’ = ’,num2str(vals(1),’%1.10E’),’ ’,num2str(
L0Known,’%1.10E’),’ ’,num2str((L0Known - vals(1))/L0Known,’
%1.10E’) ] );
28 disp( [’L_’,int2str(9),’ = ’,num2str(vals(10),’%1.10E’),’ ’,num2str(
L9Known,’%1.10E’),’ ’,num2str((L9Known - vals(10))/L9Known,’
%1.10E’) ] );
3
29 disp( [’L_’,int2str(17),’ = ’,num2str(vals(18),’%1.10E’),’ ’,num2str(
L17Known,’%1.10E’),’ ’,num2str((L17Known - vals(18))/L17Known,’
%1.10E’) ] );
30 disp( [’L_’,int2str(18),’ = ’,num2str(vals(19),’%1.10E’),’ ’,num2str(
L18Known,’%1.10E’),’ ’,num2str((L18Known - vals(19))/L18Known,’
%1.10E’) ] );
4
65 P4 = [0.18 0.79 0.8 0.17];
66 A4 = axes( ’position’, P4, ’color’, ’w’ );
67 plot( x, sols(:,19), ’k’);
68 grid on;
69 grid on;
70 ylabel(’ y(x) ’);
71 ylabel(’y(x)_{18}’);
72 hold on;
y(x)18 0.1
−0.1
0 200 400 600 800 1000
0.1
y(x)17
−0.1
0 200 400 600 800 1000
0.1
y(x)9
−0.1
0 200 400 600 800 1000
0.2
y(x)0
0.1
0
0 200 400 600 800 1000
x
73 fig2 = figure;
74 P1 = [0.16 0.4 0.8 0.55] ;
75 A = axes(’position’,P1);
76 imagesc( log10(abs(Vec) ));
77 colorbar;
78 ylabel([’Basis function number m, n_b = ’,int2str(noBfs),’’]);
79 P2 = [0.16 0.1 0.615 0.25] ;
80 A = axes(’position’,P2);
81 plot(vals , ’k’);
82 range = axis;
83 axis([0,noBfs,0,5]);
84 grid on;
85 xlabel(’Eigenvector number n’);
86 ylabel(’\% rel. error in \lambda’);
5
Basis function number m, nb = 500
−2
100
−4
200 −6
−8
300
−10
400 −12
−14
500
100 200 300 400 500
% rel. error in λ
0
0 100 200 300 400 500
Eigenvector number n
Figure 2: The Rayleigh-Ritz spectrum of the eigenfunctions with respect to the admissible func-
tions.
References
[1] Pierluigi Amodio and Giuseppina Settanni. A matrix method for the solution of sturm-liouville
problems. Journal of Numerical Analysis, Industrial and Applied Mathematics (JNAIAM),
6(1-2):1–13, 2011.
[2] J. D. Pryce. A test package for sturm-liouville solvers. ACM Trans. Math. Softw., 25(1):21–57,
March 1999.