# Multidimensional Interpolation with knots condition?

**URL:** <https://discourse.julialang.org/t/multidimensional-interpolation-with-knots-condition/62869>\
**Category:** General Usage\
**Tags:** question, interpolations\
**Created:** [June 14, 2021, 9:29am UTC](https://discourse.julialang.org/t/multidimensional-interpolation-with-knots-condition/62869 "2021-06-14T09:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marianoarnaiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marianoarnaiz/32/19377_2.png) [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Post date:** [June 14, 2021, 9:29am UTC](https://discourse.julialang.org/t/multidimensional-interpolation-with-knots-condition/62869/1 "2021-06-14T09:29:51Z")

</div>

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

```julia
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:

```julia
   #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](https://github.com/marianoarnaiz/SWF/blob/main/Data.txt)

So X1 and X2 are sampled

```julia

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:

```julia

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?
