[sympy] Re: Possible Bug in sympify

2009-05-05 Thread Colin Gillespie
at 10:45 AM, Colin Gillespie c.gilles...@ncl.ac.uk wrote: Hi Ondrej, I've tried to figure out exactly where the errors lies, but don't have anything concrete. Here's what I have come up with: y=Symbol(pow(A,2)) Poly(y,y) Poly(pow(A,2), pow(A,2)) Seems OK. x=sympify(pow1(PZPZ

[sympy] Re: Possible Bug in sympify

2009-05-01 Thread Colin Gillespie
wrote: On Thu, Apr 30, 2009 at 3:01 AM, Colin Gillespie c.gilles...@ncl.ac.uk wrote: Hi, In the code: x=sympify('pow(PZ,2)') x pow(PZ, 2) Poly(x,Symbol('PZ')) Traceback (most recent call last): File stdin, line 1, in module File /data/ncsg3/pythonModules/lib

[sympy] Possible Bug in sympify

2009-04-30 Thread Colin Gillespie
Hi, In the code: x=sympify('pow(PZ,2)') x pow(PZ, 2) Poly(x,Symbol('PZ')) Traceback (most recent call last): File stdin, line 1, in module File /data/ncsg3/pythonModules/lib/python2.5/site-packages/ sympy-0.6.4-py2.5.egg/sympy/polys/polynomial.py, line 402, in __new__ terms =

[sympy] Problem with the Poly module

2009-04-08 Thread Colin Gillespie
Dear All, I seem to be have a problem with the Poly module. Unfortunately, I can't seem to simplify my expression to get a test case. Currently, my code is: diff = value.alpha/value.beta - (c3*c1-c3*c2)/c4 #value.alpha is extracted from an XML file print value.alpha, value.beta Poly(c1*c3 -

[sympy] Question on Poly and substitution

2009-04-03 Thread Colin Gillespie
Dear All, Quick question. I have a polynomial: p =Poly(2*x*y+y, x, y) and I want to substitute in y = y+5 and x= x+1 How would I do this? I've tried things like: p.subs((y, y+5), (x, x+1)) but this doesn't work. Cheers Colin --~--~-~--~~~---~--~~ You

[sympy] Issue 773: sympify(abc) should return an abc symbol

2008-10-06 Thread Colin Gillespie
Hi, I believe that issue 773 should be reopened, as there is still a bug with sympify. For example, sympify('lambda') Traceback (most recent call last): File stdin, line 1, in ? File /lib/python2.4/site-packages/sympy-0.6.2-py2.4.egg/sympy/core/ sympify.py, line 128, in sympify raise

Fractions

2008-04-28 Thread Colin Gillespie
Dear All, Is there a method for automatically extracting the numerator and denominator of a fraction? For example, f= a/b f.numerator() a Thanks Colin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sympy

Re: easy_install and pypi

2008-04-01 Thread Colin Gillespie
Hi Ondrej, Warning: I'm not an expert on pypi or setup.py file, so these are only suggestions. Thanks for noticing. The tests/ directories are our tests, so I don't think they should be imported. Why should there by __init__ files in it? Could it be because in setup.py you have: packages =

sympify of 'lambda' and 'E'

2008-03-31 Thread Colin Gillespie
Dear All, I suspect that sympify is getting confused by python's builtin lambda and E So are the following examples bugs? If not, should the documentation be updated with a warning? sympify('S*lambda') Traceback (most recent call last): File stdin, line 1, in ? File

Degree of a polynomial

2008-03-29 Thread Colin Gillespie
Dear All, Are there any inbuilt function to work with degrees of polynomials? For example, x=Symbol('x') y=symbol('y') f=2*x**3+3*x*y+1 So f.highestDegree(x) would return 3 f.coeff(x**1) would return 3*y Many thanks Colin --~--~-~--~~~---~--~~ You received

Re: Degree of a polynomial

2008-03-29 Thread Colin Gillespie
In [14]: q.coeff(2, 1) Out[14]: 0 For more information refer to 'polys' module docstrings, eg. Poly? in ipython. Mateusz 2008/3/29, Colin Gillespie [EMAIL PROTECTED]: Dear All, Are there any inbuilt function to work with degrees of polynomials? For example, x=Symbol('x') y