.. _physics-cosmologyFunctions: Cosmology Functions =================== A class that provides various cosmological functions. The background cosmology describes the evolution of an isotropic, homogeneous Universe within which our calculations are carried out. For the purposes of Galacticus, the background cosmology is used to relate expansion factor/redshift to cosmic time and to compute the density of various components (e.g. dark matter, dark energy, etc.) at different epochs. **Default implementation:** ``cosmologyFunctionsMatterLambda`` Methods ------- ``epochValidate`` → ``void`` Check the given cosmic epoch is valid (aborting otherwise) and, optionally, return time or expansion factor associated with the epoch. * ``double precision, intent(in ), optional :: timeIn`` * ``double precision, intent(in ), optional :: expansionFactorIn`` * ``logical , intent(in ), optional :: collapsingIn`` * ``double precision, intent( out), optional :: timeOut`` * ``double precision, intent( out), optional :: expansionFactorOut`` * ``logical , intent( out), optional :: collapsingOut`` ``cosmicTime`` → ``double precision`` Return the cosmological age (in Gyr) of the universe at the given expansion factor :math:`a`, computed by integrating the Friedmann equation from :math:`a=0` to the specified value. * ``double precision, intent(in ) :: expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` ``timeBigCrunch`` → ``double precision`` Return the cosmological age at Big Crunch (or a negative value if no Big Crunch occurs). ``expansionFactor`` → ``double precision`` Returns the expansion factor at cosmological time ``time``. * ``double precision, intent(in ) :: time`` ``expansionRate`` → ``double precision`` Returns the cosmological expansion rate, :math:`\dot{a}/a` at expansion factor ``expansionFactor``. * ``double precision, intent(in ) :: expansionFactor`` ``hubbleParameterEpochal`` → ``double precision`` Returns the Hubble parameter at the requested cosmological time, ``time``, or expansion factor, ``expansionFactor``. * ``double precision, intent(in ), optional :: time,expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` ``hubbleParameterRateOfChange`` → ``double precision`` Returns the rate of change of the Hubble parameter at the requested cosmological time, ``time``, or expansion factor, ``expansionFactor``. * ``double precision, intent(in ), optional :: time,expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` ``densityScalingEarlyTime`` → ``void`` Compute the scaling of density with expansion factor at early times in the universe. * ``double precision, intent(in ) :: dominateFactor`` * ``double precision, intent( out) :: densityPower , expansionFactorDominant`` * ``double precision, intent( out), optional :: OmegaDominant`` ``omegaMatterEpochal`` → ``double precision`` Return the matter density parameter at expansion factor ``expansionFactor``. * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` ``omegaMatterRateOfChange`` → ``double precision`` Return the rate of change of the matter density parameter at expansion factor ``expansionFactor``. * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` ``omegaDarkEnergyEpochal`` → ``double precision`` Return the dark energy density parameter at expansion factor ``expansionFactor``. * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` ``equationOfStateDarkEnergy`` → ``double precision`` Return the equation of state parameter, :math:`w`, for the dark energy component. * ``double precision, intent(in ), optional :: time, expansionFactor`` ``exponentDarkEnergy`` → ``double precision`` Return the exponent of the dark energy density with expansion factor, i.e. :math:`\gamma` in :math:`\rho_\mathrm{DE}(a) \propto a^\gamma`. * ``double precision, intent(in ), optional :: time, expansionFactor`` ``equalityEpochMatterDarkEnergy`` → ``double precision`` Return the epoch of matter-dark energy magnitude equality (either expansion factor or cosmic time). * ``integer, intent(in ), optional :: requestType`` ``equalityEpochMatterCurvature`` → ``double precision`` Return the epoch of matter-curvature magnitude equality (either expansion factor or cosmic time). * ``integer, intent(in ), optional :: requestType`` ``equalityEpochMatterRadiation`` → ``double precision`` Return the epoch of matter-radiation magnitude equality (either expansion factor or cosmic time). * ``integer, intent(in ), optional :: requestType`` ``dominationEpochMatter`` → ``double precision`` Compute the epoch at which matter dominates over other forms of energy by a given factor. * ``double precision, intent(in ) :: dominateFactor`` ``temperatureCMBEpochal`` → ``double precision`` Return the temperature of the cosmic microwave background at ``expansionFactor``. * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` ``distanceParticleHorizonComoving`` → ``double precision`` Return the comoving distance to the particle horizon at the given ``time``. * ``double precision, intent(in ) :: time`` ``distanceComoving`` → ``double precision`` Return the comoving distance to the given cosmic ``time``. * ``double precision, intent(in ) :: time`` ``distanceLuminosity`` → ``double precision`` Return the luminosity distance to the given cosmic ``time``. * ``double precision, intent(in ) :: time`` ``distanceAngular`` → ``double precision`` Return the angular diameter distance to the given cosmic ``time``. * ``double precision, intent(in ) :: time`` * ``double precision, intent(in ), optional :: timeOrigin`` ``timeAtDistanceComoving`` → ``double precision`` Return the cosmic time corresponding to the given ``comovingDistance``. * ``double precision, intent(in ) :: comovingDistance`` ``distanceComovingConvert`` → ``double precision`` Convert between different measures of comoving distance (luminosity distance, distance modulus, or k-corrected distance modulus) given an input distance or redshift, returning the requested output distance measure. * ``integer , intent(in ) :: output`` * ``double precision, intent(in ), optional :: distanceLuminosity, distanceModulus, distanceModulusKCorrected, redshift`` ``redshiftFromExpansionFactor`` → ``double precision`` Returns the cosmological redshift, typically :math:`z = 1/a - 1`, corresponding to the given expansion factor :math:`a`, where :math:`a=1` corresponds to the present day (:math:`z=0`). * ``double precision, intent(in ) :: expansionFactor`` ``expansionFactorFromRedshift`` → ``double precision`` Returns the cosmological expansion factor, typically :math:`a = 1/(1+z)`, corresponding to the given redshift :math:`z`, where :math:`a=1` at the present day and :math:`a\rightarrow 0` at the Big Bang. * ``double precision, intent(in ) :: redshift`` ``comovingVolumeElementRedshift`` → ``double precision`` Returns the differential comoving volume element :math:`\mathrm{d}V/\mathrm{d}z = r_\mathrm{c}^2(t) \mathrm{c} H^{-1}(t)` (where :math:`r_\mathrm{c}` is the comoving distance to time :math:`t` and :math:`H(t)` is the Hubble parameter at that time) for unit solid angle at the specified ``time``. * ``double precision, intent(in ) :: time`` ``comovingVolumeElementTime`` → ``double precision`` Returns the differential comoving volume element :math:`\mathrm{d}V/\mathrm{d}t = r_\mathrm{c}^2(t) \mathrm{c} a(t)` (where :math:`r_\mathrm{c}` is the comoving distance to time :math:`t` and :math:`a(t)` is the expansion at that time) for unit solid angle at the specified ``time``. * ``double precision, intent(in ) :: time`` ``epochTime`` → ``double precision`` Convenience function that returns the time corresponding to an epoch specified by time or expansion factor. * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` ``matterDensityEpochal`` → ``double precision`` Convenience function that returns the matter density at the specified epoch. * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsingPhase`` .. _physics-cosmologyFunctionsMatterDarkEnergy: ``cosmologyFunctionsMatterDarkEnergy`` -------------------------------------- Cosmological relations are computed assuming a universe that contains only collisionless matter and dark energy with an equation of state :math:`w(a)=w_0+w_1a(1-a)` :cite:p:`jassal_wmap_2005`, with :math:`w_0=`\ ``[darkEnergyEquationOfStateW0]``, and :math:`w_1=`\ ``[darkEnergyEquationOfStateW1]``. **Methods** * ``targetSelf`` — Set a module-scope pointer to ``self``. * ``exponentDarkEnergyDerivative`` — Return the derivative of the dark energy exponent with respect to expansion factor. **Parameters** * ``[darkEnergyEquationOfStateW0]`` (default ``-1.0d0``) — The equation of state parameter for dark energy, :math:`w_0`, defined such that :math:`P=\rho^w` with :math:`w(a)=w_0+w_1 a (1-a)`. * ``[darkEnergyEquationOfStateW1]`` (default ``0.0d0``) — The equation of state parameter for dark energy, :math:`w_1`, defined such that :math:`P=\rho^w` with :math:`w(a)=w_0+w_1 a (1-a)`. .. _physics-cosmologyFunctionsMatterLambda: ``cosmologyFunctionsMatterLambda`` ---------------------------------- Cosmological relations are computed assuming a universe that contains only collisionless matter and a cosmological constant. **(Default implementation)** **Methods** * ``distanceTabulate`` — Tabulate comoving distance as a function of cosmic time. * ``expansionFactorTabulate`` — Tabulate expansion factor as a function of cosmic time. .. _physics-cosmologyFunctionsStaticUniverse: ``cosmologyFunctionsStaticUniverse`` ------------------------------------ A cosmology functions class for static universes. Intended for testing purposes. Time is arbitrary (as there is no Big Bang), and expansion factor is fixed at :math:`1`. Attempts to compute time from expansion factor will cause fatal errors. Expansion rates and the Hubble constant are set to zero.