=head1 NAME
Astro::Cosmology - calculate cosmological distances, volumes, and times
=head1 DESCRIPTION
This module provides a set of routines to calculate a number
of cosmological quantities based on distance and time. Some are
a bit complex - e.g. the volume element at a given redshift - while
some, such as the conversion between flux and luminosity, are more mundane.
To calculate results for a given cosmology you create an
C object with the desired cosmological parameters,
and then call the object's methods to perform the actual calculations.
If you aren't used to objects, it may sound confusing; hopefully
the L section below will help (after all, a
bit of code is worth a thousand words). The advantage of using an
object-orientated interface is that the object can carry around the
cosmological parameters, so you don't need to keep on specifying them
whenever you want to calculate anything; it also means you can write
routines which can just accept an C object rather
than all the cosmological parameters.
This module I that the PDL distribution is installed
on your machine; PDL is available from CPAN or
http://pdl.perl.org/
=head1 WARNING
Whilst I believe the results are accurate, I do not guarantee this.
Caveat emptor, as the Romans used to say...
=head1 SYNOPSIS
use Astro::Cosmology qw( :constants );
# what is the luminosity distance, in metres, for
# a couple of cosmologies
#
my $z = sequence(10) / 10;
my $eds = Astro::Cosmology->new;
my $sn = Astro::Cosmology->new( matter => 0.3, lambda => 0.7 );
my $de = 1.0e6 * PARSEC * $eds->lum_dist($z);
my $ds = 1.0e6 * PARSEC * $sn->lum_dist($z);
# let's change the parameters of the $sn cosmology
$sn->setvars( lambda=>0.6, matter=>0.2 );
=head1 UNITS
If H0 is set to 0, then the units used are the Hubble
distance, volume per steradian, or time. If greater than zero,
distances are measured in Mpc, volumes in Mpc^3/steradian,
and time in years.
=head1 NOTES
=over 4
=item *
The comoving volume routine gives a slightly smaller answer than
Figure 6 of Carroll, Press & Turner for z ~ 100. It could be due to
differences in the numerical methods, but I've not yet investigated
it thoroughly.
=item *
A year is defined to be YEAR_TROPICAL seconds.
Let me know if this is wrong.
=back
=head1 THEORY
The following calculations were cobbled together from a number
of sources, including the following (note that errors in the
documentation or code are mine, and are not due to these authors):
Distance measures in cosmology, Hogg, D.W., astro-ph/9905116
Perlmutter et al. 1997, ApJ, 483, 565
Carroll, Press & Turner 1992, ARAA, 30, 499
Weinberg, S., sections 14.6.8, 15.3.25
Sandage, A. 1961, ApJ, 133, 355-392
In the following all values are in "natural" units:
Hubble distance, volume, or time.
Symbols used in the following:
om is omega_matter
ol is omega_lambda
ok is 1 - om - ol
kappa is sqrt( abs(ok) )
=head2 Distances
For cosmologies with no lambda term, the luminosity distances
(C) are calculated by the standard formulae:
empty: dl = 0.5 * z * (2+z)
flat: dl = 2 * ( 1+z - sqrt(1+z) )
otherwise: dl = (2 / (om*om)) *
( om*z + (om-2) * (sqrt(1+om*z)-1) )
For non-zero lambda cosmologies, the luminosity distance is
calculated using:
closed: dl = (1+z) * sin( kappa * dc ) / kappa
open: dl = (1+z) * sinh( kappa * dc ) / kappa
flat: dl = (1+z) * dc
where C is the comoving distance, calculated by numerical
integration of the following from 0 to C:
1.0 / sqrt( (1+z)^2 * (1+om*z) - z*(2+z)*ol )
The comoving distance is always calculated by numerical
integration of the above formula. The angular diameter and
proper motion distances are defined as
C and C respectively.
=head2 Volumes
If C is the proper motion distance, then the
comoving volume C is given by
flat: vc = dm^3 / 3
open: vc = dm * sqrt(1+ok*dm^2) - asinh(dm*kappa) /
( 2 * kappa * ok )
closed: vc = dm * sqrt(1+ok*dm^2) - asin(dm*kappa) /
( 2 * kappa * ok )
The differential comoving volume, C, is calculated using
the proper motion distance, C, and the differential
proper motion distance, C, by
dvc = dm^2 * ddm / sqrt( 1 + ok*dm^2 )
where
ddm = dc * sqrt( 1 + abs(ok) * dm^2 )
=head2 Times
The lookback time is calculated by integration of the following
formula from 0 to C:
1.0 / ( (1+z) * sqrt( (1+z)^2 * (1+om*z) - z*(2+z)*ol ) )
=head2 Flux and Magnitudes
The conversion between absolute and apparent magnitudes is
calculated using:
$app_mag = $abs_mag + 25 + 5 * $cosmo->lum_dist($z)->log10();
The conversion between flux and luminosity is calculated using
$lumin = FOURPI * $dl * $dl * $flux
where
$dl = $cosmo->lum_dist($z) * 1.0e8 * PARSEC
Note that these equations do not include any pass-band
or evolutionary corrections.
=head2 Integration Technique
All integrations are performed using Romberg's method, which
is an iterative scheme using progressively higher-degree
polynomial approximations. The method stops when the answer
converges (ie the absolute difference in the values from the
last two iterations is smaller than the C
parameter, which is described in the L method).
Typically, the romberg integration scheme produces greater
accuracy for smooth functions when compared to simpler
methods (e.g. Simpson's method) while having little extra
overhead for badly-behaved functions.
=head1 CONSTANTS
Currently the following constants are available via
C