The motivation of my calculation is to get the inverse for the following matrix
c={{806187941679782.0, 218884444558405.0, -44574352.7996484,
263790009.291711, -7043899062155.16 , 101619269971218.0},
{218884444558405.0, 59429013469996.9, -12139526.3237759,
71717183.1728141, -1913730353321.76, 27580785304831.0},
{-44574352.7996484, -12139526.3237759,
5.06604715779434, -20.0242999918957,
455028.9823731, -5189609.42411989},
{263790009.291711, 71717183.1728141, -20.0242999918957,
100.006624596537, -2482688.13923785, 31962666.0977317},
{-7043899062155.16, -1913730353321.76,
455028.9823731, -2482688.13923785 ,
63930635211.802, -869762434934.025},
{101619269971218.0, 27580785304831.0, -5189609.42411989,
31962666.0977317, -869762434934.025, 12957503435300.3}}
A direct "b=Inverse[c]" gives the following warning
Inverse::luc: Result for Inverse of badly conditioned matrix (<<1>>) may contain significant numerical errors.
Not surprisingly, the diverge of "b.c" from the identity matrix is large. Then I try to use the matrix
a=Inverse[Inverse[c].c]
as a correction. The new Inverse is "a.b". When I test the new inverse, Mathematica gives the following results
which are obviously different.
Why do this happen? Besides, is there any better way to perform the matrix inversion in this case?
m
matrix. I assume you meantc
instead ofm
everywhere. But let me make sure I understand. You are using outputs that Mathematica saysmay contain significant numerical errors
and then wondering why the result of(a.b).c
is different froma.(b.c.)
? is it possible they are different result due to these numerical errors? $\endgroup$is there any better way to perform the matrix inversion
why are you trying to do matrix inverse in first place. Normally this is not needed, unless for academic exercise. Are you try to solve a system of equations? $\endgroup$c
matrix has very large condition number, which is not good for inverse.LUDecomposition[c][[3]]
gives2.90361*10^21
. This is practically a singular matrix. Condition number should be small. less than 100 at most. but this really depends. I do not think there is a fixed number to look for, but the smaller it is, the better for inversion. $\endgroup$