eigenvectors are are wrong; yielding matrices

3 views (last 30 days)
I am getting 2x2 matrices instead of vectors.
% -dynamics of vibrational systems-
%set variables
k(1) = 24;
k(2) = 3;
k(3) = 14;
m(1) = 9;
m(2) = 1;
format short
K = [(k(1)+k(2)), -k(2);... %stiffness matrix
-k(2),(k(2)+k(3))]
M = [m(1),0;... %mass matrix
0,m(2)];...
syms o; % omega
trialsol = det((-o^2)*M + K); % yields algebraic equation with unknown omega
omega=solve(trialsol, o); % solving for omega
omega=vpa(omega,3) % format omega
omega_sorted = sort(omega); %sort ascending
plusminusomega = omega_sorted(1:(length(omega)/2)); %extracting half the values plus/minus
for i = 1:length(plusminusomega) %loop to find eigenvectors for each eigenvalue
currentmatrix = [-((plusminusomega(i))^2)*M + K]; % generate matrix for each loop iteration
[u{i}, D] = eig(currentmatrix); %put eigenvector in cell
end
u %show cells
Result:
omega =
4.13
1.71
-4.13
-1.71
u =
[2x2 sym] [2x2 sym]
I believe it has something do with the fact I have previously solved for omega^2 (i.e. the eigenvalues) and that using the eig() function somehow repeats this process?

Accepted Answer

Matt J
Matt J on 28 Apr 2014
Edited: Matt J on 28 Apr 2014
I am getting 2x2 matrices instead of vectors.
Naturally. Your input matrices are 2x2 and the eig function solves for all eigenvectors of the input matrix.
  4 Comments
Jake
Jake on 28 Apr 2014
Edited: Jake on 28 Apr 2014
I understand they have two eigenvalues, but as I said I thought there would be only one 2x1 eigenvector for each of these eigenvalues; I don't understand why two 2x2 matrices are produced.
Matt J
Matt J on 28 Apr 2014
Edited: Matt J on 28 Apr 2014
but as I said I thought there would be only one 2x1 eigenvector for each of these eigenvalues
The eig() command does not expect the characteristic matrix K+lambda*M as input, where lambda is a known eigenvalue. It assumes that you don't know any of the eigenvalues a priori and thinks that you want it to find all of them, as well as the associated eigenvectors. It therefore expects the original matrix or, if it is a generalized eigenvalue problem, the pair of matrices K,M as input. See
>> doc eig

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 28 Apr 2014
Well, here's Hollywood's solution: http://www.youtube.com/watch?v=m4SBMyd0yEQ
  3 Comments
Matt J
Matt J on 28 Apr 2014
If you follow the link, it will be self-explanatory, but probably not what you were looking for.
Image Analyst
Image Analyst on 28 Apr 2014
Well, maybe it's an inside joke that only image processing and linear system people understand. Basically the director comes up to the image analyst and wants him to waste time while restoring an image so Kevin Costner can have more time to do an investigation.
Director says "I'm not satisfied with the way this is coming up -- the eigenvalue is off."
Analyst: "Looks alright to me"
Director: "We're pulling away from our reference information. Advise them to program a Fourier Transform."
Analyst: "I don't know - that seems like a waste of time."
Director: "Just do what I want okay!"
It's total nonsense and probably the most famous bit of malarky/gibberish related to image processing in the movies to date. As if you could tell what the eigenvalues are by looking at an image, and as if a Fourier Transform would "fix" it. But I guess it sounded impressive to the non-engineers in the audiences.

Sign in to comment.

Categories

Find more on Linear Algebra in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!