Re: Dt "gradient" (dumb title, sorry)
- To: mathgroup at smc.vnet.net
- Subject: [mg81082] Re: Dt "gradient" (dumb title, sorry)
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Tue, 11 Sep 2007 05:22:17 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <fc4ht0$e8q$1@smc.vnet.net>
Chris Chiasson wrote: > I wanted a list of different total derivatives, so I fed in the > familiar {{vars},n} syntax to Dt. Dt took it without complaint, but I > don't trust the results: The "familiar {{vars, n} syntax" is explicitly documented for the partial derivative operator D only. I have found no reference or mention of this syntax for the total derivative operator in the documentation center, the 5.2 online help, the Mathematica book, and Michael Trott's work. (Of course this does not mean that such references do not exist, but they seem hard to find.) > In[1]:= Dt[z[x,y],{x,1}] > Dt[z[x,y],{y,1}] > Dt[z[x,y],{{x,y},1}] > > (*this paste of "copy as plain text" shows derivatives as exponents; > it's not my doing and isn't the subject of this post*) > Out[1]= Dt[y,x] (z^(0,1))[x,y]+(z^(1,0))[x,y] > Out[2]= (z^(0,1))[x,y]+Dt[x,y] (z^(1,0))[x,y] > Out[3]= {(z^(1,0))[x,y],(z^(0,1))[x,y]} > > I think out 3 should be a list containing the expression for out 1 and > the expression for out 2. It seems like Dt decided to ignore the > dependence of y on x in the first entry, and the dependence of x on y > in the second entry. Another explanation (or interpretation of this behavior) is that whenever Dt is fed with an argument of the form {{vars}, n} Dt calls D instead and we get a list of partial derivatives. That would explain why Dt does not complain and produces a result identical to D's. In[1]:= Dt[z[x, y], {{x, y}, 1}] Out[1]= (1,0) (0,1) {z [x, y], z [x, y]} In[2]:= D[z[x, y], {{x, y}, 1}] Out[2]= (1,0) (0,1) {z [x, y], z [x, y]} > Please let me know if my interpretation/expectation is wrong. Thanks. You can mimic the behavior of D and get the expected result with Dt using Thread and a one dimensional list of variables as in In[3]:= Thread[Dt[z[x, y], #] &[{x, y}]] Out[3]= (0,1) (1,0) {Dt[y, x] z [x, y] + z [x, y], (0,1) (1,0) z [x, y] + Dt[x, y] z [x, y]} Best regards, -- Jean-Marc