Message Boards Message Boards

0
|
8841 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Avoid "Badly conditioned matrix...contain significant error" message?

Posted 5 years ago

Hi,

I have a matrix representing more than one physical properties and hence a vast difference b/w numerical values of the elements, say from 10^12 - 10^-9. I get the o/p when I do any matrix operation on the matrix but with a error message "Result for Inverse of badly conditioned matrix ..... may contain significant error". Perhaps, this "error identification" is also effecting the processing speed of Mathematica as well.

How can I get rid of this error message, and tell Mathematica that everything is normal in these numbers. Could there be a better way to deal with such matrices with large difference in numbers to improve the accuracy, specially during calculating inverse of them.

Will appreciate any help.

thanks

SG

POSTED BY: S G
5 Replies
Posted 5 years ago

Thanks. I was rationalizing Inverse[Matrix] rather than Matrix before Inverting. Appreciate your help.

POSTED BY: S G
In[5]:= m = {{0.768576, -2.62804*10^-11}, {2.44999*10^8, 0.369943}}

Out[5]= {{0.768576, -2.62804*10^-11}, {2.44999*10^8, 0.369943}}

In[6]:= mr = Rationalize[m, 10^-16]

Out[6]= {{12009/15625, -(1/38051171215)}, {244999000, 369943/1000000}}

In[7]:= mrinv = Inverse[mr]

Out[7]= {{43989888852471078125/34575194689676811341, 3125000000/
  34575194689676811341}, {-(29132809051574328125000000000/
   34575194689676811341), 91391303024187000000/34575194689676811341}}

In[8]:= minv = N @ mrinv

Out[8]= {{1.2723, 9.03827*10^-11}, {-8.42593*10^8, 2.64326}}

In[9]:= m.minv

Out[9]= {{1., 9.12871*10^-23}, {0., 1.}}
POSTED BY: Frank Kampas
Posted 5 years ago

I tried using Rationalize[Inverse[Matrix]], but it did not work. Perhaps I am missing something. Can you please elaborate further. Following is the simplified example of my matrix, and I am facing problem while calculating its inverse

E= {{0.768576, -2.62804*10^-11}, {2.44999*10^8, 0.369943}};

thanks once again.

POSTED BY: S G

Might try rescaling columns.

POSTED BY: Daniel Lichtblau

Try changing the matrix values to infinite precision using Rationalize

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract