code: def mass_3d(self, R, Rs, rho0, r_core):
          
          b = r_core * Rs ** -1
          x = R * Rs ** -1
  
          M_0 = 4 * np.pi * Rs**3 * rho0
  
          return M_0 * (x * (1+x) ** -1 * (-1+b) ** -1 + (-1+b) ** -2 *
                        ((2*b-1)*np.log(1/(1+x)) + b **2 * np.log(x / b + 1)))
docs: mass enclosed a 3d sphere or radius r
  
          :param r:
          :param Ra:
          :param Rs:
          :return: