Hi to all Sympy-people,

while doing some calculations I stumbled over some strange behavior in
the Sum function. I don't know, if I just misuse it or if something is
broken.

I try to calculate this:

m = Symbol('m')
I = Symbol('I')

s = Sum(exp(m), (m, -I, I))

# m should be -2 .. 2
s = s.subs(I,2).doit()
print(s)
# prints: (exp(-I) - exp(1 + I))/(1 - E)
s.subs(I,2).evalf()
# 11.61... the correct result

# now just slightly different:
s = Sum(m*exp(m), (m, -I, I))



# m should be -2 .. 2

s = s.subs(I,2).doit()

print(s)
# Sum(m*exp(m), (m, -I, I)), so it did not expand
# infinite loop here:
s.subs(I, 2).evalf()

So, how should this be done correctly or is the Sum function only
working in special cases?
Thanks for any help!
Alexander

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
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/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to