Nächste: , Vorige: , Nach oben: simplification   [Inhalt][Index]

69.6 Package rducon

Function: reduce_consts (expr)

Replaces constant subexpressions of expr with constructed constant atoms, saving the definition of all these constructed constants in the list of equations const_eqns, and returning the modified expr. Those parts of expr are constant which return true when operated on by the function constantp. Hence, before invoking reduce_consts, one should do

declare ([objects to be given the constant property], constant)$

to set up a database of the constant quantities occurring in your expressions.

If you are planning to generate Fortran output after these symbolic calculations, one of the first code sections should be the calculation of all constants. To generate this code segment, do

map ('fortran, const_eqns)$

Variables besides const_eqns which affect reduce_consts are:

const_prefix (default value: xx) is the string of characters used to prefix all symbols generated by reduce_consts to represent constant subexpressions.

const_counter (default value: 1) is the integer index used to generate unique symbols to represent each constant subexpression found by reduce_consts.

load("rducon") loads this function. demo(rducon) shows a demonstration of this function.


Nächste: , Vorige: , Nach oben: simplification   [Inhalt][Index]