[sympy] Re: Trigsimp

2011-08-11 Thread Vinzent Steinberg
On 10 Aug., 03:01, Aaron Meurer asmeu...@gmail.com wrote: No.  Right now, trigsimp() is very weak.  It basically just applies the various forms of sin**2 + cos**2 = 1. Improvements would be welcome, though. Rewriting as exp, simplifying, and rewriting as sin is sometimes more powerful than our

[sympy] Re: Trigsimp branch of sympy

2009-06-02 Thread Fabian Pedregosa
Luke wrote: I've published my branch of sympy where I started implementing the trig simplification algorithm by Hu et al. I also started working on the .eval() methods of sin, cos, and tan, and wrote a lot of tests for the behavior that Mathematica gives. Currently, py.test

[sympy] Re: Trigsimp branch of sympy

2009-06-02 Thread Ondrej Certik
On Tue, Jun 2, 2009 at 4:48 AM, Fabian Pedregosa fab...@fseoane.net wrote: Luke wrote: I've published my branch of sympy where I started implementing the trig simplification algorithm by Hu et al.  I also started working on the .eval() methods of sin, cos, and tan, and wrote a lot of tests

[sympy] Re: Trigsimp branch of sympy

2009-06-02 Thread Fabian Pedregosa
Ondrej Certik wrote: On Tue, Jun 2, 2009 at 4:48 AM, Fabian Pedregosa fab...@fseoane.net wrote: Luke wrote: I've published my branch of sympy where I started implementing the trig simplification algorithm by Hu et al. I also started working on the .eval() methods of sin, cos, and tan, and

[sympy] Re: trigsimp

2009-05-26 Thread Luke
Thanks. On May 25, 9:02 pm, Aaron S. Meurer asmeu...@gmail.com wrote: You need to use the exclude option I was telling you about.  Do,   a = Wild('a', exclude=[pi]) and   b = Wild('a', exclude=[pi]). and you get   e1.match(a*pi + b) {a_: 1, b_: x}   b = Wild('b', exclude=[pi])  

[sympy] Re: trigsimp

2009-05-26 Thread Luke
Aaron, It seems like this only works for Symbol instances, not FunctionClass instances, i.e: from sympy import * x = Function('x') a = Wild('a', exclude=[pi]) b = Wild('b') e = pi/S(2) + x e.match(a*pi + b) Traceback (most recent call last): File stdin, line 1, in module File

[sympy] Re: trigsimp

2009-05-25 Thread Luke
Here is the link for the Maxima trigsimp() code. It was written in 1981, according to the comments!!! http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/trigonometry/trgsmp.mac?revision=1.4view=markup I emailed the authors of the Fu et al. paper to see if they would be willing to

[sympy] Re: trigsimp

2009-05-25 Thread Aaron S. Meurer
On May 25, 2009, at 11:56 AM, Luke wrote: Here is the link for the Maxima trigsimp() code. It was written in 1981, according to the comments!!! http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/trigonometry/trgsmp.mac?revision=1.4view=markup I emailed the authors of the Fu et

[sympy] Re: trigsimp

2009-05-25 Thread Luke
Aaron, Thanks for the clarification. I think I get the idea, but I'm having trouble matching expressions of the following form: a = Wild('a') b = Wild('b') x = Symbol('x') e1 = pi + x e2 = pi - x e3 = -pi + x e4 = -pi - x I would think that for e{1,2,3,4} that I could get the following

[sympy] Re: trigsimp

2009-05-25 Thread Alan Bromborsky
Luke wrote: Aaron, Thanks for the clarification. I think I get the idea, but I'm having trouble matching expressions of the following form: a = Wild('a') b = Wild('b') x = Symbol('x') e1 = pi + x e2 = pi - x e3 = -pi + x e4 = -pi - x I would think that for e{1,2,3,4} that I could

[sympy] Re: trigsimp

2009-05-25 Thread Aaron S. Meurer
You need to use the exclude option I was telling you about. Do, a = Wild('a', exclude=[pi]) and b = Wild('a', exclude=[pi]). and you get e1.match(a*pi + b) {a_: 1, b_: x} b = Wild('b', exclude=[pi]) e2.match(a*pi + b) {b_: -x, a_: 1} e3.match(a*pi + b) {b_: x, a_: -1} e4.match(a*pi

[sympy] Re: trigsimp

2009-05-20 Thread Alan Bromborsky
Luke wrote: Last night I was deriving the moment of inertia for a solid torus using Sympy. It mostly worked, except for the step where the determinant of the Jacobian for the change of variables mapping was to be computed, the result was unable to be simplified by trigsimp. I gave it a

[sympy] Re: trigsimp

2009-05-20 Thread Ondrej Certik
On Wed, May 20, 2009 at 7:29 AM, Luke hazelnu...@gmail.com wrote: Last  night I was deriving the moment of inertia for a solid torus using Sympy.  It mostly worked, except for the step where the determinant of the Jacobian for the change of variables mapping was to be computed, the result

[sympy] Re: Trigsimp error

2009-04-28 Thread Luke
Incidentally, trying trigsimp with recursive=True, deep=True, or both True didn't give the desired result. On Tue, Apr 28, 2009 at 12:22 AM, Luke hazelnu...@gmail.com wrote: I'm writing some tests for some code that expresses a Vector expression in the coordinates of a different frame. I am

[sympy] Re: Trigsimp error

2009-04-28 Thread Akshay Srinivasan
I think trigsimp is too hack-ish. I'll try implementing the algorithm given at http://vv.cn/d/d.aspx?Id=21987_1.0.42119 - I guess this is the one Ondrej was talking about - in the coming weeks. I'm still not sure how good it is, does anyone know of anything better ? Akshay On Apr 28, 6:52 pm,

[sympy] Re: Trigsimp error

2009-04-28 Thread Luke
It isn't too pressing for PyDy, I just ran into it when creating some tests that would ensure PyDy gave the same output as Autolev. In Autolev, if you express a UnitVector from one reference in the coordinates of another reference frame that is 3 or more simple rotations away, when you convert

[sympy] Re: Trigsimp error

2009-04-28 Thread Alan Bromborsky
Luke wrote: It isn't too pressing for PyDy, I just ran into it when creating some tests that would ensure PyDy gave the same output as Autolev. In Autolev, if you express a UnitVector from one reference in the coordinates of another reference frame that is 3 or more simple rotations away,

[sympy] Re: Trigsimp error

2009-04-28 Thread Akshay Srinivasan
Freddie Witherden wrote: Hi all, I think trigsimp is too hack-ish. I'll try implementing the algorithm given at http://vv.cn/d/d.aspx?Id=21987_1.0.42119 - I guess this is the one Ondrej was talking about - in the coming weeks. I'm still not sure how good it is, does anyone know of anything

[sympy] Re: Trigsimp error

2009-04-28 Thread Luke
I just finished reading this paper. It seems pretty reasonable, and not to difficult to implement. Does anybody know of any other papers on this subject that might offer alternative methods that would be worth looking at? If there was some sort of gold standard paper on the subject, that might

[sympy] Re: Trigsimp error

2009-04-28 Thread Ondrej Certik
On Tue, Apr 28, 2009 at 6:17 PM, Alan Bromborsky abro...@verizon.net wrote: Luke wrote: I just finished reading this paper.  It seems pretty reasonable, and not to difficult to implement.  Does anybody know of any other papers on this subject that might offer alternative methods that would

[sympy] Re: trigsimp

2008-11-10 Thread Ondrej Certik
On Mon, Nov 10, 2008 at 10:29 PM, Alan Bromborsky [EMAIL PROTECTED] wrote: How hard would it be to have trigsimp handle hyperbolic trig functions as well as the ordinary ones? I think the code should be similar to what is already implemented, however someone needs to do it. Could you please

[sympy] Re: trigsimp

2008-11-10 Thread Alan Bromborsky
Ondrej Certik wrote: On Mon, Nov 10, 2008 at 10:29 PM, Alan Bromborsky [EMAIL PROTECTED] wrote: How hard would it be to have trigsimp handle hyperbolic trig functions as well as the ordinary ones? I think the code should be similar to what is already implemented, however someone