# How to find the eigenvectors for multiple degree of system?

5 views (last 30 days)
Kenny Gee on 8 May 2022
Commented: Kenny Gee on 8 May 2022
i have a 3DOF system trying to find the eigenvalues and eigenvector associated to the system. I used this matlab code to do it and it is showing me the correct eigenvalues I have from my hand calc, however eigenvectors look different from what I have as a hand calc. For example, when I run the code, i am getting :
(mode_shape_1 = 0.4331, 0.5597, 0.7065) (mode_shape_2 = -0.3814, -0.1346, 0.9146) (mode_shape_3 = -0.4826, 0.7938, -0.3701)
The theoretical eigenvectors I have:
(mode_shape_1 = 1, 1.2921, 1.6312) (mode_shape_2 = 1, 0.35286, -2.3981) (mode_shape_3 = 1, -1.6450, 0.7669)
I know that eigenvectors can be different depending on the values we set to calculate the other values or normalize it. The theoretical eigenvectors are also showing a different signs. How do I change the following code so that it matches with the theoretical values?
M=[3 2 1;2 2 1;1 1 1]
K=[3 0 0;0 2 0;0 0 1]
A=inv(M)*K
[V,D]=eig(A)
[D_sorted, ind] = sort(diag(D),'ascend');
V_sorted = V(:,ind);
nat_freq_1 = sqrt(D_sorted(1))
nat_freq_2 = sqrt(D_sorted(2))
nat_freq_3 = sqrt(D_sorted(3))
mode_shape_1 = V_sorted(:,1)
mode_shape_2 = V_sorted(:,2)
mode_shape_3 = V_sorted(:,3)

Paul on 8 May 2022
Hello KG,
Divide each mode shape by its first element so that the first element of each mode shape is unity.
M=[3 2 1;2 2 1;1 1 1];
K=[3 0 0;0 2 0;0 0 1];
A=M\K; % use backslash
[V,D]=eig(A);
[D_sorted, ind] = sort(diag(D),'ascend');
V_sorted = V(:,ind);
nat_freq(1) = sqrt(D_sorted(1));
nat_freq(2) = sqrt(D_sorted(2));
nat_freq(3) = sqrt(D_sorted(3));
mode_shape(:,1) = V_sorted(:,1);
mode_shape(:,2) = V_sorted(:,2);
mode_shape(:,3) = V_sorted(:,3);
mode_shape = mode_shape./mode_shape(1,:) % uses implicit expansion
mode_shape = 3×3
1.0000 1.0000 1.0000 1.2921 0.3529 -1.6450 1.6312 -2.3981 0.7669
theory(:,1) = [1, 1.2921, 1.6312].';
theory(:,2) = [1, 0.35286, -2.3981].';
theory(:,3) = [1, -1.6450, 0.7669].';
theory
theory = 3×3
1.0000 1.0000 1.0000 1.2921 0.3529 -1.6450 1.6312 -2.3981 0.7669
Kenny Gee on 8 May 2022
thank you, so much! it really works.

### Categories

Find more on Design of Experiments (DOE) in Help Center and File Exchange

R2022a

### Community Treasure Hunt

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

Start Hunting!

Translated by