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: [mg62625] Re: Bypassing built-in functions in differentiation
  • From: "Ofek Shilon" <ofek at simbionix.com>
  • Date: Tue, 29 Nov 2005 06:44:04 -0500 (EST)
  • References: <dmh8hi$8n7$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

> 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
>

Hi Peter .

The results

In[3]:= Dt[Transpose[a]]
Out[3]= Dt[a]

Are EXACTLY what I wish to avoid. ( as I wrote, I'm already able to
reproduce them). what I hope to accomplish is smthng like -

In[2345]:= Dt[Transpose[a]]
Out[2345]:=Transpose[Dt[a]]

That is, I cannot waive the Transpose head on the derivative.

Since my former post, I started using the following hack:

In[1]:= Transpose'[x_]:=Transpose[Dt[x]] / Dt[x]

Which compensates 'manually' for the Dt[x] factor formed by direct
differentiation, but is still unsatisfactory - since it fails whenever
Dt[x] is set externally to zero.


I often encounter seemingly strange behaviour from differentiation-
heads. My overall experience is that Dt resists manual intervention in
many ways that produce unpredictable results. Try the following input:

In[25]:=
ScalarQ[Dt[f_,y_]]:=True /;TrueQ[ScalarQ[f]]
ScalarQ[TestHead[f_,y_]]:=True /;TrueQ[ScalarQ[f]]

In[31]:=
ScalarQ[x]=True

In[33]:=
ScalarQ[Dt[x,y]]
ScalarQ[TestHead[x,y]]

Out[33]=
ScalarQ[Dt[x,y]]

Out[34]=
True

Maybe Dt and its cousins (Derivative, D) undergo unconventional
evaluation that I'm unaware of?


Ofek


  • Prev by Date: Re: Bypassing built-in functions in differentiation
  • Next by Date: Re: Get numbers out of PhysicalConstants?
  • Previous by thread: Re: Bypassing built-in functions in differentiation
  • Next by thread: Bypassing built-in functions in differentiation