From: thng@atri.curtin.edu.au (Ian Li-Jin Thng)
Subject: Automatic Differentiation : Help needed
Reply-To: thng@atri.curtin.edu.au
Organization: Australian Telecommunication Research Institute
Date: Wed, 27 Jan 93 07:55:04 GMT

G'day to all num-analysis netters,

I've just been recommended to seek assistance from you guys regarding 
the subject of automatic differentiation to solve a problem regarding
symbolic programming in Fortran. 

First of all, here's the background of the problem that I have :

I have at present a Fortran program which is numerically intensive
at the moment. I need to add a section to that program which is
unfortunately symbolically intensive. The requirements of the 
symbolically intensive portion is to find the partial derivatives
of a multi-variable scalar function s(x,y,z) which is given by

    s(x,y,z) =  w(T) . Q . w  
 
 where
 
    (T) denotes transpose of a vector or matrix
 
     w is an input vector whose elements consists of constants and 
     variables -
     eg : w = [2 , 2x+y, x^2, y^4, 3x , 4x-z, 4, 5.6 ](T)
 
     Q is an input matrix whose elements are similar to the elements 
     in w, ie , they can be symbolic elements (ie in terms of variables 
     x, y or z) or purely numerical entries. The symbolic elements in
     Q are limited to integer powers in x, y or z .

 Question is , how do you compute 

   d s(x,y,z)          d s(x,y,z)           d s(x,y,z)
   ----------     ,    ----------     and   ----------       ?
      d x                 d y                  d z

I guess to do the above in mathematica or maple is simple enough :

a) Define w and Q and multiply out w(T).Q.w which basically makes s(x,y,z)
   to be a polynomial function in x,y and z 
b) Then collect the terms and apply the partial differentiation function
   on s(x,y,z)

Well, the unfortunate part is that all these operations have to be done
within Fortran 77. 

Someone have recommended me to use 'automatic differentiation' . I haven't
got the faintest idea what that is and how could it be applied to solve
the above problem in Fortran. I am sure that someone out there has seen
the above problem before and hopefully have found a way out of this mess
using automatic differentiation. 

If there is anyone out there who knows what is automatic differentiation
or have come across references on this subject, I would really appreciate
if you could tell me about it and even better, show me how I can apply
it to solve the above symbolic problem in Fortran.

A thousand thanx to advance to anyone willing to help me out !

I can be reached at :

------------------------------------------------------------------------------
                 Ian Thng  - Forever Trying to be Young  
                 Email:thng@atri.curtin.edu.au
                 Adaptive Signal Processing Laboratory
                 Australian Telecommunications Research Institute
                 Curtin University of Technology
                 Ph :  +61-9-3513270
                 Fax : +61-9-3513244 
                 Bothered with seat belts ? Ride a Harley Mate !
------------------------------------------------------------------------------

Newsgroups: sci.math.num-analysis