Skip to content

amisolution/Cosmology.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosmology calculator for Julia

Build Status Coverage Status

Installation

To install the package:

julia> Pkg.add("Cosmology")

Then, to load into your session:

julia> using Cosmology

Cosmological Models

First, pick a cosmological model using the cosmology function, which takes the following options:

h = 0.69 Dimensionless Hubble constant
OmegaK = 0 Curvature density, Ωk
OmegaM = 0.29 Matter density, Ωm
OmegaR = Ωγ + Ων Radiation density, Ωr
Tcmb = 2.7255 CMB temperature (K), used to compute Ωγ
Neff = 3.04 Effective number of massless neutrino species, used to compute Ων
w0 = -1 CPL dark energy equation of state, w = w0 + wa*(1-a)
wa = 0 CPL dark energy equation of state, w = w0 + wa*(1-a)
julia> using Cosmology

julia> c = cosmology()
FlatLCDM(0.69,0.7099122024007928,0.29,8.779759920715362e-5)

julia> c = cosmology(OmegaK=0.1)
OpenLCDM(0.69,0.1,0.6099122024007929,0.29,8.779759920715362e-5)

julia> c = cosmology(w0=-0.9, OmegaK=-0.1)
ClosedWCDM(0.69,-0.1,0.8099122024007929,0.29,8.779759920715362e-5,-0.9,0.0)

Distances

angular_diameter_dist_mpc(cosmo, z) Ratio of an object's proper transverse size (in Mpc) to its angular size (in radians)
comoving_radial_dist_mpc(cosmo, z) Comoving radial distance to redshift z, in Mpc
comoving_volume_gpc3(cosmo, z) Comoving volume out to redshift z, in Gpc3
luminosity_dist_mpc(cosmo, z) Bolometric luminosity distance, in Mpc
distmod(cosmo, z) Distance modulus, in units of magnitude
julia> using Cosmology

julia> c = cosmology(OmegaM=0.26)
FlatLCDM(0.69,0.7399122024007928,0.26,8.779759920715362e-5)

julia> angular_diameter_dist_mpc(c, 1.2)
1784.0089227105118

Times

age_gyr(cosmo, z) Age of the universe at redshift z, in Gyr
lookback_time_gyr(cosmo, z) Difference between age at redshift 0 and age at redshift z, in Gyr
julia> using Cosmology

julia> c = cosmology(OmegaM=0.26)
FlatLCDM(0.69,0.7399122024007928,0.26,8.779759920715362e-5)

julia> age_gyr(c, 1.2)
5.445600787626434

About

Cosmology library for Julia

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 100.0%