I have a dataset in this form (but much bigger of course):
{{0.01, 0.227202, 1030., 44., 1555.63, 4.72143},
{0.01, 0.227202, 1030., 84., 2969.85, 4.806},
{0.01, 0.227202, 1030., 124., 4384.06, 4.82289},
{0.1, -0.169967, 1030., 440., 1555.63, 12.1294},
{0.1, -0.169967, 1030., 840., 2969.85, 12.5309}}
where the last (6th) value in each nested list is the dependent variable and the first five are independent. I've made this list by scanning across the dependent variable and solving DE's yielding a result (6th value).
I want to create an interpolating function out of the list. I am able to make such functions (example code):
data = Flatten[Table[{x, y, z, x^2*y*z^2}, {x, 1, 50, 10}, {y, 1, 50, 10}, {z, 1,
50, 10}], 2]
dataint = Interpolation[data, InterpolationOrder -> 1]
this seems to work, generating a similarly structured nested list as my actual dataset, and with random test values:
dataint[14.21, 27.54, 21.99]
I am able to get the interpolated value for the 4th parameter of the lists in 'data', taken here to be the dependent variable. I can plot regions: RegionPlot[dataint[x, y, 1] < 500, {x, 1, 50}, {y, 1, 50}]
etc.
How would I create an interpolating function out of my dataset? It has 5 independent variables, and one dependent one. Eventually I want to be able to generated interpolated values (as with dataint) as well as make 2D and 3D plots and regionplots where all but 2 or 3 of the independent variables are kept constant.
Using the following suggestion from Lukas Lang in comments unfortunately highlights further problems:
Interpolation[{Most@#, Last@#} & /@ data]
In fact, the above returns:
Interpolation::indim: The coordinates do not lie on a structured tensor product grid.
How can I get around that?
Interpolation[{Most@#, Last@#} & /@ data]
? $\endgroup$Interpolation::indim: The coordinates do not lie on a structured tensor product grid.
$\endgroup$The order-1 derivative of 0.227202 is not a tensor of rank 1 with dimensions 2.
$\endgroup$