On Wednesday, November 19, 2014 11:17:24 PM UTC+1, Jason Moore wrote:
>
> Sachin Joglekar developed the vector package this past summer. I was his 
> GSoC mentor on the project. You can check out this implemented of the 
> Cartesian coordinate system:
>
> https://github.com/sympy/sympy/blob/master/sympy/vector/coordsysrect.py
>

In sympy.diffgeom coordinate systems are defined as instances of the 
CoordSystem class, once more coordinate systems are defined, the 
transformation rules are set using the *connect_to* method:

In [1]: from sympy.diffgeom import *

In [2]: r, theta, phi = symbols('r theta phi', positive=True)

In [4]: M = Manifold('M', 3)

In [5]: P = Patch('P', M)

In [7]: rect = CoordSystem('rect', P, ['x', 'y', 'z'])

In [8]: spherical = CoordSystem('spherical', P, ['r', 'theta', 'phi'])

In [9]: spherical.connect_to(rect, [r, theta, phi], [r*sin(phi)*cos(theta), 
r*sin(phi)*sin(theta), r*cos(phi)], inverse=False)


I put *inverse=False* in the last line, because SymPy's solvers are unable 
to reverse the spherical-to-rect transformation.

Manifold and Patch are some boilerplate, Manifold specifies the space 
you're considering, while Patch is a connected subspace of the manifold. 
Patch is used because on some manifolds there does not exist a 
homeomorphism to a coordinate system (e.g. on the sphere).

I think that some algorithmic code could be shared between the vector and 
the diffgeom modules.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/7341823f-1172-4ecb-b322-f52f115d44f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to