4.1. Project on ODE Eigenvalues (template)#

Brenton LeMesurier, lemesurierb@charleston.edu

Version of November 13, 2025

A very slight revision of the original version of November 12: revision dates and notes can be important when submitting successive drafts, so I illustrate that habit here.

4.1.1. Background#

A description of the matrix eigenvalue problems to be solved related to ODE eigenvalue problems like

\[ -\frac{d^2y}{dx^2} + q(x)y = \lambda y, \qquad y(0)=0, \quad y(L) = 0 \]

See below for a question on the more general case.

4.1.2. Numerically solving the above eigenvalue problem#

In particular for the lowest eigenvalue.

4.1.3. Creating the matrix \(A\)#

4.1.4. Code for the inverse power method#

4.1.5. Solving with \(q \equiv 0\) by the inverse power method#

Assess convergence with a geometric sequence of sizes like \(n=5, 10, 20, 40 \dots\), comparing to the known smallest eigenvalue and its eigenvector.

Since the exact eigenvalue is known, one can check if the errors are proportional to \(h^2\), as hoped.

Hint: For graphical comparison of the computed eigenvector to the eigenfunction of the ODE, the values need to be “standardized”. One option is to find the entry of largest magnitude in each vector and divide by that, so that the largest value becomes 1. (The function numpy.argmax can help.)

4.1.6. Code for Rayleigh iteration#

As some of you have already seen, Rayleigh iteration needs a good initial approximation of the eigenvalue. Thus I suggest that the input to your function for this (maybe called rayleigh_iteration) should include an initial approximation of the eigenvalue.

Added November 13: This could be got with your inverse power method code.

4.1.7. Solving with \(q \equiv 0\), with Rayleigh iteration#

4.1.8. Solving with \(q = 2 + \sin x\) by the inverse power method#

4.1.9. Solving with \(q = 2 + \sin x\) by Rayleigh iteration#

4.1.10. The matrix for a more general equation#

Derive the matrix for the more general case

\[ -\frac{d^2y}{dx^2} + p(x) y + q(x)y = \lambda y, \qquad y(0)=0, \quad y(L) = 0 \]

Comment on symmetry and why that could make this problem harder!

4.1.11. MATH 545/bonus topic#

Find the second smallest eigenvalue and its eigenvector, for both cases; again the exact solution for the ODE problem is known for \(q \equiv 0\).

Again graph the approximate eigenvectors, and for \(q \equiv 0\), include a comparison with the corresponding eigenfunction of the ODE problem.

4.1.12. Observations and Conclusions#