I have stiffness matrix and mass matrix. I want to calculate my structure vibration shapes and period (eigenvalue/vector) so I am using NumPy for this. Eigenvalues are the same as those given by MATLAB, but when I compare the eigenvectors with those given by MATLAB I find some small (smaller than 1E-10) differences.
Why is this, and how can I make the two results equal?
I tried to increase precision of NumPy but it didn't work.
import numpy as np
#S Stiffness Matrix
#M Mass Matrix
w, f = np.linalg.eig(np.linalg.inv(M)@S)
Here are my results
First eigenvector from NumPy:
0.0
0.0
0.0
0.631781280460724
-1.4298382510485397e-09
-8.755329688057342e-26
0.7392387400169079
7.709528714838357e-10
1.3560471632542145e-24 # Different sign here
0.23319197867341496
1.88087901696399e-09
-4.7286506166123194e-17 # Different sign here
First eigenvector from MATLAB:
0
0
0
6.317812804607240e-01
-1.429838251048596e-09
-8.755233867348009e-26
7.392387400169076e-01
7.709528714837307e-10
-2.624482888541565e-24 % Different sign here
2.331919786734153e-01
1.880879016947830e-09
8.178753965460107e-17 % Different sign here