Questions tagged [eigenvalues]

Questions on symbolically or numerically determining the eigenvalues of matrices (Eigenvalues, Eigensystem) or differential equations (DEigenvalues, DEigensystem, NDEigenvalues, NDEigensystem) in Mathematica. Also includes determining the eigenvalues of differential equations with DSolve or NDSolve.

Filter by
Sorted by
Tagged with
45 votes
4 answers
2k views

Eigenvalues broken in Version 12.0

Bug introduced in 12.0 and fixed in 12.1 The following code calculates the eigenvalues of a certain complex matrix, which come in pairs of opposite complex numbers. Therefore one can check whether ...
xiaohuamao's user avatar
  • 4,708
41 votes
1 answer
2k views

Complex eigenvalues from a sparse Hermitian matrix

Bug introduced in 9.0 or earlier and persisting through 13.3.0. I notice in the following example that wrong complex eigenvalues are resulted if calculating from a Hermitian sparse matrix, which ...
xiaohuamao's user avatar
  • 4,708
29 votes
2 answers
1k views

Wrong eigenvalues from a sparse matrix

Bug introduced after 5.0, in or before 8.0 and persisting through 13.3. I notice in the following example that wrong smallest 2 eigenvalues are resulted if calculating from a sparse matrix. But it ...
xiaohuamao's user avatar
  • 4,708
23 votes
8 answers
2k views

Tracking Eigenvalues Through a Crossing

Suppose I have a matrix which depends on some parameter. I want to compute the eigenvalues as a function of this parameter, and then plot them. For example, I may have a matrix representing the ...
Jack S's user avatar
  • 333
22 votes
8 answers
2k views

How to check if a vector is an eigenvector of a matrix using mathematica?

Here is a vector $$\begin{pmatrix}i\\7i\\-2\end{pmatrix}$$ Here is a matrix $$\begin{pmatrix}2& i&0\\-i&1&1\\0 &1&0\end{pmatrix}$$ Is there a simple way to determine ...
conor's user avatar
  • 7,389
22 votes
1 answer
1k views

Eigenvalues broken in 11.2?

Bug introduced in 11.1.0 and fixed in 11.3.0 The code ...
Matthias's user avatar
  • 223
19 votes
2 answers
701 views

Library for FEAST method is missing

Mathematica (V 12.3.1, Native Mac M1 version) is not letting me use the FEAST method for solving eigenvalue problems. For example, ...
user99x's user avatar
  • 331
14 votes
1 answer
537 views

Specifying initial vector for finding Eigenvectors using Arnoldi method

I am trying to speedup the calculation of eigenvalues, given that I have good guesses for the eigenvectors. From what I know of Arnoldi/Lanczos, my good guesses should be helpful. Unfortunately, I am ...
Erich Mueller's user avatar
13 votes
6 answers
1k views

Solving this challenging ODE

Consider the ODE: $$w^{(4)}(x) + (L-x)w''(x) - w'(x) = 0 $$ with some of the following boundary conditions: free: $w'' = 0$, $w'''=0$, clamped: $w = 0$, $w'=0$, pivot: $w = 0$, $w''=0$. Two such ...
anderstood's user avatar
  • 14.3k
13 votes
3 answers
986 views

An ODE system easily polluted with spurious eigenvalues

I tried solving the eigenvalue problem of a 1st-order ODE system (see the code below) with NDEigenvalue. (One option I found in it seems to be ...
xiaohuamao's user avatar
  • 4,708
13 votes
3 answers
954 views

Routh-Hurwitz criterion not giving correct answer when done manually?

Consider the system: \begin{align} \frac{dS}{dt} &= \nu N -\frac{\beta S I}{N} + \xi R - \nu S\\ \frac{dE}{dt} &= \frac{\beta S I}{N}- \sigma E -\nu E \\[2ex] ...
Math's user avatar
  • 407
13 votes
0 answers
1k views

What algorithm is Mathematica using to find the smallest eigenvalue so quickly?

My question is what kind of black magic is Mathematica doing to obtain the correct answer so quickly compared to other programming languages? Details: I've written a Mathematica notebook to find the ...
Daniel Walsh's user avatar
12 votes
3 answers
2k views

How to set interface conditions for optical waveguide in NDEigensystem?

I have been working on waveguide mode analysis using FEM in Mathematica for a week, but I haven't succeeded until now. The optical fiber-like waveguide is featured with different refractive index in ...
yulinlinyu's user avatar
  • 4,805
12 votes
2 answers
1k views

Making an interactive visualization of the eigenvectors of two-dimensional matrices

I've recently stumbled upon this very nice interactive visualization of eigenvectors of two-dimensional matrices, and how powers $A^k$ act on various vectors. How can this sort of visualization be ...
glS's user avatar
  • 7,593
12 votes
3 answers
325 views

Efficient eigendecomposition of DPR1 matrices

I'm finding that the following bit is the bottleneck in my code ...
Yaroslav Bulatov's user avatar
11 votes
1 answer
6k views

Mathematica won't give eigenvectors but Wolfram Alpha will? What am I doing wrong?

If I ask Mathematica to find the eigenvectors and eigenvalues of the matrix: ...
DJBunk's user avatar
  • 683
10 votes
5 answers
783 views

NDEigenvalues vs. FindRoot for finding the eigenvalues of Airy equation?

Say I am trying to find the first 5 eigenvalues of the differential equation $f''(x)=\lambda x f(x)$, on the interval [-1,0], with boundary conditions $f(-1)=f(0)=0$. I will try to do this 3 ways, ...
guest84924657's user avatar
10 votes
1 answer
2k views

Nonlinear ODE eigenvalue problem

How does one find eigenvalues $\lambda$ of the following problem? $$ \frac{\mathrm{d}^2 u}{\mathrm{d}x^2} = \lambda \left( -u + u^2 \right),$$ $$ u(0) = u(1) = 0. $$ Can this be tackled by ...
sleepingrabbit's user avatar
10 votes
2 answers
1k views

NDEigensystem cannot solve numerically the 3D Coulomb problem, while DSolve returns the right answer

After having derived by hand the eigenvalues and eigenfunctions for the 3D and 2D hydrogen atom, I want to solve the systems numerically using Mathematica. I need to do this because my next step is to ...
Matthew Brunetti's user avatar
10 votes
1 answer
293 views

Inconsistent behaviour between Active and Inactive forms of PDEs (finite element method)

Bug introduced in 13.0 or earlier and fixed in 13.1.0 I have been using the finite element tools in Mathematica version 13.0 to solve eigenvalue problems in physics (Schrödinger equation) using ...
user404736's user avatar
9 votes
1 answer
1k views

Finding Eigenvalues for a boundary value problem

I have a 10x10 linearized BVP which I can write as $$\mathbf{y}'(x) = \mathbf{A}(\omega) \mathbf{y}(x)$$ subject to boundary conditions $$\mathbf{B} \cdot \mathbf{y} = \mathbf{0}, \quad x=0 \\ \mathbf{...
SPPearce's user avatar
  • 5,623
9 votes
1 answer
357 views

Eigendecomposition of a matrix with a variable

I have an issue with a decomposition of a matrix $B$ that is positive semidefinite and that depends on a parameter $x$. Writing $\lambda_i\geq0$ the eigenvalues and $\psi_i$ the corresponding ...
Rafifoo's user avatar
  • 103
9 votes
2 answers
2k views

How do you find the eigenvalues of a PDE (Dynamic Euler-Bernoulli beam)?

I am continuing to work on the vibration of a beam modeled by the Euler-Bernoulli equation. I have had some good answers to simulating the motion which may be found here. Now I wish to calculate the ...
Hugh's user avatar
  • 16.3k
9 votes
2 answers
1k views

Analytic solution to Orr-Sommerfeld-Squire equations for a special case

Hello everybody in Mathematica SE. Although my question is related to flow stability analysis, this should be a general application of MMA to solve a system of ODEs. Thank you for your suggestion! ...
lxy's user avatar
  • 165
9 votes
1 answer
483 views

How to solve this 2nd-order ODE with singularity?

I tried solving the eigenvalue problem of a 2nd-order ODE $$[b^2(k-2)^2y^2-2b(k-2)(1+2ky)+4k^2+b^2(k-2)3y]f(y) \\- 3b(3by-2)f'(y)\\-(3by-2)^2f''(y)=\lambda f(y)$$ with ...
xiaohuamao's user avatar
  • 4,708
9 votes
1 answer
245 views

NDEigenvalues complains not Hermitian with large dimension differential operator

The following snippet calculates eigenvalues and eigenfunctions of a null operator (just as an example): ...
atbug's user avatar
  • 685
9 votes
1 answer
676 views

Gaining precision/accuracy with NDEigenvalues

See further down for an important note Background I study (one component of) the semi-classical Pauli operator, $$ P_h=-h^2\Delta+ih(-y,x)\cdot\nabla+\frac{x^2+y^2}{4}-h. $$ For this particular ...
mickep's user avatar
  • 497
8 votes
2 answers
1k views

Lowest Magnitude Eigenvalues of Large Sparse Matrices

I am trying to find the first three lowest eigenvalues of large sparse matrices of size range $10^3 - 10^5$. The matrices depend on some parameter $x$, so I first construct the matrices and then use ...
WikawTirso's user avatar
8 votes
1 answer
1k views

Solving the Schrödinger Equation by exact diagonalization

I am solving the Schrödinger equation via finite difference, via the substitution where we are assuming $V_1 = V_N = \infty$. I solved this using Mathematica for the case that $V(x) = 0$ and get the ...
Kai's user avatar
  • 2,089
8 votes
2 answers
491 views

Solving a biharmonic eigenvalue Problem

I am interested in solving the following biharmonic eigenvalue problem. $$\begin{array}{cccc} & \Delta ^2 \Psi (x,y) = \lambda \Psi (x,y), & - \frac{\pi}{2} \le x \le \frac{\pi}{2} & -\...
Hosein Rahnama's user avatar
8 votes
1 answer
452 views

Fast method to calculating signature of a matrix

For calculation of the topological properties of a hamiltonian, sometimes we need the signature of that matrix. This means we only need number of positive eigenvalues. One simple way is to first ...
Rasoul-Ghadimi's user avatar
8 votes
2 answers
2k views

Calculating smallest eigenvalues by real part using Arnoldi method

Bug introduced in 8.0 or earlier and persisting through 11.3 According to the documentation, Eigenvalues[m,k] gives the first ...
tparker's user avatar
  • 1,766
8 votes
2 answers
285 views

Why Mathematica gives wrong eigenvalues for this equation?

Here is an eigenvalue problem in cylindrical coordinate: $$\mu(r)\frac{\partial}{\partial r} \left( \frac{1}{\mu(r)}\frac{1}{r}\frac{\partial (ru)}{\partial r} \right)=-p^2u$$ where p is the required ...
Karl Eichenhaus's user avatar
8 votes
1 answer
282 views

How to solve this 1st-order linear ODE system with a few discrete eigenvalues?

I am trying to solve the eigensystem of a 1st-order linear ODE system in the region $(-\infty,\infty)$ and with Dirichlet boundary condition at the infinities $$ -i\partial_xu(x)+f^*(x)v(x)=\lambda u(...
xiaohuamao's user avatar
  • 4,708
8 votes
0 answers
710 views

Numeric Solution Hydrogen Atom

I'm trying to solve the Schrödinger equation for the hydrogen atom without made the variable separation of the polar and radial coordinate. It is my test code to extrapolate to another system with its ...
Jorge Castaño's user avatar
8 votes
0 answers
341 views

DEigenvalues and NDEigenvalues return different values

In the following example, DEigenvalues and NDEigenvalues return different results despite having identical arguments. Does anyone know why? (I use Mathematica 11.3) ...
banone's user avatar
  • 728
7 votes
5 answers
756 views

Spectral problem for differential operator

I want to find numerically eigenvalue and eigenfunctions some nontrivial differential operator. But I can not find, how to do it in Mathematica. For the sake of simplicity let us discuss the trivial ...
Peter's user avatar
  • 205
7 votes
1 answer
706 views

Is there a bug in Eigensystem[]?

Does Eigensystem[] produce incorrect output for symmetric matrices with integer components? The following eigensystem decomposition of a 12x12 matrix and its ...
Rainer Glüge's user avatar
7 votes
1 answer
360 views

Sensitivity analysis of parameter on eigenvalues of predator-prey model

I am trying to do a sensitivity analysis of the parameter g on the eigenvalues of this simple predator-prey Lotka Volterra model. I know that this code is entirely ...
Clara's user avatar
  • 71
7 votes
1 answer
597 views

Which methods are available for NDEigensystem?

I am trying to find out what methods/options are available for NDEigensystem and descriptions of their use. Perusing the help, online Q&As, Mathematica's in-...
Eli Lansey's user avatar
  • 7,459
7 votes
1 answer
133 views

Solve computes discontinuous eigenvalues of parameter-dependent matrix

So I have a family of unitary matrices $m(x,y)$, which depend on two parameters $x,y \in [0, 2 \pi)$. Its eigenvalues should be continuous in $(x,y)$. Since $m(x,y)$ is a unitary matrix, its ...
Andreas132's user avatar
7 votes
1 answer
869 views

NDSolve eigenvalue problem of bound state

I am trying to solve this eigenvalue problem: \begin{align} \mu \Psi(r) & = -\frac{1}{2}\left ( \Psi^{\prime \prime}(r) + \frac{2}{r} \Psi' (r)\right ) -4\pi \Psi(r) \int _0^\infty dr' r'^2 \frac{...
Boson Bear's user avatar
7 votes
1 answer
712 views

NDEigensystem for structural vibration

Having installed version 11 I thought I would check an old Stack Exchange vibration problem using NDEigensytem. The old problem was Test a wooden board's vibration mode and I think this was before ...
Hugh's user avatar
  • 16.3k
7 votes
2 answers
2k views

Unable to evaluate Eigenvalues and Eigenvectors for a matrix

I have the following 3X3 matrix M and I wish to find its eigenvectors and eigenvalues ...
kowalski's user avatar
  • 375
7 votes
0 answers
284 views

How to compute eigenvalues of linear function (not matrix)?

How to compute eigenvalues of a known linear function? In Julia, there is a package https://jutho.github.io/LinearMaps.jl/dev/ to compute the matrix representation of given function, then we can ...
swish47's user avatar
  • 143
7 votes
0 answers
139 views

Differing behavior of Eigenvalues and Eigensystem

With the update to v12.0, I seem to be getting different behavior of eigenvalues returned by Eigenvalues and Eigensystem (oddly, ...
erfink's user avatar
  • 1,089
7 votes
0 answers
182 views

Memory usage for smallest eigenvalues

I have a bunch of hermitian matrices which are huge (of order 2^17 x 2^17) but extremely sparse so that, when I build the matrices, the usage of RAM is low (say of order 1 GB or similar). The ...
Dario Rosa's user avatar
6 votes
3 answers
450 views

Linear ODEs with NDSolve

I am trying to solve some first order linear odes. My code is below: ...
Gaurav Maurya's user avatar
6 votes
2 answers
19k views

How to normalize a list of eigenvectors?

Here is a simple eigenvector problem solution m = {{2, Sqrt[15]}, {Sqrt[15], 4}}; v = Eigenvectors[m] However, the list of vectors v is not normalized. The ...
Jim Napolitano's user avatar
6 votes
4 answers
305 views

FindInstance won't compute this simple expression

I want to find instances where this standard 3x3 symmetric matrix has only positive eigenvalues. So I run ...
Jesper Johansson's user avatar

1
2 3 4 5
10