Example
One of the central concepts in cosmology is the Hubble Law, which states that galaxies move away from us at speeds proportional to their distances due to the expansion of the universe.
The scale of the universe can be described by the scale factor $ a(t) $, which evolves with time.
We will solve the Friedmann equation to model how $ a(t) $ evolves over time.
For simplicity, we’ll consider a flat universe with only matter $( \Omega_m = 1 )$:
$$
\left( \frac{\dot{a}}{a} \right)^2 = H_0^2 \frac{\Omega_m}{a^3}
$$
- $ a(t) $: scale factor
- $ H_0 $: Hubble constant
- $ \Omega_m $: matter density parameter (normalized to $1$ for simplicity)
- $ \dot{a} $: derivative of the scale factor with respect to time
Goal
- Solve for $ a(t) $ over time using numerical integration.
- Plot $ a(t) $ and interpret the results.
Python Code
Below is the $Python$ implementation:
1 | import numpy as np |
Explanation
Setup:
- The Friedmann equation is modeled as a first-order ODE, which calculates $ \dot{a} $ based on the scale factor $ a $.
- Initial conditions are chosen to represent the universe at the start of the Big Bang.
Integration:
- We solve the equation numerically from $ t = 0 $ to $ t = 14 $ billion years using the
solve_ivpfunction.
- We solve the equation numerically from $ t = 0 $ to $ t = 14 $ billion years using the
Visualization:
- The graph shows how the scale factor $ a(t) $ evolves over time.
At early times, $ a(t) $ grows slowly, but as the universe expands, the growth accelerates.
- The graph shows how the scale factor $ a(t) $ evolves over time.
Results and Interpretation

- The graph indicates an accelerated growth of the universe’s scale factor.
- This reflects the universe’s matter-dominated phase transitioning into accelerated expansion.
This example provides a simplified model, but it captures the essence of cosmic expansion.










