0% found this document useful (0 votes)
35 views6 pages

Sturm Liou Ville 3

This document presents a numerical method for solving the truncated hydrogen differential equation, which is a Sturm-Liouville boundary value problem. It generates basis functions on a defined node set, constructs a matrix representation of the differential operator, solves the resulting eigenvalue problem, and compares computed eigenvalues to known values. Plots of selected eigenfunctions and the eigenvalue spectrum are presented. The method demonstrates accurate computation of several known eigenvalues for this problem.

Uploaded by

imran5705074
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views6 pages

Sturm Liou Ville 3

This document presents a numerical method for solving the truncated hydrogen differential equation, which is a Sturm-Liouville boundary value problem. It generates basis functions on a defined node set, constructs a matrix representation of the differential operator, solves the resulting eigenvalue problem, and compares computed eigenvalues to known values. Plots of selected eigenfunctions and the eigenvalue spectrum are presented. The method demonstrates accurate computation of several known eigenvalues for this problem.

Uploaded by

imran5705074
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ODEbox: A Toolbox for Ordinary Differential Equations

Sturm Liouville Example 3


The Truncated Hydrogen Differential Equation
Matthew Harker and Paul O’Leary
Institute for Automation
University of Leoben
A-8700 Leoben, Austria
URL: automation.unileoben.ac.at

Original: January 9, 2013


c 2013

Last Modified: February 27, 2013

Contents
1 The Mathieu Differential Equation 2

2 tidy up the Workspace 2

3 Define the Nodes and Compute the Basis Functions 2


3.1 Generate the Differentiating Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3.2 Define the Constraints and Compute the Admissible Functions . . . . . . . . . . . 2

4 Setup the Sturm-Liouville Matrix Linear Differential Operator 3

5 Solve the Eigenvector Problem 3

6 Known Eigenvalues 3

7 Plot the Results 4

8 Write the Figures to Disk 6

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

in the closed interval 0 ≤ x ≤ 1000.

2 tidy up the Workspace


1 clear all;
2 close all;
3 setUpGraphics;

3 Define the Nodes and Compute the Basis Functions


Define the number of nodes and the number of basis functions used.
4 noPts = 1000;
5 noBfs = round(noPts/2);
Compute the Chebyshev points, but scaled to form a open interval 0 < x < 1000.
6 x = dopNodes( noPts, ’cheby’ );
7 xMax = 1000;
8 x = xMax * (x + 1)/2;
Synthesize a complete set of basis functions
9 B = dop(x);

3.1 Generate the Differentiating Matrix


Synthesize the differentiating matrix with support length ls
10 ls = 13;
11 D = dopDiffLocal( x, ls, ls );

3.2 Define the Constraints and Compute the Admissible Functions


Define the constraints, in this example only one constraint.
12 C = zeros( noPts, 1 );
13 C(end,end) = 1;
Compute the set of constrained basis functions, i.e., admissible functions.

2
14 Bc = dopConstrain( C, B );
Truncate the constrained basis functions to avoide aliasing
15 Bc = Bc(:,1:noBfs);

4 Setup the Sturm-Liouville Matrix Linear Differential


Operator
Setup the Linear differential operator for the differential equation.
16 Gx = diag((1./x).*(2./x - 1) ) ;
17 L = Bc’ * (-D * D + Gx)* Bc;

5 Solve the Eigenvector Problem


Solve the eigenvalue problem
18 [Vec, Val] = eig( L );
19 vals = diag( Val );
and sort the eigenvalues
20 [vals, inds] = sort(vals);
21 Vec = Vec(:,inds);
Compute the eigenfunctions
22 sols = Bc * Vec;

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’) ] );

L_0 = -6.2499999978E-02 -6.2500000000E-02 3.4874503285E-10


L_9 = -2.0661156136E-03 -2.0661157025E-03 4.3009091823E-08
L_17 = -2.5757218232E-04 -2.5757359232E-04 5.4741446402E-06
L_18 = 2.8740937561E-05 2.8739013100E-05 -6.6963370220E-05

7 Plot the Results


32 setUpGraphics(10)
33 FigureSize=[1 1 10 10];
34 set(0,’DefaultFigureUnits’,’centimeters’);
35 set(0,’DefaultFigurePosition’,FigureSize);
36 set(0,’DefaultFigurePaperUnits’,’centimeters’);
37 set(0,’DefaultFigurePaperPosition’,FigureSize);
38 MyAxesPosition=[0.16 0.17 0.8 0.8];
39 set(0,’DefaultaxesPosition’,MyAxesPosition);
40 %
41 fig1 = figure;
42 P1 = [0.18 0.1 0.8 0.17];
43 A1 = axes( ’position’, P1, ’color’, ’w’ );
44 plot( x, sols(:,1), ’k’);
45 grid on;
46 xlabel(’ x ’);
47 ylabel(’y(x)_{0}’);
48 axis([0,xMax,-0.01,0.2]);
49 hold on;
50 %
51 P2 = [0.18 0.33 0.8 0.17];
52 A2 = axes( ’position’, P2, ’color’, ’w’ );
53 plot( x, sols(:,10), ’k’);
54 grid on;
55 ylabel(’y(x)_{9}’);
56 hold on;
57 %
58 P3 = [0.18 0.56 0.8 0.17];
59 A3 = axes( ’position’, P3, ’color’, ’w’ );
60 plot( x, sols(:,18), ’k’);
61 grid on;
62 ylabel(’y(x)_{17}’);
63 hold on;
64 %

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

Figure 1: The eigenfunctions corresponding to the 4 known eigenvalues.

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.

8 Write the Figures to Disk


87 fileType = ’eps’;
88 printFigure( fig1, [’SLEx5EigFnsNb’,int2str(noBfs)], fileType);
89 printFigure( fig2, [’SLEx5SpectrumNb’,int2str(noBfs)], fileType);

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy