Differentiation in PASCAL-SC: Type Gradient.
Abstract
In scientific computation, there is often need for the derivatives as well as the values of functions defined by computer programs. Here, it is shown how automatic differentation can be carried out in a modern computer language which permits user-defined operators and data types. The specific language used is PASCAL-SC, and differentation is implemented for variables of type GRADIENT vector of first partial derivatives with respect to the independent variables. Calculations of the results of operators or functions applied to GRADIENT variables are carried out according to the well-known rules for evaluation and differentiation of sums, differences, products, and so on. Since the differentiation is performed at compile time, the code produced is comparable in compactness and execution time to that obtained if numerical approximations are used for derivatives, and the theoretical and practical problems associated with numerical differentiation are avoided. PASCAL-SC source code is given for the necessary operators and standard functions, and it is shown how to prepare code for arbitrary differentiable functions to add to the library if desired. The effectiveness of the use of type GRADIENT is shown by an example of the solution of a system of nonlinear equations by Newton's method. (Author)
Document Details
- Document Type
- Technical Report
- Publication Date
- Jul 01, 1982
- Accession Number
- ADA120959
Entities
People
- Louis B. Rall
Organizations
- University of Wisconsin–Madison