Message Boards Message Boards

0
|
1159 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Tips for finding inverse of a 25x25 sparse symbolic matrix

Posted 1 year ago

Hi,

I'm trying to invert a 25x25 sparse symbolic matrix, which for concreteness I've included below. I have tried

Inverse[A,Method->OneStepRowReduction]

but it's still running after an hour (8-core 2.6GHz Intel Xeon Mac, 32Gb memory). Same with Method->Automatic. I know I could be more patient and give it a day or two, but even an hour seems on the long side, given that the matrix is mostly zeroes. I realize this is a question that has probably been asked before but I haven't been able to find a good answer or even a systematic strategy, including in the posts on other web forums that I found. So I apologize if it's a redundant question. With that said, does anyone have any thoughts?

Thanks!

Ian

A = {{1, -b1, 0, 0, 0, -b2, 0, 0, 0, 0, 0, 0, -c1, 0, 0, 0, 0, 0, -c2, 0, 
  0, 0, 0, 0, 0}, {0, 1 - g11, 0, 0, 0, -g12, 0, 0, 0, 0, 0, 0, -h11, 
  0, 0, 0, 0, 0, -h12, 0, 0, 0, 0, 0, 0}, {0, b1 (-1 + x1), 1 - x1, 0,
   0, b2 (-1 + x1), 0, 0, 0, 0, 0, 0, 0, -c1, 0, 0, 0, 0, 0, -c2, 0, 
  0, 0, 0, 0}, {0, g11 (-1 + x1), 0, 1 - x1, 0, g12 (-1 + x1), 0, 0, 
  0, 0, 0, 0, 0, -h11, 0, 0, 0, 0, 0, -h12, 0, 0, 0, 0, 0}, {0, 
  g21 (-1 + x1), 0, 0, 1 - x1, g22 (-1 + x1), 0, 0, 0, 0, 0, 0, 
  0, -h21, 0, 0, 0, 0, 0, -h22, 0, 0, 0, 0, 0}, {0, -g21, 0, 0, 0, 
  1 - g22, 0, 0, 0, 0, 0, 0, -h21, 0, 0, 0, 0, 0, -h22, 0, 0, 0, 0, 0,
   0}, {0, b1 (-1 + x2), 0, 0, 0, b2 (-1 + x2), 1 - x2, 0, 0, 0, 0, 0,
   0, 0, -c1, 0, 0, 0, 0, 0, -c2, 0, 0, 0, 0}, {0, g11 (-1 + x2), 0, 
  0, 0, g12 (-1 + x2), 0, 1 - x2, 0, 0, 0, 0, 0, 0, -h11, 0, 0, 0, 0, 
  0, -h12, 0, 0, 0, 0}, {0, g21 (-1 + x2), 0, 0, 0, g22 (-1 + x2), 0, 
  0, 1 - x2, 0, 0, 0, 0, 0, -h21, 0, 0, 0, 0, 0, -h22, 0, 0, 0, 
  0}, {0, b1 (-1 + y1), 0, 0, 0, b2 (-1 + y1), 0, 0, 0, 
  1 - a y1, -c1, -c2, 0, 0, 0, 0, -c2, 0, 0, 0, 0, -b1 y1, 0, -b2 y1, 
  0}, {0, q11 (-1 + y1), 0, 0, 0, q12 (-1 + y1), 0, 0, 0, -p1 y1, 
  1 - r11, -r12, 0, 0, 0, 0, -r12, 0, 0, 0, 0, -q11 y1, 0, -q12 y1, 
  0}, {0, q21 (-1 + y1), 0, 0, 0, q22 (-1 + y1), 0, 0, 
  0, -p2 y1, -r21, 1 - r22, 0, 0, 0, 0, -r22, 0, 0, 0, 0, -q21 y1, 
  0, -q22 y1, 0}, {0, -q11, 0, 0, 0, -q12, 0, 0, 0, 0, 0, 0, 1 - r11, 
  0, 0, 0, 0, 0, -r12, 0, 0, 0, 0, 0, 0}, {0, q11 (-1 + x1), 0, 0, 0, 
  q12 (-1 + x1), 0, 0, 0, 0, 0, 0, 0, 1 - r11, 0, 0, 0, 0, 0, -r12, 0,
   0, 0, 0, 0}, {0, q11 (-1 + x2), 0, 0, 0, q12 (-1 + x2), 0, 0, 0, 0,
   0, 0, 0, 0, 1 - r11, 0, 0, 0, 0, 0, -r12, 0, 0, 0, 0}, {0, 
  b1 (-1 + y2), 0, 0, 0, b2 (-1 + y2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  1 - a y2, 0, -c2, 0, 0, 0, 0, -b1 y2, 0, -b2 y2}, {0, q21 (-1 + y1),
   0, 0, 0, q22 (-1 + y1), 0, 0, 0, -p2 y1, -r21, -r22, 0, 0, 0, 0, 
  1 - r22, 0, 0, 0, 0, -q21 y1, 0, -q22 y1, 0}, {0, q21 (-1 + y2), 0, 
  0, 0, q22 (-1 + y2), 0, 0, 0, 0, 0, 0, 0, 0, 0, -p2 y2, 0, 1 - r22, 
  0, 0, 0, 0, -q21 y2, 0, -q22 y2}, {0, -q21, 0, 0, 0, -q22, 0, 0, 0, 
  0, 0, 0, -r21, 0, 0, 0, 0, 0, 1 - r22, 0, 0, 0, 0, 0, 0}, {0, 
  q21 (-1 + x1), 0, 0, 0, q22 (-1 + x1), 0, 0, 0, 0, 0, 0, 0, -r21, 0,
   0, 0, 0, 0, 1 - r22, 0, 0, 0, 0, 0}, {0, q21 (-1 + x2), 0, 0, 0, 
  q22 (-1 + x2), 0, 0, 0, 0, 0, 0, 0, 0, -r21, 0, 0, 0, 0, 0, 1 - r22,
   0, 0, 0, 0}, {0, g11 (-1 + y1), 0, 0, 0, g12 (-1 + y1), 0, 0, 
  0, -f1 y1, -h11, -h12, 0, 0, 0, 0, -h12, 0, 0, 0, 0, 1 - g11 y1, 
  0, -g12 y1, 0}, {0, g11 (-1 + y2), 0, 0, 0, g12 (-1 + y2), 0, 0, 0, 
  0, 0, 0, 0, 0, 0, -f1 y2, 0, -h12, 0, 0, 0, 0, 1 - g11 y2, 
  0, -g12 y2}, {0, g21 (-1 + y1), 0, 0, 0, g22 (-1 + y1), 0, 0, 
  0, -f2 y1, -h21, -h22, 0, 0, 0, 0, -h22, 0, 0, 0, 0, -g21 y1, 0, 
  1 - g22 y1, 0}, {0, g21 (-1 + y2), 0, 0, 0, g22 (-1 + y2), 0, 0, 0, 
  0, 0, 0, 0, 0, 0, -f2 y2, 0, -h22, 0, 0, 0, 0, -g21 y2, 0, 
  1 - g22 y2}}
POSTED BY: Ian Holmes
Posted 1 year ago

Update: maybe I mistyped something before; Inverse is now running in about 10 minutes using the default Method (which I guess is Automatic). That's fast enough for my purposes, though any general tips about how to accelerate things are always welcome (especially because I'd like to extend this to bigger matrices eventually...)

POSTED BY: Ian Holmes
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