1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: How to improve the 3 x 3 matrix before Inverse

  1. Jul 16, 2011 #1
    Dear all,

    After solving the inverse of 3 x 3 matrix, I got a warning which says 'badly inverse conditioned matrix, the result may contain significant numerical errors'.
    My question is that how to treat or improve such matrix so that this warning can be eliminated.

    For example: the inverse of 3 x 3 matrix:

    {1.74923*10^23, 1.14055*10^21, -4.43947*10^22},
    {6.89225*10^23, 4.49395*10^21, -1.74923*10^23},
    {4.49395*10^21, 2.93024*10^19, -1.14055*10^21}

    Please let me know if there is a treatment to the matrix before the inverse can be executed.

    Thanks for any feedback
  2. jcsd
  3. Jul 16, 2011 #2
    The problem is that your rows (or equivalently your columns) are all very nearly mutiples of one another. This can be seen by normalizing the rows:

    Code (Text):

    In[21]:= (m1={
    Out[21]//MatrixForm= (
    1.74923*10^23   1.14055*10^21   -4.43947*10^22
    6.89225*10^23   4.49395*10^21   -1.74923*10^23
    4.49395*10^21   2.93024*10^19   -1.14055*10^21
    In[23]:= Normalize/@m1//MatrixForm
    Out[23]//MatrixForm= (
    0.969251    0.00631981  -0.245992
    0.969251    0.0063198   -0.245993
    0.969251    0.00631992  -0.245993
    You see they become almost identical. At this point, if all you have is finite precision numbers with the significant digits shown, there is nothing you can do about this. Most of the information needed to invert the matrix is in the last few bits of the numbers. The only way to fix it is to use higher precision.

    Alternatively, and probably better, you should look at the original source of these vectors, try to figure out why they're all pointing in almost exactly the same direction, and find a different way of setting the problem up so that the differences come to the fore.
  4. Jul 16, 2011 #3
    Thank you so much for your response.
    I got it. It works perfectly with your first suggestion.
    Fantastic advice.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook