2
$\begingroup$

Interpolation should work fine on an unstructured array of machine numbers with interpolation order 1. However, when both the arguments and output are multidimensional, it doesn't evaluate. The first five interpolations below work fine, whereas the last one returns unevaluated.

array1 = {#, RandomReal[]} & /@ Tuples[Range@4, 2];
array2 = {#, RandomReal[1, 2]} & /@ Range@4;
array3 = {#, RandomReal[1, 2]} & /@ Tuples[Range@4, 2];
Interpolation@array1
Interpolation@array2
Interpolation@array3
Interpolation[N@Delete[array1, 1], InterpolationOrder -> 1]
Interpolation[N@Delete[array2, 1], InterpolationOrder -> 1]
Interpolation[N@Delete[array3, 1], InterpolationOrder -> 1]
$\endgroup$
3
  • $\begingroup$ InterpolationOrder -> All $\endgroup$
    – cvgmt
    Commented Jan 3, 2022 at 0:46
  • $\begingroup$ @cvgmt Interesting. I don't find anything in the documentation that explains why that's needed or why it would work. Regardless, it gives outrageous values. Interpolation[N@Delete[array3, 1], InterpolationOrder -> All][2, 2.01] can yield {-8.34406*10^9, -4.49641*10^10} $\endgroup$
    – H.v.M.
    Commented Jan 3, 2022 at 1:01
  • 2
    $\begingroup$ Related: Meaning of InterpolationOrder -> All for multidimensional interpolation. $\endgroup$
    – MarcoB
    Commented Jan 3, 2022 at 3:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.