示例#1
0
def radius_ergosphere(Rs, a, theta=np.pi / 2, coord="BL"):
    """
    Calculate the radius of ergospere of Kerr black hole at a specific azimuthal angle

    Parameters
    ----------
    Rs : float
        Schwarzschild Radius
    a : float
        Black hole spin factor
    theta : float
        Angle from z-axis in Boyer-Lindquist coordinates in radians. Defaults to pi/2.
    coord : str
        Output coordinate system. 'BL' for Boyer-Lindquist & 'Spherical' for spherical. Defaults to 'BL'.

    Returns
    -------
    ~numpy.array
        [Radius of ergosphere(R), angle from z axis(theta)] in BL/Spherical coordinates
    
    """
    Re = 0.5 * (Rs + np.sqrt((Rs**2) - 4 * (a**2) * (np.cos(theta)**2)))
    if coord == "BL":
        ans = np.array([Re, theta], dtype=float)
    else:
        ans = utils.CartesianToSpherical_pos(
            utils.BLToCartesian_pos(np.array([Re, theta, 0.0]), a))[:2]
    return ans
示例#2
0
def event_horizon(M,
                  a,
                  theta=np.pi / 2,
                  coord="BL",
                  c=constant.c.value,
                  G=constant.G.value):
    """
    Calculate the radius of event horizon of Kerr black hole

    Parameters
    ----------
    M : float
        Mass of massive body
    a : float
        Black hole spin factor
    theta : float
        Angle from z-axis in Boyer-Lindquist coordinates in radians. Mandatory for coord=='Spherical'. Defaults to pi/2.
    coord : str
        Output coordinate system. 'BL' for Boyer-Lindquist & 'Spherical' for spherical. Defaults to 'BL'.

    Returns
    -------
    ~numpy.array
        [Radius of event horizon(R), angle from z axis(theta)] in BL/Spherical coordinates
    
    """
    Rs = schwarzschild_radius_dimensionless(M, c, G)
    Rh = 0.5 * (Rs + np.sqrt((Rs**2) - 4 * (a**2)))
    if coord == "BL":
        ans = np.array([Rh, theta], dtype=float)
    else:
        ans = utils.CartesianToSpherical_pos(
            utils.BLToCartesian_pos(np.array([Rh, theta, 0.0]), a))[:2]
    return ans
示例#3
0
    Returns
    -------
    ~numpy.array
        [Radius of event horizon(R), angle from z axis(theta)] in BL/Spherical coordinates
    
    """

    Rh = 0.5 * (
        Rs + np.sqrt((Rs ** 2) - 4 * (a ** 2 + (charge_length_scale(Q, c, G, Cc)) ** 2))
    )
    if coord == "BL":
        ans = np.array([Rh, theta], dtype=float)
    else:
        ans = utils.CartesianToSpherical_pos(
            utils.BLToCartesian_pos(np.array([Rh, theta, 0.0]), a)
        )[:2]
    return ans


def metric(c, G, Cc, r, theta, Rs, a, Q):
=======
    Cc=constant.coulombs_const.value,
):
>>>>>>> 0e311bec1be2508a28ebd8a3f8b7b944db997269
    """
    Returns the Kerr-Newman Metric

    Parameters
    ----------
    
def test_CartesianToSpherical_pos(pos_vec, ans_vec):
    ans = utils.CartesianToSpherical_pos(pos_vec)
    assert_allclose(ans, ans_vec, rtol=0.0, atol=1e-5)
示例#5
0
def test_CartesianToSpherical_pos():
    pos_vec = np.array([20.0, 311.0, 210.0])
    ans_vec = np.array([375.79382645275, 0.9778376650369, 1.5065760775947])
    ans = utils.CartesianToSpherical_pos(pos_vec)
    assert_allclose(ans, ans_vec, rtol=0.0, atol=1e-5)