Git Product home page Git Product logo

cosmology.jl's Introduction

Cosmology calculator for Julia

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

cosmology.jl's People

Contributors

kbarbary avatar nolta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.