def test_compare_kerr_kerrnewman_time_velocity(pos_vec, vel_vec, mass, a01): # time velocity for kerr & kerr-newman should be same when Q=0 a = kerr_utils.scaled_spin_factor(a01, mass.to(u.kg).value, constant.c.value, constant.G.value) t1 = kerr_utils.kerr_time_velocity(pos_vec, vel_vec, mass, a) t2 = kerrnewman_utils.kerrnewman_time_velocity(pos_vec, vel_vec, mass, a, 0.0 * u.C) assert_allclose(t1.value, t2.value, rtol=1e-10)
def test_compare_kerr_kerrnewman_time_velocity(): # time velocity for Kerr & Kerr-Newman should be same when Q=0 pos_vec = np.array([1.0, np.pi / 2, 0.1]) vel_vec = np.array([-0.1, -0.01, 0.05]) mass = 1e24 * u.kg a01 = 0.85 a = kerr_utils.scaled_spin_factor(a01, mass.to(u.kg).value) t1 = kerr_utils.kerr_time_velocity(pos_vec, vel_vec, mass, a) t2 = kerrnewman_utils.kerrnewman_time_velocity(pos_vec, vel_vec, mass, a, 0.0 * u.C) assert_allclose(t1.value, t2.value, rtol=1e-10)
def __init__(self, pos_vec, vel_vec, q, time, M, a, Q): self.M = M self.a = a self.Q = Q self.q = q self.pos_vec = pos_vec self.vel_vec = vel_vec self.time = time self.time_vel = kerrnewman_utils.kerrnewman_time_velocity( self.pos_vec, self.vel_vec, self.M, self.a, Q) self.initial_vec = np.hstack( (self.time.value, self.pos_vec, self.time_vel.value, self.vel_vec)) self.schwarzschild_r = schwarzschild_radius(M)
def __init__(self, bl_coords, q, M, Q, time): self.input_coords = bl_coords self.M = M self.a = self.input_coords.a.to(u.m) self.Q = Q self.q = q pos_vec, vel_vec = ( self.input_coords.si_values()[:3], self.input_coords.si_values()[3:], ) self.time = time time_vel = kerrnewman_utils.kerrnewman_time_velocity( pos_vec, vel_vec, self.M, self.a.value, Q) self.initial_vec = np.hstack( (self.time.value, pos_vec, time_vel.value, vel_vec)) self.scr = schwarzschild_radius(M)