LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolating 2D array

Solved!
Go to solution

Unfortunately,this block diagramm is working uncorrectly,I really need to do 2D interpolation. Maybe smth can help me try to solve this issue with 2D interpolation block. I need to set value for axis-x (current) in which interpolation will be done. 

 

As it shown here:

0 Kudos
Message 21 of 49
(912 Views)

Hi Yolo,

 


@HoloYolo wrote:

Unfortunately,this block diagramm is working uncorrectly,I really need to do 2D interpolation. Maybe smth can help me try to solve this issue with 2D interpolation block. I need to set value for axis-x (current) in which interpolation will be done. 


In which way it works "incorrectly"? (How does your VI look like right now - you didn't attach it so far…)

This Interpolate1DArray function also does interpolate based on the x value. Both files also use the same frequency axis, which makes it quite easy to interpolate…

 

Why do you think you need a 2D interpolation? All you need is to interpolate between a pair of 2 point - and that's what my suggestion does…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 22 of 49
(900 Views)

Maybe I don`t understand smth,I`m sorry. Is it interpolate between one coloumn from first array and one appropriate coloumn from the second array? And I try to find mistake,why there is 9 coloumn in final array when it will be 8 and where is lost the last freequency 2000. Excuse me for bothering you with this trouble.

0 Kudos
Message 23 of 49
(895 Views)

I will try to understand what You want to do. Please comment if I have understood it correctly.

 

You have 5 data dimensions:

  1. The Current in mA, as given in the two file names.
  2. The Name of the Sensor(?) (S11, S12, S21, S22), as given in the column header.
  3. The Frequency in Hz, as given in the first column.
  4. The Real part of what you are measuring.
  5. The Imaginary part of what you are measuring.

 

  • The Real and Imaginary parts are taken together to form a single point on the Real/Imaginary number plane.
  • For every Frequency and every Sensor, there is a Point on the plane.
  • There are two planes: One for the lower Current and one for the higher Current.

 

Now, what I think You are trying to do is:

  • Take every Point on the the Plane at Current 1
  • Find the corresponding Point in the Plane at Current 2
  • Define a third Plane between these two Planes with variable Current x
  • For each pair of Points constructed in the first two steps, create a new Point on the third Plane
    • The new Point is an interpolation between the Pair of Points constructed in the first two steps.

Additionally, You might want to think about this: What will the interpolation method be? You are using real and imaginary data. Do You want to interpolate the Re/Im values or would you rather interpolate the r/phi values? Your results will be quite different.

0 Kudos
Message 24 of 49
(878 Views)

@LLindenbauer wrote:

 

Now, what I think You are trying to do is:

  • Take every Point on the the Plane at Current 1
  • Find the corresponding Point in the Plane at Current 2
  • Define a third Plane between these two Planes with variable Current x
  • For each pair of Points constructed in the first two steps, create a new Point on the third Plane
    • The new Point is an interpolation between the Pair of Points constructed in the first two steps.

Additionally, You might want to think about this: What will the interpolation method be? You are using real and imaginary data. Do You want to interpolate the Re/Im values or would you rather interpolate the r/phi values? Your results will be quite different.


Yes,you are absolutely right. I need to take every point from current 1 and corresponding points from current 2 and interpolate between all of this with new variable current X.I want to interpolate between Re/Im values in each coloumn. I mean to take pair Re/Im from 1 current,for example for S11 and corresponding Re/Im point for S11 from 2 current and interpolate between these to make a new array for new current,also to do this operation for all S-parameters for all frequincies. That`s why i think to use 2D interpolation block,because how I`ve already illustrated this,It`s probably needed to use exactly this method. Also,I have more files,not only for 2 current. Just for the beginning try to understand,how It will work with two files. In global I need to get in programm 5 files for 2,5,10,15,20 mA and realize programm which will create a new arrays with interpolation for given value of current,for example 2.5,3.5,7.5 and etc. So I have a problem,because of poor knowledges in LabView and how It can be realized in it.

0 Kudos
Message 25 of 49
(863 Views)

Hi Yolo,

 


@HoloYolo wrote:

And I try to find mistake,why there is 9 coloumn in final array when it will be 8 and where is lost the last freequency 2000. Excuse me for bothering you with this trouble.


I forgot the transpose the resulting array the same way as I did with the input arrays…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 26 of 49
(845 Views)

Ah, I see that @GerdW already found the solution - sorry for the intrusion.

0 Kudos
Message 27 of 49
(844 Views)

Ohhh... That`s it. You are exactly right,my bad I`m sorry.So how it will be changed if i`d like to use more arrays for another values of current. For example 10,15 and 20 mA. I need just to expand loop block? 

 

And if it`s possible,could you please eplain me,why I have not to use 2D interpolation in this situation. I really just think,that it will be 2D such as i`ve illustrated it earlier.

0 Kudos
Message 28 of 49
(826 Views)
Solution
Accepted by HoloYolo

Hi Yolo,

 


@HoloYolo wrote:

Ohhh... That`s it. You are exactly right,my bad I`m sorry.So how it will be changed if i`d like to use more arrays for another values of current. For example 10,15 and 20 mA. I need just to expand loop block? 


In the first step I would search for the two "surrounding" tables/arrays, then apply the same code as before…

(Example: When you want to interpolate at 11mA then you need the arrays for 10&15mA. At 19mA you need arrays for 15&20mA.)

 


@HoloYolo wrote:

And if it`s possible,could you please eplain me,why I have not to use 2D interpolation in this situation. I really just think,that it will be 2D such as i`ve illustrated it earlier.


All you want is to interpolate between just 2 points, described by X&Y values.

The function shown in my image does exactly that!

 

In contrast "2D interpolation" will try to find a point on the sphere described by each of your data files, which doesn't make any sense for your requirement (atleast for me)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 29 of 49
(822 Views)

Hi! Thank you so much for help me! 

The last problem I have it`s to load my power supply`s 3D model to labview and insert all labview`s indicators on it to finish my project.

0 Kudos
Message 30 of 49
(772 Views)