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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

(linear) interpolation if 3 ratios required - Phase 2

JBlackhole
16-Pearl

(linear) interpolation if 3 ratios required - Phase 2

Original thread started here: (linear) interpolation if 3 ratios required?

Had a look at the example kindly provided by Fred Kohlhepp but struggling with a couple of things

I created a table of (real) data (well 3 sets of data anyway) (still too lazy..). Attached mcad sheet

  1. What is the purpose of Matrix 'Mx' in Fred's example?
  2. I can extract the data from the whole table but does one need to extract only the "lambda" (the final parameters based on ratios R1,R2,R3) for the interpolation

Thanks

Regards

JXB

4 REPLIES 4

Mathcad can create a least squares polynomial regression of your three-dimensional data set. (Look up "regress" in help.) Mx is the matrix of independent variables necessary to do that--one value of lambda for each combination of r1, r2, and r3 in the tables.

Note that this is NOT a linear interpolation. It's a curve fit to the data and may wildly diverge from a linear interpolation. But it's relatively simple to implement, a three-way linear interpolation would cost a lot more brain power.

Thanks a lot for the clarification Fred, much appreciated. The manual (and example) makes sense now.. I have re-arranged the (known) data and it seems to work. Well I get a interpolated lambda value.

did a test with R1=R2=R3=0.25 (the 1st known set of value) for which lambda=0.9953 and the interp() returns 0.9816 (with n=5)

Agree about the three-way linear interpolation. Lot of 'IF' statements I think.

take R1 = 0.5, R2 = 1 and R3=0.5, one would have to do a lot of ifs based on the Rs' values to "extract" the known lambda values (2 sets of 4 values, see below data highlighted) and do some sort of interpolate/averaging (in the "vertical" and "horizontal" direction). Food for thought I guess!

Thanks for your help on the original question.

Regards

JXB

R1R2R3=0.25R4=0.75
0.250.250.99531.3617
0.750.90301.2948
1.500.84481.2323
3.000.79681.1648
6.000.75471.1056
12.000.69661.0626
0.750.251.28731.7014
0.751.17151.6242
1.501.09791.5507
3.001.03731.4698
6.000.98511.3981
12.000.91371.3455

Hey.. I am trying to use VLOOPUP function... my problem is defining the function..which gives value of zero when the VLOOPUP function is not able to find an exact match... how to do that.............................

StuartBruff
23-Emerald II
(To:tcebulla)

Thomas Cebulla wrote:

Hey.. I am trying to use VLOOPUP function... my problem is defining the function..which gives value of zero when the VLOOPUP function is not able to find an exact match... how to do that.............................

Use Mathcad's "on error" programming construct to trap the error that vlookup raises when it can't find a match.  Then have "on error" return whatever result you want.  I've used NaN in the example below, but you simply replace it with 0 to get the result you want.

Stuart

Top Tags