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 the expression back to the original
frame, you won't just get a UnitVector.  This isn't a huge deal and I
don't see immediately a situation where you would go back and forth
between frames just for fun, but it would be nice to know that you
could if you wanted to :)

I'll file the bug report, and I'll try to look at the paper Akshay
mentioned.  Akshay, if you need more examples that should simplify, I
can provide you with a handful more :)

~Luke



On Apr 28, 8:28 am, Akshay Srinivasan <akshaysriniva...@gmail.com>
wrote:
> I think trigsimp is too hack-ish. I'll try implementing the algorithm
> given athttp://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, Alan Bromborsky <abro...@verizon.net> wrote:
>
> > Ondrej Certik wrote:
> > > 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 using Sympy's trigsimp to
> > >> simplify expressions, but the following Sympy expression isn't
> > >> trigsimplifying:
> > >> cos(q4)**2 + sin(q3)**2*sin(q4)**2 + cos(q3)**2*cos(q4)**2*tan(q4)**2
>
> > >> It should simplify to 1, instead it trigsimplifies to:
> > >> cos(q4)**2 + sin(q3)**2*sin(q4)**2 + cos(q3)**2*sin(q4)**2
>
> > > It's a bug. Could you please file an issue for it?
>
> > > There is a nice article how to implement robust trigsimp somewhere in
> > > our issues, but noone found time for it yet.
>
> > > Is it very pressing for pydy? If not, let's keep this in mind and
> > > continue --- I think at the end of the summer it will be clear what
> > > sympy bugs should be fixed first and which later, so that pydy works
> > > reasonably well.
>
> > > Ondrej
>
> > Program:
>
> > from sympy import *
> > q3,q4 = symbols('q3,q4')
> > f = cos(q4)**2 + sin(q3)**2*sin(q4)**2 + cos(q3)**2*cos(q4)**2*tan(q4)**2
> > print f
> > f = trigsimp(f,deep=True,recursive=True)
> > f = trigsimp(f,deep=True,recursive=True)
> > print f
>
> > Output:
>
> > cos(q4)**2 + sin(q3)**2*sin(q4)**2 + cos(q3)**2*cos(q4)**2*tan(q4)**2
> > 1
>
> > Note on strange behavior.  When I ran this program from SPE I did not
> > need the second
> > "f = trigsimp(f,deep=True,recursive=True)" to simplify to 1, but when I
> > ran it from a shell
> > I did.  Shell results without second "f =
> > trigsimp(f,deep=True,recursive=True)" :
>
> > cos(q4)**2 + sin(q3)**2*sin(q4)**2 + cos(q3)**2*cos(q4)**2*tan(q4)**2
> > cos(q4)**2 + cos(q3)**2*sin(q4)**2 + sin(q3)**2*sin(q4)**2
>
> > Perhaps what trigsimp needs to do is convert all expressions to sin and
> > cos and do algebraic simplification
> > and then do trigsimp!
>
>
--~--~---------~--~----~------------~-------~--~----~
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 sympy+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to