# Accurate Spectral Collocation Solutions to 2nd-Order Sturm–Liouville Problems

## Abstract

**:**

## 1. Introduction

## 2. 2nd-Order Sturm–Liouville Eigenproblems

## 3. Chebfun vs. Conventional Spectral Collocation

#### 3.1. Chebfun

#### 3.2. Spectral Collocation Methods

#### 3.3. The Drift of Eigenvalues

**Boyd’s Eigenvalues Rule-of-Thumb**in which he notices that in solving such a problem with a spectral method using $(N+1)$ terms in the truncated spectral series, the lowest $N/2$ eigenvalues are usually accurate to within a few percent, while the larger $N/2$ numerical eigenvalues differ from those of the differential equation by such large amounts as to be useless.

#### 3.4. Preconditioning

## 4. Numerical Experiments

#### 4.1. Hinged Ends or Simply Supported Boundary Conditions

#### 4.1.1. The Viola’s Eigenproblem-Revisited

`splitting`have been necessary when Chebfun has been used.

#### 4.1.2. The Bénard Stability Problem

N=256; % order of approximation nu=-(1+4*(pi^2))-sqrt(1+4*(pi^2)); % parameter \nu [x,D]=chebdif(N,2); D2=D(2:N-1,2:N-1,2); % differentiation matrices I=eye(size(D2)); Z=zeros(size(D2)); A=[ 4*D2 -I Z; Z 4*D2 -I; -(nu^2+2*nu+2)*I (nu^2+4*nu+3)*I 4*D2-(2*nu+3)*I]; B=[Z Z Z; Z Z Z; I Z Z]; % block matrices in pencil k = 8; % number of computed eigs E=eigs( @(x)(A\(B*x)), size(A,1),k, ’SM’) % Arnoldi method

`eigs(${A}^{-1}B$)`and with the above code obtained the eigenvalue reported in Table 1. It is very clear that for the values of $\nu $ considered, the block matrix $\mathbf{A}$ is non singular and the block matrix $\mathbf{B}$ is singular and independent of $\nu .$

#### 4.1.3. A Self-Adjoint Eighth-Order Problem

#### 4.2. Clamped Boundary Conditions

#### 4.2.1. A Fourth Order Problem with a Third Derivative Term

#### 4.2.2. A Fourth Order Eigenproblem from Spherical Geometry

#### 4.2.3. A Set of Sixth Order Eigenproblems

#### 4.3. Problems with Mixed Boundary Conditions

#### 4.3.1. The Free Lateral Vibration of a Uniform Clamped–Hinged Beam

#### 4.3.2. A Fourth Order Eigenproblem with Higher Order Boundary Conditions

% Cantilevered beam in Euler-Bernouilli theory dom=[0,pi];x=chebfun(’x’,dom); % the domain L = chebop(dom); L.op = @(x,y) diff(y,4); % the operator L.lbc = @(y)[y; diff(y,1)]; % fixed b. c. L.rbc = @(y)[diff(y,2); diff(y,3)];% free b. c. [U,D]=eigs(L,40,’SM’); % first six eigs. % Sorted eigenpairs (eigenvalues and eigenvectors) D=diag(D); [t,o]=sort(D); D=D(o); disp((D.^(1/4))) U=U(:,o);

#### 4.3.3. The Harmonic Oscillator and Its Second and Third Powers

% The sinc differentiation matrices [Weideman & Reddy] N=400;M=6;h=0.1; %Orders of approximation and differentiation and scaling factor [x, D] = sincdif(N, M, h); D1=D(:,:,1);D2=D(:,:,2);D6=D(:,:,6); % The cube of the "harmonic oscillator" operator L=-D6+D2*(3*diag(x.^2)*D2)+D1*(diag(8-3*(x.^4))*D1)+diag(x.^6-14*(x.^2)); % Finding eigenpairs of L [U,S]=eigs(L,250,0); S=diag(S); [t,o]=sort(S); S=S(o);

## 5. Conclusions and Open Problems

## Funding

## Acknowledgments

## Conflicts of Interest

## Abbreviations

ChC | Chebyshev collocation method |

ChT | Chebyshev tau method |

${D}^{2}$ | strategy to reduce a 2nd-order equation to a second order system |

FCT | fast Chebyshev transform |

FD | finite difference method |

FE | finite element method |

MATSLISE | a MATLAB package for the numerical solution of SL and Schröedinger equations |

SiC | sinc spectral collocation |

SL | Sturm–Liouville |

SLEDGE | Sturm–Liouville estimates determined by global errors |

SLEUTH | Sturm–Liouville Eigenvalues using Theta Matrices |

## References

- Straughan, B. Stability of Wave Motion in Porous Media; Springer Science+Business Media: New York, NY, USA, 2008. [Google Scholar]
- Trefethen, L.N.; Birkisson, A.; Driscoll, T.A. Exploring ODEs; SIAM: Philadelphia, PA, USA, 2018. [Google Scholar]
- Pruess, S.; Fulton, C.T. Mathematical Software for Sturm-Liouville Problem. ACM Trans. Math. Softw.
**1993**, 19, 360–376. [Google Scholar] [CrossRef] - Pruess, S.; Fulton, C.T.; Xie, Y. An Asymptotic Numerical Method for a Class of Singular Sturm-Liouville Problems. ACM SIAM J. Numer. Anal.
**1995**, 32, 1658–1676. [Google Scholar] [CrossRef] - Marletta, M.; Pryce, J.D. LCNO Sturm-Liouville problems. Computational difficulties and examples. Numer. Math.
**1995**, 69, 303–320. [Google Scholar] [CrossRef] - Pryce, J.D.; Marletta, M. A new multi-purpose software package for Schrödinger and Sturm–Liouville computations. Comput. Phys. Comm.
**1991**, 62, 42–54. [Google Scholar] [CrossRef] - Bailey, P.B.; Everitt, W.N.; Zettl, A. Computing Eigenvalues of Singular Sturm-Liouville Problems. Results Math.
**1991**, 20, 391–423. [Google Scholar] [CrossRef] [Green Version] - Bailey, P.B.; Garbow, B.; Kaper, H.; Zettl, A. Algorithm 700: A FORTRAN software package for Sturm-Liouville problems. ACM Trans. Math. Softw.
**1991**, 17, 500–501. [Google Scholar] [CrossRef] - Ledoux, V.; Van Daele, M.; Vanden Berghe, G. MATSLISE: A MATLAB Package for the Numerical Solution of Sturm-Liouville and Schrödinger Equations. ACM Trans. Math. Softw.
**2005**, 31, 532–554. [Google Scholar] [CrossRef] - Baeyens, T.; Van Daele, M. The Fast and Accurate Computation of Eigenvalues and Eigenfunctions of Time-Independent One-Dimensional Schrödinger Equations. Comput. Phys. Commun.
**2021**, 258, 107568. [Google Scholar] [CrossRef] - Abbasb, Y.S.; Shirzadi, A. A new application of the homotopy analysis method: Solving the Sturm—Liouville problems. Commun. Nonlinear. Sci. Numer. Simulat.
**2011**, 16, 112–126. [Google Scholar] [CrossRef] - Perera, U.; Böckmann, C. Solutions of Direct and Inverse Even-Order Sturm-Liouville Problems Using Magnus Expansion. Mathematics
**2019**, 7, 544. [Google Scholar] [CrossRef] [Green Version] - Gheorghiu, C.I. Spectral Methods for Non-Standard Eigenvalue Problems: Fluid and Structural Mechanics and Beyond; Springer: Heidelberg, Germany, 2014. [Google Scholar]
- Greenberg, G.; Marletta, M. Oscillation Theory and Numerical Solution of Sixth Order Sturm-Liouville Problems. SIAM J. Numer. Anal.
**1998**, 35, 2070–2098. [Google Scholar] [CrossRef] [Green Version] - Everitt, W.N. A Catalogue of Sturm-Liouville Differential Equations. In Sturm-Liouville theory: Past and Present; Amrein, W.O., Hinz, A.M., Hinz, D.B., Eds.; Birkhäuser Verlag: Basel, Switzerland, 2005; pp. 271–331. [Google Scholar]
- Driscoll, T.A.; Bornemann, F.; Trefethen, L.N. The CHEBOP System for Automatic Solution of Differential Equations. BIT
**2008**, 48, 701–723. [Google Scholar] [CrossRef] - Driscoll, T.A.; Hale, N.; Trefethen, L.N. Chebfun Guide; Pafnuty Publications: Oxford, UK, 2014. [Google Scholar]
- Driscoll, T.A.; Hale, N.; Trefethen, L.N. Chebfun-Numerical Computing with Functions. Available online: http://www.chebfun.org (accessed on 15 November 2019).
- Gheorghiu, C.I. Spectral Collocation Solutions to Problems on Unbounded Domains; Casa Cărţii de Ştiinţă Publishing House: Cluj-Napoca, Romania, 2018. [Google Scholar]
- Weideman, J.A.C.; Reddy, S.C. A MATLAB Differentiation Matrix Suite. ACM Trans. Math. Softw.
**2000**, 26, 465–519. [Google Scholar] [CrossRef] [Green Version] - Gheorghiu, C.I.; Pop, I.S. A Modified Chebyshev-Tau Method for a Hydrodynamic Stability Problem. In Proceedings of the International Conference on Approximation and Optimization; Stancu, D.D., Coman, G., Breckner, W.W., Blaga, P., Eds.; Transilvania Press: Cluj-Napoca, Romania, 1996; Volume II, pp. 119–126. [Google Scholar]
- Boyd, J.P. Traps and Snares in Eigenvalue Calculations with Application to Pseudospectral Computations of Ocean Tides in a Basin Bounded by Meridians. J. Comput. Phys.
**1996**, 126, 11–20. [Google Scholar] [CrossRef] - Gheorghiu, C.I. Accurate Spectral Collocation Computation of High Order Eigenvalues for Singular Schrödinger Equations. Computation
**2021**, 9, 2. [Google Scholar] [CrossRef] - Boyd, J.P. Chebyshev and Fourier Spectral Methods; Dover Publications: New York, NY, USA, 2000; pp. 127–158. [Google Scholar]
- Huang, W.; Sloan, D.M. The Pseudospectral Method for Solving Differential Eigenvalue Problems. J. Comput. Phys.
**1994**, 111, 399–409. [Google Scholar] [CrossRef] - Straughan, B. The Energy Method, Stability, and Nonlinear Convection; Springer: New York, NY, USA, 1992; pp. 218–222. [Google Scholar]
- Lesnic, D.; Attili, S. An Efficient Method for Sixth-order Sturm-Liouville Problems. Int. J. Sci. Technol.
**2007**, 2, 109–114. [Google Scholar] - Gheorghiu, C.I.; Rommes, J. Application of the Jacobi-Davidson method to accurate analysis of singular linear hydrodynamic stability problems. Int. J. Numer. Meth. Fluids
**2013**, 71, 358–369. [Google Scholar] [CrossRef] - Gardner, D.R.; Trogdon, S.A.; Douglass, R.W. A Modified Spectral Tau Method That Eliminates Spurious Eigenvalues. J. Comput. Phys.
**1989**, 80, 137–167. [Google Scholar] [CrossRef] - Fornberg, B. A Practical Guide to Pseudospectral Methods; Cambridge University Press: Cambridge, UK, 1998; pp. 89–90. [Google Scholar]
- McFadden, G.B.; Murray, B.T.; Boisvert, R.F. Elimination of Spurious Eigenvalues in the Chebyshev Tau Spectral Method. J. Comput. Phys.
**1990**, 91, 228–239. [Google Scholar] [CrossRef] - Mai-Duy, N. An effective spectral collocation method for the direct solution of high-order ODEs. Commun. Numer. Methods Eng.
**2006**, 22, 627–642. [Google Scholar] [CrossRef] [Green Version] - Zhao, S.; Wei, G.W.; Xiang, Y. DSC analysis of free-edged beams by an iteratively matched boundary method. J. Sound. Vib.
**2005**, 284, 487–493. [Google Scholar] [CrossRef]

**Figure 1.**The dependence of the lowest eigenvalue of the Viola’s eigenproblem (4), computed by Chebfun, on the parameter $\theta .$

**Figure 2.**From upper left to lower right we display the first four eigenvectors of the Viola’s eigenproblem (4) computed by Chebfun with $\theta =0.98765.$

**Figure 3.**The Chebyshev coefficients of the first four eigenvectors of the Viola’s eigenproblem (4) computed by Chebfun with $\theta =0.98765.$ A very narrow rounding-off plateau can be seen.

**Figure 4.**The relative drift of the first forty eigenvalues of Bénard problem is displayed when $\nu :=-(1+{\pi}^{2})-{(1+{\pi}^{2})}^{-1/2}$-red dotted line when ${N}_{1}:=256$ and ${N}_{2}:=128$ and green circled line when ${N}_{1}:=64$ and ${N}_{2}:=128.$

**Figure 5.**From upper left to lower right we display the first four eigenvectors of problem (8) computed by ChC along with ${D}^{2}$ method when the order of approximation has been $N:=256$.

**Figure 6.**(

**a**) The Chebyshev coefficients of the first four vectors of the problem (8) computed by FCT (fast Chebyshev transform). (

**b**) The relative drift of the first twelve eigenvalues to problem (8), red dotted line ${N}_{1}:=96$, ${N}_{2}:=200$, green stared line ${N}_{1}:=128$, ${N}_{2}:=200$, and magenta circled line ${N}_{1}:=200$, ${N}_{2}:=\mathrm{exact}.$

**Figure 8.**The first four eigenvectors of problem (13) with $j:=4,$ computed by Chebfun, are reported in the the upper panels and their Chebyshev coefficients are displayed in the lower panel.

**Figure 9.**From upper left to lower right we display the first four eigenvectors to problem (14) computed by Chebfun.

**Figure 10.**In a log-linear plot we display the Chebyshev coefficients of the first four eigenvectors to problem (14) computed by Chebfun.

**Figure 12.**In a log-linear plot we display the scalar products ${u}_{1}^{\prime}\ast {u}_{j}$—red dotted line, ${u}_{3}^{\prime}\ast {u}_{j}$—blue dotted line, ${u}_{5}^{\prime}\ast {u}_{j}$—green dotted line and ${u}_{10}^{\prime}\ast {u}_{j}$—magenta dotted line, $j:=1,2,\dots ,50$ when the eigenproblem (16) and (17) is solved by Chebfun.

**Figure 13.**A zoom in on the first four eigenvectors of the cube of harmonic oscillator (20) computed by SiC is displayed in the upper panels and the sinc coefficients of eigenvectors are reported in the lower panel.

**Figure 14.**(

**a**)The relative drift of the first 250 eigenvalues of the cube of harmonic oscillator computed by SiC. Red stared line compares the exact values with the eigenvalues computed with $N:=400$ and the circled green line compares the latter eigenvalues with those computed when in SiC $N:=500.$ In both cases, the scaling factor h equals $0.1$. (

**b**) The orthonormality of the first 250 eigenvectors, i.e., the scalar products, ${u}_{1}^{\prime}\ast {u}_{j}$ red dotted line, ${u}_{10}^{\prime}\ast {u}_{j}$ blue dotted line, ${u}_{50}^{\prime}\ast {u}_{j}$ green dotted line and ${u}_{100}^{\prime}\ast {u}_{j}$ magenta dotted line, $j:=1,2,\dots ,250$.

**Figure 15.**(

**a**) We display the Chebyshev coefficients of the first four eigenvectors of eigenproblem (19); red dotted line-first vector, green stared line-second, blue circles-third and magenta diamonds-fourth vector. (

**b**) In a log-linear plot we display the scalar products ${u}_{1}^{\prime}\ast {u}_{j}$—red dotted line, ${u}_{3}^{\prime}\ast {u}_{j}$—blue dotted line, ${u}_{5}^{\prime}\ast {u}_{j}$—green dotted line and ${u}_{10}^{\prime}\ast {u}_{j}$—magenta dotted line, $j:=1,2,\dots ,200$ when the eigenproblem (19) is solved by Chebfun.

**Figure 16.**The relative drift (errors) with respect to X of the first 250 eigenvalues of second order harmonic oscillator operator ${h}^{2}$.

**Table 1.**The first two eigenvalues of Bénard problem (5) for various $\nu $ computed by ${D}^{2}$ strategy along with ChC.

$\mathit{\nu}$ | ${\mathit{\lambda}}_{0}\left(\mathit{\nu}\right)$ | ${\mathit{\lambda}}_{1}\left(\mathit{\nu}\right)$ | ${\mathit{\lambda}}_{0}\left(\mathit{\nu}\right)$ according to [14] |
---|---|---|---|

$-(1+{\pi}^{2})$ | $-1.000000000102923e+00$ | $-3.548769279033568e+04$ | $-1.000005$ |

$-(1+4{\pi}^{2})$ | $-1.000000009534114e+00$ | $-9.530184561696226e+03$ | $-1.0001$ |

$-(1+{\pi}^{2})-{(1+{\pi}^{2})}^{-1/2}$ | $-1.191482998363510e+02$ | $-2.802486989002433e+04$ | $-1\times {10}^{-7}$ |

$-(1+4{\pi}^{2})-{(1+4{\pi}^{2})}^{-1/2}$ | $-1.639502291744172e+03$ | $-1.406538196754713e+04$ | $-3\times {10}^{-5}$ |

i | ${\mathit{\lambda}}_{\mathit{i}}$ Chebfun | ${\mathit{\lambda}}_{\mathit{i}}$ Preconditioned Chebfun | ${\mathit{\lambda}}_{\mathit{i}}$ Solution to (11) |
---|---|---|---|

1 | $-\mathbf{9.8}70154876048822e+00$ | $-\mathbf{9.869604}528925013e+00$ | $-9.8696044$ |

2 | $-\mathbf{2.019}216607051227e+01$ | $-\mathbf{2.0190728}37497370e+01$ | $-20.1907286$ |

**Table 3.**The first five eigenvalues to problem (14) computed by Chebfun and compared with those provided by Magnus expansion.

j | ${\mathit{\lambda}}_{\mathit{j}}$ Chebfun | ${\mathit{\lambda}}_{\mathit{j}}$ According to [12] |
---|---|---|

1 | $\mathbf{2.377}373239875730e+02$ | $\mathbf{2.377}210675300e+02$ |

2 | $\mathbf{2.496}524908617440e+03$ | $\mathbf{2.496}487437860e+03$ |

3 | $\mathbf{1.0867}83642364734e+04$ | $\mathbf{1.0867}58221697e+04$ |

4 | $\mathbf{3.17}7977410414838e+04$ | $\mathbf{3.17}8009645380e+04$ |

5 | $\mathbf{7.400}167551416633e+04$ | $\mathbf{7.400}084934040e+04$ |

j | ${\mathit{\beta}}_{\mathit{j}}$ by Chebfun | ${\mathit{\beta}}_{\mathit{j}}$ Exact Solutions of (18) |
---|---|---|

1 | $\mathbf{5.96}7718563107258e-01$ | $\mathbf{0.596}86$ |

2 | $\mathbf{1.4941}63617547652e+00$ | $\mathbf{1.4941}8$ |

3 | $\mathbf{2.5002}44462376521e+00$ | $\mathbf{2.5002}5$ |

4 | $\mathbf{3.49999}0154542449e+00$ | $\mathbf{3.49999}$ |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Gheorghiu, C.-I.
Accurate Spectral Collocation Solutions to 2nd-Order Sturm–Liouville Problems. *Symmetry* **2021**, *13*, 385.
https://doi.org/10.3390/sym13030385

**AMA Style**

Gheorghiu C-I.
Accurate Spectral Collocation Solutions to 2nd-Order Sturm–Liouville Problems. *Symmetry*. 2021; 13(3):385.
https://doi.org/10.3390/sym13030385

**Chicago/Turabian Style**

Gheorghiu, Călin-Ioan.
2021. "Accurate Spectral Collocation Solutions to 2nd-Order Sturm–Liouville Problems" *Symmetry* 13, no. 3: 385.
https://doi.org/10.3390/sym13030385