Ordinary Differentiation



next up previous contents index
Next: Partial Differentiation Up: The General Relativity Previous: The General Relativity

Ordinary Differentiation

      As of REDTEN version v3.3 the ordinary differentiation code was entirely rewritten to make use of automatically created objects to store the derivatives of other objects. This change was intended to improve the performance of the system by avoiding the unnecessary re-computation of derivatives, and to simplify the code. When an objects' index indicates an ordinary differentiation and the object is involved in an indexed assignment, the system will either store a newly computed derivative or retrieve an existing value from the derivative object. Higher order derivatives cause multiple objects to be created, each containing the derivative of the previous object and having a rank one greater.

The automatically created derivative objects have names of the form <name>_DF<#> where <name> is the name of the object whose derivative is being computed, and <#> is an integer, starting from 2, that distinguishes higher order objects. The indextype is formed by adding enough covariant tensor indices to those already on the parent object to match the order of the derivative. This is strictly incorrect, since ordinary derivative indices do not transform as tensor indices, but it is much more convenient to regard them as such. The user is responsible for ensuring that combinations of objects having ordinary derivative indices are in fact tensors. For derivatives of order 2 or higher, the derivative indices are symmetric because of the commutative property of differentiation; the derivative objects also inherit the intrinsic symmetries of the parent object.

When created on the fly the derivative objects are filled with the hitherto unmentioned value <undefined> (which cannot be entered by the user) so as to distinguish between components that have been evaluated and those which have not. Thus, a derivative object may be ``incomplete'' after being created automatically, since the indexed algebra may not have touched on all the possible components. The user can fully evaluate any order derivative of an object via the function odf(), which takes the object name as the first argument, and odf() the order of the derivative as the optional second argument. Objects so created are visible in a directory listing, but the automatic objects are flagged nodir and are hidden unless the all keyword (or the * pattern) is used. Since the number of real components is uncertain for the automatic objects, a directory listing will usually display a large number of components (representing the full number of possible components each with the value <undefined>), followed by a ? to indicate the uncertainty. Using odf() also causes the derivatives and the parent to become write protected.

The derivative objects are given the itype odf and form a chain starting from the parent; each object stores its order and the objects that are its anti-derivative and derivative under the odf property. See the function getfam() for information on how to simplify both the parent object and its derivatives at the same time.

The derivative objects are set up with a printname that is the parent objects' printname, and their indices are printed with the appropriate differentiation symbols in place. For example, if q is a rank-1 indexed object, the user can create its 3rd-order derivative via

 
#: odf(q,3);
computing q_DF3 

  q_DF3
and a display of the components of this object would appear as follows:
 
#: q_DF3[];

  0
 q         = <value>
    |0 0 0

  0
 q         = <value>
    |0 0 1

etc.
The user may also cause the automatic creation of the derivative objects by entering a fixed index containing a derivative operator. The required derivatives are computed and immediately returned, and also stored in the derivative objects. For example,
 
#: R[1,2,1,2,|0];
                           2                   2
   - (2 rt  sin(sqrt(k) om)  rt) (rt   rt + rt   + k)
          t                         2t        t
 -----------------------------------------------------
                           k 




next up previous contents index
Next: Partial Differentiation Up: The General Relativity Previous: The General Relativity



John Harper
Wed Nov 16 13:34:23 EST 1994