From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolation Questions

Dear Forum,

 

I have a set of Calculated Curves (Cylinder pressure based on Crank Angle = 1D Array of Data) from another source in form of text files.

Each of this Array is only valid for a specific Speed and Torque.

Assume that I have following files:

File1: = 1D Array of Data Valid for 2000RPM and 10NM

File2: = 1D Array of Data Valid for 2000RPM and 20NM

File3: = 1D Array of Data Valid for 2000RPM and 30NM

File4: = 1D Array of Data Valid for 2200RPM and 10NM

File5: = 1D Array of Data Valid for 2200RPM and 20NM

File6: = 1D Array of Data Valid for 2200RPM and 30NM

File7: = 1D Array of Data Valid for 2300RPM and 10NM

.

.

.

FileN: = 1D Array of Data Valid for 4000RPM and 30NM

 

If I need to get the 1D Array of Data for an Operating Point where no File is available (i.e. 2100RPM and 12NM), I need to interpolate.

 

But How ? What kind of function do I need ?

 

I can provide sample Data if needed.

 

THX and Br,

Hannes

0 Kudos
Message 1 of 10
(3,150 Views)

Hi Hannes,

 

 

all you need is the function "Interpolate 2D" - and you need to reorganize your data into a 2D array for your cylinder pressure and a 1D array for RPM and torque...

 

LabVIEW comes with an example demonstrating the usage of that function, just read it's context help!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(3,122 Views)

Hi GerdW,

thanks for the quick response.
I already thought about the 2D Interpolation function. Not 100% sure how to organize the data and function usage in my case. I will try to read the help and use the example in more detail, for better understanding. If I still fail, I will come back to this thread.

Regards,

Hannes

0 Kudos
Message 3 of 10
(3,111 Views)

Hi GerdW,

 

to be honest: I have no clue how this 2D interpolation works in General and how it can solve my issue...

 

Playing around with the examples / help does not help me.

 

Can you please give me an example on how to organize the data and how to use the 2D Interpolation in my case ?

 

Br,

Hannes

0 Kudos
Message 4 of 10
(3,083 Views)

Hi Hannes,

 

you need to setup X, Y, and Z data and provide an x/y point to search your table:

check.png

In this example x should be within 1 and 3, y between 10 and 30...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 10
(3,074 Views)

Either I still do not understand or there is a misunderstanding of my request:

In your Case you are looking in a table. In my Case each Point in Z must be 2D. Remember I have many Curves (Pressure based on Crank Angel, see attachment examples of this curves). Now additionally I have to interpolate on RPM AND Torque.

 

Actually the examples using Intake Pressure (IP in file Name) not Torque. But in principle same function I need. N in the file Names is the Speed / RPM.

 

Br,

Hannes

 

 

 

Testing Example.png

0 Kudos
Message 6 of 10
(3,045 Views)

Hi Hannes,

 


as said before: you have to reorganize your data! (as said in message #2 and mentioned in message #4…)

I will not do that for you: it's your data and your task!

 

In my snippet above "Z" needs to contain all your data, "Y" and "X" will be your input vector (RPM and IP). Then you can use "x" and "y" to interpolate for a give coordinate in your Z data...

 

So you have to load all your single small files, get the Z data from them and combine them to a big 2D array.

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(3,034 Views)

Hi GerdW,

 

of course you do not have to reorganize my Data 😉

 

But maybe you can help me to understand how I have to organize it.

 

My results always give me a single Value in that a 2D Array, but I need a Array with the same amount of Values then in one of the text files of course.

 

Br,

Hannes

0 Kudos
Message 8 of 10
(3,025 Views)

Hi Hannes,

 

in those text files you have a list of "crank angle data" vs crank angle for a given speed/torque value.

Now you want to interpolate such a list for any random speed/torque.

So infact you have a Z value for any triple of input values: speed/torque and angle.

 

You can solve that by creating a Z table in the example above for each angle and iterate over all angle values!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(3,017 Views)

Hi again,

 

Thank you!

 

Now I got it...

 

Br,

Hannes

0 Kudos
Message 10 of 10
(3,006 Views)