Opened 4 years ago

Closed 4 years ago

# Introduce periodic coordinates on manifolds

Reported by: Owned by: Eric Gourgoulhon major sage-8.8 geometry coordinate chart, manifold Travis Scrimshaw Eric Gourgoulhon Travis Scrimshaw N/A 1718b1d 1718b1d43dcc024c5bb1b9b1be6afa0142c99b36

This ticket introduces periodic coordinates on manifolds for more flexibility. In particular, this fixes an issue with the azimuthal angle phi being limited to the interval (0,2*pi). For instance, the numerical computation of a geodesic that is winding around the center in Schwarzschild spacetime fails:

sage: M = Manifold(4, 'M', structure='Lorentzian')
sage: X.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi')
sage: g = M.metric()
sage: g[0,0], g[1,1] = -(1-2/r), 1/(1-2/r)
sage: g[2,2], g[3,3] = r^2, (r*sin(th))^2
sage: p0 = M((0, 8, pi/2, pi))  # initial point
sage: v0 = M.tangent_space(p0)((1.297, 0, 0, 0.064))  # initial tangent vector
sage: s = var('s')
sage: geod = M.integrated_geodesic(g, (s, 0, 1500), v0)
sage: geod.solve() # numerical integration
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
...
ValueError: the 7th point (initial point being the '0th' point) of the
numerical solution (obtained for a curve parameter equal to 105.0) is
out of the chart domain

This is because phi reaches 2*pi at some point in the integration.

With the branch in this ticket, it suffices to declare phi to be a periodic coordinate, by adding the keyword periodic in the chart definition

sage: X.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):periodic:\phi')

to allow for the full integration of the geodesic.

The periodicity of the coordinate is taken into account in point comparisons:

sage: M((0, 8, pi/2, pi)) == M((0, 8, pi/2, 3*pi))
True
sage: M((0, 8, pi/2, pi)) == M((0, 8, pi/2, -pi))
True

### comment:1 Changed 4 years ago by Eric Gourgoulhon

Branch: → public/manifolds/periodic_coords Travis Scrimshaw added → 1d658e0e3f95a6c8389e7b0b36eea914078bfff8 new → needs_review

New commits:

 ​d27d464 Add periodic coordinates in manifold charts ​2e2543e Treatment of periodic coordinates in point comparison; add periodic azimuthal coordinate in Euclidean spaces ​1d658e0 Correct typo in error message in IntegratedCurve.solve()

### comment:2 Changed 4 years ago by Eric Gourgoulhon

Description: modified (diff)

### comment:3 Changed 4 years ago by git

Commit: 1d658e0e3f95a6c8389e7b0b36eea914078bfff8 → 1718b1d43dcc024c5bb1b9b1be6afa0142c99b36

Branch pushed to git repo; I updated commit sha1. New commits:

 ​1718b1d Fix two pyflakes errors in src/sage/manifolds/differentiable

### comment:4 Changed 4 years ago by Travis Scrimshaw

Reviewers: → Travis Scrimshaw needs_review → positive_review

LGTM.

### comment:5 Changed 4 years ago by Eric Gourgoulhon

Thanks for the review!

### comment:6 Changed 4 years ago by Volker Braun

Branch: public/manifolds/periodic_coords → 1718b1d43dcc024c5bb1b9b1be6afa0142c99b36 → fixed positive_review → closed
Note: See TracTickets for help on using tickets.