Opened 4 years ago
Closed 4 years ago
#27548 closed enhancement (fixed)
Introduce periodic coordinates on manifolds
Reported by:  Eric Gourgoulhon  Owned by:  

Priority:  major  Milestone:  sage8.8 
Component:  geometry  Keywords:  coordinate chart, manifold 
Cc:  Travis Scrimshaw  Merged in:  
Authors:  Eric Gourgoulhon  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  1718b1d (Commits, GitHub, GitLab)  Commit:  1718b1d43dcc024c5bb1b9b1be6afa0142c99b36 
Dependencies:  Stopgaps: 
Description (last modified by )
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] = (12/r), 1/(12/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
Change History (6)
comment:1 Changed 4 years ago by
Branch:  → public/manifolds/periodic_coords 

Cc:  Travis Scrimshaw added 
Commit:  → 1d658e0e3f95a6c8389e7b0b36eea914078bfff8 
Status:  new → needs_review 
comment:2 Changed 4 years ago by
Description:  modified (diff) 

comment:3 Changed 4 years ago by
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
Reviewers:  → Travis Scrimshaw 

Status:  needs_review → positive_review 
LGTM.
comment:6 Changed 4 years ago by
Branch:  public/manifolds/periodic_coords → 1718b1d43dcc024c5bb1b9b1be6afa0142c99b36 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
Add periodic coordinates in manifold charts
Treatment of periodic coordinates in point comparison; add periodic azimuthal coordinate in Euclidean spaces
Correct typo in error message in IntegratedCurve.solve()