Comment #5 on issue 2032 by smichr: Ability to work with K[x, 1/x] in Polys
http://code.google.com/p/sympy/issues/detail?id=2032
I don't know if the ideas I was working on for separating a rational into a
series of terms would help or not. It looks something like this:
Here's the full original equation with all terms visible
eq=y+1/x/y+1/x+1/(y+1)+c
Here it is "obscured"
ceq=cancel(eq); ceq
(1 + 2*y + x*y + c*x*y + y**2 + x*y**2 + c*x*y**2 + x*y**3)/(x*y + x*y**2)
Take the num and den
n,d=ceq.as_numer_denom()
Separate the denominator
d=separatevars(d)
d
x*(y + y**2)
Now, for each separated term in the denominator you can recover the
original terms:
Divide by factor1 of d...
w,r=reduced(n,[x])
cancel the remainder with the full d
cancel(r/d).expand()
1/x + 1/(x*y) ############################
We are done with that first factor
d = d/x
Now take the whole part and divide by the next factor in d (there is only 1
now)
w,r = reduced(w[0],[y+y**2])
divide by the current d
cancel(r/d).expand()
1/(1 + y) ######################
There are no more factors in d so you are done:
w[0]
c + y ########################
The ######### mark your original terms. Now you can walk through the terms
and find the ones you are interested in.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" 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-issues?hl=en.