- #1

- 14

- 0

## Main Question or Discussion Point

Hi,

I faced a problem (in Mathematica) when trying to plot a partial

derivative of a functiona (of two variables) obatined by "Interpolation".

More precisely, here is my input:

surf=Interpolation[{

{{160.0, 160.0}, 2.852688},

{{160.0, 170.0}, 2.827547},

{{160.0, 180.0}, 2.818931},

{{160.0, 190.0}, 2.826640},

{{160.0, 200.0}, 2.851483},

{{170.0, 160.0}, 2.861634},

{{170.0, 170.0}, 2.832750},

{{170.0, 180.0}, 2.822240},

{{170.0, 190.0}, 2.830275},

{{170.0, 200.0}, 2.858395},

{{180.0, 160.0}, 2.862344},

{{180.0, 170.0}, 2.831671},

{{180.0, 180.0}, 2.820786},

{{180.0, 190.0}, 2.831775},

{{180.0, 200.0}, 2.862605},

{{190.0, 160.0}, 2.857940},

{{190.0, 170.0}, 2.830020},

{{190.0, 180.0}, 2.822137},

{{190.0, 190.0}, 2.832657},

{{190.0, 200.0}, 2.861574},

{{200.0, 160.0}, 2.850865},

{{200.0, 170.0}, 2.826201},

{{200.0, 180.0}, 2.818547},

{{200.0, 190.0}, 2.827127},

{{200.0, 200.0}, 2.852228}

}]

s1=Function[{a,b},surf[a,b]]

da=Function[{a,b},D[s1[a,b],a]]

Plot3D[da[a, b], {a, 175.0, 185.0}, {b, 175.0, 185.0}]

When running this input Mathematica gives the error:

General::ivar: 175.00071499999999` is not a valid variable

Any help will be greatly appreciated !!!

Many thanks!

Best,

Evgeniy

I faced a problem (in Mathematica) when trying to plot a partial

derivative of a functiona (of two variables) obatined by "Interpolation".

More precisely, here is my input:

surf=Interpolation[{

{{160.0, 160.0}, 2.852688},

{{160.0, 170.0}, 2.827547},

{{160.0, 180.0}, 2.818931},

{{160.0, 190.0}, 2.826640},

{{160.0, 200.0}, 2.851483},

{{170.0, 160.0}, 2.861634},

{{170.0, 170.0}, 2.832750},

{{170.0, 180.0}, 2.822240},

{{170.0, 190.0}, 2.830275},

{{170.0, 200.0}, 2.858395},

{{180.0, 160.0}, 2.862344},

{{180.0, 170.0}, 2.831671},

{{180.0, 180.0}, 2.820786},

{{180.0, 190.0}, 2.831775},

{{180.0, 200.0}, 2.862605},

{{190.0, 160.0}, 2.857940},

{{190.0, 170.0}, 2.830020},

{{190.0, 180.0}, 2.822137},

{{190.0, 190.0}, 2.832657},

{{190.0, 200.0}, 2.861574},

{{200.0, 160.0}, 2.850865},

{{200.0, 170.0}, 2.826201},

{{200.0, 180.0}, 2.818547},

{{200.0, 190.0}, 2.827127},

{{200.0, 200.0}, 2.852228}

}]

s1=Function[{a,b},surf[a,b]]

da=Function[{a,b},D[s1[a,b],a]]

Plot3D[da[a, b], {a, 175.0, 185.0}, {b, 175.0, 185.0}]

When running this input Mathematica gives the error:

General::ivar: 175.00071499999999` is not a valid variable

Any help will be greatly appreciated !!!

Many thanks!

Best,

Evgeniy