[sympy] Re: Problem with matches()

2009-05-21 Thread Aaron S. Meurer
http://code.google.com/p/sympy/issues/detail?id=1429 Aaron Meurer On May 21, 2009, at 8:36 PM, Ondrej Certik wrote: > > On Thu, May 21, 2009 at 7:33 PM, Aaron S. Meurer > wrote: >> >> I tried the following, >> >> >>> a = Wild('a', exclude=[f(x).diff(x)]) >> >>> b = Wild('b', exclude=[f(x).d

[sympy] Re: Problem with matches()

2009-05-21 Thread Ondrej Certik
On Thu, May 21, 2009 at 7:33 PM, Aaron S. Meurer wrote: > > I tried the following, > >  >>> a = Wild('a', exclude=[f(x).diff(x)]) >  >>> b = Wild('b', exclude=[f(x).diff(x)]) >  >>> eq = x+f(x) - (x - f(x))*diff(f(x), x) >  >>> r = eq.match(a+b*diff(f(x),x)) > > r is None.  I need it to be{a:x+f(

[sympy] Problem with matches()

2009-05-21 Thread Aaron S. Meurer
I tried the following, >>> a = Wild('a', exclude=[f(x).diff(x)]) >>> b = Wild('b', exclude=[f(x).diff(x)]) >>> eq = x+f(x) - (x - f(x))*diff(f(x), x) >>> r = eq.match(a+b*diff(f(x),x)) r is None. I need it to be{a:x+f(x), b:-(x-f(x))}. This works for other things similarly formatted, for

[sympy] Re: div and curl with sympy

2009-05-21 Thread Alan Bromborsky
Alan Bromborsky wrote: > Alan Bromborsky wrote: > >> Ondrej Certik wrote: >> >> >>> Hi, >>> >>> I need the div and curl operators in sympy, 3D is enough. I am >>> attaching a simple script, that takes the vector potential A, >>> calculates B and then div B: >>> >>> A: >>> [0, 0, 16*x**2*

[sympy] Re: div and curl with sympy

2009-05-21 Thread Ondrej Certik
On Thu, May 21, 2009 at 6:58 PM, Alan Bromborsky wrote: > Ondrej Certik wrote: > Here's the code (attached): Wow, that was quick. Here is the output of it: A = (16*x**2*y**2*(1 - x)**2*(1 - y)**2)e_z B = curl(A) = (-16*x**2*y**2*(1 - x)**2*(2 - 2*y) + 32*y*x**2*(1 - x)**2*(1 - y)**2)e_x+(16*x**

[sympy] Re: div and curl with sympy

2009-05-21 Thread Alan Bromborsky
Alan Bromborsky wrote: > Ondrej Certik wrote: > >> Hi, >> >> I need the div and curl operators in sympy, 3D is enough. I am >> attaching a simple script, that takes the vector potential A, >> calculates B and then div B: >> >> A: >> [0, 0, 16*x**2*y**2*(1 - x)**2*(1 - y)**2] >> B: >> [-16*x**2*

[sympy] Re: div and curl with sympy

2009-05-21 Thread Alan Bromborsky
Ondrej Certik wrote: > Hi, > > I need the div and curl operators in sympy, 3D is enough. I am > attaching a simple script, that takes the vector potential A, > calculates B and then div B: > > A: > [0, 0, 16*x**2*y**2*(1 - x)**2*(1 - y)**2] > B: > [-16*x**2*y**2*(1 - x)**2*(2 - 2*y) + 32*y*x**2*(1

[sympy] div and curl with sympy

2009-05-21 Thread Ondrej Certik
Hi, I need the div and curl operators in sympy, 3D is enough. I am attaching a simple script, that takes the vector potential A, calculates B and then div B: A: [0, 0, 16*x**2*y**2*(1 - x)**2*(1 - y)**2] B: [-16*x**2*y**2*(1 - x)**2*(2 - 2*y) + 32*y*x**2*(1 - x)**2*(1 - y)**2, 16*x**2*y**2*(1 - y

[sympy] Poll on usage of solve()

2009-05-21 Thread Luke
Does anybody use solve() by passing the function and/or the symbol arguments as a set, rather than a list or a tuple? I can't see a reason why using it with a set would be beneficial, and without support for sets, there are some aspects of solve that would become easier with regard to being able

[sympy] Re: How to integrate a customised function ?

2009-05-21 Thread Christophe
Thanks a lot. Christophe. Ondrej Certik a écrit : > On Thu, May 21, 2009 at 10:38 AM, Christophe wrote: > >> Hello, >> I use Python 26, and the installation was made with >> sympy-0.6.4.win32.exe. I'm under Windows XP. >> >> Christophe. >> >> PS : here is the output. >> >> >> **

[sympy] Re: How to integrate a customised function ?

2009-05-21 Thread Aaron S. Meurer
OK. My stable version was actually 0.6.3. Aaron Meurer On May 21, 2009, at 11:47 AM, Ondrej Certik wrote: > > On Thu, May 21, 2009 at 10:38 AM, Christophe > wrote: >> >> Hello, >> I use Python 26, and the installation was made with >> sympy-0.6.4.win32.exe. I'm under Windows XP. >> >> Christ

[sympy] Re: How to integrate a customised function ?

2009-05-21 Thread Ondrej Certik
On Thu, May 21, 2009 at 10:47 AM, Ondrej Certik wrote: > On Thu, May 21, 2009 at 10:38 AM, Christophe wrote: >> >> Hello, >> I use Python 26, and the installation was made with >> sympy-0.6.4.win32.exe. I'm under Windows XP. >> >> Christophe. >> >> PS : here is the output. >> >> >> *

[sympy] Re: How to integrate a customised function ?

2009-05-21 Thread Ondrej Certik
On Thu, May 21, 2009 at 10:38 AM, Christophe wrote: > > Hello, > I use Python 26, and the installation was made with > sympy-0.6.4.win32.exe. I'm under Windows XP. > > Christophe. > > PS : here is the output. > > > **

[sympy] Re: How to integrate a customised function ?

2009-05-21 Thread Christophe
Hello, I use Python 26, and the installation was made with sympy-0.6.4.win32.exe. I'm under Windows XP. Christophe. PS : here is the output. *** File "C:\Python26\Lib\site-packages\sympy\utilities

[sympy] Re: How to integrate a customised function ?

2009-05-21 Thread Aaron S. Meurer
It worked for me in the stable build, as well as in the git repository: >>> import sympy >>> x = sympy.Symbol('x') >>> f = x**3+4*x+1/x >>> >>> print sympy.integrate(f,x) log(x) + 2*x**2 + 1/4*x**4 What output are you getting, and what versions of Python and SymPy are you using? Aaron Me

[sympy] How to integrate a customised function ?

2009-05-21 Thread Christophe
Hello, I would like to integrate a custom functions but the following code doesn't work. Christophe. import sympy x = sympy.Symbol('x') f = x**3+4*x+1/x print sympy.integrate(f,x) --~--~-~--~~~---~--~~ You received thi

[sympy] Re: trigsimp

2009-05-21 Thread Akshay Srinivasan
Luke wrote: > I tried both of those options and had no luck :( > > Have you looked at the paper by Fu, Zhong, and Zeng: > http://vv.cn/d/d.aspx?Id=21987_1.0.42119 > > I read it, and think it seemed reasonable, but I'm no expert and want > to see what else was out there... maybe there are other app