0
$\begingroup$

I need to interpolate a function defined on a triangular surface (grid). The grid is defined as

l=50; 
Ω = 
  Flatten[
    Table[
      {(i1 - 9/10)/(2*l), 
       (i2 - 9/10)/(2*l), 
       1 - (i1 - 9/10)/(2*l) - (i2 - 9/10)/(2*l)}, 
      {i1, 1, 2*l}, {i2, 1, 2*l - i1 + 1}],
    0];

The grid thus consists of a set of 5050 (x,y,z) coordinates. The function, $f(x,y,z)$, then has a value every point of Ω. Let's say the function is constant, i.e. the data for the interpolation is

data = 
  Transpose[
    {ArrayReshape[Ω[[All, All, {1, 2, 3}]], {Length[loc[[All, 1]]], 3}], 
     Table[1,{i,1,5050}]}];

Using Interpolation on this data Interpolation[data] gives me the following messages:

Interpolation::udeg: Interpolation on unstructured grids is currently only supported for InterpolationOrder->1 or InterpolationOrder->All. Order will be reduced to 1. >> TetGenTetrahedralize::err: Tetrahedralize returned an error. >> TetGenDelaunay::tetgpts: The points could not be extracted from the TetGen instance. >> Interpolation::umesh: Unable to find a mesh from the points {{0.001,0.001,0.998},{0.001,0.011,0.988},{0.001,0.021,0.978},{0.001,0.031,0.968},{0.001,0.041,0.958},{0.001,0.051,0.948},{0.001,0.061,0.938},{0.001,0.071,0.928},<<36>>,{0.001,0.441,0.558},{0.001,0.451,0.548},{0.001,0.461,0.538},{0.001,0.471,0.528},{0.001,0.481,0.518},{0.001,0.491,0.508},<<5000>>} for interpolation. >>

The error is due to the grid. I tried using InterpolatingPolynomial, and the NonGridInterpolation package, but to no avail. My question is: how do I obtain interpolated $f(x,y,z)$ from function values over this grid?

$\endgroup$
  • 2
    $\begingroup$ Your data points lie entirely in a 2D plane, so it is not possible to perform interpolation across 3D space. Maybe discard one of the three coordinates and perform 2D interpolation? $\endgroup$ – Rahul Jan 3 '16 at 8:38
  • $\begingroup$ Yes, I tried 2D interpolation as well. But I was getting a similar error. But then I came across this link: mathematica.stackexchange.com/questions/77786/…, and this seems to have solved my issue. Thanks. $\endgroup$ – Majid Hasan Jan 5 '16 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.