Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.4K Views
|
5 Replies
|
4 Total Likes
View groups...
Share
Share this post:

problem with LUDecomposition and SparseArray

Posted 12 years ago
POSTED BY: Luis Ledesma
5 Replies
POSTED BY: Shenghui Yang

LU decomp does not guarantee a unique solution. Click link here. The permutation matrix is possible: PA = LU if P is not identity matrix. The "A" is your "kl" in the problem.

Check:

(l.u).Inverse[kl] // MatrixForm

permutation matrix

POSTED BY: Shenghui Yang
Posted 12 years ago

Shenghui Yang thanks for the link, is very explicit in the decomposition, and to say of the programs, just what I need, but that can also be done in Mathematica using the commands described above? I hope you can guide me on this topic

POSTED BY: Luis Ledesma
Posted 12 years ago

The rows are out of order

In[1]:= kl = {
   {1, 0, 0, 0, 0, 0},
   {-1, -6, -2, 0, 0,  0},
   {0, -2, -8, -2, 0, 0},
   {0, 0, -2, 8, 6, 0},
   {0, 0, 0, 6, -4, -8},
   {0, 0, 0, 0, 0, 1}};
{lu, p, c} = LUDecomposition[kl];
l = lu SparseArray[{i_, j_} /; j < i -> 1, {6, 6}] + IdentityMatrix[6];
u = lu SparseArray[{i_, j_} /; j >= i -> 1, {6, 6}];
l.u

Out[5]= {
  {1, 0, 0, 0, 0, 0},
  {0, -2, -8, -2, 0, 0},
  {0, 0, -2, 8, 6, 0},
  {0, 0, 0, 6, -4, -8},
  {-1, -6, -2, 0, 0, 0},
  {0, 0, 0, 0, 0, 1}}
POSTED BY: Bill Simpson
Posted 12 years ago

Bill Simpson thanks for the help, but I do not understand what you mean with The rows are out of order, is bad built my matrix?,anxiously await your response in order to continue using this command

Shenghui Yang thanks for the link, is very explicit in the decomposition, and to say of the programs, just what I need, but that can also be done in Mathematica using the commands described above? I hope you can guide me on this topic

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