Пример #1
0
def scaled_spin_factor(a, M, c=constant.c.value, G=constant.G.value):
    """
    Returns a scaled version of spin factor(a)

    Parameters
    ----------
    a : float
        Number between 0 & 1
    M : float
        Mass of massive body
    c : float
        Speed of light. Defaults to speed in SI units.
    G : float
        Gravitational constant. Defaults to Gravitaional Constant in SI units.

    Returns
    -------
    float
        Scaled spinf factor to consider changed units

    Raises
    ------
    ValueError
        If a not between 0 & 1

    """
    half_scr = (schwarzschild_radius_dimensionless(M, c, G)) / 2
    if a < 0 or a > 1:
        raise ValueError("a to be supplied between 0 and 1")
    return a * half_scr
Пример #2
0
def radius_ergosphere(M,
                      a,
                      theta=np.pi / 2,
                      coord="BL",
                      c=constant.c.value,
                      G=constant.G.value):
    """
    Calculate the radius of ergospere of Kerr black hole at a specific azimuthal angle

    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. 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
    
    """
    Rs = schwarzschild_radius_dimensionless(M, c, G)
    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
Пример #3
0
def delta(r, M, a, c=constant.c.value, G=constant.G.value):
    """
    Returns the value r^2 - Rs * r + a^2
    Specific to Boyer-Lindquist coordinates

    Parameters
    ----------
    r : float
        Component r in vector
    M : float
        Mass of massive body
    a : float
        Any constant

    Returns
    -------
    float
        The value r^2 - Rs * r + a^2
    
    """
    Rs = schwarzschild_radius_dimensionless(M, c, G)
    return (r**2) - (Rs * r) + (a**2)
Пример #4
0
def metric(r, theta, M, a, c=constant.c.value, G=constant.G.value):
    """
    Returns the Kerr Metric

    Parameters
    ----------
    
    r : float
        Distance from the centre
    theta : float
        Angle from z-axis
    M : float
        Mass of massive body
    a : float
        Black Hole spin factor
    c : float
        Speed of light
    Returns
    -------
    ~numpy.array
        Numpy array of shape (4,4)

    """
    Rs = schwarzschild_radius_dimensionless(M, c, G)
    m = np.zeros(shape=(4, 4), dtype=float)
    sg, dl = sigma(r, theta, a), delta(r, M, a, c, G)
    c2 = c**2
    # set the diagonal/off-diagonal terms of metric
    m[0, 0] = 1 - (Rs * r / sg)
    m[1, 1] = (sg / dl) * (-1 / c2)
    m[2, 2] = -1 * sg / c2
    m[3, 3] = ((-1 / c2) * ((r**2) + (a**2) + (Rs * r * (np.sin(theta)**2) *
                                               ((a**2) / sg))) *
               (np.sin(theta)**2))
    m[0, 3] = m[3, 0] = Rs * r * a * (np.sin(theta)**2) / (sg * c)
    return m
Пример #5
0
def dmetric_dx(r, theta, M, a, c=constant.c.value, G=constant.G.value):
    """
    Returns differentiation of each component of Kerr metric tensor w.r.t. t, r, theta, phi

    Parameters
    ----------
    
    r : float
        Distance from the centre
    theta : float
        Angle from z-axis
    M : float
        Mass of massive body
    a : float
        Black Hole spin factor
    c : float
        Speed of light
    Returns
    -------
    dmdx : ~numpy.array
        Numpy array of shape (4,4,4)
        dmdx[0], dmdx[1], dmdx[2] & dmdx[3] is differentiation of metric w.r.t. t, r, theta & phi respectively

    """
    Rs = schwarzschild_radius_dimensionless(M, c, G)
    dmdx = np.zeros(shape=(4, 4, 4), dtype=float)
    sg, dl = sigma(r, theta, a), delta(r, M, a, c, G)
    c2 = c**2

    # metric is invariant on t & phi
    # differentiation of metric wrt r
    def due_to_r():
        nonlocal dmdx
        dsdr = 2 * r
        dddr = 2 * r - Rs
        tmp = (Rs * (sg - r * dsdr) / sg) * (1 / sg)
        dmdx[1, 0, 0] = -1 * tmp
        dmdx[1, 1, 1] = (-1 / c2) * (dsdr - (sg * (dddr / dl))) / dl
        dmdx[1, 2, 2] = (-1 / c2) * dsdr
        dmdx[1, 3,
             3] = ((-1 / c2) * (2 * r + (a**2) * (np.sin(theta)**2) * tmp) *
                   (np.sin(theta)**2))
        dmdx[1, 0, 3] = dmdx[1, 3,
                             0] = (1 / c) * (a * (np.sin(theta)**2) * tmp)

    # differentiation of metric wrt theta
    def due_to_theta():
        nonlocal dmdx
        dsdth = -2 * (a**2) * np.cos(theta) * np.sin(theta)
        tmp = (-1 / sg) * Rs * r * dsdth / sg
        dmdx[2, 0, 0] = -1 * tmp
        dmdx[2, 1, 1] = (-1 / c2) * (dsdth / dl)
        dmdx[2, 2, 2] = (-1 / c2) * dsdth
        dmdx[2, 3,
             3] = (-1 / c2) * (2 * np.sin(theta) * np.cos(theta) *
                               ((r**2) +
                                (a**2)) + tmp * (a**2) * (np.sin(theta)**4) +
                               (4 * (np.sin(theta)**3) * np.cos(theta) *
                                (a**2) * r * Rs / sg))
        dmdx[2, 0, 3] = dmdx[2, 3, 0] = (a / c) * (
            (np.sin(theta)**2) * tmp +
            (2 * np.sin(theta) * np.cos(theta) * Rs * r / sg))

    due_to_r()
    due_to_theta()
    return dmdx