Summing problem



On Tue, 21 Jan 2003, Mathieu Avila wrote:

> Hello everyone,
> 
> I have a problem with maxima when using sums:
> 
> ----------------
> 
> Mult2(Elem1,M,indice) :=
> 			 Block(	[ calc:0,I, exp:0 ],		
> 			SIMPSUM:TRUE,
> 			exp:SUBST(I,indice,elem1),			
> 			exp2:SUM(exp,I,0, M-1 )		
> );
> 

 Mult2(elem1,M,indice) := Block([exp],                        
                        exp:SUBST(I,indice,elem1),
                        exp2:SUM(ev(exp),I,0, M-1 ));

gives the right result, but I cannot really explain why... Maybe it has to
do with the way sum evaluates its arguments... Certainly this is not
clean.

Martin

PS: note that there is a bug in simpsum, described and fixed in

http://sourceforge.net/tracker/index.php?func=detail&aid=625278&group_id=4933&atid=104933