def get_max_velocity(p_spt, s_temp):
MS = SpectralTypeRelations.MainSequence()
s_spt = MS.GetSpectralType('temperature', s_temp, prec=1e-3)
R1 = MS.Interpolate('radius', p_spt)
T1 = MS.Interpolate('temperature', p_spt)
M1 = MS.Interpolate('mass', p_spt)
M2 = MS.Interpolate('mass', s_spt)
G = constants.G.cgs.value
Msun = constants.M_sun.cgs.value
Rsun = constants.R_sun.cgs.value
v2 = 2.0 * G * Msun * (M1 + M2) / (Rsun * R1 * (T1 / s_temp) ** 2)
return np.sqrt(v2) * u.cm.to(u.km)
评论列表
文章目录