2
$\begingroup$

I obtained a mass matrix through Finite Elements discretization. Now, I want to check if it is symmetric. To do that I subtract to my matrix $M$ its transposed $M^T$. The result is another matrix of which I compute the norm. The norms that I use are max norm defined as $\max(|a_{i,j}|; i,j)$ or infnorm defined as $\max(\sum(|a_{i,j}|,j),i)$. I would expect these norms to be zero but they are in the order of $10^{-19}$ or $10^{-17}$ if I use a coarser mesh. Do you think that it is a numerical problem simply due to finite precision effects?

Thanks

$\endgroup$
  • 1
    $\begingroup$ What's the norm of $M$ itself? $\endgroup$ – Brian Borchers May 14 '15 at 14:05
  • $\begingroup$ Welcome on Computational Science. Your question is of course legitimate, but you are not providing enough information for giving a sensible answer. Usually one is not concerned with small relative errors $\Vert M-M^T\Vert / \Vert M \Vert$, so you should state what your relative error is, and not only the absolute error. Why you are expecting that $M = M^T$ should hold exactly? $\endgroup$ – Stefano M May 14 '15 at 14:34
  • 1
    $\begingroup$ I would not care to much for such a small relative error. It is quite common in numerical applications. The only concern is to explicitly choose a symmetric solver, to avoid that some sort of "automatic" choosing library could switch to a slower non-symmetric solver. $\endgroup$ – Stefano M May 14 '15 at 14:48
  • 1
    $\begingroup$ @StefanoM is saying that it is usually not a problem. with numerics, the best you can hope to get down to is machine accuracy (you usually won't get to zero), and a lot of solvers don't even get there. what you're looking for is small relative error, and for most applications, $10^{-17}$ is considered small. you're probably fine. $\endgroup$ – aeroNotAuto May 14 '15 at 15:10
  • 2
    $\begingroup$ Your matrix is very close to symmetric. Some codes actually check to make sure that a matrix is exactly symmetric (with equal floating point numbers above/below the diagonal) and might chose to treat a matrix as unsymmetric if this doesn't hold. You can force the symmetry by either copying the upper triangle to the lower triangle or averaging the upper and lower triangular parts (M=(M+M')/2.) $\endgroup$ – Brian Borchers May 14 '15 at 17:00
5
$\begingroup$

As the comments note, it shouldn't be an issue with your eigensolver if the matrix is symmetric to machine precision. That being said, however, if you are really worried about it, just copy the transpose of the upper triangle to lower triangle after you generate the mass matrix, and then it will be exact.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.