0
$\begingroup$

I have a list of rules to the values of the derivatives of a generic (real valued, 3 variables) function, for example: df/dxdydz(0,0,0)-> 0.7. I would like to be able to generically reference this derivatives as in: give me the value for the function differentiated twice at the first argument, once at the second argument and none at the third argument. How can I do this? Ideally, I would be able to just assign the value given by the rules to the derivatives itself, but I cant seem to work around on that. Thanks.

$\endgroup$
2
  • 1
    $\begingroup$ Could you give an example list of rules as a Mathematica code? $\endgroup$
    – ybeltukov
    Commented Jan 17, 2015 at 18:16
  • $\begingroup$ {(g^(0,0,1))[-1.79324,0,0]->0.,(g^(0,1,0))[-1.79324,0,0]->0.841743,(h^(0,0,1))[-1.79324,0,0]->0.,(h^(0,1,0))[-1.79324,0,0]->1.39703,(h^(1,0,0))[-1.79324,0,0]->0.419109,(g^(1,0,0))[-1.79324,0,0]->0.252523,(g^(0,0,2))[-1.79324,0,0]->-0.192144,(h^(0,0,2))[-1.79324,0,0]->0.482044,(g^(0,1,1))[-1.79324,0,0]->0.,(h^(0,1,1))[-1.79324,0,0]->0.,(g^(0,2,0))[-1.79324,0,0]->-0.0568662,(h^(0,2,0))[-1.79324,0,0]->-0.077802,(g^(1,0,1))[-1.79324,0,0]->0.,(h^(1,0,1))[-1.79324,0,0]->0.,(g^(1,1,0))[-1.79324,0,0]->-0.0170599,(h^(1,1,0))[-1.79324,0,0]->-0.0233406 $\endgroup$
    – user191919
    Commented Jan 17, 2015 at 19:29

1 Answer 1

1
$\begingroup$

If all you want is to define the derivatives at certain points, then you can simply do it as follows:

Derivative[0, 0, 1][g][-1.79324, 0, 0] = 0

(* ==> 0 *)

Derivative[0, 1, 0][g][-1.79324, 0, 0] = 0.841743

(* ==> 0.841743 *)

Here I'm testing the assignments in a different notation:

D[g[x, y, z], z] /. Thread[{x, y, z} -> {-1.79324, 0, 0}]

(* ==> 0 *)

D[g[x, y, z], y] /. Thread[{x, y, z} -> {-1.79324, 0, 0}]

(* ==> 0.841743 *)
$\endgroup$
2
  • $\begingroup$ Hi thanks for the answer. What if I had such a list of generic derivative, but would all of them to be evaluated at a particular point. For example: {D[f[x,y],x],D[f[x,y],y]}, but I would like: {D[f[x,y],x][0,0],D[f[x,y],y][0,0]}. Is there anyway I can append the [0,0] to every element of the initial list? $\endgroup$
    – user191919
    Commented Jan 29, 2015 at 16:16
  • $\begingroup$ Yes, e.g. like this: {D[f[x, y], x], D[f[x, y], y]} /. Thread[{x, y} -> {0, 0}]. Or also Through[Through[{Derivative[1,0],Derivative[0,1]}[f]][x,y]]. $\endgroup$
    – Jens
    Commented Jan 29, 2015 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.