What you need to define a coordinate system and vector calculus (div, curl,
etc.) is a set of coordinate variables, a corresponding set of basis
vectors, the dot products of all the basis vectors in terms of the
coordinates (the metric tensor), and the derivatives of the basis vectors
as a linear combination of the basis vectors with coefficients that depend
only upon the coordinates (derivable from the Christoffel symbols which are
derived from the metric tensor).  Note that the metric tensor can be
derived from the vector manifold function which you can write in
rectangular coordinates with coefficients that are functions of the
coordinates of the coordinate system you wish to define.  Instead of hard
coding a particular coordinate system just instantiate a member of the
coordinate system class as needed with a given vector manifold function or
a given metric tensor.  For example if the class is called CoordinateSystem
then for a spherical coordinate system you would have -

ShericalCooridinates =
CoordinateSystem((r*cos(theta),r*sin(theta)*cos(phi),r*sin(theta)*sin(phi)),(r,theta,phi))

where (r*cos(theta),r*sin(theta)*cos(phi),r*sin(theta)*sin(phi)) is the
vector manifold for spherical coordinates and (r,theta,phi) are the
coordinate symbols. The if V is a vector function in terms of the spherical
coordinates you could have

ShericalCooridinates.div(V) returns the divergence and

ShericalCooridinates.curl(V) returns the curl, and if A and B are two
vectors in spherical coordinates then

ShericalCooridinates.dot(A,B) returns the dot product and

ShericalCooridinates.cross(A,B) returns the cross product.

On Tue, Mar 21, 2017 at 4:21 PM, Sassi Aissa <
sassi.aissa.takiedd...@gmail.com> wrote:

> As I read the description of the Idea, I think I have to implement an
> abstract class called: Coordinate System, then create several classes that
> represent different types
> of Coordinate system and inherent from the so called 'Coordinate System'
> class. Is it like this?
>
> --
> 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 https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/747ffaa1-3d64-4728-8e8e-8b76b59e4a31%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/747ffaa1-3d64-4728-8e8e-8b76b59e4a31%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CALOxT-kNRNxOhxn7MvkKHO5MQb1dKFbio6c37cv0oF8MujHKMA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to