MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Partial derivative function definitions


Hello,
Can someone please explain me why the following partial derivative 
function definitions do not work? I get errors like:
General::ivar: -6.28229 is not a valid variable. >>
General::ivar: -5.38469 is not a valid variable. >>
General::ivar: -4.48709 is not a valid variable. >>
General::stop: Further output of General::ivar will be suppressed during 
this calculation. >>

Thanks for helping!
Mat




XFunction[x_, y_] := Sin[x] Sin[y];
YFunction[x_, y_] := Cos[x] Cos[y];
dXFunctiondx[x_, y_] := D[XFunction[x, y], x];
dXFunctiondy[x_, y_] := D[XFunction[x, y], y];
dYFunctiondx[x_, y_] := D[YFunction[x, y], x];
dYFunctiondy[x_, y_] := D[YFunction[x, y], y];

Grid[{
   {
    DensityPlot[
     XFunction[x, y], {x, -2 \[Pi], 2 \[Pi]}, {y, -2 \[Pi], 2 \[Pi]}]
    , DensityPlot[
     YFunction[x, y], {x, -2 \[Pi], 2 \[Pi]}, {y, -2 \[Pi], 2 \[Pi]}]
    }
   , {
    DensityPlot[
     dXFunctiondx[x, y], {x, -2 \[Pi], 2 \[Pi]}, {y, -2 \[Pi], 2 \[Pi]}]
    , DensityPlot[
     dYFunctiondx[x, y], {x, -2 \[Pi], 2 \[Pi]}, {y, -2 \[Pi], 2 \[Pi]}]
    }
   , {
    DensityPlot[
     dXFunctiondy[x, y], {x, -2 \[Pi], 2 \[Pi]}, {y, -2 \[Pi], 2 \[Pi]}]
    , DensityPlot[
     dYFunctiondy[x, y], {x, -2 \[Pi], 2 \[Pi]}, {y, -2 \[Pi], 2 \[Pi]}]
    }
   }]



  • Prev by Date: Using Mathematica Workbench to debug compiled functions ??
  • Next by Date: Re: Data Format
  • Previous by thread: Using Mathematica Workbench to debug compiled functions ??
  • Next by thread: Re: Partial derivative function definitions