1 | | This ticket implements Euclidean spaces as Riemannian manifolds diffeomorphic to '''R'''^n^ and equipped with a flat metric. Using the operators introduced in #24622, it provides the standard operators of vector calculus: dot product, norm, cross product, gradient, divergence, curl and Laplacian, along with the standard coordinate systems (Cartesian, spherical, cylindrical, etc.). |
| 1 | This ticket implements Euclidean spaces as Riemannian manifolds diffeomorphic to '''R'''^n^ and equipped with a flat metric, which defines the Euclidean dot product. Using the operators introduced in #24622, this provides the standard operators of vector calculus: dot product, norm, cross product, gradient, divergence, curl and Laplacian, along with the standard coordinate systems (Cartesian, spherical, cylindrical, etc.). |
5 | | Some functionalities introduced by this ticket are illustrated in this [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/Euclidean_plane.ipynb Jupyter worksheet]. |
| 5 | The implementation is performed via the parent class `EuclideanSpaceGeneric`, which inherits from `PseudoRiemannianManifold` (introduced in #24622). Two subclasses are devoted to specific cases: |
| 6 | - `EuclideanPlane` for n=2 |
| 7 | - `Euclidean3dimSpace` for n=3 |
| 8 | The user interface for constructing an Euclidean space relies on a single function: `EuclideanSpace`. |
| 9 | |
| 10 | The implementation through the manifold framework allows for an easy use of various coordinate systems, along with the related transformations. However, the user interface does not assume any knowledge of Riemannian geometry. In particular, no direct manipulation of the metric tensor is required. |
| 11 | |
| 12 | A minimal example is |
| 13 | {{{ |
| 14 | sage: E.<x,y,z> = EuclideanSpace(3) |
| 15 | sage: v = E.vector_field(-y, x, 0) |
| 16 | sage: v.display() |
| 17 | -y e_x + x e_y |
| 18 | sage: v[:] |
| 19 | [-y, x, 0] |
| 20 | sage: w = v.curl() |
| 21 | sage: w.display() |
| 22 | 2 e_z |
| 23 | sage: w[:] |
| 24 | [0, 0, 2] |
| 25 | }}} |
| 26 | The transformation to spherical coordinates: |
| 27 | {{{ |
| 28 | sage: spherical.<r,th,ph> = E.spherical_coordinates() |
| 29 | sage: spherical_frame = E.spherical_frame() # orthonormal frame (e_r, e_th, e_ph) |
| 30 | sage: v.display(spherical_frame, spherical) |
| 31 | r*sin(th) e_ph |
| 32 | sage: v[spherical_frame, :, spherical] |
| 33 | [0, 0, r*sin(th)] |
| 34 | sage: w.display(spherical_frame, spherical) |
| 35 | 2*cos(th) e_r - 2*sin(th) e_th |
| 36 | sage: w[spherical_frame, :, spherical] |
| 37 | [2*cos(th), -2*sin(th), 0] |
| 38 | }}} |
| 39 | |
| 40 | More detailed examples are in the following Jupyter notebooks: |
| 41 | |
| 42 | - [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_cartesian.ipynb vector calculus in Cartesian coordinates] |
| 43 | - [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_spherical.ipynb vector calculus in spherical coordinates] |
| 44 | - [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_cylindrical.ipynb vector calculus in cylindrical coordinates] |
| 45 | - [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_change.ipynb changing coordinates in the Euclidean 3-space] |
| 46 | - [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_advanced.ipynb Advanced aspects: Euclidean spaces as Riemannian manifolds] |
| 47 | - [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/Euclidean_plane.ipynb the Euclidean plane] |