Do you think, that we should restrict our class to only orthogonal curvilinear coordinates (Cartesian, Spherical, Cylindrical) or create class as general as possible?
W dniu wtorek, 21 marca 2017 23:56:32 UTC+1 użytkownik brombo napisał: > > 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 <[email protected] > <javascript:>> 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 [email protected] <javascript:>. >> To post to this group, send email to [email protected] <javascript:> >> . >> 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 [email protected]. To post to this group, send email to [email protected]. 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/9f60d7ef-1d8d-4f31-8c96-19a668a886d2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
