       Re: Bypassing built-in functions in differentiation

• To: mathgroup at smc.vnet.net
• Subject: [mg62640] Re: Bypassing built-in functions in differentiation
• From: Peter Pein <petsie at dordos.net>
• Date: Wed, 30 Nov 2005 00:06:23 -0500 (EST)
• References: <dmh8hi\$8n7\$1@smc.vnet.net> <dmhfcv\$bfj\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Ofek Shilon schrieb:
>
> Hi Peter .
>
> The results
>
> In:= Dt[Transpose[a]]
> Out= 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:= Dt[Transpose[a]]
> Out:=Transpose[Dt[a]]
>
> That is, I cannot waive the Transpose head on the derivative.
>
Oops, I didn't read carefully - sorry.

> Since my former post, I started using the following hack:
>
> In:= 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'm currently testing
Unprotect[Transpose, Dt];
Dt[Transpose[x_]] := Transpose[Dt[x]];
Derivative[Transpose][x_] :=
If[Dt[x] === 0, 0, Transpose[Dt[x]]/Dt[x]];

but have got difficulties to understand the meaning of Transpose (or
any other scalar).

>
>
> 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:=
> ScalarQ[Dt[f_,y_]]:=True /;TrueQ[ScalarQ[f]]
>
> In:=
> ScalarQ[x]=True
>
> In:=
> ScalarQ[Dt[x,y]]
>
> Out=
> ScalarQ[Dt[x,y]]
>
> Out=
> True
>
> Maybe Dt and its cousins (Derivative, D) undergo unconventional
> evaluation that I'm unaware of?

It is the pattern Dt[f_,y_] which evaluates to
Dt[f, y_]*Derivative[1, 0][Pattern][f, _], because
FullForm[HoldPattern[Dt[f_,y_]]] is
HoldPattern[Dt[Pattern[f, Blank[]], Pattern[y, Blank[]]]].

ScalarQ behaves as expected, when it is defined via HoldPattern:

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

>
>
> Ofek
>

Regards,
Peter

```

• Prev by Date: 3D Plot of frequency data
• Next by Date: Re: storage, compatibility and HP98xx
• Previous by thread: Re: Bypassing built-in functions in differentiation
• Next by thread: Re: Bypassing built-in functions in differentiation