Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
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
Thanks
Regards
JXB
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
R1 | R2 | R3=0.25 | R4=0.75 |
0.25 | 0.25 | 0.9953 | 1.3617 |
0.75 | 0.9030 | 1.2948 | |
1.50 | 0.8448 | 1.2323 | |
3.00 | 0.7968 | 1.1648 | |
6.00 | 0.7547 | 1.1056 | |
12.00 | 0.6966 | 1.0626 | |
0.75 | 0.25 | 1.2873 | 1.7014 |
0.75 | 1.1715 | 1.6242 | |
1.50 | 1.0979 | 1.5507 | |
3.00 | 1.0373 | 1.4698 | |
6.00 | 0.9851 | 1.3981 | |
12.00 | 0.9137 | 1.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.............................
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