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

11-Garnet

## interpolate

Any one can help me to interpolate the value of x

Thank you.

D:24m

H:8m

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:ldante)
 Lex Dante wrote: Yes D/H is a ratio  and the condition is like this,

Now your "table" is more meaningful.

I guess you are looking for something like the attached.

You can use "if" and "otherwise" (in Mathcad 15 and below) statements for the out-of-range values and can manually interpolate the values between 1 and 4 (function x1) which is easy enough  or you can let Mathcad do the interpolation for you (function x2).

In Prime you would use if, also if and else and it would look more cluttered. You may also use return statements to avoid the nesting of if's, etc -> see function x2b.

You may also let max and min do the "cutting off" of the values which are out of range as in function x3, but I guess thats a bit harder to read.

Implementation in Prime:

Regards

Werner

6 REPLIES 6
23-Emerald II
(To:ldante)

It's a bit hard to see but: are those ratio's of D and H?

Then for D/H=1, the leftmost AND the rightmost conditions apply: the value on the lower line must be at the same time 0.8 and 0.6.

I see no way to interpolate x.

Success!
Luc

11-Garnet
(To:LucMeekes)

Yes D/H is a ratio  and the condition is like this,

24-Ruby V
(To:ldante)
 Lex Dante wrote: Yes D/H is a ratio  and the condition is like this,

Now your "table" is more meaningful.

I guess you are looking for something like the attached.

You can use "if" and "otherwise" (in Mathcad 15 and below) statements for the out-of-range values and can manually interpolate the values between 1 and 4 (function x1) which is easy enough  or you can let Mathcad do the interpolation for you (function x2).

In Prime you would use if, also if and else and it would look more cluttered. You may also use return statements to avoid the nesting of if's, etc -> see function x2b.

You may also let max and min do the "cutting off" of the values which are out of range as in function x3, but I guess thats a bit harder to read.

Implementation in Prime:

Regards

Werner

11-Garnet
(To:Werner_E)

Thank you

24-Ruby V
(To:ldante)

You are welcome.

I just noticed that we can handle the constant values outside of the range 1..4 even more efficient, if we want to use linterp:

Any values lower than 1 or higher than 4 will do as first or last element in the first vector.

Werner

11-Garnet
(To:Werner_E)

This is easy... I used to do the linterp command in this way . It never come to  my mind that it will work in this way.  Thank you once again.

Announcements