The SUMCONTRACT package comes with four functions which are
called from MACSYMA. These are SUMCONTRACT, INTOSUM, BASHINDICES,
and NICEINDICES. each of their operations will be described, and
a pointer to a batch file is given which gives an example from
Differential Equations showing the use of the functions in a
will combine all sums of an addition that have upper and
lower bounds that differ by constants. The result will be an
expression containing one summation for each set of such
summations added to all appropriate extra terms that had to be
extracted to form this sum. MACSYMA used to merge two sums with
THE EXACT SAME upper AND lower bounds, and create a tedious index
for the summation. SUMCONTRACT will combine all compatible sums
and use one of the indices from one of the sums if it can, and
then tries to form a reasonable index if it cannot use any
will take all things that a summation is multiplied by,
and put them inside the summation. If the index is used in the
outside expression, then the function tries to find a reasonable
index, the same as it does for SUMCONTRACT. This is essentially
the reverse idea of the OUTATIVE property of summations, but note
that it does not remove this property, it only bypasses it.
will take the expression and give each index of a
summation and product a unique index. This is here to allow
CHANGEVAR to be selective in which summations it is playing with.
The form of the unique index is J<number>. If <number> gets to
big for your liking, it can be changed by changing GENSUMNUM
(eg GENSUMNUM:0$ will reset it).
will take the expression and change all the indices of
sums and products to something easily understandable. It makes
each index it can "I" , unless "I" is in the internal expression,
in which case it sequentially tries J,K,L,M,N,I0,I1,I2,I3,I4,...
until it finds a legal index.
There is a file (dcp;sum demo) which can be invoked from
MACSYMA by typing DEMO(SUMCON,DEMO,DSK,DCP);
Be warned this is a long BATCH job, but it should give a good idea
of what is going on.
Please send any bug and/or requests to DCP@MC