I am getting zero eigenvector while using sym/eig. What is the problem?

50 views (last 30 days)
I am getting zero eigenvector while using sym/eig. What is the problem?
  2 Comments
the cyclist
the cyclist on 23 Nov 2018
You have not given us enough information to help you. It would help if you
  • give more description
  • show us the code you written
  • upload the actual variables in a MAT file
John D'Errico
John D'Errico on 24 Nov 2018
Please don't add answers just to add information.
Moved from an answer:
"Please have a look at the symbolic matrix in the mat file below.
A simple [V,D] = eig(FTM), will show that one of the columns of V is zero.
I additionally found out that the matrix is singular (close to singularity). But I am not able to see why.
Thanks
Bharath"

Sign in to comment.

Answers (1)

John D'Errico
John D'Errico on 24 Nov 2018
Edited: John D'Errico on 24 Nov 2018
The problem is not with MATLAB. It appears that your matrix is defective. It does not have a complete basis set of eigenvectors. Not all matrices will do so.
A classic example of such a matrix is this:
[V,D] = eig([1 1; 0 1])
V =
1 -1
0 2.2204e-16
D =
1 0
0 1
So, as you can seee, a double eigenvalue at 1. But the two eigenvectors shown are essentially the same, except for a sign change in this case.
While not all matrices with replicated eigenvalues are defective, but you should recognize that yours is indeed defective.
  2 Comments
Bharath Swaminathan
Bharath Swaminathan on 24 Nov 2018
In the example you have shown, the repeated eigenvectors all have norm 1. But I am getting a Zero eigenvector. Why is matlab doing that?
John D'Errico
John D'Errico on 24 Nov 2018
Edited: John D'Errico on 24 Nov 2018
A defective matrix does not have a complete set of eigenvectors. One chacteristic of a defective matrix is it always has a replicated eigenvalue. While not all such matrices are defective, this is where you will find such a problem arise, and it will be for one of the replicated eigenvalues that one or more of the eigenvectors may be garbage.
Now, does it really matter what form the garbage takes on?
That you got one of the eigenvectors as zero just means that one or more of the eigenvectors was garbage. If you call eig on the double precision version of your matrix, it returns a different kid of garbage, than if you use the symbolic eig on FTM. TRY IT YOURSELF!!!!!!
[V,D] = eig(FTM);
>> double(diag(D))
ans =
14.373 + 0i
1 + 0i
1 + 0i
1 + 0i
0.5454 + 0i
3.5174e-22 - 1.3011e-21i
3.5174e-22 + 1.3011e-21i
1.9983e-42 + 0i
-6.3204e-42 - 9.1509e-43i
-6.3204e-42 + 9.1509e-43i
-0.45072 - 0.16644i
-0.45072 + 0.16644i
>> V(:,2:4)
ans =
[ 1.0, 0, 0]
[ 0, 1.0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, 0]
Note that one of the eigenvalues was not merely a duplicated eigenvalue, but a triplicated one. It is that 4th eigenvector that is garbage. The problem arose in the subspace of eigenvectors that we see spanned by V(:,2:4) here.
Now, lets see what happens when eig is called on the double precision version of FTM? That call uses LAPACK, whereas the sym version cannot possibly do so.
[V,D] = eig(double(FTM));
>> diag(D)
ans =
1 + 0i
1 + 0i
1 + 0i
14.373 + 0i
0.5454 + 0i
-0.45072 + 0.16644i
-0.45072 - 0.16644i
-4.9009e-17 + 0i
1.9739e-16 + 0i
1.9177e-17 + 0i
3.7573e-18 + 0i
-1.1414e-17 + 0i
In this case, the triplicated eigenvalues were 1:3. So lets look at what LAPACK gave us.
V(:,1:3)
ans =
1 0 1
0 1 0
0 0 1.9485e-17
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
Do you recognize anything interesting? Is there a difference? Does this in fact look vaguely like what eig gave us on the classic example that I showed in my answer?
YOU HAVE A DEFECTIVE MATRIX. WHEN THAT HAPPENS, YOU WILL GET GARBAGE FOR ONE OR MORE OF THE EIGENVECTORS. sym/eig just decides to return a different sort of numerical garbage, than does double/eig. Garbage is still garbage.
Now, while the symbolic form of eig is apparently able to recognize a defectiove matrix, and retrn fewer eigenvectors, this is not always the case. For example, here, we see that sym/eig succeeds, where the double version fails:
[V,D] = eig(sym([1 1 0; 0 1 0;0 0 2]))
V =
[ 0, 1]
[ 0, 0]
[ 1, 0]
D =
[ 2, 0, 0]
[ 0, 1, 0]
[ 0, 0, 1]
>> [V,D] = eig([1 1 0; 0 1 0;0 0 2])
V =
1 -1 0
0 2.2204e-16 0
0 0 1
D =
1 0 0
0 1 0
0 0 2
So fewer eigenvectors were generated by sym/eig, rather than returning a garbage eigenvector. But apparently in your 12x12 matrix, sym/eig was unable to figure out that it was defective, and thus return fewer eigenvectors.

Sign in to comment.

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!