Exemplo n.º 1
0
def test_electromagnetic_potential_from_em_potential_vector(test_input):
    """
    Tests, if the calculated EM 4-Potential is the same as that from the formula

    """
    r, theta, M, a = test_input
    Q = 15.5

    # Using function from module
    mkn = KerrNewman(coords="BL", M=M, a=a, Q=Q)
    mkn_pot = mkn.em_potential_covariant(r, theta, M=M, a=0., Q=Q)

    # Calculated using formula
    calc_pot = np.zeros((4, ), dtype=float)
    calc_pot[0] = (Q / ((_c**2) * r)) * np.sqrt(_G * _Cc)

    assert_allclose(mkn_pot, calc_pot, rtol=1e-8)
Exemplo n.º 2
0
def test_electromagnetic_potential_from_em_potential_vector(test_input):
    """
    Tests, if the calculated EM 4-Potential is the same as that from the formula

    """
    bl, M, a = test_input
    Q = 15.5 * u.C

    x_vec = bl.position()
    r = x_vec[1]

    # Using function from module (for a = 0)
    mkn = KerrNewman(coords=bl, M=M, a=0. * u.one, Q=Q)
    mkn_pot = mkn.em_potential_covariant(x_vec)

    # Calculated using formula (for a = 0)
    calc_pot = np.zeros((4,), dtype=float)
    calc_pot[0] = (Q.value / ((_c ** 2) * r)) * np.sqrt(_G * _Cc)

    assert_allclose(mkn_pot, calc_pot, rtol=1e-8)