I have produced a set of points in a variable of the type {{x1, y1}, z1},{{x2, y2}, z2}, ,... }
, where {x, y}
should be the arguments of the function and z
is the associated value. What I need to obtain is the continuous function in order to generate z
for any value of {x, y}
in the domain implicit in the data.
As I understand it, a good way to do this would be to use a 2D Spline. At first I had an unstructured grid, but with the help of the community, now I've produced a grid and values of this form (the real list has been "thinned"):
{{{0.11, 0.1}, 0.621687}, {{0.11, 0.3}, 0.674455}, {{0.11, 0.5}, 0.743462},
{{0.11, 0.7}, 0.803179}, {{0.11, 0.9}, 0.843444}, {{0.11, 1.1}, 0.866607},
{{0.11, 1.3}, 0.881172}, {{0.11, 1.5}, 0.890488}, {{0.11, 1.7}, 0.896887},
{{0.11, 1.9}, 0.901538}, {{0.11, 2.1}, 0.905067}, {{0.11, 2.3}, 0.907836},
{{0.11, 2.5}, 0.910066}, {{0.11, 2.7}, 0.911902}, {{0.11, 2.9}, 0.913404},
(*==============delimiter==================*)
{{0.15, 0.1}, 0.15}, {{0.15, 0.3}, 0.15}, {{0.15, 0.5}, 0.15},
{{0.15,0.7}, 0.414754}, {{0.15, 0.9}, 0.648793}, {{0.15, 1.1}, 0.768185},
{{0.15, 1.3}, 0.832127}, {{0.15, 1.5}, 0.862517}, {{0.15, 1.7}, 0.879246},
{{0.15, 1.9}, 0.889989}, {{0.15, 2.1}, 0.897541}, {{0.15, 2.3}, 0.90316},
{{0.15, 2.5}, 0.907512}, {{0.15, 2.7}, 0.910985}, {{0.15, 2.9}, 0.913761},
(*==============delimiter==================*)
{{0.19, 0.1}, 0.19}, {{0.19, 0.3}, 0.19}, {{0.19, 0.5}, 0.19},
{{0.19,0.7}, 0.19}, {{0.19, 0.9}, 0.402054}, {{0.19, 1.1}, 0.658819},
{{0.19, 1.3}, 0.81877}, {{0.19, 1.5}, 0.871256}, {{0.19, 1.7}, 0.88874},
{{0.19, 1.9}, 0.898598}, {{0.19, 2.1}, 0.905459}, {{0.19, 2.3}, 0.910567},
{{0.19, 2.5}, 0.914527}, {{0.19, 2.7}, 0.917694}, {{0.19, 2.9}, 0.920228}}
Further, I use:
fspl = Interpolation[Xac, Method -> "Spline", InterpolationOrder -> 2]
and obtain, in principle, satisfying results if I could get the expression for the spline (for use outside Mathematica). Searching on stackexchange shows that people have had similar problems, but I found no evident solution. I tried to use fspl["Methods"]
, but the list it returns does not seem to be really helpful.
Interpolation[]
. $\endgroup${x, y}
pairs with different z values. Also,Interpolation
will not give you the form of the interpolating function, it will just allow you to get values in between your grid points. To actually get the spline function is a nontrivial task. $\endgroup$dat
thenSelect[# > 1 &]@Counts[Most /@ dat]
selects one such duplicate pair. $\endgroup$