subs() doesn't replace s because it is a bound variable. You can use
replace or xreplace to do it.
>>> Sum(a*exp((2*s + 1)*I*t), (s, -oo, oo)).xreplace({s: j})
Sum(a*exp(I*t*(2*j + 1)), (j, -oo, oo))
Aaron Meurer
On Thu, Oct 8, 2020 at 1:30 PM Thomas Ligon <[email protected]> wrote:
>
> Here is a code snippet (for test purposes):
>
> from sympy import symbols, I, oo, Sum, exp
> a, s, t, j = symbols('a s t j')
> ex = Sum(a*exp((2*s + 1)*I*t), (s, -oo, oo))
> print(ex)
> ex = ex.subs(s, j)
> print(ex)
>
> The subs statement has no effect. Is there another way to do this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/57c9522d-7e3b-42be-88cb-1834a3d49efdn%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAKgW%3D6K6vCy9to%2B5Ruy90M09y4mW_c0%2BLwmXoPg_vSWaOgqNQw%40mail.gmail.com.