# Multidimensional Interpolation with knots condition?

Hi Everyone!
I am trying to make up an interpolated multidimansional function with 5 dimensions and 1 variable. In this case:

``````X1 X2 X3 X4 X5 Density

X1=Tempertaure
X2=Preassure
X3 to X5: % of composition of 3 elements
Density.
``````

So, in my data table I have something like:

``````   #X1      X2     X3    X4     X5    Density1 Density2 Density3
200.0    0.5    0.0   70.0   30.0  6.2762  3.2896  2.6654
400.0    0.2    0.0   70.0   30.0  6.2085  3.2603  2.643
1000.0  0.6    0.0   90.0   10.0  6.3092  3.273   2.6636
``````

FULL DATAFILE at: SWF/Data.txt at main · marianoarnaiz/SWF · GitHub

So X1 and X2 are sampled

``````
X1=[200 400 600 800 1000]
X2=[0.0 0.1 0.2 0.3 0.4 0.5 0.6]
``````

But X3 to X5 have a condition, they must sum = 100.

So:
`[215 0.05 75 12.5 12.5] #Should exist from the interpolation`

But:
`[215 0.05 100 10 10] #Should NOT exist from the interpolation.`

When I am building my interpolation function:

``````
knots = ([t for t in X1], [p for p in X2], [qz for qz in X3], [cl for cl in X4], [cy for cy in X5]);
Density = interpolate(knots, D_M, Gridded(Linear()));
``````

I need to create a D_M (Density multidimensional array). I have tried filling it with missing, NaN, Big values… It all gives me problems because I can only evaluate in the nodes with data and Interpolation in a none knot gives me a problem.

Any ideas?