LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PseudoInverse Matrix Glitch

Solved!
Go to solution

Hi,

 

until Christian brings the "ultimate" improvement I just "clean up" a little bit:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 15
(1,182 Views)

Yes, I actually did the same thing. Not sure why we need option "full" for the SVD. Same result (I did not check if the algorithm is sound ;)):

 

Personally, I would probably go over all diagonal elements and handle values close to zero differently.

 

altenbach_1-1618860969977.png

 

0 Kudos
Message 12 of 15
(1,178 Views)

@altenbach wrote:

Personally, I would probably go over all diagonal elements and handle values close to zero differently.


Here's how that could look like (I think the elements of S are always nonnegative, but please verify).

The tolerance can be computed based on the elements and machine epsilon, e.g. as described here)

 

altenbach_0-1618861968824.png

 

0 Kudos
Message 13 of 15
(1,173 Views)

On a side note, you can of course operate on the vector S instead of matrix S. Maybe more efficient. (not tested).

 

I am sure things could be further optimized....

 

 

altenbach_1-1618869664874.png

 

0 Kudos
Message 14 of 15
(1,161 Views)

For what its worth I can replicate the original problem on a cRIO (VM) in LabVIEW 2020. Certainly looks like a bug in their RT Linux implementation. Interestingly when I tried it on a Linux desktop it didn't replicate - but I only had LabVIEW 2019 available.

 

It would be worth sharing your original code with NI through a service request at http://ni.com/ask so they can record it as a LabVIEW bug and hopefully fix it going forward.

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 15 of 15
(1,100 Views)