Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

CanadaGuy

Member

10-24-2016 06:28 PM - edited 10-24-2016 06:30 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I spent a lot of time narrowing down a problem I was having and have come to the conclusion that I believe there is a bug in the Interpolate 2D Scattered VI. Since this VI just implements some matrix code, I suspect the bug is actually in the underlying matrix solver code. On to business.

I have tried several data sets, but I have reduced it to some very simple data as you will find in the attached VI which is a copy of the Scattered 2D interpolation block diagram (with a few modifications). The X and Y have been made to be ramps from 0 to 10 with a length specified on the front panel. The Z values are simply a random input between 0 and 1. If you specify the length (i.e. number of points) as anything other than 208 points, then you will get the right answer (the Z is random value, but the right answer should be something in the range of 0 to 1). However, if you specify exactly 208 points, an incorrect answer is returned (in the hundreds...where it should be between 0 and 1).

I have tested with a range of datasets, and if the number of datapoints equals exactly 208, then the answer will be off by a factor of about 1e3 to 1e4 or so.

Anyone at NI able to comment or anyone else seen this problem? The VI is saved in 2016.

Solved! Go to Solution.

10-24-2016 07:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Bob_Schor

Knight of NI

10-25-2016 09:30 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

The Good News is I can reproduce the behavior you describe. The Bad News is that I have no idea what the code you posted is supposed to do (that is, an understanding "at a high level" of what is going on). There are a bunch of functions in there including things that look like RMS, exponentials, etc. Something is clearly not quite right, but without understanding what is happening, I'm not sure where to look for more clues.

Bob Schor

10-25-2016 09:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

This was a test VI in an effort to debug the problem...and I realized I made a mistake in my description so I will clarify:

The original intent is to use Interpolate 2D Scattered (1D).vi (found in the interpolation and extrapolation palette) to interpolate irregularly sampled XY data with Z values to produce the new Zi value.

When I noticed the bug, I went digging into this VI to see what could be the issue. This VI is composed of VIs for each interpolation method (nearest, linear, cubic, biharmonic spline). Nearest is useless for this application, linear works, but since my original data has curvature to the surface, that leaves cubic of biharmonic spline. Cubic is not good for this data, and that leaves biharmonic spline (this is background to understand the selection of method). If you look at the inner case structure, in the block diagram of Interpolate 2D Scattered (1D).vi, and select 3 (corresponding to the biharmonic spline selection) it executes Interpolate 2D Scattered_Green Function.vi. It is the block diagram of this vi that I have replicated, with a few minor changes for debugging to incorporate test data. This is the block diagram that exhibits the bug.

In summary, I want(ed) to use Interpolate 2D Scattered (1D).vi to interpolate irregular spaced data. During debug I noticed a sub-vi, Interpolate 2D Scattered_Green Function.vi has the bug and I duplicated the code so I could try to work out the issue. The data I'm feeding in is random, and exhibits the issue as you found. I suspect the issue is related to the matrix solver, but under the hood, it is a DLL which makes it inaccessible for further end user debug.

Does this bring enough context?

10-25-2016 09:50 AM - edited 10-25-2016 09:51 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

10-25-2016 10:32 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Sorry for multiple posts but I'm remembering other parts of my debug. If I tunnel down through the subvis as follows:

Interpolate 2D Scattered (1D).vi --> Interpolate 2D Scattered_Green Function.vi --> Solve Linear Equations (single right hand).vi

There is a "relative tolerance" input to Solve Linear Eqs (Gen, single right hand).vi which is hard coded to -1. Looking at the subvi of this one, -1 or 0 changes which solver is used. If I change this constant from -1 to 0, then the dataset size of 208 starts solving with reasonable values.

Most likely all of this seems to point to an NI specific investigation, since it deals with some hard coded settings in typically unused subvis...just looking for more direction on how I might approach this to get the best response from them.

Solution

Accepted by CanadaGuy

ttrr

Active Participant

10-28-2016 12:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi,

Thanks for reporting this problem. I think this can be a bug in the underlying implementation of linear equation solver in the DLL. I will report a CAR to track this problem.

10-28-2016 08:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Thank you very much.

X.

Trusted Enthusiast

10-29-2016 02:23 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

10-30-2016 11:15 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Good call...64bit doesn't exhibit the problem, only 32bit.