MathGroup Archive 2008

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

Search the Archive

Re: Automatic Differentiation in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85594] Re: Automatic Differentiation in Mathematica
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 14 Feb 2008 06:27:46 -0500 (EST)
  • References: <foumc1$qv0$1@smc.vnet.net> <fp0kus$5cs$1@smc.vnet.net>


Hi Marco,

now that I have understood what Automatic Differentiation means, I can 

give an answer.

To implement the "2 dimensional" numbers we may define a new typ with 

head e.g. aD (automatic Diff, it is custom to begin user specific stuff 

with lowercase). We then define rules for our data. E.g.:

Clear[aD];

aD/: aD[x1_,y1_]+ aD[x2_,y2_]= aD[x1+x2,y1+y2];

aD/: aD[x1_,y1_]- aD[x2_,y2_]= aD[x1-x2,y1-y2];

aD/: aD[x1_,y1_]* aD[x2_,y2_]= aD[x1*x2,x1*y2+y1*x2];

aD/: aD[x1_,y1_]^n_/;n!=0= aD[x1^n,n x1^(n-1) y1];

with this defined we may say:

aD[x1,1]+aD[x1,1]^-1  what yields:

aD[1/x1+x1,1-1/x1^2]

hope this helps, Daniel



Daniel Huber wrote:

> Hi marco,

> can you please explain what you mean by:

> "Differentiation of an algorithm"

> Usually we differentiate functions. For symbolic differentiation there 

> is D and Dt. For numeric differentiation there is ND

> sincerely, Daniel

> 

> Marco Gabiccini wrote:

>> Hi,

>>

>> I was wondering if any of you know about packages in Mathematica implementing

>> Automatic Differentiation of algorithms like ADOL-C in C++ or MAD in another system.

>>

>> Thanks,

>>

>> marco

>>

>> Ing. Marco Gabiccini, PhD

>> Assistant Professor of Applied Mechanics

>> Dept. of Mechanical, Nuclear and Production Engineering

>> University of Pisa

>> Via Diotisalvi, 2, 56126 Pisa (PI) - Italy

>> Phone: +39-050-836.676

>> E-mail: m.gabiccini at ing.unipi.it 

>>

>>

> 




  • Prev by Date: Re: Find smallest eigenvalues in mathematica
  • Next by Date: Re: eliminate all the occurrences of "theta ->" and "lambda ->"
  • Previous by thread: Automatic Differentiation in Mathematica
  • Next by thread: Re: Automatic Differentiation in Mathematica