After a pause I remember this non intuitive facts: n: is a funtion in sage and should be declared as symbol
And in >> print h(a=1,r=0.0123,noo=10) Answer: sum((i^2 + 0.0246*i + 1.00015129)^(-3/2), i, 0, 10) This is an expression and that is why I cannot have a number like typing >> sum((i^2 + 0.0246*i + 1.00015129)^(-3/2), i, 0, 10) #SUMATION 1.499... where sage "knows" it's all numbers. In the screen they are exactly the same. Internally they are different. Pedro On Oct 5, 3:24 pm, Pedro Cruz <[email protected]> wrote: > Why in this code: > > >> r,a,n,i,noo=var('r,a,n,i,noo') > >> hterm(a,r,n) = 1/(a^2+(r+n)^2)^(3/2) > >> h(a,r,noo) = a^2*sum(hterm(a,r,i), i, 0, noo) > >> print h(a=1,r=0.0123,noo=oo) > > sum((i^2 + 0.0246*i + 1.00015129)^(-3/2), i, 0, +Infinity)>> print > h(a=1,r=0.0123,noo=10) > > sum((i^2 + 0.0246*i + 1.00015129)^(-3/2), i, 0, 10) #SUMATION > > but if I do > > >> sum((i^2 + 0.0246*i + 1.00015129)^(-3/2), i, 0, 10) > > 1.49935960541 > > How can I turn the #SUMATION to a number when I call function h? > > Thanks > > Pedro Cruz -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
