On Tue, Jan 12, 2010 at 5:42 AM, [email protected]
<[email protected]> wrote:
> i just found sympy and it looks incredible.
>
> i have an error, which might be my mistake (either mathematically, or
> programatically) but i am getting unexpected behavoir on an integral.
>
> here is my code
>
> x = Symbol('x')
> m = Symbol('m', integer=True)
>
> g = sin(pi*x/a)
> gg = sin(pi*m*x/a)
>
> Integral(g*gg,(x,0,a)) # this looks correct
> Integral(g*gg,(x,0,a)).subs({m:1}) # this looks correct
> Integral(g*gg,(x,0,a)).subs({m:1}).doit() #this looks correct
> Integral(g*gg,(x,0,a)).doit() # i get 0, why? where did dependence
> on m go?
Try:
Integral(g*gg,(x,0,a)).subs({m:2}).doit()
and other numbers for "m". Looks like you always get 0, except m=1.
Ondrej
--
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.