Skip to main content
added 6 characters in body; edited tags
Source Link
Kuba
  • 138.9k
  • 13
  • 297
  • 803
tt = Flatten[Table[{x, y, z, btot[x, y, z]}, {x, -1, 1, 0.1}, {y, -1, 1,0.1}, {z, -1, 1, 0.1}], 2]; ff = Interpolation[tt] 

Till here it is working fine as it is returning the values of the interpolated function at various {x,y,z}{x,y,z} points. Then

Then I want to find the gradient of this interpolated function. But when I am using ffd[x_,y_,z_]:= D[ff[x,y,z],{{x,y,z}}] I

ffd[x_,y_,z_]:= D[ff[x,y,z],{{x,y,z}}] 

I am not getting the gradient.

tt = Flatten[Table[{x, y, z, btot[x, y, z]}, {x, -1, 1, 0.1}, {y, -1, 1,0.1}, {z, -1, 1, 0.1}], 2]; ff = Interpolation[tt] 

Till here it is working fine as it is returning the values of the interpolated function at various {x,y,z} points. Then I want to find the gradient of this interpolated function. But when I am using ffd[x_,y_,z_]:= D[ff[x,y,z],{{x,y,z}}] I am not getting the gradient.

tt = Flatten[Table[{x, y, z, btot[x, y, z]}, {x, -1, 1, 0.1}, {y, -1, 1,0.1}, {z, -1, 1, 0.1}], 2]; ff = Interpolation[tt] 

Till here it is working fine as it is returning the values of the interpolated function at various {x,y,z} points.

Then I want to find the gradient of this interpolated function. But when I am using

ffd[x_,y_,z_]:= D[ff[x,y,z],{{x,y,z}}] 

I am not getting the gradient.

Source Link
Hippo
  • 23
  • 2

Gradient of interpolated 3D data in mathematica 9

tt = Flatten[Table[{x, y, z, btot[x, y, z]}, {x, -1, 1, 0.1}, {y, -1, 1,0.1}, {z, -1, 1, 0.1}], 2]; ff = Interpolation[tt] 

Till here it is working fine as it is returning the values of the interpolated function at various {x,y,z} points. Then I want to find the gradient of this interpolated function. But when I am using ffd[x_,y_,z_]:= D[ff[x,y,z],{{x,y,z}}] I am not getting the gradient.