Ask Your Question

Switching coordinate charts mid-integration with solve_across_charts

asked 2023-03-07 11:49:36 +0200

Bubbz gravatar image

I am trying to utilize solve_across_charts to avoid coordinate singularities by switching from spherical to cartesian coordinates when integrating geodesics in the Kerr spacetime. However the code just keeps infinitely running. Following the documentation, my code is (9.3 version),

M = Manifold(4, 'M', latex_name=r'\mathcal{M}', structure='Lorentzian')
X.<t,r,th,ph>=M.chart(r"t r:(2.011,+infinity) th:(0,pi):\theta ph:(0,2*pi):periodic\phi") 
C.add_restrictions(sqrt(x**2+y**2+z**2) > 2.011) 
X_to_C=X.transition_map(C,[t,r*sin(th)*cos(ph),r*sin(th)*sin(ph), r*cos(th)])
var('m,b,a', domain='real')
g = M.metric()

rho2 = r^2 + (a*cos(th))^2
Delta = r^2 -2*m*r + a^2
g[0,0] = -(1-2*m*r/rho2)
g[0,3] = -2*a*m*r*sin(th)^2/rho2
g[1,1], g[2,2] = rho2/Delta, rho2
g[3,3] = (r^2+a^2+2*m*r*(a*sin(th))^2/rho2)*sin(th)^2

def g00(m,r,th,a):return g[0,0](m,r,th,a)
def g03(m,r,th,a):return g[0,3](m,r,th,a)
def g11(m,r,th,a):return g[1,1](m,r,th,a)
def g22(m,r,th,a):return g[2,2](m,r,th,a)
def g33(m,r,th,a):return g[3,3](m,r,th,a)
def D(m,r,th,a): return (g03(m,r,th,a))^2-g00(m,r,th,a)*g33(m,r,th,a)

def initial_vector(r0, b,al,ph0=0, E=1, inward=False):
L = -b*E
vth0 = al/(r0*r0)
if inward:

    vr0 = - vr0

vph0 = -(1/D(m,r0,th0,a))*(E*g03(m,r0,th0,a)+L*(g00(m,r0,th0,a)))
p0 = M((t0, r0, th0, ph0), name='p_0')

return M.tangent_space(p0)((vt0, vr0, vth0, vph0), name='v_0')

r0 = 100 
s = var('s') 

v0 = initial_vector(r0, b=0,al=0, ph0=ph0, inward=True)
geod = M.integrated_geodesic(g, (s, 0, 150), v0, across_charts=True)

sol = geod.solve_across_charts(step=0.1, method='odeint', parameters_values={a:0.5},
interp = geod.interpolate()

I think the issue is on the declaration of the transition maps, however I've tried everything I could think of with no luck. Any help would be much appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-03-09 01:08:52 +0200

Florentin Jaffredo gravatar image

I am not entirely sure how to solve your issue. Indeed If I remove your chart transition, the geodesic declaration (M.integrated_geodesic(...) no longer hangs. My guess is that it is trying to express the metric in the second frame, and fails to invert/simplify something. It does not even start integrating.

But I am wondering what you are trying to achieve with this second chart. None of the systems of coordinates you are using are regular on the horizon. However, Kerr's original coordinates are (see Eq. (3) of this review). Using a coordinate system that is regular on the horizon, it is sufficient to impose $r>0.1$ (or anything small) to avoid the central singularity (no change of variable can save you, since it is a true, physical singularity). solve_across_charts should automatically stop the integration if it exits the chart domain.

If you are interested, you can check this notebook, where I implement basic black-hole ray-tracing step by step. Extending it to the Kerr metric should be straightforward (but very computationally intense, since I make use of the spherical symmetry of Schwarzschild to drastically reduce the computation time).

edit flag offensive delete link more


Thanks for your response. My issue is not with the horizon but with the axis of the object. For example in the edge-on case (observer theta=pi/2), a good number of geodesics, with a set of impact parameters (b,a)=(0,a), exit the chart and the integration stops, when it shouldn't.

Bubbz gravatar imageBubbz ( 2023-03-09 19:30:40 +0200 )edit

Can you try without solve_across_charts? The integration is supposed to stop when exiting the chart. Are you saying it wrongly detects the edge of the charts? Do you have a minimum working example for the behaviour you describe?

Florentin Jaffredo gravatar imageFlorentin Jaffredo ( 2023-03-09 20:18:39 +0200 )edit

For example in the code that is in my post, whatever the impact parameter al maybe, however large, if b=0 meaning that we send a geodesic on the axis of the BH, the integration terminates due to the spherical chart reaching its edge.

Bubbz gravatar imageBubbz ( 2023-03-12 19:59:16 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2023-03-07 11:49:36 +0200

Seen: 115 times

Last updated: Mar 09 '23