Matlab flips the eigenvalue and eigenvector of matrix when passing through singularity

6 views (last 30 days)
Problem: I have a matrix(H(3x3)) in which I vary a parameter(B) and compute the eigenvalues and eigenvectors with varying parameter. I am using the eig() function of matlab. At a particular value of B, the matrix H becomes singular and after that I see in result that the eigenvalues and eigenvectors are flipped automatically. The first and second eigenvectors and eigenvalues changes there place after passing through singularity although they are being calculated correctly. I am sure of it because I have solved the problem analytically.
Mathematical Description: H = [D-B 0 0; 0 0 0; 0 0 D+B]; D=1.5; B=0:0.1:3
eigenvector [0 1 0] corresponds to eigenvalue 0
eigenvector [1 0 0] corresponds to eigenvalue D-B
eigenvector [0 0 1] corresponds to eigenvalue D+B
First eigenvalue should not change through out the variation of parameter B, but one can check that second eigenvalue takes the place of first eigenvalue after passing through the singularity B=D.
Is there any solution for such problems, because in future I will be using higher dimension matrices where it's not analytically possible to calculate eigenvalues.

Accepted Answer

Christine Tobler
Christine Tobler on 3 Jul 2018
The eigenvalues don't have any intrinsic order, so for real symmetric matrices, EIG just sorts them by size. Looking at just the 0.18 matrix, there's no way for EIG to know in what order the eigenvalues are at point 0.06, and to match this up.
Check out eigenshuffle on the MATLAB File Exchange, which takes the matrices for all data points at once and shuffles their eigenvalues to match up. Note this is not an easy problem to solve, so I don't know how well it will scale for larger matrices.
  1 Comment
Jitendra Kumar Singh
Jitendra Kumar Singh on 4 Jul 2018
Edited: Jitendra Kumar Singh on 4 Jul 2018
Eigenshuffle() did work for this case. Thanks a lot.
By the way, if eig() writes the values in ascending order then this might not be a problem with Skew-Hermitian Matrices. However, if the eigenvalues are mixed(both real and complex) then I am not sure if Eigenshuffle() will work or not. In such case, I think one solution is to write the square matrix as a summation of Hermitian and Skew-Hermitian Matrix.

Sign in to comment.

More Answers (0)

Categories

Find more on Linear Algebra in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!