0
$\begingroup$

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 enter image description here

which are obviously different.

Why do this happen? Besides, is there any better way to perform the matrix inversion in this case?

$\endgroup$
12
  • $\begingroup$ there is no m matrix. I assume you meant c instead of m everywhere. But let me make sure I understand. You are using outputs that Mathematica says may contain significant numerical errors and then wondering why the result of (a.b).c is different from a.(b.c.) ? is it possible they are different result due to these numerical errors? $\endgroup$
    – Nasser
    Commented Nov 3, 2021 at 5:00
  • $\begingroup$ 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$
    – Nasser
    Commented Nov 3, 2021 at 5:05
  • $\begingroup$ Thanks for you reminding. I meant "c" when I use "m". The only operation involves the "significant numerical errors" is "b=Inverse[c]", while the operation "(a.b).c" and "a.(b.c)" gives no warning. It may be possible that the numerical errors in "b" cause such difference. But I hope to make things clear. @Nasser $\endgroup$
    – Rui Yu
    Commented Nov 3, 2021 at 5:22
  • 2
    $\begingroup$ You can check the condition number of the matrix before doing inverse. Your c matrix has very large condition number, which is not good for inverse. LUDecomposition[c][[3]] gives 2.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$
    – Nasser
    Commented Nov 3, 2021 at 5:32
  • 2
    $\begingroup$ Instead of the Inverse for badly conditioned matrices, the "PseudoInverse", also called "Moore[Dash]Penrose inverse" is used. Look it up in the help. $\endgroup$ Commented Nov 3, 2021 at 8:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.