Eigenvector calculation

조회 수: 10 (최근 30일)
Kamuran
Kamuran 2011년 1월 24일
편집: Naveed Ahmed 2023년 10월 24일
I am trying to calculate the eigenvectors and eigenvalues for the following matrix (6,6) and I am getting complex eigenvector which I should not. I check the eigenvectors with maple and no complex eigenvector. Can anyone help me? ( complex numbers are not small. There on the same order or real ones)
-30.400000000000009 20.099689437998496 16.988854381999836 -12.099689437998487 13.411145618000168 -7.999999999999998
-1.105572809000086 -3.811145618000166 4.683281572999748 1.105572809000084 -3.577708763999662 2.705572809000083
4.494427190999916 -0.683281572999748 -7.388854381999832 3.577708763999663 2.894427190999915 -2.894427190999915
-2.894427190999916 2.894427190999916 3.577708763999664 -7.388854381999831 -0.683281572999745 4.494427190999913
2.705572809000084 -3.577708763999665 1.105572809000085 4.683281572999745 -3.811145618000171 -1.105572809000080
-7.999999999999998 13.411145618000166 -12.099689437998482 16.988854381999822 20.099689437998467 -30.399999999999970
You can see that the first 3 row almost a mirror image of last 3 (or vice versa). Actually it has to be to same, but due to around offs coming from calculation creates 10^-13 differences. If I make those changes and makes them excatly mirror images no complex eigenvectors (which is little odd)
  댓글 수: 5
Naveed Ahmed
Naveed Ahmed 2023년 7월 31일
편집: Naveed Ahmed 2023년 10월 24일
and the matrix should always be 'Square' to get the eigean vectors.
Torsten
Torsten 2023년 7월 31일
How should A*x = lambda*x hold if A were not square ?

댓글을 달려면 로그인하십시오.

채택된 답변

Ned Gulley
Ned Gulley 2011년 1월 25일
When I run the eig command (see help here: eig) I don't get any complex eigenvectors. Maybe the problem is data entry?
Assuming your matrix is in a, then
[v,d] = eig(a)
v =
-0.7059 -0.6622 0.4830 0.3203 -0.0000 0.4644
0.0294 -0.1076 0.4654 -0.4804 0.5774 0.4425
0.0294 0.2235 0.2239 0.3203 -0.0000 -0.2974
0.0294 -0.2235 -0.2239 -0.4804 0.5774 -0.2974
0.0294 0.1076 -0.4654 0.3203 -0.0000 0.4425
-0.7059 0.6622 -0.4830 -0.4804 0.5774 0.4644
d =
-40.0000 0 0 0 0 0
0 -31.1332 0 0 0 0
0 0 -2.4668 0 0 0
0 0 0 0.0000 0 0
0 0 0 0 -0.0000 0
0 0 0 0 0 -9.6000
  댓글 수: 3
Bruno Luong
Bruno Luong 2011년 1월 25일
You might try free host servers, but as I have pointed out earlier, the smallest eigen values are 1e-17 of the largest, so any small perturbation of matrix elements could easily make smallest eigen value becomes complex. That's not a surprise to me. You might need to make some safeguard code against this issue.
Christine Tobler
Christine Tobler 2023년 7월 31일
Yes, you can attach a .mat file (look for the little "attachment button" when editing the post - like a paperclip).
For this small matrix, here's a way you can display it so that there are no differences:
for ii=1:size(A, 1)
s(ii) = string(sprintf('%.20e ', A(ii, :)));
end
disp("Acopy = [" + join(s, ";"+newline) + "]")
Run this code where you have the original matrix A, then use isequal(A, Acopy) to verify it matches exactly.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by