Cosmology
Cosmology: the expansion of a homogeneous universe.
ScaleFactorElement(label, visual=None, *, a=1.0, a_d1=0.0, H0=1.0, omega_matter=0.3, omega_lambda=0.7)
Bases: Element
Homogeneous universe whose size is the scale factor a, a state of order 2 with the expansion rate a_d1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the universe. |
required |
visual
|
VisualSpec | None
|
How the universe is drawn, or |
None
|
a
|
Annotated[float, StateSpec(domain=open(0, oo), order=2)]
|
The initial scale factor. |
1.0
|
a_d1
|
float
|
The initial rate of change of the scale factor. |
0.0
|
H0
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Hubble constant. |
1.0
|
omega_matter
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The density parameter of matter. |
0.3
|
omega_lambda
|
Annotated[float, ParameterSpec()]
|
The density parameter of dark energy. |
0.7
|
Examples:
>>> from skcomplex.models.physics.cosmology import ScaleFactorElement
>>> ScaleFactorElement('universe', H0=2.0).H0
2.0
Source code in src/skcomplex/models/physics/cosmology/_expansion.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
friedmann_expansion(a=1.0, *, H0=1.0, omega_matter=0.3, omega_lambda=0.7)
Return the scale factor of a homogeneous universe of matter and dark energy, after Friedmann and Lemaître.
The acceleration equation a² a'' = -4 pi G M / 3 + Lambda a³ / 3 is written with the density parameters of
matter Ω_m = 8 pi G M / (3 H0²) and of the cosmological constant Ω_Λ = Lambda / (3 H0²) in units of the Hubble
constant H0 at a = 1, so a² a'' = -Ω_m H0² / 2 + Ω_Λ H0² a³. The initial expansion rate follows from the
Friedmann equation a'² = H0² (Ω_m / a + Ω_Λ a² + 1 - Ω_m - Ω_Λ), which stays a first integral of the motion.
Matter decelerates the expansion and dark energy accelerates it once a exceeds (Ω_m / (2 Ω_Λ))^(1/3).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The initial scale factor. |
1.0
|
H0
|
float
|
The Hubble constant, the expansion rate at |
1.0
|
omega_matter
|
float
|
The density parameter of matter. |
0.3
|
omega_lambda
|
float
|
The density parameter of the cosmological constant. |
0.7
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The model, with the scale factor |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The universe does not expand at the initial scale factor. |
Examples:
>>> from skcomplex.models.physics.cosmology import friedmann_expansion
>>> friedmann_expansion(omega_matter=1.0, omega_lambda=0.0).elements[0].a_d1
1.0
Source code in src/skcomplex/models/physics/cosmology/_expansion.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |