Hey everyone:
So, I was trying to compute this sum symbolically, and then make it so that
I could plug in values for u later. I don't think that it's possible using
the Sage sum, though it works with the python sum.
This is my attempt to do it using a Sage sum:
reset()
var("G")
G = 5
u = [SR("u_%i"%x) for x in [0..6]]
gamma = (1/G)*sum(-(u[i])^(k-1)/(u[i]-1)^k,i,1,G-1)
show(gamma(4))
I get the error "Unable to coerce I to an integer"
Here it is using a python sum:
reset()
var("G")
var('i')
G = 5
u = [SR("u_%i"%x) for x in [0..6]]
gamma(k) = (1/G)*sum(-(u[i])^(k-1)/(u[i]-1)^k for i in (1..G-1))
show(gamma(4))
It works just fine.
I guess my real question is, what exactly is the point of the Sage version
of the sum? Why don't we just use the python sum by default? Are there any
benefits to Sage's version? The python version seems to run faster as well.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.