How to improve the 3 x 3 matrix before Inverse

  • Thread starter Thread starter kaizen.moto
  • Start date Start date
  • Tags Tags
    Inverse Matrix
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
kaizen.moto
Messages
94
Reaction score
0
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:

Inverse[
{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
 
Physics news on Phys.org
kaizen.moto said:
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:

Inverse[
{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
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:
In[21]:= (m1={
{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}
})//MatrixForm
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.
 
Thank you so much for your response.
I got it. It works perfectly with your first suggestion.
Fantastic advice.