Jump to content

Solve linear equations flaw


Recommended Posts

Hi LAVAs,

I try to solve a system of linear equations AX = Y with LV 7.1. I played around with the "Solve Linear Equations.vi" (SLE) and the "Inverse Matrix.vi" (IM) from the linear algebra palette and found some strange behaviour:

I expected the SLE-vi to be much faster than the IM-vi. A small test (see attachment) shows that this is not the case.

LabVIEW help tells us that the SLE-vi uses LU-decomposition for NxN-matrices. In the SLE-vi a function named CxEqsSetBySVDDri_head in lvanlys.dll-library is called. I think the SVD in the function name means singular value decomposition. This would be the right algorithm for solving rectangular matrices but not for square matrices. This would also explain why the function is so tedious slow compared to the IM-vi.

I found the function CxEqsSetByLUDri_head in lvanlys.dll (LU-decomposition) which, I think, should be used for NxN-matrices. In the attached vi I used the modified SLE calling CxEqsSetByLUDri_head to check the speed against the IM-vi. Using a 10x10 Matrix for A and a 10x2 for Y, the modified SLE-vi with LU-decomposition should be 10/2=5 times faster then the IM-vi which has to invert (10/10 = 1) the whole matrix. Unfortunately it is only slightly faster (factor 1.5 to 2) than the matrix inversion. Either the matrix inversion algorithm is so fast that it can almost beat the (modified) SLE or the performance of the CxEqsSetByLUDri_head-function was such a flaw that it was intentionally not used ;)

My problem is, that I have to solve small linear equation systems of the size in the example, as fast as possible. Has anybody an idea to speed the things up?

Thanks,

Toni

P.S. Would be nice to know, if this behaviour has changed in LabVIEW 8.5. I only have 7.1 availible.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.