It looks like a bug. If you do foo.expand() - foo.apart(xi_s).expand()
you get a term which is definitely not equal to zero.

Aaron Meurer

On Tue, Mar 10, 2015 at 9:57 AM, Francesco Biscani <[email protected]> wrote:
> Hello list,
>
> I feel a bit embarrassed as probably I am doing something blatantly wrong,
> but I cannot understand what is going here. Consider this snippet (copy
> pasted from an Ipython notebook):
>
> """
> import sympy
> sympy.init_printing()
> from sympy import Symbol,sqrt,cos,sin,solve,Function,atan,apart,S
>
> # Some symbols
> h,n,m,M,g,t,xi_s,eta_s = [Symbol(_) for _ in
> ['h','n','m','M','g','t',r'\xi',r'\eta']]
> pxi,peta = [Symbol(_) for _ in [r'p_\xi',r'p_\eta']]
>
> # A rational expression
> foo =
> 32*eta_s**8*g*m/(eta_s**2+xi_s**2)**3-64*eta_s**6*g*m/(eta_s**2+xi_s**2)**2-23*g/2*eta_s**2*m-7*g/2*xi_s**2*m+(320*eta_s**4*g*m**2+peta**2+pxi**2)/(8*m*(eta_s**2+xi_s**2))
> """
>
> Now if I do "foo_apart(xi_s)", it seems like there are two parts of the
> expression that disappear. (specifically, -23*g/2*eta_s**2*m-7*g/2*xi_s**2*m
> is not there any more). Indeed, if I do:
>
> """
> foo.apart(xi_s).expand() == foo.expand()
> """
>
> This returns False.
>
> My brain is a bit fried at the moment :) So what am I overlooking here?
>
> Cheers,
>
>   Francesco.
>
> --
> 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 post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAHExjCsbts1UA_p%3DB6g-%2B6H7ny_MJomiaCjb5YgzSMAgDTs08g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2BDXE-qSq_TkD4K0Op_8-1gmA3%2BQN8VYcR4Q%2BLq%3D%3DMFmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to