Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.8K Views
|
3 Replies
|
1 Total Like
View groups...
Share
Share this post:

Interpolation of function of two variables over very large range

Posted 6 years ago
3 Replies

First I would like to remark that with the ti's you gave above you don't cover the whole (square) region where your function may be defined. The ti's form something like a "diagonal" region.

Second I would really like to know what an "unstructured grid " is.

But perhaps you can get what you want by a modified approach. Let n be the exponent (of 10) of your highest number. Then define for example

n = 3;
elim = Range[0, n]
f[x_, y_] := x^2/5 + Sqrt[y]

and

values[i_, j_] := Module[{a, b, x, y},
a = 10^i;
b = 10^j;
Flatten[
Table[{{x = a (1 + 9 u), y = b (1 + 9 v)}, f[x, y]}, {u, 0, 1, .2}, {v, 0, 1, .2}], 1]
]

For more datapoints you should change the .2 to .1 in the iterators.

Then

intpol = Table[
   Interpolation[values[i, j]],
   {i, 1, Length[elim]}, {j, 1, Length[elim]}];

and

func[x_, y_] := 
intpol[[IntegerPart[Log[10, x]], IntegerPart[Log[10, y]]]][x, y]

will call the appropriate interpolation-function

POSTED BY: Hans Dolhaine
Posted 6 years ago
POSTED BY: Bill Nelson
Posted 6 years ago

Thank you! This indeed work for these simplest cases, as there is a single table of values with the same spacing. However, I would be still interested in knowing if there is a way to actually interpolate by joining different tables of the same function with different spacings in different intervals, or whether this is really not possible in Mathematica. Thank you again, Best Fabrizio

POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard