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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to linearly interpolate from a table

Eng_ReyD_497
10-Marble

How to linearly interpolate from a table

I need to linearly interpolate from a table, which I attached with some examples.
I appreciate any help... Thanks a lot!

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:Eng_ReyD_497)

We had almost feared you had lost interest.

Anyway, I guess what you need can still be done with linterp, it just requires an addition to the table at both sides you add a column with repeating values. See attached.

 

Success!
Luc

View solution in original post

7 REPLIES 7
LucMeekes
23-Emerald III
(To:Eng_ReyD_497)

Did you already have a look here?

https://community.ptc.com/t5/PTC-Mathcad/Interpolation-of-Table-Values/td-p/721321

 

Anyway, attached is a sheet that should work for you.

 

Success!
Luc

Thanks @LucMeekes and @Fred_Kohlhepp for your efforts! ... Nice work

Sorry, I was away for over a week, and I did not have the chance to check earlier.

The solution that @LucMeekes has provided works perfect, BUT, I do not want to extrapolate beyond the boundaries. Just stick to the minimum or the maximum if the interpolated value goes beyond the limits. Otherwise works fantastic! 

The solution that @Fred_Kohlhepp has provided works perfect for not performing the extrapolation, but works only the SiteClass "B" and does not change automatically if I change the class to "D" for instance.
Looks like the row position is "hard coded" but I need it more dynamic to perform the lookup by changing the SiteClass to any other letter in the list...

Thanks guys, I learn from both of you!

LucMeekes
23-Emerald III
(To:Eng_ReyD_497)

We had almost feared you had lost interest.

Anyway, I guess what you need can still be done with linterp, it just requires an addition to the table at both sides you add a column with repeating values. See attached.

 

Success!
Luc

Thanks @LucMeekes! this trick did the job 👍
I appreciate your help... All the best!

Have a great care!

 

From your example there is a problem.  There is a command (linterp) that will do what you ask, EXCEPT it will not extrapolate beyond the limits of your data.  Your example has points beyond that range, and will require some thought.

 

Fred_Kohlhepp_0-1618577066711.png

 

 

(Linterp is developed to do the same thing as the Mathcad "premium feature" linterp.

LucMeekes
23-Emerald III
(To:Fred_Kohlhepp)

Fred,
The function linterp does extrapolate as well as interpolate. From Prime (4) help:
LucMeekes_0-1618577747916.png

The extrapolation doesn't produce the answers that the OP expected though:

LucMeekes_0-1618577986108.png

 

Luc

 
 

The extrapolation doesn't produce the answers that the OP expected though:

 

Beg to differ!

Fred_Kohlhepp_0-1618599434350.png

That's why I made f(x,X,Y)

 

Announcements

Top Tags