Why Does My VI Return a Slightly Different Value When I Run it on a Different Operating System?Primary Software: LabVIEW Modules>>Real-Time ModulePrimary Software Version: 8.5 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I have a VI that returns one value on a Real-Time target, but when I run the same VI on a Desktop PC, I get a slightly different value. What is the difference? Solution: On a desktop, we rely on the Intel Math Kernel Library (MKL) for Windows and Linux systems. The corresponding library on Mac OS X is VecLib. Both MKL and VecLib expose the same API of the Linear Algebra PACKage (LAPACK) to perform linear algebra operations such as QR decomposition, eigenvalue and eigenvector. The difference is that MKL and VecLib are optimized based on different systems to obtain better performance. On Real-Time, we rely on a generic LAPACK library. Although we ensure that the results returned by those libraries on different platforms are absolutely correct mathematically, we cannot guarantee that they all provide the same result on every bit. The slight numerical difference is unavoidable on different platforms and libraries. For example, there could be differing results when attempting to compute the determinant of a matrix. On Real-Time, the result may be 4.258963258413368, while the same VI may return 4.258963258414782 on a desktop PC. Based on the last four digits, these values appear to be different. The LabVIEW Equal primitive will return False if these two values were to be compared though both values are correct. If you are going to be comparing numbers computed to very precise decimal points on different platforms, we recommend comparing the least number of significant digits to ensure equality. Related Links: Attachments:
Report Date: 07/21/2008 Last Updated: 08/19/2008 Document ID: 4NK8FEHN |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
