I cannot get the partial derivative of a set of data. I managed to get the accurate interpolation, but I cannot evaluate its derivatives.
Here are my details:
data = Import["data.dat"];
The data set looks like this:
In[]=
data[[38;;49]]
Out[]=
{
{2, 38, -0.000307893533656},
{2, 39, -0.000307922246488},
{2, 40, -0.000307952337061},
{3, 0, -0.000461750353095},
{3, 1, -0.000462600240141},
{3, 2, -0.000463450127186},
{3, 3, -0.000464294338731},
{3, 4, -0.000464294338731}
}
The 3D Interpolation looks good:
pot = Interpolation[data]
And the Plot3D does too:
ListPlot3D[data, ColorFunction -> "SouthwestColors"]
There is a slight change along y (unnoticeable from Plot3D), I want to get the derivative for this function (which is along y):
Plot[ pot[50, y], {y, 0, 40} ]
When I use Derivative
I get this, unable to even extract a value:
pot'[50, y]
pot'[50,3]
Not getting a function at all...
Plot[pot'[50, y], {y, 0, 40}]
What is the smart way to get the gradient of the 3D interpolated function? I also tried 'Gradient' without success:
Gradient[pot[x, y]]
VectorPlot[Gradient[pot[x, y]], {x, 0, 100}, {y, 0, 40}]
What must I do?