10-28-2025 12:44 AM
I edited the original VI you attached to get this:
When I run it, I see these results (the same results we have been sharing in all these posts):
On the left, the results are computed and displayed with full precision. On the right, the matrices Sigma_reg_6SigFigs and Sigma_inv_6SigFigs have been rounded to 6 significant figures, but are shown with 8 significant figures to show that data was lost in the rounding. The diagonals of Ainv * A are computed and displayed. Given that the rounded result agrees with the result from Mathematica, I conclude that rounded matrices were input to Mathematica. Tim, would you be willing to try a simpler problem with your LabVIEW version and Mathematica? How about a simple 3x3 matrix with diagonal elements: 3, 6, 9. I hope LabVIEW returns the inverse with decimal equivalent of diagonal elements: 1/3, 1/6, 1/9. When performing the validation checks with full precision, Ainv * A should have diagonal elements very close to 1 (i.e. 1.000000000000000) If we use less precision, we should expect more error. If that experiment doesn't shed light, we can do a 1x1 A matrix = [3]. We know what the inverse is, and we can verify the math easily. Please let us know what you discover.
10-28-2025 03:23 AM
@aeastet wrote:
LabVIEW is the only place where I am not seeing this as a result of matrix multiplying Sigma_reg and Sigma_ inv. For LabVIEW I only get 1.000000000000000000000. Noone is answering this question.
The LabVIEW result:
How can I make my question more clear?
Matrix A multiplied by the inverse matrix of A yields the identity matrix, in which all elements are 0 except for the diagonal elements, which are 1.
LabVIEW returns the identity matrix, so my questions are:
Why do you think LabVIEW is wrong and the other places are right?
Are "the other places" using single precision values?
10-28-2025 09:42 AM
Cutting to 6 digits emulates OPs values pretty well, which is what a Single represents ... so what's the precision in OPs other programs.
(Also, why would x * (1/x) _not_ be 1?)
10-28-2025 11:46 AM
Mathematica can use "infinite" precision in its calculations. To speed up numeric calculations in Mathematica you need to specify a lesser precision.
10-28-2025 01:20 PM
@aeastet wrote:
I am showing 20 digits. It is not a display issue. I have been doing this a really long time. I am not going to get caught on something that simple. Did anyone actually look at what I am doing in my code?
I loaded your exact "Matrix Example Simple" and you were only showing 6 digits, not 20. Maybe your non-simple code is doing something different? Expanding the number of digits in your example showed the number change after the 6th digit. I only looked at your simple example, which disagreed due to the number of digits shown.