MATLAB Answers

incorrect eigenvector using eig(A,B)

26 views (last 30 days)
Amin Taraghi
Amin Taraghi on 21 Apr 2016
Answered: Christine Tobler on 23 Oct 2020
I am solving an eigenvalue problem and I need the 5 first eigenvalues I use [V, w2]=eig(MK,MM) to find the eigenvalues.
Then I test the results by MK*V-MM*V*w2 and it is incorrect!!!!
when I sort the eigenvalues and eigenvectors using the following code
for i=1:length(w2)
for j=i+1:length(w2)
if w2(i,i)>= w2(j,j)
comparing the results with other simulation in Abaqus I realized that the first 5 eigenvalues which are my natural frequencies are true but the eigenvectors which are my mode shapes are wrong.


John D'Errico
John D'Errico on 21 Apr 2016
What is wrong about them?
Amin Taraghi
Amin Taraghi on 21 Apr 2016
the result for test is not zero and the elements have different orders test= MK*V-MM*V*w2;

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 21 Apr 2016
Eigenvectors are not uniquely determined. Any constant multiple of an eigenvector is also an eigenvector.


Amin Taraghi
Amin Taraghi on 21 Apr 2016
You are right but in each case the eigenvectors should satisfy the MK*V-MM*V*w2=0
In my case they do not satisfy it and you can see the attached matrices. Instead of 0 the elements are the order of 10^2, 10^3, 10^4 and so on.
Meanwhile comparing the results with simulations the vectors and their multiplies are not true
Achyut Dave
Achyut Dave on 23 Oct 2020
That's true if and only if the corresponding eigenvalue is appropriately scaled.

Sign in to comment.

Christine Tobler
Christine Tobler on 23 Oct 2020
The residual MK*V-MM*V*w2 is expected to be numerically close to zero, however, you have to take into account the scaling of the whole system. Here norm(MK) is 4.2241e+20 and the residual will also be scaled with this factor, which gets us to a residual of around 1e7. Here's what I get for a scaled residual:
>> [V, w2]=eig(MK,MM);
>> max(vecnorm(MK*V - MM*V*w2)) / norm(MK)
ans =
About matching eigenvectors between MATLAB's and Abaqus's result - you definitely have to expect different scaling of each individual eigenvector (you could try applying V ./ vecnorm(V) to both matrices, which will given each column a 2-norm of 1). At that point, the only effect of scaling should be the sign of each column.
But in addition to this, here's a plot of the eigenvalues w2:
As you can see, the eigenvalues are (A) not sorted, so the order of the eigenvalues returned by Abaqus might be different, and (B) decrease rapidly, so the eigenvectors related to the relatively very small eigenvalues (< 1e7 let's say) probably don't have matching eigenvectors, because at that point they are mostly tracking numerical noise.


Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by