Ondrej Certik wrote:
> Hi,
>
> I implemented coordinate transformations with sympy, patches are here,
> please review:
>
> http://groups.google.com/group/sympy-patches/browse_thread/thread/e0f5ceb33828d31c
>
> or download from my git repo, branch curvi:
>
> http://github.com/certik/sympy
>
> I implemented it as an example, here is how the output looks like
> (unfortunately wiki.sympy.org doesn't seem to handle unicode):
>
> http://code.google.com/p/sympy/wiki/CurvilinearCoordinates
>
> Currently I added examples of: polar, cylindrical, spherical, rotating
> disk, parabolic and elliptic coordinates. It calculates the Jacobi
> matrix, metric tensor, Laplace operator etc.
>
> Couple ideas for improvement:
>
> * the partial derivatives should be printed with the partial sign
> * the trigsimp function should be improved, as it can't simplify the
> metric tensor for spherical coordinates
> * more information could be added, like other operators, Christoffel
> symbols, etc.
> * it could optionally produce images of the coordinates, as are on the 
> wikipedia
>
> If anyone is interested in improving it, feel free to go ahead.
>
> Thorough explanation of the mathematical machinery behind all of this
> is in my differential geometry notes here:
>
> http://github.com/certik/differential-geometry/raw/master/geom.pdf
>
> If you have any questions, just ask.
>
> Ondrej
>
> >
>
>   
Ondrej - Try using this recursive application of trigsimp instead of 
just trigsimp, but preceed with
simplify (this worked for me for spherical coordinates):

def TrigSimp(f):
    """
    Recursive application of sympy.trigsimp().  Works in many applications
    where simple application of sympy.trigsimp() does not.
    """
    (w,g) = sympy.cse(f)
    g = sympy.trigsimp(g[0])
    for sub in reversed(w):
        g = g.subs(sub[0],sub[1])
        g = sympy.trigsimp(g)
    return(g)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to