I am looking for a way for variable partitioning of the data in the form of a "list of lists" for interpolating the imported data from excel. The data looks like:
data = {
{{5., 9.53333, 0.057735}, {5., 19.3333, 0.057735}, {5.,29.2667, 0.057735},
{5., 39.0667, 0.11547}, {5., 49., 0.}, {10., 11., 0.}, {10., 22.4, 4.35117*10^-15},
{10., 33.6667, 0.057735}, {10., 45.1, 0.}, {10., 56.3333, 0.11547},
{15., 12.4667, 0.057735}, {15., 25.2667, 0.057735}, {15., 38., 0.1},
{15., 50.9333, 0.057735}, {15., 63.7667, 0.057735}, {20., 13.8333, 0.057735},
{20., 28.1, 0.1}, {20., 42.3667, 0.057735}, {20., 56.5333, 0.057735},
{20., 70.8667, 0.152753}}
}
Now I want to interpolated this data using Interpolation
function but the problem is that Interpolation
needs the data in the form:
{{5., 9.53333}, 0.057735}, {{5., 19.3333}, 0.057735},...}
Without bothering about this form, if I try to Interpolate using command:
f = Interpolation[data[[1]], InterpolationOrder -> 2]
it interpolates but produces a warning as well:
Interpolation::udeg: Interpolation on unstructured grids is currently only supported for InterpolationOrder -> 1 or InterpolationOrder -> All. Order will be reduced to 1.
I would have been happy if the 3D plot of f[x,y]
would have been a bit better than this (I hate spikes in the plot):
Overall, I think that the problem can be resolved by supplying "structured grids" to the Interpolation
command and that's where I have got stuck. I need to arrange the data as it is required in the Interpolation
command. I have also checked Mr Wizard's solution for [dynamic partitioning](Partitioning with varying partition size"list manipulation - Partitioning with varying partition size") but it dose not work (or I must say - I could not make it work) in this case. I have got a feeling that some modification in that will do the job but I do not know the workaround for that.
So the question is how to do that?