Lesson 2 of 15

The Friedmann Equation

The Friedmann Equation

The Friedmann equation is the master equation governing how the universe expands. Derived from Einstein's field equations applied to a homogeneous, isotropic universe, it relates the Hubble parameter H(a)H(a) to the energy content of the cosmos.

The Full Equation

H2(a)=H02[Ωma3+Ωra4+ΩΛ+Ωka2]H^2(a) = H_0^2 \left[ \frac{\Omega_m}{a^3} + \frac{\Omega_r}{a^4} + \Omega_\Lambda + \frac{\Omega_k}{a^2} \right]

where aa is the scale factor (normalised so a0=1a_0 = 1 today), and:

  • Ωm\Omega_m — matter density parameter (dark + baryonic)
  • Ωr\Omega_r — radiation density parameter
  • ΩΛ\Omega_\Lambda — dark energy (cosmological constant)
  • Ωk=1ΩmΩrΩΛ\Omega_k = 1 - \Omega_m - \Omega_r - \Omega_\Lambda — curvature term

For the observed flat universe (Ωk=0\Omega_k = 0) with negligible radiation today, the standard Λ\LambdaCDM values are Ωm0.3\Omega_m \approx 0.3, ΩΛ0.7\Omega_\Lambda \approx 0.7.

Dimensionless Hubble Parameter

It is convenient to define E(a)=H(a)/H0E(a) = H(a)/H_0:

E(a)=Ωma3+Ωra4+ΩΛE(a) = \sqrt{\frac{\Omega_m}{a^3} + \frac{\Omega_r}{a^4} + \Omega_\Lambda}

At a=1a = 1 (today), E(1)=1E(1) = 1 when Ωm+ΩΛ=1\Omega_m + \Omega_\Lambda = 1 (flat).

Deceleration Parameter

The deceleration parameter q0q_0 measures whether the expansion is speeding up or slowing down today:

q0=Ωm2+ΩrΩΛq_0 = \frac{\Omega_m}{2} + \Omega_r - \Omega_\Lambda

For Ωm=0.3\Omega_m = 0.3, ΩΛ=0.7\Omega_\Lambda = 0.7: q0=0.55<0q_0 = -0.55 < 0 — the universe is accelerating.

Your Task

Implement the following functions. All constants must be defined inside each function body.

  • H_over_H0(Omega_m, Omega_r, Omega_Lambda, a) — returns E(a)=H(a)/H0E(a) = H(a)/H_0 for flat universe
  • H_at_z(H0_km_s_Mpc, Omega_m, Omega_r, Omega_Lambda, z) — returns H(z)H(z) in km/s/Mpc
  • deceleration_parameter(Omega_m, Omega_r, Omega_Lambda) — returns q0q_0
Python runtime loading...
Loading...
Click "Run" to execute your code.