Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Bypassing built-in functions in differentiation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62621] Re: Bypassing built-in functions in differentiation
  • From: Peter Pein <petsie at dordos.net>
  • Date: Tue, 29 Nov 2005 06:43:26 -0500 (EST)
  • References: <dmh8hi$8n7$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Ofek Shilon schrieb:
> Dear MathGroup.
> 
> consider the following statement:
> 
> Dt[Transpose[a]]
> 
> which evaluates to
> 
> Dt[a] Transpose`[a]
> 
> that is, mathematica treats Transpose as a function and uses the chain
> rule. i can try and bypass this behaviour manually:
> 
> Unprotect[Dt];
> Dt[Transpose[x_]] := Transpose[Dt[x]]
> 
> but now consider expressions like -
> 
> Dt[Transpose[a].b]
> 
> which still produces:
> 
> Transpose[a].Dt[b] + Dt[a] Transpose`[a] b
> 
> which is a bit surprising. i can of course bypass this behaviour
> manually as well:
> 
> Dt[Transpose[x_].y_] := Transpose[Dt[x]].y + Transpose[x].Dt[y]
> 
> which gives the desired result, but then check the following -
> Dt[(Transpose[a].b)^2]
> 
> etc. etc.
> 
> i tried also to define -
> Dt[Transpose[x_]] =1
> 
> which produces readable results, but discards the (correct, and needed)
> 'Transpose' head over a factor in the differentiation.
> 
> There has to be a general solution. is there a 'hook' where i can
> interfere with the derivative computation? (i thought user definitions
> would suffice, but apparently not)
> 
> 
> thanks,
> 
> Ofek
> 
Hi Ofek,

dig a little deeper and change Transpose' :

In[1]:= Unprotect[Transpose];
   Derivative[1][Transpose] ^= 1 &
Out[2]= 1&
In[3]:= Dt[Transpose[a]]
Out[3]= Dt[a]
In[4]:= Dt[Transpose[a] . b]
Out[4]= Dt[a].b+Transpose[a].Dt[b]
In[5]:= Dt[(Transpose[a] . b)^2]
Out[5]= 2 Transpose[a].b (Dt[a].b+Transpose[a].Dt[b])

etc.

Peter


  • Prev by Date: Re: How does NIntegrate suppress messages?
  • Next by Date: Re: Bypassing built-in functions in differentiation
  • Previous by thread: Re: 3D plot question
  • Next by thread: Re: Bypassing built-in functions in differentiation