This subroutine is designed for the calculation of eigenvalues, eigenfunctions and/or spectral density functions for Sturm-Liouville problems in the form
with boundary conditions (at regular points)
We assume that
when aʹ1≠ 0 and aʹ2≠ 0. The problem is considered regular if and only if
a and b are finite,
p(x) and r(x) are positive in (a, b),
1/p(x), q(x) and r(x) are locally integrable near the endpoints.
Otherwise the problem is called singular. The theory assumes that p, pʹ, q, and r are at least continuous on (a, b), though a finite number of jump discontinuities can be handled by suitably defining an input mesh.
For regular problems, there are an infinite number of eigenvalues
λ0 < λ1 < … < λk, k→∞
Each eigenvalue has an associated eigenfunction which is unique up to a constant. For singular problems, there is a wide range in the behavior of the eigenvalues.
As presented in Pruess and Fulton (1993) the approach is to replace (1) by a new problem
with analogous boundary conditions
where
are step function approximations to p, q, and r, respectively. Given the mesh a = x1 < x2 < … < xN+1 = b, the usual choice for the step functions uses midpoint interpolation, i. e.,
for x in (xn, xn+1) and similarly for the other coefficient functions. This choice works well for regular problems. Some singular problems require a more sophisticated technique to capture the asymptotic behavior. For the midpoint interpolants, the differential equation (2) has the known closed form solution in (xn, xn+1)
with
where
and
Starting with,
consistent with the boundary condition,
an algorithm is to compute for n = 1, 2, …, N,
which is a shooting method. For a fixed mesh we can iterate on the approximate eigenvalue until the boundary condition at b is satisfied. This will yield an O(h2) approximation
to some λk.
The problem (2) has a step spectral function given by
where the sum is taken over k such that
and
Comments
1. Workspace may be explicitly provided, if desired, by use of S2EIG/DS2EIG. The reference is:
JOB(1) = .true. if a set of eigenvalues are to be computed but not their eigenfunctions.
JOB(2) = .true. if a set of eigenvalue and eigenfunction pairs are to be computed.
JOB(3) = .true. if the spectral function is to be computed over some subinterval of the essential spectrum.
JOB(4) = .true. if the normal automatic classification is overridden. If JOB(4) = .true. then TYPE(*,*) must be entered correctly. Most users will not want to override the classification process, but it might be appropriate for users experimenting with problems for which the coefficient functions do not have power-like behavior near the singular endpoints. The classification is considered sufficiently important for spectral density function calculations that JOB(4) is ignored with JOB(3) = .true..
JOB(5) = .true. if mesh distribution is chosen by SLEIG. If JOB(5) = .true. and NUMX is zero, the number of mesh points are also chosen by SLEIG. If NUMX > 0 then NUMX mesh points will be used. If JOB(5) = .false., the number NUMX and distribution XEF(*) must be input by the user.
IPRINT — Control levels of internal printing. (Input) No printing is performed if IPRINT = 0. If either JOB(1) or JOB(2) is true:
IPRINT
Printed Output
1
Initial mesh (the first 51 or fewer points), eigenvalue estimate at each level.
4
The above and at each level matching point for eigenfunction shooting, X(*), EF(*) and PDEF(*) values.
5
The above and at each level the brackets for the eigenvalue search, intermediate shooting information for the eigenfunction and eigenfunction norm.
IfJOB(3) = .true.
IPRINT
Printed Output
1
The actual (a, b) used at each iteration and the total number of eigenvalues computed.
2
The above and switchover points to the asymptotic formulas, and some intermediate (t) approximations.
3
The above and initial meshes for each iteration, the index of the largest eigenvalue which may be computed, and various eigenvalue and RN values.
4
The above and values at each level.
5
The above and RN add eigenvalues below the switchover point
IfJOB(4) = .false.
IPRINT
Printed Output
2
Output a description of the spectrum.
3
The above and the constants for the Friedrichs' boundary condition(s).
5
The above and and intermediate details of the classification calculation.
TOLS — Array of length 4 containing tolerances. (Input)
TOLS(1) — absolute error tolerance for eigenfunctions
TOLS(2) — relative error tolerance for eigenfunctions
TOLS(3) — absolute error tolerance for eigenfunction derivatives
TOLS(4) — relative error tolerance for eigenfunction derivatives
The absolute tolerances must be positive.The relative tolerances must be at least 100 * amach(4)
NUMX — Integer whose value is the number of output points where each eigenfunction is to be evaluated (the number of entries in XEF(*)) when JOB(2) = .true.. If JOB(5)= .false. and NUMX is greater than zero, then NUMX is the number of points in the initial mesh used. If JOB(5) = .false., the points in XEF(*) should be chosen with a reasonable distribution. Since the endpoints a and b must be part of any mesh, NUMX cannot be one in this case. If JOB(5) = .false. and JOB(3) = .true., then NUMX must be positive. On output, NUMX is set to the number of points for eigenfunctions when input NUMX = 0, and JOB(2) or JOB(5) = .true.. (Input/Output)
XEF — Array of points on input where eigenfunction estimates are desired, if JOB(2) = .true.. Otherwise, if JOB(5) = .false. and NUMX is greater than zero, the user’s initial mesh is entered. The entries must be ordered so that a = XEF(1) < XEF(2) < < XEF(NUMX) = b. If either endpoint is infinite, the corresponding XEF(1) or XEF(NUMX) is ignored. However, it is required that XEF(2) be negative when ENDFIN(1) = .false., and that XEF(NUMX‑1) be positive when ENDFIN(2) = .false.. On output, XEF(*) is changed only if JOB(2) and JOB(5) are true. If JOB(2) = .false., this vector is not referenced. If JOB(2) = .true. and NUMX is greater than zero on input, XEF(*) should be dimensioned at least NUMX + 16. If JOB(2) is true and NUMX is zero on input, XEF(*) should be dimensioned at least 31.
NRHO — The number of output values desired for the array RHO(*). NRHO is not used if JOB(3) = .false.. (Input)
T — Real vector of size NRHO containing values where the spectral function RHO(*) is desired. The entries must be sorted in increasing order. The existence and location of a continuous spectrum can be determined by calling SLEIG with the first four entries of JOB set to false and IPRINT set to 1. T(*) is not used if JOB(3) = .false.. (Input)
TYPE — 4 by 2 logical matrix. Column 1 contains information about endpoint a and column 2 refers to endpoint b. TYPE(1,*) = .true. if and only if the endpoint is regular TYPE(2,*) = .true. if and only if the endpoint is limit circle TYPE(3,*) = .true. if and only if the endpoint is nonoscillatory for all eigenvalues TYPE(4,*) = .true. if and only if the endpoint is oscillatory for all eigenvalues Note: all of these values must be correctly input if JOB(4) = .true.. Otherwise, TYPE(*,*) is output. (Input/Output)
EF — Array of eigenfunction values. EF((k‑1)*NUMX + i) is the estimate of u(XEF(i)) corresponding to the eigenvalue in EV(k). If JOB(2) = .false. then this vector is not referenced. If JOB(2) = .true. and NUMX is greater than zero on entry, then EF(*) should be dimensioned at least NUMX*NUMEIG. If JOB(2) = .true. and NUMX is zero on input, then EF(*) should be dimensioned 31 *NUMEIG. (Output)
PDEF — Array of eigenfunction derivative values. PDEF((k‑1)*NUMX + i) is the estimate of (puʹ) (XEF(i)) corresponding to the eigenvalue in EV(k). If JOB(2) = .false. this vector is not referenced. If JOB(2) = .true., it must be dimensioned the same as EF(*). (Output)
RHO — Array of size NRHO containing values for the spectral density function ρ(t), RHO(I) = ρ(T(I)). This vector is not referenced if JOB(3) is false. (Output)
IFLAG — Array of size max(1, numeig) containing information about the output. IFLAG(K) refers to the K-th eigenvalue, when JOB(1) or JOB(2) = .true.. Otherwise, only IFLAG(1) is used. Negative values are associated with fatal errors, and the calculations are ceased. Positive values indicate a warning. (Output) These are the possible values for IFLAG(K)
IFLAG(K)
Description
-1
Too many levels needed for the eigenvalue calculation; problem seems too difficult at this tolerance. Are the coefficient functions nonsmooth?
-2
Too many levels needed for the eigenfunction calculation; problem seems too difficult at this tolerance. Are the eigenfunctions ill-conditioned?
-3
Too many levels needed for the spectral density calculation; problem seems too difficult at this tolerance.
-4
The user has requested the spectral density function for a problem which has no continuous spectrum.
-5
The user has requested the spectral density function for a problem with both endpoints generating essential spectrum, i.e. both endpoints either OSC or O-NO.
-6
The user has requested the spectral density function for a problem in spectral category 2 for which a proper normalization of the solution at the NONOSC endpoint is not known; for example, problems with an irregular singular point or infinite endpoint at one end and continuous spectrum generated at the other.
-7
Problems were encountered in obtaining a bracket.
-8
Too small a step was used in the integration. The TOLS(*) values may be too small for this problem.
-9
Too small a step was used in the spectral density function calculation for which the continuous spectrum is generated by a finite endpoint.
-10
An argument to the circular trig functions is too large. Try running the problem again with a finer initial mesh or, for singular problems, use interval truncation.
-15
p(x) and r(x) are not positive in the interval (a, b).
-20
Eigenvalues and/or eigenfunctions were requested for a problem with an OSC singular endpoint. Interval truncation must be used on such problems.
1
Failure in the bracketing procedure probably due to a cluster of eigenvalues which the code cannot separate. Calculations have continued but any eigenfunction results are suspect. Try running the problem again with tighter input tolerances to separate the cluster.
2
There is uncertainty in the classification for this problem. Because of the limitations of floating point arithmetic, and the nature of the finite sampling, the routine cannot be certain about the classification information at the requested tolerance.
3
There may be some eigenvalues embedded in the essential spectrum. Use of IPRINT greater than zero will provide additional output giving the location of the approximating eigenvalues for the step function problem. These could be extrapolated to estimate the actual eigenvalue embedded in the essential spectrum.
4
A change of variables was made to avoid potentially slow convergence. However, the global error estimates may not be as reliable. Some experimentation using different tolerances is recommended.
6
There were problems with eigenfunction convergence in a spectral density calculation. The output ρ(t) may not be accurate.
WORK — Array of size MAX(1000, NUMEIG + 22) used for workspace.
IWORK — Integer array of size NUMEIG + 3 used for workspace.
Examples
Example 1
This example computes the first ten eigenvalues of the problem from Titchmarsh (1962) given by
p(x) = r(x) = 1
q(x) = x
[a, b] = [0, ∞]
u(a) = u(b) = 0
The eigenvalues are known to be the zeros of
For each eigenvalue λk, the program prints k, λk and f(λk).
In this problem from Scott, Shampine and Wing (1969),
p(x) = r(x) = 1
q(x) = x2 + x4
[a, b] = [-∞,∞]
u(a) = u(b) = 0
the first eigenvalue and associated eigenfunction, evaluated at selected points, are computed. As a rough check of the correctness of the results, the magnitude of the residual
is printed. We compute a spline interpolant to uʹ and use the function CSDER to estimate the quantity ‑(p(x)uʹ)ʹ.
USE S2EIG_INT
USE CSDER_INT
USE UMACH_INT
USE CSAKM_INT
IMPLICIT NONE
! SPECIFICATIONS FOR LOCAL VARIABLES
INTEGER I, IFLAG(1), INDEX(1), IWORK(100), NINTV, NOUT, NRHO, &
NUMEIG, NUMX
REAL BRKUP(61), CONS(8), CSCFUP(4,61), EF(61), EVAL(1), &