[sympy] Re: simplify by canceling

2010-03-18 Thread smichr
On Mar 16, 7:37 pm, Vinzent Steinberg vinzent.steinb...@googlemail.com wrote: On 15 Mrz., 19:37, smichr smi...@gmail.com wrote: exec(%s=symbols('%s') % ((n,P,R,D,m,f,a,C,L,)*2)) Why don't you just use var(n,P,R,D,m,f,a,C,L) That exec statement is what I used in a function to generate

[sympy] Re: simplify by canceling

2010-03-18 Thread Vinzent Steinberg
On Mar 17, 3:45 pm, smichr smi...@gmail.com wrote: So I guess the only difference is that in the interactive environment, var() echoes the variables while Symbol and symbols does not. (And symbols will parse single characters from a string like 'abcxyz'.) Yes. I'm open to remove the confusing

[sympy] Re: simplify by canceling

2010-03-16 Thread Vinzent Steinberg
On 15 Mrz., 19:37, smichr smi...@gmail.com wrote: exec(%s=symbols('%s') % ((n,P,R,D,m,f,a,C,L,)*2)) Why don't you just use var(n,P,R,D,m,f,a,C,L) ? Vinzent -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to

Re: [sympy] Re: simplify by canceling

2010-03-16 Thread Dan Schult
On Mar 15, 2010, at 2:37 PM, smichr wrote: I think the thing to do is to use polynomial division which is going to tell you exactly (as in a numerical division) what the whole and remainder parts are: n,d = eq.as_numer_denom(); s = eq.atoms(Symbol); w,r = div(Poly (n,*s),Poly(d, *s)) print

[sympy] Re: simplify by canceling

2010-03-16 Thread Mateusz Paprocki
Hi, On Tue, Mar 16, 2010 at 10:52:41AM -0400, Dan Schult wrote: On Mar 15, 2010, at 2:37 PM, smichr wrote: I think the thing to do is to use polynomial division which is going to tell you exactly (as in a numerical division) what the whole and remainder parts are: n,d =

[sympy] Re: simplify by canceling

2010-03-14 Thread Vinzent Steinberg
On 12 Mrz., 16:44, Dan Schult dsch...@colgate.edu wrote: Thanks very much for the explanation.  It still seems I have to intervene to tell it to collect the terms with r. I have found that I can include a list of terms like r and collect will still work and then cancel can work on that. But