Esempio n. 1
0
// EWTemperature computes the emission-wieghted temperature of a halo
// integrated out to the specified radius.  Here, the emission-weighted
// temperature is:
//
// int dr r**2 rhoG**2 * Lambda * T / int dr r**2 * rhoG**2 * Lambda
//
// Here, Lambda is a cooling coefficient taken to be proportional to
// sqrt(T) and the temperature is calculated from the pressure profile which
// is specified by pbt and ppt. bt is necceary because we're using PV = nRT
// and thus need ot figure out the
//
// Return value is in keV.
func (h *Halo) EWTemperature(bt BiasType, pbt PressureBiasType, ppt PressureProfileType, rMax float64) float64 {
	rMin := h.MinR()
	scale := math.Log10(rMax) - math.Log10(rMin)

	numFunc := createNumFunc(h, pbt, ppt, bt)
	numInt := num.Integral(numFunc, rMin, scale, num.Log, num.Spherical)

	denFunc := createDenFunc(h, pbt, ppt, bt)
	denInt := num.Integral(denFunc, rMin, scale, num.Log, num.Spherical)

	return numInt(rMax) / denInt(rMax)
}
Esempio n. 2
0
// ThomsonY calculates the spherical Thompson Y out to the specified radius.
func (h *Halo) ThompsonY(pbt PressureBiasType, ppt PressureProfileType, r float64) float64 {
	P := func(r float64) float64 {
		return h.Pressure(pbt, ppt, ElectronPressure, r)
	}

	intTerm := num.Integral(P, h.MinR(), h.Rs, num.Log, num.Spherical)(r)
	constTerm := cosmo.SigmaTMks / (cosmo.MeMks * cosmo.CMks * cosmo.CMks)
	return intTerm * constTerm * cosmo.MpcMks
}
Esempio n. 3
0
// DFluctuaction gives the linear growth rate of density fluctuations at
// a = 1 / (1 + z).
func DFluctuation(a float64) float64 {
	x := pradaX(a)

	term1 := (5.0 / 2.0) * math.Pow(OmegaM/OmegaL, 1.0/3.0)
	term2 := math.Sqrt((1.0 + x*x*x) / (x * x * x))

	dimlessIntegral := num.Integral(func(xp float64) float64 {
		return xp / math.Pow(1.0+xp*xp*xp, 1.5)
	}, 0, x, num.Linear, num.Flat)

	return term1 * term2 * dimlessIntegral(x)
}
Esempio n. 4
0
// GasEnclosed returns the mass of all the gas in a halo enclosed within the
// given radius. The returned value is given in MSolar.
func (h *Halo) GasEnclosed(bt BiasType, pbt PressureBiasType, ppt PressureProfileType, r float64) float64 {
	rho := func(r float64) float64 { return h.RhoGas(bt, pbt, ppt, r) }
	return num.Integral(rho, h.MinR(), 0.1, num.Log, num.Spherical)(r)
}