\documentclass[main.tex]{subfiles}
\begin{document}

% \section*{4 October 2019}
% \marginpar{Friday\\ 2019-10-4, \\ compiled \\ \today}

% From yesterday we recall that \(k=0\) iff \(\rho (t) = \rho_C(t)\).

% We can write \(H (t_0) = H_0 = 100 h \times \SI{}{\kilo\metre\per\second\per\mega\parsec} \).
% Do note that \(\SI{1}{\mega\parsec} = \SI{3.086e22}{\metre}\).

% If we have \(H\) we can find \(\rho_{0C} = h^2 \times \SI{1.88e-28}{\gram\per\cubic\metre}\). We have defined \(\Omega(t) \defeq \rho / \rho_C\): recall that \(\sign{\Omega -1} = \sign k\).

% So we want to measure the energy density in galaxies to figure out what \(\Omega\) is.

The Schechter function is an empirical estimate for the shape of this distribution:
%
\begin{equation}
  \Phi(L) = \frac{\Phi^*}{L^*} \qty(\frac{L}{L^*})^{-\alpha} \exp(-\frac{L}{L^*})
  \,,
\end{equation}
%
where \(\Phi_{*}\), \(L_{*}\) and \(\alpha \) are parameters, with dimensions of respectively a number density, a luminosity and a pure number.

These can be fit by observation: we find \(\Phi^* \approx \SI{e-2}{} h^3 \SI{}{\mega\parsec^{-3}}\), \(L^* \approx \num{e10}h^{-2} L_\odot \) (a typical galaxy contains roughly ten billion Suns) and \(\alpha \approx 1\).

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/Schechter.pdf}
\caption{A rough plot of the Schechter function for \(\alpha = 1\).}
\label{fig:Schechter}
\end{figure}

The integral for \(\mathscr L_g\) converges despite the divergence of \(\Phi(L)\) as \(L \rightarrow 0\), since it is multiplied by \(L\): so we do not need to really worry about the low-luminosity divergence of the distribution.

The result of the integral for a generic value of \(\alpha \) is \(\mathscr L_g = \Phi^* L^* \Gamma(2-\alpha)\), where \(\Gamma\) is the Euler gamma function; for the \(\alpha = 1\) case we get a factor \(\Gamma(2-1) = 1\).

Numerically, inserting reasonable estimates for the parameters, we get the following estimate for the mean luminosity: \(\mathscr{L}_{g} \approx \num{2.0(7)e8} h L_\odot \SI{}{\per\cubic\mega\parsec}\).
% \todo[inline]{This is reported incorrectly in \cite{paccianiAppuntiCorsoPhysical2018} as \(\sim \num{e18}\)! The correct figure can be found in \cite[eq. 4.5.14]{colespCosmology2002}.
% I do not think there is much of a point in reporting the specific value, since the parameters are already given as order-of-magnitude estimates.}

Now, we must estimate \(\expval{M / L}\).
The luminosity of galaxies can be measured readily, the great difficulty lies in estimating their mass.

\subsection{Estimating the masses of galaxies}

We must distinguish between the different shapes of the galaxies: spiral galaxies are characterized by rotation of the stars about the galactic center, while in elliptical galaxies the stars' motion is disordered.

\subsubsection{Spiral galaxies}

If we see a spiral galaxy edge-on, we will have a side of it coming in our direction, and the other side moving away from us (after correcting for other sources of Doppler shift, such as the velocity of the whole galaxy).
So, using the Doppler effect we can measure the distribution of the velocity in the galaxy as a function of the radius.

% We plot the velocity of rotation of galaxies \(v\)  against the radius \(R\).

In order to get a theoretical model, we can approximate the galaxy as a sphere: this is very rough (spiral galaxies are closer to being disk-like), but it gives the same qualitative result, so there is no need for a more precise model in this context.

We model the galaxy velocity distribution using Newtonian mechanics: the GR corrections are negligible at these scales, galaxies are much larger than their Schwarzschild radii.

Equating the gravitational acceleration \(GM/R^2\) to the centripetal acceleration \(v^2 /R\) we find:
%
\begin{align}
v = \sqrt{\frac{GM}{R}}
\,,
\end{align}
%
where \(v\) and \(M\) are functions of \(R\): \(M\) is the mass contained in the spherical shell of radius \(R\), and \(v\) is the orbital velocity at the boundary of the shell.

In the inside regions of the galaxy, where \(M(R) \propto R^3\) since the density is approximately constant, we will have \(v \propto R\), while in the outskirts of the galaxy \(M(R)\) will not change much, since all the mass is inside, so we will have \(v \propto R^{-1/2}\).

Our prediction is then a roughly linear region, and then a region with \(v \sim R^{-1/2}\).
This is shown as the ``Predicted'' curve in figure \ref{fig:dark_matter}.
A plot with real data can be found in \textcite[fig.\ 1]{garrettDarkMatterPrimer2011}, which in turn is quoting a seminal paper by \textcite{rubinDarkMatterSpiral1983}.

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/Dark_matter.pdf}
\caption{Predicted and observed velocity distribution for galaxies. The point at which they star to diverge is approximately the radius of the bulk of the galaxy. This plot is approximate, realistic models do not have such sharp corners, since there will not be a precise edge after which the density drops to zero immediately.}
\label{fig:dark_matter}
\end{figure}

Instead of this, when in the 1980s people started to be able to measure this curve accurately they saw that, after the linear region, \(v(R)\) was approximately constant.
So, is Newtonian gravity wrong?

An option to solve this problem was proposed by Milgrom and collaborators: it is called MOdified Newtonian Dynamics, or MOND: they propose that gravity is not actually always described by a \(r^{-1}\) potential, but instead at low accelerations it behaves differently.
Specifically, they posit that the gravitational acceleration \(g\) should be modulated by a factor \(\mu (g / a_0 )\), where \(a_0 \approx \num{8e-10} h^2 \SI{}{m /s^2}\) is a characteristic acceleration while \(\mu (x)\) is an dimensionless function such that \(\mu \rightarrow 1\) for \(x \gg 1\) and \(\mu \rightarrow x\) for \(x \ll 1\), such as \(\mu = x / (1+x)\) \cite{bekensteinDoesMissingMass1984}.

This approach is Newtonian but there are also relativistic MOND variants. They do not match observation as well as the alternative approach does.\footnote{MOND would be compatible with the speed of gravity being less than the speed of light, which is equivalent to the graviton being massive. Recent measurements of gravitational waves seem to agree with the general-relativistic prediction that it is massless.}
The heaviest thing weighing against MOND is the fact that even using it we still need dark matter in order to fully explain observations.

\subsubsection{Dark matter}

The alternative option is that Newtonian mechanics describes galactic mechanics well, but the galaxy's matter distribution inferred from our observations is actually smaller than the real distribution, which extends outward further than the matter we can see: this is \textbf{dark matter}.

We'd need mass obeying \(M (R) \propto R\) in order to have a constant value of \(v\): since \(M(R) = 4 \pi \int_0^{R_{\text{max}}}  R^2 \rho(R) \dd{R}\), we need the density profile to decay like \(\rho(R) \propto R^{-2}\).
This is called an \emph{isothermal} density profile: we call it the \emph{dark matter halo}, which surrounds all spiral galaxies.

We do not know what dark matter is: we can say that it   interacts gravitationally but not electromagnetically.
People tend to believe that it is made up of beyond-the-standard-model particles, like a \emph{neutralino} or an \emph{axion}.
Historically, people thought the effect could be due to massive neutrinos; however their mass would need to be around \SI{30}{eV}, and the analysis of the CMB data showed that the sum of the masses of the neutrino species must be \(\sum m_\nu < \SI{0.120}{eV}\) \cite[Table 7]{planckcollaborationPlanck2018Results2019a}.

The total density of matter (dark+regular) is \(\sim 6\) times more than that of regular matter alone: this must be accounted for in our estimate of the \(M/L\) ratio for spiral galaxies (since we have additional mass but not additional luminosity):
with this correction, we find that for spiral galaxies
%
\begin{align}
\expval{\frac{M}{L}} \approx 300 h \frac{M_{\odot}}{L_{\odot}}
\,,
\end{align}
%
Historically, this was the first evidence for dark matter.

\subsubsection{Elliptical galaxies}

If galaxies are not spiral-shaped, we have to weigh them in a different way: the Doppler broadening of spectral lines gives us a measure of the root-mean-square velocity.

% \subsection{Virial theorem}
Later in the course we will obtain the (nonrelativistic) \emph{virial theorem}, now we just state it: if \(T\) is the kinetic energy of a gravitationally bound system, \(U\) is the potential energy, then
%
\begin{equation}
  2T + U = 0
\end{equation}
%
holds when the inertia tensor stabilizes, that is, when we have dynamical equilibrium.

The kinetic energy is \(T = \frac{3}{2} M \expval{v_r^2} \), where \(v_r\) is the radial\footnote{By ``radial'' we mean directed towards us, not towards the center of the galaxy.}
component of the velocity, which we expect to account for one third of total energy by the equipartition theorem.
\(M\) is the total mass of the galaxy.

The potential energy, instead, is \(U = - G M^2 /R\). Substituting these expressions into the virial theorem we get
%
\begin{align}
2 \times \frac{3}{2} M \expval{v_r^2} - \frac{GM^2}{R} &= 0  \\
M &= \frac{3R}{G} \expval{v_r^2}
\,,
\end{align}
%
so if we can measure \(\expval{v_r^2}\) through Doppler broadening and we can give a reasonable estimate for the radius \(R\) of the galaxy we can give an estimate for \(M\).

\subsubsection{Global matter contributions}

Accounting for the dark matter mass, we get \(\expval{M/L} \approx 300 h M_\odot / L_\odot\).

The value of the critical energy density today, \(\rho_{0c}\), is given by\footnote{Do note that the numerical figure, \num{1.88e-29}, is approximate but its value is known to at least four significant digits, since the only source of uncertainty in it lies in the uncertainty in our measurement of \(G\) --- all the uncertainty in \(H_0 \) is expressed in variable form, with the parameter \(h\).}
%
\begin{align}
\rho_{0c} = \frac{3H^2}{8 \pi G}  \approx \num{1.88e-29} h^2 \SI{}{g /cm^3}
\,,
\end{align}
%
so, in order to have \(\Omega = 1\), we'd need \(\expval{M/L}\) to be equal to:
%
\begin{align}
\expval{\frac{M}{L}}
= \frac{\rho_{0c}}{\mathscr{L}_{g}}
\approx \frac{\SI{1.88e-29}{\littleh^2 g /cm^{3}}}{\SI{2e8}{\littleh \Lsun /Mpc^{3}}}
\approx 1390 h M_{\odot} / L_{\odot}
\,.
\end{align}

% So measuring the number density of galaxies and their velocities we get a way to measure \(\Omega_0\).

We can define quantities of the form \(\Omega_{0i}  = \rho_{0i} / \rho_{0c}\), where \(i\) is a type of matter, such as baryonic matter, dark matter, dark energy, radiation and so on, whose density is represented as \(\rho_{0i}\).

These variables quantify how much, at the present, time, of the cosmic energy budget is accounted for by that type of matter.

So, only \(\Omega_{0b} \approx 5\%\) of the energy budget is given by baryonic matter (not all of which is visible), while around \(\Omega_{0 DM} \approx 27\%\) is dark matter.
Together, they are just denoted as ``matter'', and \(\Omega_{0m} \approx 30 \%\).

We can ask ourselves: is dark matter actually baryonic matter which for some reason we cannot see, such as black holes or brown dwarfs?

This cannot be the case: our observations, combined with models for primordial nucleosynthesis,
% \todo[inline]{Ricordati di mettere la referenza al paragrafo della nucleosintesi quando lo sistemerai, che sarebbe carino}
gives the following bounds for the baryonic energy density:
%
\begin{equation}
0.013 \leq \Omega_{\text{0b}} h^2 \leq 0.025
\,.
\end{equation}

The upper bound for \(\Omega_{0b}\) is around \(2.5\%/h^2 \approx \SI{5.4}{\percent}\).

% where \(\Omega_b\) corresponds to the baryonic density: so the universe \emph{cannot} be made only of baryons.

% Dark matter likes ``clumping'': we characterize it by this property.

This would seem to indicate that \(\Omega_{0} \approx \num{.3} \ll 1\): however we are failing to consider a crucial contribution.
Consider the second Friedmann equation \eqref{eq:friedmann-2}: in the Newtonian limit \(P \sim 0\) while \( \rho >0 \), so we get \(\ddot{a} <0\): the universe contracts.
This is not what is observed: we actually see it in accelerated expansion.

\subsection{Dark energy}

The measurements leading to this conclusion are performed by estimating the distance and redshift of far-away objects whose intrinsic luminosity is well known, called \emph{standard candles}: the most commonly used are type Ia supernovae and Cepheid variables.

So, if the expansion is accelerated then \(\ddot{a} > 0\): this means, again from the second Friedmann equation \eqref{eq:friedmann-2}, that \(P < -\rho c^2/3\).
This is commonly expressed by defining \(w = P / \rho c^2\).
In order to have accelerated expansion we need \(w < -1/3\); what is observed is closer to \(w \sim -1\).

This negative pressure has the effect of a \emph{tension}, pulling the universe apart.
As we will discuss in section \ref{sec:cosmological-constant}, a candidate for a cosmological fluid with negative pressure (specifically, \(w = -1\)) is a cosmological constant term, called \(\Lambda \), which can be inserted in the Einstein Field Equations.
It is not the possible one: dark energy is defined to be what causes the expansion we see, so it could be constituted by any kind of fluid which is uniformly distributed in space and which has negative pressure.

% This contribution is also called a ``cosmological constant term'', for reasons which will be expanded upon in later sections, and denoted with the letter \(\Lambda \).

We cannot see directly neither dark matter nor dark energy: how do we distinguish the two? Dark matter tends to cluster, while dark energy is uniformly distributed; furthermore, dark energy has negative pressure.

From observations of both the anisotropies in the CMB and the distribution of galaxies we can determine that \(\Omega_{\Lambda } \approx \num{.7}\).

% The Friedmann equation would imply deceleration if \(\rho, P \geq 0\): dark energy seems to have \emph{negative pressure}.

\subsection{Radiation}

We still need to compute the contribution of the energy of electromagnetic and neutrino radiation to the total energy balance.
Let us start with EM radiation: the greatest fraction of the radiation energy density is contained in the CMB,\footnote{This fact is not obvious: the CMB permeates the universe, but each photon in it has a much lower energy than the typical photon emitted by a star.
Also, stellar fusion is quite efficient, being able to convert around \SI{0.7}{\percent} of the mass of its baryons into energy in the form of photons. If all the baryonic matter in the universe underwent fusion, this would give us a contribution of the order of \(\Omega_m \times \SI{.7}{\percent} \approx \SI{5}{\percent} \times \num{.007} \approx \num{3e-4}\), which as we will see in a moment is of the same order of magnitude as the CMB contribution.

However, assuming that all baryonic matter undergoes fusion leads us to overestimate the result: first, a large fraction of the baryons in the universe are not in star-forming galaxies but are instead distributed in filaments among them, in what is called the Warm-Hot Intergalactic Medium, which accounts for around \SI{30}{\percent} of the baryonic density in the universe \cite[]{degraaffProbingMissingBaryons2019}.

Also, in a given galaxy only a small fraction of the baryonic mass is contained in stars: roughly speaking, \SI{15}{\percent} \cite[fig.\ 11]{andreonStellarMassFraction2010}.

A third point: stars only started forming in the relatively-early universe, with redshifts of around \(z \sim 10 \divisionsymbol 30\).

As for high-energy (UV) photons, their contribution is truly negligible: their intensity is around \SI{3}{nW / m^2 / sr} \cite[page 2]{collaborationGammarayDeterminationUniverse2018}, corresponding to a density of around \SI{e-36}{g / cm^3} (we multiply by \(4 \pi / c^3\) to find this result). The same paper estimates the infrared density at around 4 times the UV one, which still means it is a couple orders of magnitude below the CMB density.
} which is extremely close to a Planckian distribution:
%
\begin{align}
B (\nu, T) = \frac{2 h}{c^2} \frac{\nu^3}{\exp(\frac{h \nu }{k_B T}) - 1}
\,,
\end{align}
%
with \(T = T_{0 \gamma } \approx \SI{2.725(1)}{K}\). \(B\) is a measure of spectral intensity: it is measured in units of energy per unit second, area, solid angle and frequency. This is a well-known distribution, whose integral is given by
%
\begin{equation}
  \rho_{0 \gamma} = \frac{\sigma_r T_{0 \gamma}^4}{c^2} = \SI{4.6e-34}{\gram\per\centi\metre\cubed}
\end{equation}
%
where \(\sigma_r = \pi^2 k_B^4 / (15 \hbar ^3 c^3)\), while \(\sigma_{SB} = \sigma_r c /4\).

% \todo[inline]{Doing the computation, by }
% \begin{lstlisting}[language=Python]
% (4 * cosmo.Tcmb0**4 * ac.sigma_sb / ac.c**3 ).cgs
% \end{lstlisting}
% \todo[inline]{gives \SI{4.6e-34}{g / cm^3}: it is very close to the figure of 4.8 given in \cite{paccianiAppuntiCorsoPhysical2018}, but I do not see where the discrepancy would come from. (Confermo il tuo conto, magari ha cacciato un typo)}

So, the radiation contribution to the global energy balance is \(\Omega_{0 \gamma } \approx \SI{2.5e-5}{\littleh^{-2}} < \SI{.01}{\percent}\), definitely negligible.

% \todo[inline]{Typo in \cite{paccianiAppuntiCorsoPhysical2018}: exponent of \(h\) is \(-2\), not \(+2\).}

We are going to show in later sections
% \todo[inline]{Qui pure sarebbe carino mettere la ref alla sezione}
that if neutrinos were massless, their temperature would be \(T_\nu = (4/11)^{1/3} T_\gamma < T_\gamma \).

They might not be massless, and if they are not the main contribution to the energy density they will give will be from their masses.
However, recent observations (for example, by the Planck satellite) are bounding the mass of the neutrinos,
\(\sum m_\nu \leq \SI{0.12}{eV} \): we have
%
\begin{equation}
\rho_\nu = 3 N_\nu \frac{\expval{m_\nu} }{\SI{10}{eV}} \SI{e-30}{\gram\per\cubic\centi\metre}
\,,
\end{equation}
%
where \(N_{\nu }\) is the number of neutrino species.
Even if we assume the upper bound, \(N_{\nu } \expval{m_{\nu }} = \SI{.12}{eV}\), we get \(\Omega_{0 \nu } < \SI{.5}{\percent}\).

\subsubsection{Conclusions} \label{sec:global-omega-contributions}

% In the end we have \(\Omega = 1 = \Omega_b + \Omega_{DM} + \Omega_{DE}\) (do note that the value of 1 is measured, not theoretical!)
If we add up all the contributions to  \(\Omega = \Omega_b + \Omega_{DM} + \Omega_{\Lambda }\) (neglecting, as we said, the contributions by EM radiation and neutrinos) we find experimentally \(\Omega_{k} \overset{\text{def}}{=} 1- \Omega  \approx (5^{+38}_{-40}) \times  \num{e-4}\) \cite[Table A.2]{planckcollaborationPlanck2018Results2019a}.

So, with the observational uncertainties we have currently we cannot determine the sign of the universe's spatial curvature: the value of \(\Omega_{k}\) is very much compatible with \(0 \); even though one is drawn to say that this means that an open universe is more likely, no particular meaning should be drawn from the fact that the nominal value of \(\Omega_{k}\) is slightly above 0.

\subsection{The Hubble law}

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/hubble_original.png}
\caption{Original velocity versus distance data from Edwin Hubble's paper in 1929 \cite{hubbleedwinRelationDistanceRadial1929}.}
\label{fig:hubble_original}
\end{figure}

At the end of the 1920s Edwin Hubble compared the estimates for the distances of far-away galaxies (obtained through standard candles and other types of estimates) to their velocities relative to us, as measured through their redshift. His results are shown in figure \ref{fig:hubble_original}: he obtained a roughly linear relation in the form:
%
\begin{equation}
  v = H_0 d\,,
\end{equation}
%
where \(v\) is the velocity of the galaxies, and \(d\) is their distance from us, while \(H_0 \) is a constant of proportionality.
Hubble's measurements suggested \(H_0 \sim \SI{500}{km/s/Mpc}\), more refined modern ones using techniques similar to those used by Hubble yield a value of \SI{73.24(174)}{km/s/Mpc} \cite{riessDeterminationLocalValue2016}.

Measurements of \(H_0 \) through analysis of the CMB gives an incompatible value: \(H_0 = \SI{67.8(9)}{km/s/Mpc}\) \cite{adePlanck2015Results2016}.

Let us now show that this \(H_0 \) is actually the same one we defined before, \(H_0 = \dot{a} / a\).
\(H_0 \) is called the \textbf{Hubble constant}, since it is constant with respect to the direction we look in the sky.

% Can we derive this from the Robertson-Walker line element?
% It was actually derived first by Lemaitre.

We are considering the distance connecting us (the center of our reference frame) to a distant galaxy, so we drop the angular part in the flat (\(k = 0\)) FLRW line element:
%
\begin{equation}
  \dd{s^2} = c^2 \dd{t^2} - a^2(t) \dd{r^2}
  \,.
\end{equation}

So, at a fixed time the physical distance is given by \(d = a(t) r\): therefore \(v = \dot{d} = \dot{a}r = \frac{\dot{a} }{a} d = H_0 d\).

Assuming the universe is spatially flat is correct up to second order: for a general value of \(k\) we have
%
\begin{align}
d = a \int_{0}^{r} \frac{ \dd{\widetilde{r}} }{\sqrt{1 - k \widetilde{r}^2}} = a  \qty( r + \mathcal{O}(r^3))
\,,
\end{align}
%
since the integral gives either \(r\), \(\arcsin(r)\) or \(\operatorname{arcsinh}(r)\) depending on \(k\), and all three of these equal \(r\) up to second order.

Do note that we neglected the temporal part of the metric: this is equivalent to assuming that photons travel instantaneously.
So, this is Newtonian and rough, but it gives us the correct intuitive idea.
We now wish to make this reasoning more precise.

The first step, since we want to discuss our observations of light, is to define the redshift and the luminosity distance.

\begin{definition}[Redshift]
The redshift \(z\) of a photon is defined by
%
\begin{equation}
  z = \frac{\lambda_0 - \lambda_e}{\lambda_{e}}
  = \frac{\lambda_0 }{\lambda_{e}} - 1
  = \frac{\nu_{e}}{\nu_{0}} - 1
  \,,
\end{equation}
%
where \(\lambda_0\) and \(\lambda_e\) are the observed and emission wavelengths respectively, while \(\nu \) are frequencies with the same notation.
\end{definition}

We will show
% \todo[inline]{Idem sarebbe bella la ref al punto dove viene dimostrato}
that the redshift can be found from the ratio of the scale factors now and at emission: \(1+z = a_0/ a_e\).
Therefore, \(\nu_o / \nu_e = a_e / a_0\).

We wish to study the distribution of light from an astronomical source: in Minkowski spacetime the apparent luminosity \(\ell\) decreases like \(r^{-2}\) if \(r\) is the distance from the object.
In a generic spacetime this will not be the case: however, we can define a measure of spatial distance \(d_L\) such that \(\ell = L / (4 \pi d_L^2)\), where \(L\) is the intrinsic luminosity of the object.

Do note that \(\ell \) is dimensionally a luminosity flux: it is measured in units of energy per unit time per unit area.

\begin{definition}
The luminosity distance \(d_L\) is defined as:
%
\begin{equation}
d_L = \sqrt{\frac{L}{4 \pi \ell} } \,.
\end{equation}

Since \(L \propto \ell\), this is a well-defined measure of distance between two generic points in spacetime, regardless of the presence of a source of light there.
\end{definition}

How do we relate the luminosity distance and the scale factor?
The radiation from our source is spread on a sphere: we integrate the angular part of the FLRW metric over a sphere of fixed comoving radius \(r\) to find its area.

The metric restricted to the angular coordinates at fixed \(r\) is given by
%
\begin{align}
\dd{s^2} = a^2 r^2 \qty(\dd{\theta^2} + \sin^2\theta \dd{\varphi^2})
\,,
\end{align}
%
so the area form on the surface of the sphere is
%
\begin{align}
\dd{A} = \sqrt{ \det g} \dd{\theta } \wedge \dd{\varphi }
\,,
\end{align}
%
where \(\sqrt{ \det g} = \sqrt{a^{4} r^{4} \sin^2\theta } = a^2r^2 \sin \theta \).
So,
%
\begin{align}
A = \int_{S^{2}}  \dd{A} = a^2r^2 \int_{0}^{\pi } \dd{\theta } \int_{0}^{2 \pi } \dd{\varphi } \sin \theta = 4 \pi a^2r^2
\,,
\end{align}
%
where we substituted the wedge product for the regular tensor product of the differentials since our axes are orthogonal.
Now, at which time do we compute the scale factor? We are measuring the flux at the surface of the sphere, at the time at which we are observing: therefore we need to compute the scale factor at observation time as well. This gives us \(A = 4 \pi r^2a_0^2\).

Now, the emitted luminosity is in the form:
%
\begin{align}
L = \dv{N}{t_{e}} \expval{h \nu_{e} }
\,,
\end{align}
%
where \(\dv*{N}{t}\) is the number of photons emitted per unit time, whose average energy is \(\expval{h \nu _e}\).
From the point of view of the observer, the number of photons is the same, while the frequency of the observed photon and the time interval \(\dd{t_{e}}\) change: specifically, \(\nu_{e} = \nu_0 a_0 / a_e\) and \(\dd{t_{e}} = \dd{t_0 } a_e / a_0 \).\footnote{This is the case even though the temporal component of the metric does not change, since we are not considering a fixed instance of cosmic time (which is unphysical): instead, we are considering the time intervals that the emitter and observed measure between the crests of a light wave sent from one to the other.}
Therefore, the observed absolute luminosity obeys the relation \(L= L_0 (a_0 / a_e)^2 \).

So, putting everything together we get:
%
\begin{equation}
  \ell = \frac{L_0 }{A}
  = \frac{L}{4 \pi r^2 a_0 ^2} \qty(\frac{a_e}{a_0}) ^2
  \,,
\end{equation}
%
note that the value of \(k\) does not enter into the equation.
% The corrective factor comes from the frequency dependence of energy and the fact that power is energy over time, which also changes.

Therefore:
%
\begin{equation} \label{eq:luminosity-distance}
d_L = \sqrt{\frac{L}{4 \pi \ell}}
= \sqrt{\frac{4 \pi r^2a_0^2}{4 \pi } \qty(\frac{a_0}{a_e})^2}
= \frac{a_0^2}{a_e} r = a_0  (1+z) r\,.
\end{equation}

\end{document}


\section{Discussion}
When considering the performance of the two approaches used, one must consider their efficacy in solving the examination timetabling problems from the benchmark set as well as their ability to generalise across different problem instances. In addition, these considerations must be made when comparing the approaches to one another and to other approaches used in the literature.

In comparing the efficacy of the two approaches in solving the given problem instances, there is little evidence to suggest that one approach is more effective. Each approach achieved the better average objective value for 3 of the 6 problem instances while the single-point approach achieved the best overall objective value for 4 of the 6 instances. This indicates relatively similar efficacy in solving the given problems. It is worthwhile to consider, however, that one approach may fair better with larger problem instances but there is insufficient evidence to support this.

When considering the generalisation of the two approaches it would seem that the multi-point search approach does perform slightly better, considering the proportionate standard deviations across problem instances as opposed to the single-point approach. However, it does seem this comes at the cost of performance, with the multi-point search displaying immensely longer runtimes.

Finally, the results of both approaches are not comparable to other approaches in the literature, such as those covered by Pillay \cite{pillay2016review}, due to their inability to find a viable solution. However, an avenue for future research may be to explore an increase in size of the genetic parameters for the multi-point search to discover whether a feasible solution can be found given a larger population or more generations.


\RequirePackage[l2tabu, orthodox]{nag}

\documentclass[10pt]{article}

% Useful LaTeX packages.
\usepackage{amsmath}
\usepackage[a4paper]{geometry}
%\usepackage[a4paper,left=2.8cm,right=2.8cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage{microtype}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage[colorlinks=false, pdfborder={0 0 0}]{hyperref}
\usepackage{cleveref}

\usepackage[utf8]{inputenc} % cp1250, latin2
\usepackage[T1]{fontenc}
\usepackage{indentfirst}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{cite}
\usepackage{needspace}
\usepackage{color}
\usepackage{enumerate}

%\usepackage[MeX]{polski}
%\usepackage{tikz}
%\usetikzlibrary{arrows,shapes}

\newcommand\entry[1]{\needspace{5\baselineskip}
\bigskip
\bigskip \centerline{\bf #1}
\bigskip
\bigskip}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\newtheorem{claim}{Claim}
\newtheorem{proposition}{Proposition}
\newtheorem{corollary}{Corollary}
\newtheorem{problem}{Problem}

%\pagestyle{empty}
\title{}
\author{}
\date{}

\begin{document}

\maketitle

\section*{Outline of the (Revised) Simplex Algorithm.}

A standard form LP is:

\begin{align}
    \textrm{min } & {\bf c}^T {\bf x} \label{lp:obj} \\
    \textrm{st. } & {\bf A} {\bf x} = {\bf b}, \label{lp:Axeqb} \\
                  & {\bf x} \geq 0. \label{lp:nonneg}
\end{align}

Matrix ${\bf A}$ has $n$ columns and $m$ rows, and $n > m$.

Usually the problem is originally defined with the use of both equality and inequality constraints, as well as special inequality constraints called {\em bounds}, i.e., instead of \eqref{lp:Axeqb} we have:

\begin{align}
     {\bf A}^E {\bf x} = {\bf b}^E, \\
     {\bf A}^L {\bf x} \leq {\bf b}^L, \label{lp:ineq}\\
     {\bf l} \leq {\bf x} \leq {\bf u}. \label{lp:bounds}
\end{align}

Note that \eqref{lp:ineq}--\eqref{lp:bounds} can be transformed into constraint of type \eqref{lp:Axeqb} by extending the vector of variables ${\bf x}$ by {\em slack} variables and adding them to the lefthand side of \eqref{lp:ineq}. Also the inequalities of type ``greater than'' can be replaced by that of type ``less than'' by multiplying both sides by -1. Thus we assume that the problem is transformed into the standard form \eqref{lp:obj}--\eqref{lp:nonneg} before we run Simplex.

\medskip
{\bf Terminology}

A {\em basis} $B$ is an ordered set of $m$ linearly independent columns. By ${\bf A}_B$ we denote the matrix consisting of columns in $B$, and by ${\bf c}_B$ we denote the vector of coefficients restricted to the elements of ${\bf c}$ that correspond to the indices of columns in ${B}$. We write ${\bf A}_N$ to denote the matrix consisting of non-basic columns, and, similarly, ${\bf c}_N$ to denote the vector of non-basic coefficients.

A {\em bfs} (basic feasible solution) is a vector ${\bf x} = ({\bf x}_B, {\bf x}_N)$, where ${\bf x_N}$ is a zero vector and ${\bf x}_B$ is a solution of the system ${\bf A}_B {\bf x}_B = {\bf b}$ that satisfies ${\bf x}_B \geq 0$. Such a vector corresponds to a vertex of polytope defined by the set of LP constraints.

A bfs is {\em degenerate} if ${\bf x}_B$ contains zero. This means that the vertex corresponding to this bfs also can be obtained by taking another bfs (i.e., the same vertex is obtainable as an intersection of different choices of polytope facets).

\medskip
{\bf Phase I}

The purpose of the Phase I is to determine an initial {\em bfs}. There are two cases:
\begin{enumerate}
    \item Initially, all constraints were inequalities of the form \eqref{lp:ineq}, with ${\bf b}^L \geq 0$. Then we have introduced $m$ slack variables when transforming them into equality constraints. Such slack variables also define a basis, which clearly is feasible. We proceed directly to Phase II from this point.
    \item No initial basis is known, but we can add $m$ artificial variables that would form a basis.
\end{enumerate}

Assuming that the second case occurs, we add to each constraint an artificial variable $x^{a}_i$, $i = 1, \ldots, m$, and solve an auxiliary LP with an objective function:
$$
    \sum_{i=1}^m x^{a}_i,
$$
and the set of constraints:
$$
    {\bf A} {\bf x} + {\bf I} {\bf x}^a = {\bf b}, \;\;\; {\bf x}, {\bf x}^a \geq 0.
$$

The simplex method itself can be used for solving this LP with initial bfs ${\bf x}^a_B = {\bf b}$.

If the auxiliary LP has optimal value greater than zero, then the original LP \eqref{lp:obj}--\eqref{lp:nonneg} is infeasible, and we stop at this point.
If the original LP is feasible, then the auxiliary LP has optimal value $0$. The basis corresponding to the solution of auxiliary LP should now consist entirely of non-artificial variables, and can be used as an initial basis in Phase II. If otherwise some artificial variable remains in the basis corresponding to the optimal solution of value $0$, then this variable can be moved out from the basis, and replaced by a variable corresponding to any nonzero element in the tableaux row corresponding to the artificial variable. If there are no nonzero elements in that row, then the original matrix ${\bf A}$ does not have a full rank, and the redundant row must be removed.

\medskip
{\bf Phase II}

In this phase we solve the original LP \eqref{lp:obj}--\eqref{lp:nonneg}, given an initial bfs, obtained in Phase I.

\medskip
{\bf The Algorithm}
\begin{enumerate}
    \item Given a basis $B$, construct $m$-by-$m$ matrix ${\bf A}_B$.
    \item Compute ${\bf x} = {\bf A}_B^{-1} {\bf b}$.
    \item Compute ${\bf y} = ({\bf A}_B^T)^{-1} {\bf c}_B$.
    \item Compute ${\bf s} = {\bf c}_N - {\bf A}_N^T {\bf y}$.
    \item If ${\bf s} \geq 0$ then STOP. Return optimal value $({\bf x}_B, {\bf x}_N = {\bf 0})$.
    \item Select entering index $j$, such that ${\bf s}_j < 0$ and $j$ is the smallest.
    \item Compute ${\bf d} = {\bf A}_B^{-1} {\bf A}_j$.
    \item If ${\bf d} \leq 0$ then STOP. Problem is unbounded.
    \item Select leaving index $i$, to be the smallest one in the set $\min \{ \frac{x_i}{d_i}, \; d_i > 0 \}$.
    \item Let $B \leftarrow B \setminus \{ i \} \cup \{ j \}$. Go to step 1.
\end{enumerate}

The rules for selecting entering and leaving indices are called {\em Bland's rules}.

\section*{Simplex method for problems with bounded variables}

Let us assume that variables in the problem are bounded, i.e.,
$$
    \forall_{j=1,\ldots,n} \;\; L_j \leq x_j \leq U_j.
$$

By substituting $x_j' = x_j - L_j$ we can, without the loss of generality, consider the following formulation:

\begin{align}
    \textrm{min } & {\bf c}^T {\bf x} \label{lp:obj_sub} \\
    \textrm{st. } & {\bf A} {\bf x} = {\bf b}, \label{lp:Axeqb_sub} \\
                  & 0 \leq {\bf x} \leq {\bf u}. \label{lp:bounds}
\end{align}
where ${\bf u} = [U_1 - L_1, U_2 - L_2, \ldots, U_n - L_n]^T$, and we use ${\bf x}$ instead of ${\bf x}'$ for brevity (note that we also omit the constant term from the objective function, as the optimal solution remains the same).

Instead of adding slack variables to singleton upper-bound constraints and appending them to the matrix ${\bf A}$, we consider this special type of constraints separately. We use the notion of {\it extended basic feasible solution}. In such a solution, all basic variables assume values
$$0 < x_j < U_j,$$
while all nonbasic variables assume
$$ x_j = 0 \;\; \textrm{ or } \;\; x_j = U_j.$$

\medskip

{\bf Theorem.} If every nonbasic variable at its lower bound has a nonnegative objective coefficient, and every nonbasic variable at its upper bound has a nonpositive objective coefficient, then the extended basic feasible solution minimizes the objective function over the feasible region. \qed

\medskip

If the objective coefficient $\hat{c}_j$ of nonbasic variable $x_j = 0$ is negative, we may increase $x_j$. If the objective coefficient $\hat{c}_j$ of nonbasic variable $x_j = U_j$ is positive, we may decrease $x_j$. In either case, the value of solution is improving.

To simplify the computations, whenever a nonbasic variable assumes $x_j=U_j$, we apply the {\it upper-bound substitution}:
$$
    x_j = U_j - x_j'.
$$
This substitution affects the objective function coefficient $c_j$, as well as $a_{ij}$ and $b_i$ of each constraint that involves $x_j$. After applying it, all nonbasic variables have $x_j = 0$ or $x_j' = 0$. Thus we may use the same condition for selecting entering variable $x_s$ as in the original simplex method:

\begin{quote}
Select entering index $j$, such that ${\bf s}_j < 0$ and $j$ is the smallest.
\end{quote}

To determine the leaving variable we need to take 3 cases into consideration that may happend when the entering variable $x_s$ is increased from 0. Either $x_s$ reaches its upper bound $U_s$, some basic variable $x_k$ decreases to 0, or some basic variable $x_k$ increases to its upper bound $U_k$. Thus we compute the following:
$$
    t_1 = \min_i \{ \frac{x_i}{d_i} : \; d_i > 0 \},
$$
$$
    t_2 = \min \{ \frac{U_k - x_i}{-d_i} : \; d_i < 0 \},
$$
$$
    \theta = \min \left\{ U_s, \; t_1, \; t_2 \right\}.
$$

\begin{enumerate}[i)]
    \item If $\theta = \infty$ then problem is unbounded.
    \item If $\theta = U_s$ then we apply the upper-bounding substitution to entering variable $x_s$ (basis remains unchanged).
    \item If $\theta = t_1$ then we perform usual simplex pivot to introduce $x_s$ into basis.
    \item If $\theta = t_2$ then we first apply the upper-bounding substitution to basic variable $x_k$ (corresponding to the minimum in $t_2$), and then perform simplex pivot to introduce $x_s$ into basis.
\end{enumerate}

When optimal solution is found (no increase in any variable can lead to improvement of the objective function) we must reverse all upper-bounding substitutions to retrieve the actual solution.

\end{document}