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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

8-Gravel

2d interpolation

Dear all,

I'm facing an issue with 2d interpolation in Mathcad.

The interpolating function results in negative, not plausible values.

Attached you find the file.

Thank-you very much.

Enrico

1 ACCEPTED SOLUTION

Accepted Solutions
23-Emerald I
(To:ebelmonte)

Tried a simple linear interpolation, put the Y scale logarithmic, saw the problem.

Try attached

11 REPLIES 11
24-Ruby IV
(To:ebelmonte)

Hello Valery,

Thank you for answering. However I didn't get where is the problem by the definition of the two-dimensional spline function.

Do you have any Idea?

Thanks!

Enrico

23-Emerald I
(To:ebelmonte)

Tried a simple linear interpolation, put the Y scale logarithmic, saw the problem.

Try attached

Thank-you all for your precious support!

10-Marble
(To:ebelmonte)

Among the functions lspline, pspline, cspline,  there is no function by which the value of the first derivative of a function on the boundary could be specified.

To solve your problem it is necessary to add boundary conditions (imaginary conditions).

Look at the small example for a function of one variable.

Я понимаю вашу проблему.

Среди функций lspline, pspline, cspline нет функции, с помощью которой можно было бы задать значение первой производной функции на границе.

Для решения вашей задачи необходимо добавить граничные условия (мнимые условия).

Посмотрите маленький пример для функции одной переменной.

24-Ruby V
(To:ebelmonte)

Splines tend to oscillate, so its no surprise you also get negative values in your interpolation - especially given the wide range of your "Properties" values.

Its interesting to see that Freds interesting tricky way works and gives positive values.

I would stick with a simple 2D linear interpolation.

As Mathcads 2D interpolations restricts me to a square data matrix I had written a few 2D (and 3D) interpolation routines which do not have that restriction. See attached file

Here is the 3D-plot using Freds function

Maybe his function is more appropriate for your purpose - you'll have to decide.

12-Amethyst
(To:Werner_E)

Dear Werner, could it be that you have attached an older version of your file? When I open it with MC 15.045 I see this:

As you can see there are some strange issues in both plots.

24-Ruby V
(To:FDS)

No, its saved with MC15 M045.

But 3D-plots are lknown to be problematic depending on OS, video driver, setting of color depth and graphics acceleration.

Not sure why you see those distorted plots.

12-Amethyst
(To:Werner_E)

Thank you for your prompt reply. What should be the most likely cause, or is it like searching for the needle in the hay stack?

24-Ruby V
(To:FDS)

The usual tipps when one experiences problems with 3D plots are

- turn off the border (which already is in my plots)

- reduce the color depth on your system

- turn off grahics acceleration

But the problem usually is that 3Dplots do not show up completetly. Thats not the case here as you see the plots.

No clue what could be the cause. What happens if you create the plots yourself from scratch?

Did you experience problems with 3D plots before?

12-Amethyst
(To:Werner_E)

Reducing color depth from 32 bits to 16 bits gave a massive improvement (plot 2 OK, Plot 1 still a black bar). Recreating the plots from scratch did not change anything. When I change the plot to data points I get correct plots even without reducing color depth. I am afraid I will be forced to experiment a little bit further. Anyway, thank you for your valuable help (as usual). Filip

Announcements
Top Tags