This site uses cookies. By continuing to use this site you agree to our use of cookies. To find out more, see our Privacy and Cookies policy. Close this notification

A Cosmology Calculator for the World Wide Web

Published 2006 December 13 © 2006. The Astronomical Society of the Pacific. All rights reserved. Printed in U.S.A.
, , Citation E. L. Wright 2006 PASP 118 1711 DOI 10.1086/510102

1538-3873/118/850/1711

ABSTRACT

A cosmology calculator that computes times and distances as a function of redshift for user‐defined cosmological parameters has been made available online. This paper gives the formulae used by the cosmology calculator and discusses some of its implementation. A version of the calculator that allows one to specify the equation‐of‐state parameter w and w', and one for converting the light‐travel times usually given in the popular press into redshifts, is also located at the same site.

Export citation and abstract BibTeX RIS

1. INTRODUCTION

There are many definitions of distance in cosmology, and it is often frustrating to calculate the kind of distance needed for a given situation. In particular, press releases (W. Clavin 2006, unpublished)2 very often use the "light‐travel time distance," Dltt = c(t0 - tem), even though this distance has many undesirable characteristics. I wrote the cosmology calculator in order to be able to calculate Dltt along with the observable angular and luminosity distances DA and DL, respectively. It also computes the proper radial distance, which is the only distance that is compatible with the common definition of distance for moving objects: the spatial separation at a common time. The common time used is right now, or t0. This is called Dnow below. The term Dnow, also known as the comoving radial distance, is not measurable from a single position, but can in principle be measured by a family of comoving observers. It is the one distance that satisfies the Hubble law exactly— dD/dt = H(t)D—without any corrections. Other distances are defined using quantities taken from more than one time and generally only satisfy the Hubble law to first order.

2. EQUATIONS

The following results have been given many times before. Hogg (1999) gives equations that are equivalent to the ones in this paper, but for completeness in documenting the cosmology calculator, the equations are spelled out below.

The metric is given by

where S(x) is sinh (x) if Ωtot<1, and sin (x) for Ωtot>1. The radius of curvature is given by R0 = (c/H0)/(|1 - Ωtot|)1/2, since I use the normalization that a = 1 at the current time, so the redshift is given by 1 + z = 1/a. The past light cone is given by cdt = a(t)R0dψ, so the comoving radial distance is

and of course the light‐travel time distance is given by

The exact dynamics of the universe can be captured using the energy equation from the Newtonian approximation to cosmology, which gives

General relativity modifies the acceleration equation by including the pressure as a source of gravity, but this just cancels the variation of the enclosed mass M(<a) caused by the pressure, so the energy equation is exact. Thus, we can write a ˙ as H0 X, with

where q0 is the deceleration parameter. Let us define a quantity Z that is the comoving distance divided by the Hubble radius c/H0. Then

To first order, this agrees with the redshift, so Z = z + .... This definition gives Dnow = (cZ/H0) and Dltt = (c/H0) ∫1/(1 + z)1da/ X. Thus, the angular size distance—defined as DA = R/ θ, where R is the transverse proper length of an object that subtends an angle θ on the sky—is given by

We can define a function J(x), given by

Then

Note that the luminosity distance DL is defined to make the inverse square law work perfectly for bolometric fluxes, so that Fbol = L/(4πD2L) for an object of luminosity L.

The enclosed volume calculation requires the integral of either sin2ψdψ or sinh2ψdψ. The closed case becomes

Note that ψ = (|1 - Ωtot|)1/2Z(z). The open case gives

The ratio of V(<z) to the Euclidean formula (4π/3)(R0ψ)3 is given by

in both the open and closed cases.

3. IMPLEMENTATION

The cosmology calculator is implemented as a Web page (CosmoCalc)3 that has a large number of JavaScript definitions in the header, followed by immediately executed JavaScript that writes a frame set to the current document. The frame set calls for the input form (CCform)4 and the output page (CCout).5 If JavaScript is not enabled, or if there is an error in the JavaScript, then the body of CosmoCalc is displayed. This body is just an error message saying that JavaScript must be enabled.

I have received several requests for the code used in the cosmology calculator; but since the code is in JavaScript, it is in the HTML files in ASCII form. It is easy to save the page source to get the code, and it is easy to modify the code using any text editor. If your modifications introduce an error, then you will see the error message saying that JavaScript must be enabled. This only means that you must find the error in your modified CosmoCalc. I have had to do this dozens of times, so do not be discouraged.

Even if you do not intend to modify the code, downloading the three HTML files will let you run the calculator locally when not connected to the Internet.

The numerical evaluation of the integrals for Z and t is done using the midpoint rule with 1000 panels. While this is not a very efficient use of CPU time, it was very easy to code. And with JavaScript, the CPU time is consumed on the user's computer instead of on the server. The functions being integrated go smoothly to zero as a goes to zero, as long as Ωr>0.

Another hidden aspect of the cosmology calculator is that it automatically sets the radiation density Ωrh2 to the value appropriate for T0 = 2.72528 K and three massless neutrino species, Ωrh2 = 4.165 × 10-5. Here h = H0/(100 km s-1 Mpc-1), and this factor includes a small (<1%) boost in the neutrino density due to a slight transfer to e+,e- annihilation energy into neutrinos (Hannestad & Madsen 1995). Therefore, if you want to verify some simple cases, such as the empty universe, you should use a large value of the Hubble constant, which reduces the relative importance of this radiation term. For example, the "Open" button with H0 = 97.78 and ΩM = 0 gives an age of the universe of 9.934 Gyr, which is 0.7% from the expected 10 Gyr. But using H0 = 977.8 gives an age of 999 Myr, which is only 0.1% from the expected 1 Gyr.

For very early times, the age of the universe is adjusted to allow for the existence of e+,e-, μ+-, etc., using the terms g* and g*S for the standard model of particle physics given by Kolb & Turner (1990).

4. LIGHT‐TRAVEL TIME INVERSION

A slightly modified version of the cosmology calculator (DlttCalc) is also posted online.6 The input form asks for the light‐travel time in Gyr, instead of redshift. The redshift is found by evaluating the integral for light‐travel time in steps of −0.001 in a, starting from a = 1 until the input value is exceeded, and then interpolating to get a and thus z. Once z is known, the calculations proceed as in CosmoCalc.

5. MORE OPTIONS

Since the cosmology calculator was first written, there have been two developments that have changed the kinds of models that people want to run. I have created a new version of the cosmology calculator (ACC) that has more options and have made it available on the Web.7 One development is the discovery of neutrino oscillations, indicating that the assumption of massless neutrinos is not correct. The neutrino temperature is (4/11)1/3T0 = 1.95 K, and a typical momentum for a thermal neutrino is ≈ 3kT/c. This corresponds to the rest energy of a neutrino with mc2 ≈ 0.0005 eV. Since the neutrinos thermalized while still relativistic, their distribution is that of a relativistic Fermi‐Dirac particle, so the neutrino density is given by

The number of spin states for a neutrino is one, but to allow for antineutrinos, one should use gs = 2.

The integral over neutrino momentum has to be evaluated for each step of the integration over a, so it needs to be done efficiently, even when the work is done on the user's computer. In the low‐temperature limit when kTν≪mνc2, the integral over x evaluates to mν(3/4)ζ(3)Γ(3), while in the high‐temperature limit kTν≫mνc2, the integral evaluates to (kTν/c2)(7/8)ζ(4)Γ(4). Both limits can be evaluated correctly by approximating the integral using

with the single integration knot at x1 = [(7/8)ζ(4)Γ(4)]/[(3/4)ζ(3)Γ(3)] = 3.151. This approximation has a maximum error of <3%. However, a better approximation is

with

and β = 1.842, which has a maximum error <0.3%. The mass at which neutrinos are semirelativistic at the current epoch is

The final result is that the effective neutrino density can be written as

The normalization of 93.14 eV is from Mangano et al. (2005) and is 1.05% higher than the nominal, due to residual coupling of annihilation energy to the neutrinos. In the relativistic limit, the density is 1.53% higher. Increasing Tν by 0.48% over the nominal (4/11)1/3T0 when computing mrel allows for the relativistic limit, and this boost is included in equation (17).

This Ων(z) is just a function of z that gives Ων at z = 0 and should not be confused with the actual Ων at z‐values other than zero. In ACC, the neutrino density at z = 0 is subtracted from the input ΩM, giving separate ΩCM = ΩM - Ων(z = 0) for the cold dark matter (CDM) and baryons, and Ων for the neutrinos. Of course, the neutrinos are not included in the radiation, so Ωrh2 = 2.778 × 10-5(T0/2.72528)4.

For a hierarchical neutrino mass pattern with masses ≈0.001, 0.009, and 0.049 eV, the change in distances introduced by neutrino masses is negligible. At redshifts up to 5 in the Wilkinson Microwave Anisotropy Probe concordance flat ΛCDM cosmology with ΩM = 0.27 and H0 = 71, the changes are less than 0.01%. This mass pattern is the default when ACC is loaded. But even the more massive nearly degenerate neutrino mass patterns, such as ≈0.33, 0.33, and 0.33 eV, have a minimal effect on the distances and times.

The second change in the paradigm is the introduction of the equation of state w(z) = P/ρc2 as a parameter in the model. I have implemented w(z) as w = w0 + 2w'(1 - a), following Linder (2003), who added the factor of 2 normalization to the simple form used by Chevallier & Polarski (2001). This functional form behaves well at high redshift, and it allows an analytic solution for the dark energy density as a function of z. This solution is

The defaults are w = -1 and w' = 0, and in that case, ACC reduces to the CosmoCalc case.

Unlike the neutrino masses, changes in w have substantial effects on distances and ages. Changing w to −0.7 instead of the default −1 changes the age of the universe by 6% and the luminosity distance at z = 1 by 7% when ΩM = 0.27, ΩDE = 0.73, and H0 = 71 are left unchanged. But for w = -0.7, the model that is consistent with both supernovae (Riess et al. 2004, "gold+silver") and the cosmic microwave background (Page et al. 2003, peak positions) changes to an open model with ΩM = 0.19, ΩDE = 0.74, and H0 = 84, and this gives an age change of 17% and a luminosity distance change of 21% at z = 1. However, if ΩM and ΩDE are allowed to vary as free parameters, the observable supernova signal in DL is reduced to only 0.3% (Wright 2005).

Finally, ACC allows one to input T0, allowing for easier tests of simple cases. With these changes, the X‐function is

The rest of the calculation of distances is unchanged.

6. CONCLUSION

These cosmology calculators are suitable for interactive use, providing fairly quick answers for single cases. Users who wish to use the code for large‐scale calculations should translate it into a compiled language and change the quadrature formula. In particular, if fitting to data sets with redshifts and distance, the data should be sorted by redshift, and the distance integrals should be evaluated for all objects in a single pass through the sorted data. Plotting figures is an obvious case in which redshifts are computed in order: Figure 1 shows the distance measures discussed in this paper as a function of z for three different models. The formulae presented here were translated into Postscript for this figure, resulting in a 4 kbyte file.

Fig. 1.—

Fig. 1.— Four distance measures DA, Dltt, Dnow, and DL (bottom to top), plotted against a fifth distance measure, the redshift z, for three different cosmological models: an open CDM model, a flat ΛCDM model, and a closed CDM model. The center and right panels are consistent with the CMB angular power spectrum, while the left and center panels are consistent with large‐scale structure. Only the center panel is consistent with supernova data.

Footnotes

  • See the JPL press release online at http://www.nasa.gov/centers/jpl/news/spitzerf‐20060321.html.

  • See http://www.astro.ucla.edu/∼wright/CosmoCalc.html.

  • See http://www.astro.ucla.edu/∼wright/CCform.html.

  • See http://www.astro.ucla.edu/∼wright/CCout.html.

  • See http://www.astro.ucla.edu/∼wright/DlttCalc.html.

  • See http://www.astro.ucla.edu/∼wright/ACC.html.

Please wait… references are loading.
10.1086/510102