Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.2K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

ListInterpolation help?

Posted 12 years ago
POSTED BY: Paul Reiser
4 Replies
Posted 12 years ago

Hi Ilian - The real problem I have is somewhat less complicated. I have an unstructured {xa,ya} and I want to calculate the corresponding {x,y} which is structured; it has equal increments in x and y. That means I can use Interpolation[ ] to interpolate from {x,y} to {xa,ya}, but not from {xa,ya} to {x,y}, which is what I want.

What I guess I will have to do is use the F[{x,y}]={xa,ya} interpolation, and then use FindMinimum[ ] to find the {x,y} that minimizes [ F[{x,y}] - {xa,ya} ]^2

Does that sound like the best way to do it?

POSTED BY: Paul Reiser
POSTED BY: Ilian Gachevski
Posted 12 years ago

Hmm - that's not doing it. If I use p (no random added), the above gives {6.5,6.5}, not the {6.25,6.25) that I need, because it's using InterpolationOrder->1, but if I remove the InterpolationOrder->1, it gives me the unstructured grid problem again, and forces the interpolation order to 1.

POSTED BY: Paul Reiser

Try interpolating separately for each output component.

In[4]:= if1 = Interpolation[Transpose[{pp[[All, 1]], pp[[All, 2, 1]]}], InterpolationOrder -> 1];
        if2 = Interpolation[Transpose[{pp[[All, 1]], pp[[All, 2, 2]]}],  InterpolationOrder -> 1];
        if[x_, y_] := {if1[x, y], if2[x, y]}
        if[2.5, 2.5]

Out[7]= {6.19335, 6.35006}
POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard