04-02-2012 01:16 AM
Hello everybody,
I have a problem. In a LabView VI I calculated a spline function with the 1d-spline-interpolation during an experiment:
http://zone.ni.com/reference/en-XX/help/371361E-01/gmath/spline_interpolation_1d/
In "X" I have set 4 points - index 109, 288, 421, 534 - with which I calculate 640 points in all (including the 4; 640 set with "Xi") and all works fine.The problem is, the base points were slightly wrong.
Now, the correct 4 point index are 102,281,425,540. I cannot repeat the experiment, but the data is generally ok - I just have to recalculate the spline in DIAdem, which leads me to the problem - how? Specifically, how do I get the points 1-101 and 541-640? How do I make sure it is the same math? Apparently LabView extrapolates somehow and I dont understand how.
Just to clarify, I have the 4 values in DIAdem and need to calculate it, as LabView would have done it. The calculation by LabView has always been satisfying and worked well.
Thanks!
04-03-2012 06:53 AM
Hi matV,
can you tell me, which values are processed or which values you give the subVI and what exactly is the question?
Best regards
Marko
04-04-2012 06:06 AM
Hello Marko,
thanks for the reply. I cant acces the actual values right now, but I have a diagram of 3 of the splines:
I am measuring the temperature(y-axis) at the "x" on the graph. The line is the calculated spline, where I used the function in the link of the original post (explained below). You see the index "Pixel" - I am calculating a temperature for each pixel from 1 to 640 using 4 measured pixels ("x").
The "+" are temperatures I can manually adjust, to make sure, that the spline is somewhat close to actual values in the beginning and end (I wont use roughly 20 Pixels in the beginning and end anyways, so it is not important to be too accurate).
So the spline is calculated between pixel 0 and 640, with the 4 values at index (pixel) 109, 288, 421, 534. For all this, I used Labview during the experiment. However, those index where slightly wrong, the "x" are actually a bit different and I need to recalculate the spline in DIAdem, because I cannot repeat the experiment. For that, I still have the Temperatures, and I need to calculate a new spline with those temperatures, same mathematical procedure, just that the temperatures are at the index 102,281,425,540.
The "+" will still be tolerable as I tried to stay much closer to the calculated temperatures than necessary.
What I did exactly in Labview:
http://zone.ni.com/reference/en-XX/help/371361E-01/gmath/spline_interpolation_1d/
Y - array of temperatures for each pixel, i.e. 4 temperatures ("x" in the graph).
X - 109, 288, 421, 534 - associating the 4 temperatures to a pixel in the spline
Xi - 1-640 - calculate 640 points with the 4 "X" at the said pixels
I hope you understand what I am doing. I am looking for the same function in DIAdem, but couldnt find it. My last resort will be to program a new VI in labview to read the values of the database and somehow calculate the spline again. I was hoping that there is a function in DIAdem, that does that for me.
Thanks for you time!
04-05-2012 08:01 AM
If you know that your values are wrong and you have the correct values. Why you can not repeat the experiment?
It is also easier when you can calculate this in LabVIEW. In DIAdem it is little bit more difficult to create.
Give it a whirl with the "non-parametric spline".
You can find it under the Dunktion ANALYSIS -> Curve calculation -> Non-parametric spline.
You have the x values but also all y?
You have 3 graphs, and you want each to create a spline?
Or you want to create a spline from all three graphs?
Or do you want from all three graphs, create a spline from an x value (vertically upwards)?
Happy Easter
04-06-2012 08:04 AM
I cannot repeat the experiment, because it involves a major change in the setup. We already changed it and I noticed the mistake right after the change. Moreover the measurement takes time, where recalculating is simply faster.
I tried the "non-parametric-spline", but I dont really know how I implement, that my first and last values are not in the beginning and end. I tried around, but couldnt get a satisfying solution with the apparently extrapolated parts. I cant use the "+" data for the spline. The visible spline does not only interpolate between the points, but also extrapolates around them, which I probably need to do then as well (supposedly linear with the last slope).
The y-values in the diagrams are calculated through the spline. The diagrams show splines I created with Labview, i.e. three of them (even averaged for the temperature- I have roughly 1500 splines to create). I just put them in as separate examples to show what I am trying to do. Each diagram is a single spline that I calculated with Labview and I need to do that again. I created each spline from the 4 values marked with "x". The line shows the spline, i.e. all the created y-values. However, those depend on the location of the 4 "x" which in the above diagrams is slightly wrong. So the diagrams show 3 slightly wrong splines, that I want to calculate again in DIAdem.
I hope you understand what I am trying to do. This is my first post and I keep forgetting that all of you dont know my setup. Sorry for that anyways.
Thanks for all the efforts and Happy Easter to you as well 🙂
04-10-2012 10:17 AM
Send me your exact parameters, or how look like your channels in DIAdem?
for example:
channel 1: 102...
channel 2: ........
chan......
...
04-10-2012 01:35 PM
No, they look different. Anyways, I managed to make a VI in Labview today, that works, so the problem is solved. Thanks so far to everyone.
04-11-2012 01:50 AM
I am glad that it works now.
Can you send me the VI, I will sand the VI to America to RND.
They will chack it why the VI makes false values.
Best regards
Marko
04-11-2012 10:06 AM
Hello,
the VI got me slightly wrong values because I put in slightly wrong data. The calculation procedure worked fine.
I couldnt repeat the procedure in DIAdem, though. So I made a VI in Labview that did the same calculation again. Just with correct settings, so the results were correct.
Again, just to avoid misunderstandings - the programs and VIs all did correct calculations, concerning the actual calculation procedure. Just the conditions under which things were calculated were set wrong by me (the positions). I noticed and concluded that the results were wrong - however the wrong values itself were calculated correctly. I repeated the calculation with correct conditions, so now everything is fine. No need to bother anyone with it 🙂
Regards
04-12-2012 07:19 AM
Hi matV,
One minor additional point on this topic-- it is possible to call that VI you created from DIAdem, using the LVRuntime object in a VBScript. This means that you could add a custom icon or menu to DIAdem that would invoke this custom VI and create a resulting channel in the Data Portal. You can add functionality to DIAdem by calling your custom VIs from the DIAdem environment, and you can choose whether to show or hide that VI's front panel during execution.
In case that's interesting to you,
Brad Turpin
DIAdem Product Support Engineer
National Instruments