Numerical eigenmodes from realistic operators on any interval. Built for students, engineers, and researchers alike. Tune functions, run, and visualize modes with confidence now.
This solver targets the Sturm–Liouville eigenproblem on [a,b]:
A uniform grid is created with step h. For interior node x_i the centered finite-difference form is:
To keep the eigen-solve symmetric, the generalized problem is transformed using D = diag(\sqrt{w}), solving D^{-1} A D^{-1} v = \lambda v, then recovering y = D^{-1} v.
If you see convergence warnings, try smaller N or a slightly looser tolerance. For sharper features in coefficients, increase N gradually.
| Case | Interval | p(x) | q(x) | w(x) | BC | Expected |
|---|---|---|---|---|---|---|
| String | [0, π] | 1 | 0 | 1 | y(0)=y(π)=0 | λ_n \approx n^2 |
| Neumann string | [0, π] | 1 | 0 | 1 | y'(0)=y'(π)=0 | λ_0\approx0 |
| Potential bump | [0, 1] | 1 | 50x(1-x) | 1 | y(0)=y(1)=0 | Spectrum shifted upward |
Boundary types are implemented using first-order endpoint relations so the interior operator remains symmetric:
For stiff Robin settings where 1-αh or 1+βh is near zero, the discretization becomes unstable; adjust α/β or N.
Sturm–Liouville models arise when a spatial field separates from time, converting a differential equation into an eigenvalue problem. Vibrating strings, heat conduction, diffusion in media, and quantum wells fit the form \(-\frac{d}{dx}(p y')+qy=\lambda w y\). Eigenvalues quantify mode spacing and stability.
The solver assumes a self-adjoint operator on \([a,b]\) with boundary conditions that make the boundary term vanish under integration by parts. This structure guarantees real eigenvalues and orthogonal eigenfunctions under the weighted inner product \(\langle y_m,y_n\rangle=\int_a^b w(x)y_m y_n\,dx\). Numerically, symmetry improves stability and reduces spurious complex modes.
In many applications, \(p(x)\) behaves like stiffness or diffusivity, \(q(x)\) acts as a potential or reaction term, and \(w(x)\) is a positive weight. Keeping \(w(x)>0\) is essential because the eigenproblem uses \(B=\mathrm{diag}(w_i)\) and the weighted inner product to define orthogonality.
A uniform grid of \(N\) points with step \(h=(b-a)/(N-1)\) yields a second-order centered approximation in the interior, so smooth problems typically show \(O(h^2)\) eigenvalue convergence for low modes. As a practical check, double \(N\) and confirm the first few eigenvalues change only slightly. The calculator also reports a residual magnitude to highlight under-resolved cases.
Dirichlet conditions fix the field value, Neumann conditions fix the flux or slope, and Robin conditions blend both, often modeling convection or impedance at a boundary. For example, on \([0,\pi]\) with \(p=1\), \(q=0\), \(w=1\) and Dirichlet ends, the analytic spectrum is \(\lambda_n=n^2\). Changing to Neumann introduces a near-zero \(\lambda_0\) corresponding to a constant mode.
The solver returns the lowest modes first for reduced-order modeling. Eigenfunctions are normalized for plotting and export, but orthogonality uses \(w(x)\). Compare two modes with a weighted dot product; it should be near zero. Large cross-products suggest coarse \(N\), rough coefficients, or extreme Robin parameters.
Each mode includes a maximum residual estimate based on \(\|Ay-\lambda By\|\). Smaller values indicate a more consistent discrete eigenpair. If residuals stay large, try increasing \(N\), smoothing coefficients, or loosening the tolerance slightly. For Robin boundaries, avoid values where \(1-\alpha h\) or \(1+\beta h\) becomes nearly zero, as that amplifies endpoint error.
A common workflow is to start with a benchmark case (constant coefficients), then introduce variable \(p\), \(q\), or \(w\) and track shifts in the first few eigenvalues. Export eigenvalues to CSV for parameter sweeps, and export mode samples to compare shapes across designs. The PDF report summarizes settings, eigenvalues, and representative samples for documentation and peer review. For audits, record N, h, and the first three eigenvalues after each change to verify numerical stability quickly across runs consistently.
The discrete problem uses B = diag(w). If w becomes zero or negative, the weighted inner product breaks and the symmetric transform may fail, producing unstable or nonphysical eigenvalues.
Small \(\lambda\) typically corresponds to low-frequency or slowly varying modes. With Neumann boundaries, a nearly zero eigenvalue often represents a constant mode, such as uniform temperature or displacement.
Start with N between 51 and 91 for smooth coefficients, then increase N until the first few eigenvalues change negligibly. Sharp coefficient variations or narrow boundary layers require larger N.
Higher modes oscillate faster and demand finer resolution. If N is too small, the grid cannot represent the oscillations, so the eigenfunction develops stair-step artifacts and residuals rise.
You can, but accuracy may degrade near jumps. Increase N and interpret results cautiously. For strong discontinuities, consider smoothing the coefficient or modeling the interface with a piecewise formulation.
It approximates how well the computed vector satisfies \(Ay=\lambda By\) on the grid. Lower residuals mean a more consistent discrete eigenpair; higher residuals suggest under-resolution or instability.
The endpoint discretization involves factors like \(1-\alpha h\) and \(1+\beta h\). When these approach zero, the boundary relation becomes ill-conditioned, magnifying numerical errors and distorting modes.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.