cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Interpolation (and/or lookup) with 3 inputs and 35 outputs

JL_9930831
2-Explorer

Interpolation (and/or lookup) with 3 inputs and 35 outputs

Hi guys, 

I am attempting to automate finding the correct row with 3 inputs as shown attached in a spreadsheet using Mathcad prime 10. I have also attached the data in a Mathcad 10 prime file. There are some challenges with this, First, each column has multiple of the same values, so the normal linterp function cannot be used. I suppose a better option would be a combination of lookup and linterp. 

Any suggestions on how to best solve this? 

Cheers.

Snag_11e74f2.png

Snag_113a629.png

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:JL_9930831)

Here is my attempt using my linterp_3D function.

I tried to keep it more general with respect to the number of values in the input data and the matrix dimensions of the output so its easier to adopt it from the dummy data to your real data.

I also noticed that the data in the excel sheet is different from the data you have in the Prime sheet.
EDIT: OK, the differences are just +/- 0.0005.

 

Please check and double check the results my function returns very thoroughly for plausibility!!

 

View solution in original post

5 REPLIES 5
Werner_E
25-Diamond I
(To:JL_9930831)

Thats demanding.

I once wrote simple functions which would do 2D and 3D linear interpolations.

In case of the 3D interpolation, the data had to be provided via a nested vector, consisting of matrices because Prime does not allow 3- ore ,more dimensional arrays.

Werner_E_0-1717425980390.png

This function returns just ONE single value for three inputs a, b and c.

So in your case you would have to set up 35 data vectors "Data" and use the function 35 times to get the 5x7 result matrix you need.

 

Creating the necessary data matrices might need some programming and maybe it would be easier to write a program which uses the data structure as provided by the Excel sheet and loop through the three input vectors to find the most suitable values.

Anyway, I attach the 3D interpolation file if you want to give it a try.

 

 

Cornel
19-Tanzanite
(To:Werner_E)

Do you have also for 2D interpolation prime 9 sheet or function to show?

Werner_E
25-Diamond I
(To:Cornel)


@Cornel wrote:

Do you have also for 2D interpolation prime 9 sheet or function to show?


Was posted here in the forum quite often (mostly for real Mathcad 15, but also converted to Prime.

See attached

 

Werner_E
25-Diamond I
(To:JL_9930831)

Here is my attempt using my linterp_3D function.

I tried to keep it more general with respect to the number of values in the input data and the matrix dimensions of the output so its easier to adopt it from the dummy data to your real data.

I also noticed that the data in the excel sheet is different from the data you have in the Prime sheet.
EDIT: OK, the differences are just +/- 0.0005.

 

Please check and double check the results my function returns very thoroughly for plausibility!!

 

Impressive! Thanks a lot. 

Announcements

Top Tags