What's the difference between eig(A,B) and eig(A/B)

12 views (last 30 days)
Mengqi
Mengqi on 28 Mar 2015
Edited: Matt J on 29 Mar 2015
Hi all,
I'm solving a generalized eigenvalue problem Ax=lambda Bx. I can either do eig(A,B) or eig(A/B). The eigenvalues are slightly different obtained from these two methods, and the eigenvectors are totally different. It seems obviously that eig(A/B) can't get the eigenvector correct (since I enforced some boundary conditions in A and B, for eig(A,B) the resultant eigenvectors have the correct boundary conditions, while eig(A/B) doesn't). Do you know why this is the case? Thanks.
  2 Comments
Image Analyst
Image Analyst on 28 Mar 2015
Why don't you print out A/B to the command line? I think you'll see the reason.
Mengqi
Mengqi on 28 Mar 2015
Why? Sorry, I don't understand. Could you be more specific?

Sign in to comment.

Answers (1)

Matt J
Matt J on 29 Mar 2015
Edited: Matt J on 29 Mar 2015
The results of eig(A,B) and eig(A/B) can only have any kind of equivalence if B is non-singular, as far as I can see.
Assuming this is true, the eigenvalue results will differ between the two slightly because of floating point precision issues. The eigenvectors will differ by a transformation v=c*B\u where v is an eigenvector from eig(A,B), u is an eigenvector from eig(A/B), and c is an arbitrary complex scalar.
You can test this using the following code. You will see that V1 and V2 contain the same eigenvectors, though perhaps not in the same order,
A=rand(3); B=rand(3);
[V,~]=eig(A,B);
[U,~]=eig(A/B);
V1=bsxfun(@rdivide,V,V(1,:));
V2=(B\U);
V2=bsxfun(@rdivide,V2,V2(1,:));

Categories

Find more on Denoising and Compression 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!