MATLAB: How to get the inverse of a symmetric matrix and ensure accurancy

inverse of matrixMATLABsymmetrix matrix

Hi,
I have a flexibility matrix (20*20), F, which is symmetric and positively defined. I need to reverse it to get the stiffness matrix, K=F_inv, and then to obtain eigenvalues using K. Theoretically speaking, K should also be symmetric and positively defined, which also results in positive real eigenvalues. However, in Matlab, the inverse of F does not yield to a symmetric matrix anymore by using K=inv(F) probability due to numerical errors. Moreover, this phenomenon leads to a few complex eigenvalues due to the non-symmetric K.
I tested norm(K*F) very close to 1. So how can I deal with this situation? I also tried to use Cholesky decomposition to get the inverse matrix instead of build-in inv. This approach can definitely provides symmetric inverse matrix of F, however, the accurancy is reduced as well. norm(F_inv*F) using Cholesky is around 1.2, and F_inv*F is close to the identity matrix, but not accurate enough. So how can get the inverse of F to be symmetrix and accurate as well? Anyone has suggestion on this? Thank you very much!

Best Answer

Hi,
you could consider to do the calculation symbolic. Here is a small example:
A = [9 3 -6 12; 3 26 -7 -11; -6 -7 9 7; 12 -11 7 65]
B = inv(A)
C = A*B
% do the same symbolic
D = sym(A)
E = inv(D)
F = D*E
Note that maybe things are getting ugly, when using this approach on a 20x20 matrix.
Best regards
Stephan