Parsing function strings

2007-10-29 Thread Fabian Steiner
Hello! I am currently working on a Python program based on PyQt and Qwt intended to demonstrate the approximation of a function by using Taylor's theorem. The user is able to type in a function (e.g. 2 * exp(x**2 + 4*x) in a QLineEdit and afterwards the string is validated by using the follwing c

Re: Parsing function strings

2007-10-29 Thread Fabian Steiner
Hi! On 29 Okt., 14:27, "Ondrej Certik" <[EMAIL PROTECTED]> wrote: > [...] > Yes, we just fixed the problem a few days ago, see this issue for more > details: > > http://code.google.com/p/sympy/issues/detail?id=439 > > and this one: > > http://code.google.com/p/sympy/issues/detail?id=440 > > So y

Re: Parsing function strings

2007-10-29 Thread Fabian Steiner
On 29 Okt., 16:58, "Ondrej Certik" <[EMAIL PROTECTED]> wrote: > > > I am currently working on a Python program based on PyQt and Qwt > > > intended to demonstrate the approximation of a function by using > > BTW I forgot - if you could send us a link to your application I'll > add it to SymPy's

Errors while calculating exp(-0.5*x**2).series(x, 10)

2007-12-26 Thread Fabian Steiner
Hello! When trying to evaluate exp(-0.5*x**2).series(x, 10) using sympy-0.5.8 the following error appears: File "", line 1, in File "/usr/lib/python2.5/site-packages/sympy/core/basic.py", line 1000, in series r = self.oseries(o) File "/usr/lib/python2.5/site-packages/sympy/core/basic_

Re: Errors while calculating exp(-0.5*x**2).series(x, 10)

2007-12-26 Thread Fabian Steiner
Thanks a lot for your help :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED]

Wrong series() expansion

2008-01-03 Thread Fabian Steiner
Hello! Attempting to obtain the Tayor series of sqrt(x) and 1/x gives the following: >>> x = Symbol('x') >>> sqrt(x).series(x, 4) x**(1/2) >>> (1/x).series(x, 4) 1/x But these are definitely no Taylor polynoms so that sympy should throw an exception or inform the user that both expressions have

Re: Wrong series() expansion

2008-01-03 Thread Fabian Steiner
Hi Ondrej! On 3 Jan., 17:45, "Ondrej Certik" <[EMAIL PROTECTED]> wrote: > [...] > The series does Laurent (or generalized) series expansion, so > > 1/x is expanded to 1/x, which is correct > > sqrt(x) cannot be expanded, so it is left as is. Maybe we can consider > raising an exception, > but I

Re: Wrong series() expansion

2008-01-03 Thread Fabian Steiner
Hello! On 3 Jan., 18:13, Pearu Peterson <[EMAIL PROTECTED]> wrote: > [...] > Yes, I think there should be different series methods/functions: > > taylor - taylor series > series or pseries - power (Laurent) series > oseries - asymptotic series > > given in the order of implementation complexity.

Re: Wrong series() expansion

2008-01-03 Thread Fabian Steiner
On 3 Jan., 18:54, "Ondrej Certik" <[EMAIL PROTECTED]> wrote: > [...] > Series should return the asymptotic series by default. If someone > implements that, there > can also be methods for just laurent series, or just taylor ones, but > could you tell us > some applications where this is needed? I

Re: Wrong series() expansion

2008-01-03 Thread Fabian Steiner
On 3 Jan., 19:27, "Ondrej Certik" <[EMAIL PROTECTED]> wrote: > Hi, > > so first, the patch fixing the sin(cos(x)) problem was sent for a > review, see the issue above. > You can fix your code immediatelly, just go to sympy/core/function.py > and apply this simple patch: > > diff --git a/sympy/core

Some more series() problems

2008-01-06 Thread Fabian Steiner
Hi! I discovered some more problems when trying to get the series expansion for the cosh(x), sinh(x), tanh(x) functions: >>> cosh(x).series(x, 10) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/sympy/core/basic.py", line 1045, in series r =

Re: Some more series() problems

2008-01-07 Thread Fabian Steiner
Hello! On 7 Jan., 02:50, "Ondrej Certik" <[EMAIL PROTECTED]> wrote: > Fixed: > > http://code.google.com/p/sympy/issues/detail?id=555 Thanks a lot! > This time it took me a little longer, but I was busy. :) Where's the problem?! Your response was *fast*. Even some companies can learn a lesson f

Use real numbers only

2008-01-20 Thread Fabian Steiner
Hello! Is there any way to instruct sympy to use real numbers only? In [1]: from sympy import * In [2]: x = Symbol('x', real=True) In [3]: sqrt(x**2-3) Out[3]: I*(3 - x**2)**(1/2) Why is sqrt(x**2-3) transformed in that way that it uses the imaginary unit? This makes it hard for me to turn t

Re: Use real numbers only

2008-01-20 Thread Fabian Steiner
Hello! On 20 Jan., 21:03, "Ondrej Certik" <[EMAIL PROTECTED]> wrote: > [...] > It doesn't do that anymore, we fixed that in the hg. > > In [1]: x = Symbol('x', real=True) > > In [2]: sqrt(x**2-3) > Out[2]: >⎽ > ╱ 2 > ╲╱ -3 + x > > In [3]: Basic.set_repr_level(1) > Out[3]: 2 >

Re: Use real numbers only

2008-01-20 Thread Fabian Steiner
I just noticed that as_expr_orders() is failing at the moment. The following small patch made it work again: --- sympy/core/basic.py.old 2008-01-20 22:14:11.0 +0100 +++ sympy/core/basic.py 2008-01-20 22:14:23.0 +0100 @@ -973,7 +973,7 @@ l1 = [] l2 = []

Caching and series()

2008-01-24 Thread Fabian Steiner
Hello! >From time to time the need may arise to compute large series expansions. This may take a long time so that the user decides to stop evaluating by hitting ctrl+c resulting in a KeyboardInterrupt exception. >>> (cos(x**2)*sin(x**2-3*x)).series(x, n=40) Traceback (most recent call last):