I am writting a Fem code in c++ for a 2d plane stress model. My question is regarding the assembly stiffness matrix.I noticed that some elements of the matrix are not exactly zero but insted a number close to zero for example -1.7677e-15. Can floating point arithmetic erros result to an ill-conditioned stiffness matrix? If yes how can I avoid it?

  • $\begingroup$ Did you initialize everything to 0? $\endgroup$
    – EMP
    Oct 7 '20 at 17:47
  • $\begingroup$ Yes, I initialize the stiffness matrix to 0 and I did the assembly.However I took this kind of out when a operation like -6.77+6.77 takes place in some matrix positions $\endgroup$
    – spyros
    Oct 7 '20 at 18:09
  • $\begingroup$ Yea, that looks to be machine precision subtraction error. Doesn't guarantee that the matrix is ill-conditioned. ill-conditioning is a ratio of the largest to smallest eigenvalue, not the largest and smallest values; otherwise every sparse matrix would have an infinite condition number. $\endgroup$
    – EMP
    Oct 7 '20 at 18:44
  • 1
    $\begingroup$ Small round-off errors in constructing your stiffness matrix won't make your stiffness matrix ill-conditioned if it wasn't ill-conditioned in exact arithmetic. If the theoretical exact arithmetic stiffness matrix is ill-conditioned then such round off errors can make things work. $\endgroup$ Oct 7 '20 at 18:45
  • $\begingroup$ The matrix may have small negative entries, but is that a problem? I see no real issue with this by itself. $\endgroup$ Oct 8 '20 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.