MATLAB: Assemblt of global stiffness matrix

assemblt of global stiffness matrix

Hi,
I write a code to find stiffness (K) matrix. It is strange that the determinant of K becomes infinity. However, ke, stiffness for each element does make sense and it is symmetric. Global K is also symmetric but as I said determinant is zero instead of infinity. Does anyone know what is the problem?
Thanks

Best Answer

A determinant is NEVER a good measure of whether a matrix is singular. And as matrices get large, the determinant becomes more than useless.
For example,
det(eye(1000)) == 1
however,
det(0.1*eye(1000)) == ???
When computed in floating point in MATLAB, the latter will yield zero, which I imagine you know not to be true. However, both matrices are equally non-singular. As easily, I could have modified the problem to yield inf by a different scale factor.
Answer? Don't use the determinant for anything of importance. It will only guide you to a poor conclusion.
Of course, this does not imply that your matrix has been created correctly or incorrectly. However, your test of that using the determinant is a useless one. Instead, you might look at the rank, or the eigenvalues. A valid stiffness matrix will be at least positive semi-definite. Don't forget that even for a singular matrix, eig can return negative eigenvalues on the order of -eps.