Previous chapters introduced some of the fundamental concepts related to robotic perception, and specifically techniques for sensing the environment and extracting useful semantic information. While these techniques provide \textit{local} information that is crucial for robots to navigate autonomously, additional \textit{global} information is often required.
For example, distance measurements from a laser rangefinder might be useful for detecting objects in an environment, but they only provide information \textit{relative} to the robot's current position. Alternatively, object detection via computer vision only provides information about what is in the robot's \textit{current} view. Robotic autonomy, in particular autonomous decision making and planning, generally requires more than just local information to answer questions such as ``have I seen this object before?'' and ``have I been here before?''.
These new challenges, associated with building a global understanding of the environment from local measurements, are often referred to as \textit{localization and mapping}\footnote{Localization and mapping is the component of the ``think'' part of the ``see, think, act'' cycle that connects with robotic perception.}.

\notessection{Introduction to Localization and Filtering}

The problem of \textit{localization} is to endow the robot with the ability to understand its current position with respect to its environment in a global sense\cite{ThrunBurgardEtAl2005}\cite{SiegwartNourbakhshEtAl2011}.
One of the main classes of techniques for robot localization are \textit{map-based}, where the robot explicitly localizes its position with respect to a \textit{map} of the environment.
For example, consider the floor plan (the environment map) in Figure \ref{fig:sample-room}: before a robot can navigate to a particular room it must know where in the building it is currently located.\footnote{Other approaches to navigate in environments include \textit{behavioral} approaches, which rely on a specified set of behaviors that will result in a desired global behavior without the need for explicit mapping or localization. An example of this approach would be to have a left-wall following behavior for movement about a building.}
\begin{figure}[ht]
	\centering
    \includegraphics[width=0.9\textwidth]{tex/figs/ch13_figs/map.png}
    \caption{An example environment where localization is crucial for robotic autonomy. For a robot to move from location A to location B it must first understand which room it is in, and that the only path to B is through the hallway. Extracting such global information about the environment from local measurements (e.g. from a range sensor) requires specialized algorithms.}
    \label{fig:sample-room}
\end{figure}

There are two primary components to map-based localization: map representation and belief representation. This chapter focuses on belief representation, which addresses the problem of how to best represent the robot's belief of its current position with respect to the map. One simple approach would be to simply store a best guess of the robot's position (in some map-based coordinate system). However in practice localization information is often \textit{uncertain}, and representing the belief by only a best guess does not capture this important fact. Therefore one common approach is to use a \textit{probabilistic} representation of the robot's belief since probability distributions can be used to model uncertainty (and extract best guesses, for example by finding the mean of a unimodal distribution). A variety of probabilistic representations can be used, for example singe-hypothesis or multiple-hypothesis representations as well as continuous or discrete representations. A few examples showing the differences between these types of representations are given in Figure \ref{fig:belief-representation}.
\begin{figure}[ht!]
	\centering
    \includegraphics[width=0.6\textwidth]{tex/figs/ch13_figs/distributions.png}
    \caption{A graphical representation of different types of probabilistic representations: (a) a continuous single-hypothesis belief (e.g. from a single Gaussian distribution), (b) a continuous multiple-hypothesis belief (e.g. a mixture of Gaussians), (c) discrete representation with a finite number of possible values.}
    \label{fig:belief-representation}
\end{figure}
Some representations are more expressive than others, but there is usually a trade-off with computational complexity of the resulting algorithms that support the representation. Algorithms based on these different probabilistic representations will be presented in this chapter and in subsequent chapters.

\subsection{Basic Concepts in Probability}
Before discussing different types of robot localization algorithms it is useful to provide a review of some of the fundamental concepts from probability.

\subsubsection{Random Variables}
Uncertain quantities such as sensor measurements, robot state, and environment variables can be modeled as discrete or continuous \textit{random variables}.
\begin{definition}[Discrete Random Variable]
A discrete random variable $X$ is a random variable that can only take on values from a countable set. Discrete random variables are characterized by a probability mass function $p(x)$ (which can be read as $p(X=x)$, ``the probability that $X$ takes on value $x$'') that satisfies:
\begin{equation*}
    \sum_x p(x) = 1,
\end{equation*}
where the summation is over all possible values of $X$.
\end{definition}
\begin{definition}[Continuous Random Variable]
A continuous random variable $X$ is a random variable that can take on values from a continuous range. Continuous random variables are characterized by a probability density function $p(x)$ that satisfies:
\begin{equation*}
    \int_{-\infty}^\infty p(x) dx = 1.
\end{equation*}
The probability of the random variable taking on a value in the interval $[a,b]$ is similarly defined as:
\begin{equation*}
    P(a \leq X \leq b) = \int_{a}^b p(x) dx = 1.
\end{equation*}
\end{definition}
A common example of a discrete random variable is the result of a coin flip, which can only take on two values: heads or tails. In robotics, a common example of a continuous random variable may be the position of the robot, which could take on an infinite number of values.

\subsubsection{Joint Distributions, Independence, and Conditioning}
Many applications of probability theory rely on more than one random variable. In these instances it is useful to be able to quantify probabilities associated with multiple random variables at the same time. One of the most fundamental tools when dealing with multiple variables is the \textit{joint distribution}.
\begin{definition}[Joint Distribution]
The joint distribution of two random variables $X$ and $Y$ defines the probability associated with both taking on specific values at the same time. This is denoted mathematically as $p(x,y)$, which can be read as $p(X=x \:\:\text{and}\:\: Y=y)$.
\end{definition}
It is also useful to determine whether different random variables have any relationship to each other. In particular, two random variables that do not have any influence on each other in a probabilistic sense are considered to be probabilistically independent.
\begin{definition}[Independence]
Two random variables $X$ and $Y$ are independent if and only if:
\begin{equation} \label{eq:indep}
    p(x,y)=p(x)p(y).
\end{equation}
Independence holds when the occurrence of one value of a random variable does not affect the probability of another random variable taking on a specific value.
\end{definition}
Another useful tool that relates two random variables is the conditional probability, which defines the probability of a random variable when the value of a second random variable is \textit{known} or \textit{fixed}.
\begin{definition}[Conditional Probability]
The conditional probability of a random variable $X$ taking on a value given that a second random variable $Y$ has a specific value is defined as:
\begin{equation} \label{eq:condprob}
    p(x\:|\: y)\coloneqq \frac{p(x,y)}{p(y)}.
\end{equation}
This can be read as ``the probability of $X$ taking on value $x$ conditioned on the fact that $Y$ has taken on value $y$''.
\end{definition}
Notice that if the random variables $X$ and $Y$ are independent, then the conditional probability definition simplifies to $p(x\:|\: y) = p(x)$, which suggests that knowing that $Y$ has taken on value $y$ has provided no new information about the random variable $X$ (which of course is in line with the definition of independence).
Additionally, another notion of independence can be defined based on whether or not two random variables are independent when \textit{conditioned} a third random variable.
\begin{definition}[Conditional Independence]
Two random variables $X$ and $Y$ are conditionally independent given the value of a third random variable $Z$ if and only if:
\begin{equation} \label{eq:condindep}
    p(x,y\:|\: z) = p(x \:|\: z) p(y \:|\: z).
\end{equation}
\end{definition}
It is important to note however that conditional independence does not imply independence, and vice versa.

\subsubsection{Law of Total Probability}
The law of total probability defines a relationship between probabilities, joint probabilities, and conditional probabilities.
\begin{definition}[Law of Total Probability]
For discrete random variables $X$ and $Y$ the law of total probability states that:
\begin{equation*}
    p(x) = \sum_y p(x,y) = \sum_y p(x \:|\: y) p(y).
\end{equation*}
Similarly, for continuous random variables this law is given by:
\begin{equation*}
    p(x) = \int p(x,y) dy = \int p(x \:|\: y) p(y) dy.
\end{equation*}
\end{definition}
In words, this law says that the probability of a random variable $X$ taking on a value $x$ can be found by looking at the joint probabilities between $X$ and $Y$ and accounting for \textit{all} possible values of $Y$. The second part of the law is a direct result of applying the definition of conditional probabilities.

\subsubsection{Bayes' Rule}
The joint probability $p(x,y)$ between two random variables $X$ and $Y$ can be related to the conditional probabilities $p(x \:|\: y)$ and $p(y \:|\: x)$ via the definition of conditional probabilities \eqref{eq:condprob}. In particular, since the joint probability can be equivalently expressed in two ways it can be seen that:
\begin{equation*}
    p(x,y) = p(x \:|\: y)p(y) = p(y \:|\: x) p(x).
\end{equation*}
This relationship is commonly referred to as Bayes' rule:
\begin{definition}[Bayes' Rule]
For discrete random variables $X$ and $Y$, Bayes' rule states that:
\begin{equation} \label{eq:bayes}
    p(x \:|\: y) = \frac{p(y \:|\: x) p(x)}{p(y)}.
\end{equation}
\end{definition}
Bayes' rule is useful as it provides a relationship between the ``inverse'' conditional probabilities $p(x \:|\: y)$ and $p(y \:|\: x)$. This is particularly important for \textit{probabilistic inference}, which is the problem of inferring the value of a random variable from another.

For example, suppose you had a good initial guess of the probability distribution $p(x)$ for a random variable $X$ (the distribution $p(x)$ in this case is often called the \textit{prior}, because it is the guess that comes before any new information is taken into account). Then, suppose some new information regarding the value of a random variable $Y$ is obtained. Using Bayes' rule it is possible to update your belief about the probability distribution of $X$ based on this new information. In particular, the new belief is the conditional probability $p(x \:|\: y)$ (which is often called the \textit{posterior} because it comes after new information is introduced). These two distributions are related by Bayes' rule!

Bayes' rule can also be extended to cases with additional random variables. For example with three random variables $X$, $Y$, and $Z$, Bayes' rule is:
\begin{equation*}
    p(x \:|\: y, z) = \frac{p(y \:|\: x, z) p(x \:|\: z)}{p(y \:|\: z)}.
\end{equation*}

\subsubsection{Expectation and Covariance}
Probability distributions define in a vary precise way the probability associated with any particular value of a random variable. However, sometimes it is useful to aggregate this information into more practically useful metrics. Two of the most commonly used metrics are the \textit{expected value} and the \textit{covariance}.
\begin{definition}[Expected Value]
The expected value for a random variable $X$ is denoted as $E[X]$. For discrete random variables the expected value can be computed by:
\begin{equation*}
    E[X] = \sum_x x p(x).
\end{equation*}
Similarly, the expected value for a continuous random variable can be computed by:
\begin{equation*}
    E[X] = \int x p(x) dx.
\end{equation*}
\end{definition}
The expected value can be thought of as the average result of an experiment over an infinite number of trials, and is also sometimes referred to as the \textit{first moment} of the distribution.
Additionally, expectation is a \textit{linear operator}, such that:
\begin{equation*}
    E[aX + b]= aE[X] + b,
\end{equation*}
for any values $a$ and $b$.
In the case that the random variable $X$ is a vector-valued random variable, the expectation of the random vector is simply the vector of expectations of each element.

\begin{definition}[Covariance]
The covariance between two random variables $X$ and $Y$ is denoted $\text{cov}(x,y)$ and is computed by:
\begin{equation*}
    \text{cov}(x,y) = E[(X-E[X])(Y-E[Y])^\top ] = E[XY^\top ] - E[X]E[Y]^\top
\end{equation*}
\end{definition}
Covariance is a metric used to describe the relationship between random variables and is positive if greater values of one variable generally corresponds to greater values of the other (and same for lesser values). Similarly, it is negative if the variables tend to show opposite behavior of each other. If there is no general relationship between the two then their covariance is zero (e.g. independent random variables have zero covariance).

\subsection{Markov Models}
Recall from previous chapters the kinematic and dynamic models that were developed to describe the physical behavior of a robot. These models consisted of a robot state $\x$, and a set of equations that described how $\x$ varied in time given some control inputs $\bu$. In this section another type of model will be developed that is based on these same core ideas. These new models, referred to as \textit{Markov models}, are commonly used in robotics for localization tasks as well as higher level planning tasks.

\subsubsection{States, Measurements, and Controls}
Similar to previous chapters, the state $\x$ is a collection of variables that contains information required to define the physical state of the robot. However unlike previous chapters, the state might also include information about the environment (this state has a higher-level perspective). In the context of robotics, the state may include the robot pose (i.e. location and orientation information), velocity, as well as locations and features of surrounding objects in the environment.
Note that in general the state discussed in this section might be different from the state defined for robot kinematics and dynamics (even if the robot is the same). This is because the choice of model is usually specific to the task at hand, and while the kinematic and dynamic models are useful for control, they may not strictly be necessary (or sufficient) for use in localization and planning tasks.

A discrete time formulation is also used in this context, where the state is specified for discrete time instances and denoted by $\x_t$ (rather than $\x(t)$, as was done in previous chapters). The models developed in this section then describe the changes in the state between time steps, for example between $\x_t$ and $\x_{t+1}$. It is also useful to define the notation $\x_{t_1:t_n} \coloneqq \x_{t_1},\x_{t_2},...,\x_{t_n}$ for describing a sequence of states between times $t_1$ and $t_n$.

The robot interacts with the environment through control actions and by gathering information through measurements\footnote{In the context of robot localization, measurements increase the robot's knowledge and control actions tend to result in a loss of knowledge.}. In this context, the measurement data collected at a time $t$ will be denoted as $\z_t$, and the control data is denoted as $\bu_t$. Similar to the state, a useful notation for representing a sequence of measurements or controls is given by  $\z_{t_1:t_n} \coloneqq \z_{t_1},\z_{t_2},...,\z_{t_n}$ and $\bu_{t_1:t_n} \coloneqq \bu_{t_1},\bu_{t_2},...,\bu_{t_n}$. In general, the measurements can come from any number of the sensors discussed in previous sections on robotic perception, including cameras and laser rangefinders.

\subsubsection{Model}
The kinematic and dynamic models from previous chapters (expressed as a set of ordinary differential equations) were deterministic models. However, to leverage a probabilistic framework for robot localization it is typically required that the model also be probabilistic. In the most general sense a probabilistic model can be defined by:
\begin{equation} \label{eq:genprobmod}
p(\x_t \mid \x_{0:t-1}, \z_{1:t-1}, \bu_{1:t}),
\end{equation}
which defines a probability distribution over the possible current state $\x_t$ given the state, measurement, and control histories. Note that here the convention that will be used is that the robot executes control $\bu_t$ first, and then the measurement $\z_t$ can be made based on the resulting state $\x_t$. A general probabilistic measurement model can also be defined as:
\begin{equation} \label{eq:genmeasmod}
p(\z_t \mid \x_{0:t}, \z_{1:t-1}, \bu_{1:t}).
\end{equation}

In many cases however, the state is defined such that it is \textit{complete}. A state $\x_t$ is complete if no variables prior to $\x_t$ can influence the future states. In other words, $\x$ contains a sufficient amount of information that the history is not important. This is also known as the \textit{Markov property}. If the Markov property holds, the probabilistic model \eqref{eq:genprobmod} can be simplified to:
\begin{equation} \label{eq:markovprobmod}
p(\x_t \mid \x_{t-1}, \bu_{t}),
\end{equation}
and the measurement model \eqref{eq:genmeasmod} can be simplified to:
\begin{equation} \label{eq:markovmeasmod}
p(\z_t \mid \x_{t}).
\end{equation}

The resulting overall model with the Markov property, consisting of the state transition probability \eqref{eq:markovprobmod} and the measurement model \eqref{eq:markovprobmod} is referred to as a Bayes network model or a hidden Markov model. Graphically this model can be represented as shown in Figure \ref{fig:hmm}, where the sequencing of the control and measurements are more clearly shown (first control, then measurement).
\begin{figure}[ht]
	\centering
    \includegraphics[width=0.55\textwidth]{tex/figs/ch13_figs/hmm.png}
    \caption{Graphical representation of the Bayes network model (hidden Markov model). Note that the sequencing assumes that the control is applied, and then a measurement is taken.}
    \label{fig:hmm}
\end{figure}

\subsection{Bayes Filter}
Given a Bayes network model defined by a state transition model \eqref{eq:markovprobmod} and a measurement model \eqref{eq:markovmeasmod}, the next task is to determine a way to use this information for robot localization. In particular, the desired task is to estimate the current robot state $\x_t$ given the measurement and control information that is available. In the probabilistic framework this estimate is referred to as a \textit{belief distribution}, which is a probability distribution over $\x$. This distribution assigns a probability to each hypothesis with respect to the true state. Mathematically the belief distribution is denoted as $bel(\x_t)$ and is defined as:
\begin{equation} \label{eq:belief}
bel(\x_t):=p(\x_t\mid \z_{1:t}, \bu_{1:t}).
\end{equation}
In other words, the belief $bel(\x_t)$ is a posterior probability distribution over the state variables conditioned on the available data. A similar distribution, known as the \textit{prediction} distribution, can also be defined as:
\begin{equation} \label{eq:predbelief}
\overline{bel}(\x_t):=p(\x_t\mid \z_{1:t-1},\bu_{1:t}),
\end{equation}
which is does not include the most recent measurement $\z_t$. The process of computing a belief from a predicted belief (i.e. the process of accounting for the new measurement $\z_t$) is called a \textit{correction} or \textit{measurement update}.

The most general algorithm for computing beliefs $bel(\x_t)$ (which leverages Bayes network models that satisfy the Markov property) is known as the \textit{Bayes filter}. This filter is a recursive algorithm that consists of a prediction step for computing $\overline{bel}(\x_t)$ and a correction step for computing $bel(\x_t)$ given a new measurement $\z_t$.

\subsubsection{Algorithm}
The Bayes filter algorithm is given in Algorithm \ref{alg:bayes}. In this algorithm, the probability associated with each potential state $\x_t$ is updated via a prediction and a correction. The term $\eta$ in the correction step is simply a normalization constant that ensures the resulting posterior $bel(\x_{t})$ satisfies the requirements of a probability density function\footnote{In fact this normalization constant comes from the denominator in Bayes' rule.}. This algorithm is typically initialized with a prior distribution $bel(\x_{0})$ that may come from a best guess or simply a uniform distribution.
\begin{algorithm}[ht]
 \KwData{$bel(\x_{t-1}), \bu_{t},\z_{t}$}
 \KwResult{$bel(\x_{t})$}
 \ForEach{$\x_t$}{
    $\overline{bel}(\x_t) = \int p(\x_t\mid \bu_{t}, \x_{t-1}) bel(\x_{t-1}) d\x_{t-1}$ \\
    $bel(\x_t) = \eta p(\z_t\mid \x_{t})\overline{bel}(\x_t)$
 }
 \Return $bel(\x_{t})$
 \caption{Bayes Filter Algorithm}
 \label{alg:bayes}
\end{algorithm}
Note that the prediction step is essentially just using the state transition model \eqref{eq:markovprobmod} to guess what might happen to each state for the given control $\bu_t$. The correction step is then modifying the prediction to actually account for what was observed in the real world.

\subsubsection{Derivation}
Recall that the belief distribution is defined as \eqref{eq:belief}, which can be expanded using Bayes' rule to yield:
\begin{equation*}
\begin{split}
bel(\x_t) &\coloneqq p(\x_t\mid \z_{1:t}, \bu_{1:t}), \\
&=\eta p(\z_{t}\mid \x_{t},\z_{1:t-1},\bu_{1:t})p(\x_{t}\mid \z_{1:t-1},\bu_{1:t}),
\end{split}
\end{equation*}
where
\begin{equation*}
    \eta = \frac{1}{p(\z_{t}\mid \z_{1:t-1},\bu_{1:t})}.
\end{equation*}
The Markov property can then be leveraged to simplify $p(\z_{t}\mid \x_{t},\z_{1:t-1},\bu_{1:t}) = p(\z_{t}\mid \x_{t})$ and the definition of the prediction belief can be used to give:
\begin{equation*}
\begin{split}
bel(\x_t) = \eta p(\z_{t}\mid \x_{t}) \overline{bel}(\x_t),
\end{split}
\end{equation*}
which is precisely the second step of the Bayes filter algorithm. Now the derivation of the prediction can be given by again starting from its definition and leveraging the law of total probability:
\begin{equation*}
\begin{split}
 \overline{bel}(\x_t) &= p(\x_{t}\mid \z_{1:t-1},\bu_{1:t}), \\
 &= \int p(\x_{t}\mid \x_{t-1},\z_{1:t-1},\bu_{1:t}) p(\x_{t-1}\mid \z_{1:t-1},\bu_{1:t}) d\x_{t-1}.
\end{split}
\end{equation*}
Again the Markov property can now be used to simplify $p(\x_{t}\mid \x_{t-1},\z_{1:t-1},\bu_{1:t}) = p(\x_{t}\mid \x_{t-1},\bu_{t})$, and additionally the structure of the model makes it possible to remove the $\bu_t$ term from the prior distribution $p(\x_{t-1}\mid \z_{1:t-1},\bu_{1:t})$ since the control $\bu_t$ has no impact on the state $\x_{t-1}$ (see Figure \ref{fig:hmm}). Therefore the expression above can be simplified to:
\begin{equation*}
\begin{split}
 \overline{bel}(\x_t) = \int p(\x_{t}\mid \x_{t-1},\bu_{t}) bel(\x_{t-1}) d\x_{t-1},
\end{split}
\end{equation*}
since by definition $bel(\x_{t-1}) = p(\x_{t-1}\mid \z_{1:t-1}, \bu_{1:t-1})$. This result is precisely the prediction step from the Bayes filter algorithm.

\subsubsection{Practical Considerations}
The Bayes filter is a great starting point to derive many useful algorithms, but is itself often not practical to implement. In particular it is generally not reasonable to assume that the integrals in Algorithm \ref{alg:bayes} can be computed, and if they could be approximated via a numerical scheme this may computationally still be challenging.

\subsection{Discrete Bayes Filter}
The discrete Bayes filter is a discrete version of the Bayes filter previously introduced. This filter can be applied to problems where the state space is finite (i.e. only a finite number of values of $\x$ are possible). This makes the Bayes filter approach more tractable because the integrals do not need to be computed over an infinite set.

In the discrete Bayes filter the belief $bel(\x_{t})$ is represented using a probability mass function rather than a probability density function (as is the case with the \textit{continuous} Bayes filter). In particular, this probability mass function is simply a finite collection of probabilities $\{p_{k,t}\}$ where $p_{k,t}$ is the probability associated with state $k$ at timestep $t$. The algorithm generally follows the exact procedure as the Bayes filter in Algorithm \ref{alg:bayes}, but with summations replacing the integrals. In particular, the discrete Bayes filter algorithm is provided in Algorithm \ref{alg:discretebayes}.
\begin{algorithm}[ht]
 \KwData{$\{p_{k,t-1}\}, \bu_{t}, \z_{t}$}
 \KwResult{$\{p_{k,t}\}$}
 \ForEach{k}{
  $\overline{p}_{k,t}=\sum_{i} p(\x_{t}\mid \bu_{t}, \x_{i})p_{i,t-1} $\\
  $p_{k,t}=\eta p(\z_{t}\mid \x_{k})\overline{p}_{k,t}$\\
 }
 \Return $p_{k,t}$
 \caption{Discrete Bayes Filter Algorithm}
 \label{alg:discretebayes}
\end{algorithm}


\documentclass[letterpaper]{article}

\usepackage{fullpage}
\usepackage{nopageno}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage[utf8]{luainputenc}
\usepackage{aeguill}
\usepackage{setspace}

\tikzstyle{edge} = [fill,opacity=.5,fill opacity=.5,line cap=round, line join=round, line width=50pt]
\usetikzlibrary{graphs,graphdrawing}
\usegdlibrary{trees}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\allowdisplaybreaks

\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}

\begin{document}
\title{Notes}
\date{17 avril, 2015}
\maketitle
9.4 chromatic plynomials

the chromatic poly counts the number of \lambda-colorings of a graph $G$

notation $P(G,\lambda)$

polynomial starts at zero and then becomes positive. once positive it's positive forever. discrete poly (integer), not continuous.

leading coefficient is positive from end ending positive

zeros are factors

two colorings $C, C'$ are distinct if $\exists v\in V(G)$ such that $C(v)\ne C'(v)$

example:

\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph [tree layout] { 1 -- {2 -- 3} -- 1 --4--3}
  [shift=(0:1)];

let $\lambda=6$. how many ways can we color $G$ with 6 colors? 1 has 6, 3 has 5, 4 choices for 2 and 4. so 480.

we have shown:

$P(G,6)=480$

the enumeration of choices above, we can get $P(G,\lambda)=\lambda(\lambda-1)(\lambda-2)^2$

\subsubsection*{properties}
that should make sense
\begin{enumerate}
\item
chromatic number: $\chi(G)=3$
\item
what is the smallest $\lambda$ such that $P(G,\lambda)>0$? 3o
\item
convention: $P(G,0)=0\forall G$
\end{enumerate}

formally, if $P(G,\lambda)$ is the chrompoly of $G$ then $\chi(G)=\min\limits_\lambda(P(G,\lambda)>0)$

\subsubsection*{exercise}
find the $P(K_n,\lambda)$

$P(K_3,\lambda)=\lambda(\lambda-1)(\lambda-2)$

$P(K_4,\lambda)=\lambda(\lambda-1)(\lambda-2)(\lambda-3)$

$P(K_n,\lambda)=\prod\limits_{i=0}^{n-1}(\lambda-i)=\frac{\lambda!}{(\lambda-n)!}$

if $E_n$ is the empty graph (no edges) on $n$ vertices $P(E_n,\lambda)=\lambda^n$

\subsubsection*{exercise}
$P(C_4,\lambda)$
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph [tree layout] { 1 -- 2 -- 3 -- 4--1 }
  [shift=(0:1)];

  $P(C_4,\lambda)=\lambda(\lambda-1)^2(\lambda-2)$ unless the two adjacent to the starting count are the same then $\lambda(\lambda-1)^3$

  this leads to sums in $P(G,\lambda)$ and so we have graph theoretically two options
\begin{enumerate}
\item
if they are the same edge contraction
\item
if they are different then we can insert an edge with no change
\end{enumerate}

either choice leads to  a complete graph

\section*{theorem}
if $uv\not\in E(G)$ and $H$ is the graph $G+uv$ with $uv$ contracted, then $P(G,\lambda)=P(G+uv,\lambda)+P(H,\lambda)$

we are going to draw graphs instead of using this notation

\subsubsection*{example}
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 1;2--3 --1--2;4--5;2--4;5--3};
  =
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 1;2--3 --1--2;4--5;2--4;5--3;5--1};
  +
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2};

=
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 1;2--3 --1--2;4--5;2--4;5--3;5--1};
  +
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2};
+
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2;4--3};
+
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 3;4--3--5--4};

$\vdots$

=
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 1;2--3 --1--2;4--5;2--4;5--3;5--1;4--3;5--2};
  +
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2;4--3};
+
$3\cdot($
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2;4--3};
+
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 3;4--3--5--4};
$)$

homework is $1,6,7$
\end{document}


%!TEX program = xelatex
%!TEX root = ./thesis.tex
\chapter{Experiments}\label{chap:experiments}

% \yan{How about using the title ``Evaluations''?}
% No, thx.
% \yan{For grammar issues, do you mind using Grammarly \textit{https://app.grammarly.com/} to check your document? Our lab often uses it when writing English papers.}
% Yep, this whole thesis has already been revised on Grammarly.

The GreenEyes model is based on WaveNet and LSTM. Unlike computer vision models, which take 2D images as inputs, the GreenEyes model is trained on 1D sequential data arrays.

To build a data feeding pipeline, we built a slice data generator on the $PM_{2.5}$ IAQI data. Train data pairs as below are fed to the model:

\begin{equation}
\left\{
    \begin{array}{l}
    X_i=[D(t_i),D(t_{i+1}),...,D(t_{i+L-1})] \\
    y_i=P(t_{i+L})
    \end{array}
\right.
\end{equation}

% 实验目的是用window化的 IAQI 数据（注意是iaqi数据，不是原始pm数据）fit手动标注的 IAQI level

Where $D$ denotes the whole $PM_{2.5}$ IAQI data array, $P$ denotes the whole target function, i.e., the polygonized IAQI level we get in the last chapter. It is clear that our model takes a 1D array as input and outputs a scalar.

$L$ denotes the length of the slice when we sample sequences from the $PM_{2.5}$ IAQI data, and $t_i$, $t_{i+1}$ etc. are the discrete-time points. Note that to make the model to be \textbf{causal}, the target value $y_i$ in the train data pair is sampled at time point $t_{i+L}$, which is exactly next to the last time point in $X_i$.

In our experiment, as the total length of the $PM_{2.5}$ IAQI data is 219,989, setting different values for the length of the slice $L$ will firstly lead to variant input size for the GreenEyes model because the input size equals $L$, which will also make the number of training parameters larger or smaller. Secondly, as the length of the whole sequence data is limited, the larger $L$ is, the less the number of total train data is. Number of total train data is $(219,989-L+1)$.

We finally chose 7,200 as the length of the slice for the following reasons:
\begin{enumerate}
    \item 7,200 seconds equals 2 hours in the time axis, and we design the model to predict the next second's IAQI level by previous data within these 2 hours.
    \item The model's size (number of parameters, etc.) w.r.t. the input size of 7,200 is exactly appropriate both for learning and inferring.
\end{enumerate}

\section{Data Sampling and Splitting}

As described above, the number of total train data is $(219,989-L+1)$. When setting $L=7200$, it is 212,790, which is an enormous number when feeding the model. Hence, we introduced the sampling method and set stride when collecting train samples from the original data, and the size will be $\frac{\lfloor 219,989-L+1 \rfloor}{stride}+1$.

Moreover, we split the data into a training set and validation set, with a validation ratio of 0.2. The number of training/validation samples varies when stride varies. Out experiments use 10, 5, 2 as stride's value and Table \ref{table:N_samples} illustrates the number of training/validation samples.

\begin{table}[!htbp]
    \centering
    \begin{tabular}{|l|l|l|l|l|}
    \hline
    $L$ (The length of the slice) & Stride & $N_{samples}$ & $N_{train}$ & $N_{val}$ \\ \hline
    7200 & 10 & 21280  & 17024  & 4256  \\ \hline
    7200 & 5  & 42559  & 34048  & 8511  \\ \hline
    7200 & 2  & 106396 & 85117  & 21279 \\ \hline
    \end{tabular}
    \caption{The relationship between different strides and number of samples.}
    \label{table:N_samples}
\end{table}

Figure \ref{fig:model_feeding_pipeline} shows the model feeding pipeline of our GreenEyes model during training.

\begin{figure}[!htbp]
    \centering
    \includegraphics[width=2.9in]{graphs/data_slicing.pdf}
    \caption{Data feeding pipeline when training.}
    \label{fig:model_feeding_pipeline}
\end{figure}

\section{Sensor Data Augmentation}

As brought out before, we believe that with more data together, the model could learn better. Though these four data channels differ a little from each other, they approximately follow the same distribution. Hence, besides training the model on every single channel of \text{$PM_{2.5}$} data, we also \textbf{combined} all these channels' data together and fed it. The corresponding data is called \text{$PM_{2.5}$ (All)}.

\section{Experiments}
% 描述实验的组别，个数
As we sampled $PM_{2.5}$ data from 4 sensors, Sensor 0 to Sensor 3, so we have four channels of $PM_{2.5}$ IAQI data, and there are three different stride values. Finally, we have 12 experiments. Besides, we have a group of augmentation experiments in which all four sensors' data are fed to the model, yielding another three experiments.
% LR 配置
For each experiment, We optimized our GreenEyes model using Adam \cite{kingma2017adam} an initial learning rate of 0.0001, which is multiplied by 0.1 after 20 epochs. We trained our model to 100 epochs for each experiment.
% Loss 配置
We used mean squared error (MSE) as a loss metric and recorded mean absolute error (MAE). They are defined by equations below:

\begin{equation}
    MSE(p, y)=E((p_i-y_i)^2)
\end{equation}

\begin{equation}
    MAE(p, y)=E(|p_i-y_i|)
\end{equation}

Where $p$ is the prediction sequence and $y$ is the polygonized $PM_{2.5}$ IAQI sequence.

% four metrics, mean squared error (MSE), mean absolute percentage error (MAPE), mean squared logarithmic error (MSLE).

\subsection{Training and Validation} % 15 experiments

\subsubsection{Training Loss Curves}

Figure \ref{fig:training_mse} and Figure \ref{fig:val_mse} illustrate the training MSE curves and validation MSE curves respectively. It is observed that our system can fit the data well.
% \yan{Add a conclusion. } \yan{It is observed our system can xxx.}

% \yan{By the way, does your institution require inserting PDF figures?}

\begin{figure}[!htbp]
    \centering
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/train_curves_stride_10.pdf}
        \caption{stride=10.}
        \label{fig:train_stride_10}
    \end{subfigure}
    \hfill
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/train_curves_stride_5.pdf}
        \caption{stride=5.}
        \label{fig:train_stride_5}
    \end{subfigure}
    % \hfill
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/train_curves_stride_2.pdf}
        \caption{stride=2.}
        \label{fig:train_stride_2}
    \end{subfigure}
\caption{Training MSE curves.}
\label{fig:training_mse}
\end{figure}

\begin{figure}[!htbp]
    \centering
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/val_curves_stride_10.pdf}
        \caption{stride=10.}
        \label{fig:val_stride_10}
    \end{subfigure}
    \hfill
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/val_curves_stride_5.pdf}
        \caption{stride=5.}
        \label{fig:val_stride_5}
    \end{subfigure}
    % \hfill
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/val_curves_stride_2.pdf}
        \caption{stride=2.}
        \label{fig:val_stride_2}
    \end{subfigure}
\caption{Validation MSE curves.}
\label{fig:val_mse}
\end{figure}

% 讨论一个 Sensor，其它的放附录
% For Sensor 0, we fed the model with three different stride values. Figure
% the learning curves
% after the learning rate changes at the 20th epoch
% For more model training data, please refer to Appendix \ref{chapter:other_model_training_data}
% Figure \ref{fig:model_training_mse_mae_msle} shows the training process. We can infer that the model is already saturated after 100 epochs.

\subsubsection{Training Best Metrics}

As we used MSE as loss, i.e., the supervising metric, we extracted minimum train MSE and minimum validation MSE from all the training epochs. These best metric results reflect the model's fitting capability. They are all rounded to 4 decimals.

% We also record other metrics such as MAE during training.

Table \ref{table:best_metrics} lists each experiment's final best metrics during training.

\begin{table}[!htbp]
    \centering
    \begin{tabular}{|c|c|c|c|c|}
        \hline\hline
        Data & Stride & Minimum train MSE & Minimum validation MSE & ratio \\\hline
        \multirow{3}{*}{\text{$PM_{2.5}$(0)}} & 10 & 0.0223 & 0.0234 & 0.96 \\ \cline{2-5}
                                        & 5 & 0.0034 & 0.0114 & 0.30 \\ \cline{2-5}
                                        & 2 & \textbf{\textit{0.0006}} & \textbf{\textit{0.0035}} & 0.16 \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(1)}} & 10 & 0.0486 & 0.0510 & 0.95 \\ \cline{2-5}
                                        & 5 & 0.0058 & 0.0142 & 0.41 \\ \cline{2-5}
                                        & 2 & \textbf{\textit{0.0006}} & \textbf{\textit{0.0036}} & 0.17 \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(2)}} & 10 & 0.0171 & 0.0187 & 0.92 \\ \cline{2-5}
                                        & 5 & 0.0024 & 0.0092 & 0.27 \\ \cline{2-5}
                                        & 2 & \textbf{\textit{0.0012}} & \textbf{\textit{0.0066}} & 0.19 \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(3)}} & 10 & 0.0509 & 0.0468 & 1.09 \\ \cline{2-5}
                                        & 5 & 0.0074 & 0.0167 & 0.44 \\ \cline{2-5}
                                        & 2 & \textbf{\textit{0.0010}} & \textbf{\textit{0.0068}} & 0.15 \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(All)}} & 10 & 0.0068 & 0.0103 & 0.66 \\ \cline{2-5}
                                        & 5 & 0.0014 & 0.0022 & 0.67 \\ \cline{2-5}
                                        & 2 & \textbf{0.0007} & \textbf{0.0009} & 0.77 \\
        \hline
        \hline
    \end{tabular}
    \caption{Experiments' final best metrics.}
    \label{table:best_metrics}
\end{table}

We also define a generalization coefficient ratio as the equation below to measure the model's generalization capability during certain experiments. The larger the ratio,  the better the generalization capability is. The ratio results are rounded to 2 decimals.

\begin{equation}
    ratio=\frac{min(train\ MSE)}{min(validation\ MSE)}
\end{equation}

\subsection{Model Evaluation}

% Evaluation curves
\begin{figure}
    \centering
    \includegraphics[width=\linewidth]{fig/model_eval_pm25_0_stride_10.png}
    \caption{Evaluation of the GreenEyes model (\text{$PM_{2.5} (0)$}, stride=10).}
    \label{fig:model_eval_pm25_0_stride_10}
\end{figure}

As earthquake prediction aims to fit the model and learn time-series information, i.e., the triangular lines in coordination with the acoustic data, our model also fits the level lines regarding their air pollutant concentration data. Figure \ref{fig:model_eval_pm25_0_stride_10} proves that the model fits the labeled IAQI level lines well, except that its predictions differ from the ground truth a little on some parts of the lines, and especially on the turning corners of the piecewise linear function.

% Test results table here.
To quantify the testing results of our model by different parameters, we tested it on the whole $PM_{2.5}$ sequence by setting stride as 1, which is different from the training config. As stride is set to 1, the slice window will move one point after another. Hence, the model can make the inference on the whole source sensor data. When the stride is set a 10, 5, and 2 for different training data sampling configs, these sampled data slices form a subset of the sliced data when the stride is set to 1.

We performed the tests using two metrics, mean square error (MSE) and mean absolute error (MAE).

And we test all models trained under different stride parameters and on every channel of $PM_{2.5}$ data. Table \ref{table:test_mse_mae} lists the statistics of our tests. Digit in the brackets is the channel number. "All" means the model is trained by all channels together. All result values of MSE have rounded four decimals, and all MAE values are rounded to 2 decimals.

\begin{table}[!htbp]
    \centering
    \begin{tabular}{|c|c|c|c|}
        \hline\hline
        Data & Stride & MSE & MAE \\\hline
        \multirow{3}{*}{\text{$PM_{2.5}$(0)}} & 10 & 0.0266 & 0.13 \\ \cline{2-4}
                                        & 5 & 0.0144 & 0.11 \\ \cline{2-4}
                                        & 2 & \textbf{\textit{0.0037}} & \textbf{\textit{0.05}} \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(1)}} & 10 & 0.0517 & 0.18 \\ \cline{2-4}
                                        & 5 & 0.0113 & 0.10 \\ \cline{2-4}
                                        & 2 & \textbf{\textit{0.0036}} & \textbf{\textit{0.05}} \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(2)}} & 10 & 0.0188 & 0.11 \\ \cline{2-4}
                                        & 5 & 0.0092 & 0.09 \\ \cline{2-4}
                                        & 2 & \textbf{\textit{0.0069}} & \textbf{\textit{0.07}} \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(3)}} & 10 & 0.0501 & 0.16 \\ \cline{2-4}
                                        & 5 & 0.0108 & 0.09 \\ \cline{2-4}
                                        & 2 & \textbf{\textit{0.0070}} & \textbf{\textit{0.07}} \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(All)}} & 10 & 0.0118 & 0.09 \\ \cline{2-4}
                                        & 5 & 0.0026 & 0.04 \\ \cline{2-4}
                                        & 2 & \textbf{0.0010} & \textbf{0.02} \\ \hline
        \hline
        \hline

    \end{tabular}
    \caption{Test MSE and MAE under different strides.}
    \label{table:test_mse_mae}
\end{table}

The data on the table shows that for each channel of $PM_{2.5}$ data, the smaller the stride parameter is, the less the MSE and MAE are, which means the model can fit the target better. This is reasonable and consistent with our intuition.

Meanwhile, when put all channels' data together and feed the model, it can learn the best result.

Figure \ref{fig:test_mse} and Figure \ref{fig:test_mae} respectively present the test MSE and MAE results by bar plots. The plots are divided into three stride groups, which's stride is 10, 5, 2. Results from the different data channels (or all channels of the data) but sharing the same stride join into the same group for comparisons.

\begin{figure}[!htbp]
    \centering
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/test_mse.pdf}
        \caption{Test MSE.}
        \label{fig:test_mse}
    \end{subfigure}
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/test_mae.pdf}
        \caption{Test MAE.}
        \label{fig:test_mae}
    \end{subfigure}
    \caption{Test MSE and MAE.}
    \label{fig:test_mse_mae}
\end{figure}

\subsection{Results Analyses}

From the results table and bar plots, we could draw at least two useful and meaningful conclusions. Firstly, for each kind of data, whichever $PM_{2.5}$ (i) or $PM_{2.5}$ (All), when the stride parameter decreases, the model can outcome better results.

Secondly, in each stride group, $PM_{2.5}$ (All)'s performance surpasses every single channel of $PM_{2.5}$ data, w.r.t. both MSE and MAE. And when the stride is 5 or 2, this conclusion is more significant.

The first conclusion is obvious. As Table \ref{table:N_samples} shows, the smaller the stride is, the number of training samples gets larger. More data will result in a better model's fitting performance. However, while we want the model to predict and fit more precisely, we don't want to sample sliced data from original data flow too frequently (set the stride too small). The model's capability is reflected by its relevant fitting results (MSE, MAE, etc.), while a rather less frequent sampling is configured (e.g., set stride to 10, not 2).

For our GreenEyes model, the evaluation curve in Figure \ref{fig:model_eval_pm25_0_stride_10} shows its fitting capability, as stride 10 is already enough.

During application, we could trade off on this stride parameter to balance the model's performance and the computation costs.


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

\marginpar{Wednesday\\ 2020-11-4, \\ compiled \\ \today}

We were discussing the flow of plasma from the donor star to the compact object through the inner Lagrangian point.
The velocities of the compact object in the frame of the gas are \(v_\parallel \sim \SI{10}{km/s}\) and \(v_\perp \sim \SI{100}{km/s}\), so we neglect \(v_{\parallel}\).

Suppose we have a mass \(M\), and a particle in a bound orbit around this mass.
Its energy \(E\) and energy per unit mass \(\epsilon \) will be
%
\begin{align}
E = - \frac{GMm}{2a} && \epsilon = - \frac{GM}{2a}
\,,
\end{align}
%
while its specific angular momentum will be (in terms of the eccentricity \(e\)):
%
\begin{align}
\qty( \frac{L}{m})^2 = \ell^2 = (1 - e^2) GMa
\,.
\end{align}

Then, we can write the semimajor axis as
%
\begin{align}
\frac{1}{a} = \frac{(1-e^2) GM}{\ell^2}
\,,
\end{align}
%
so the specific energy will read
%mk
\begin{align}
\epsilon = - \frac{GM (1-e^2) GM}{2\ell^2}= - \frac{(GM)^2(1-e^2)}{2 \ell^2}
\,.
\end{align}

We can ask ourselves: what is the orbit which has the minimum energy \(\epsilon _{\text{min}}\) at fixed \(\ell\)? The only thing which can vary is the eccentricity \(e\), so the minimum energy is attained for the circular orbit, with \(e = 0\), where
%
\begin{align}
\epsilon _{\text{min}} = -\frac{(GM)^2}{2 \ell^2}
\,.
\end{align}

The stream of gas will be subjected to frictional forces, which will dissipate energy, and since the energy of circular orbits is minimum this will circularize the orbit.
We will discuss the timescale of this process later.

We can estimate the radius of circularization, \(R _{\text{circ}}\): we know that for a circular orbit the angular momentum will reach its Keplerian value, \(L_k\), and the velocity will reach its Keplerian value.
This reads
%
\begin{align}
v_K = \sqrt{ \frac{GM}{R}}
\,,
\end{align}
%
which comes from equating \(v^2 /R\) and \(GM/ R^2\).
The Keplerian (specific!) angular momentum reads
%
\begin{align}
L_K = R v_K
\,,
\end{align}
%
which we can compute at \(R _{\text{circ}}\):
%
\begin{align}
L_K (R _{\text{circ}}) = \sqrt{GM R _{\text{circ}}}
\,.
\end{align}

If we fix the specific angular momentum \(\ell\) of an incoming fluid parcel we can then determine the radius of its orbit, \(R _{\text{circ}} = \ell^2 / GM\).

We can compute this initial value of \(\ell\) since the velocity of the fluid is given by the \(v_{\perp} = \omega b_1 \), and then \(\ell = v_\perp b_1 = \omega b_1^2\).
Then, finally, we have
%
\begin{align}
R _{\text{circ}} = \frac{\omega^2 b_1^{4}}{GM} = \frac{4 \pi^2 b_1^{4}}{GM P^2}
\,.
\end{align}

In units of the orbital separation, and using Kepler's law
%
\begin{align}
\omega^2 = \frac{G (M_1 + M_2 )}{a^3}
\,
\end{align}
%
we get (now denoting, more specifically, as \(M_1 \) the mass we previously just called \(M\)):
%
\begin{align}
\frac{R _{\text{circ}}}{a} &= \frac{\omega^2 b_1^{4}}{GM_1  a}  \\
&= \frac{b_1^{4} G (M_1 + M_2 )}{GM_1 a^{4}} = \qty(\frac{b_1 }{a})^{4} (1 + q)
\,.
\end{align}

Yesterday we saw that \cite[]{frankAccretionPowerAstrophysics2002}:
%
\begin{align}
\frac{b_1 }{a} \approx \num{.5} - \num{.227} \log q
\,,
\end{align}
%
using which we get
%
\begin{align}
\frac{R _{\text{circ}}}{a} \approx \qty(\num{.5} - \num{.227} \log q)^{4} (1+q)
\,,
\end{align}
%
and we can also calculate the radius of the Roche lobe by inverting a result from yesterday (with \(q \to 1/q\)):
%
\begin{align}
\frac{R_1}{a} = \begin{cases}
    \num{.38} -\num{.2} \log q & \num{.05} < q < 2 \\
    \frac{\num{.426}}{(1 + q)^{1/3}} & q > 2
\end{cases}
\,.
\end{align}

We can then see that \(R _{\text{circ}}\) is at least 10 times smaller than the radius of the lobe.

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/roche-vs-circularization}
\caption{Roche lobe of star 1 versus circularization radius; both are plotted as \(R / a\).}
\label{fig:roche-vs-circularization}
\end{figure}

For a star we would need to ensure that \(R _{\text{circ}} > R_{*}\), but for a compact object there are no issues.

\subsection{The accretion disk}

Particles at their Keplerian velocities and radii around the compact object would keep orbiting, were it not for dissipative effects, which allow for energy and momentum to be transmitted throughout the disk.
% If we had two concentric disks, both of which

There are three characteristic times we need to account for:
%
\begin{align}
t _{\text{dyn}} < t _{\text{rad}} < t _{\text{visc}}
\,,
\end{align}
%
the dynamical, radiative and viscous timescale. Injection happens on a short \(t _{\text{dyn}}\) timescale, circularization happens on a longer \(t _{\text{rad}}\) timescale, shrinkage happens on an even longer \(t _{\text{visc}}\) timescale.

The true trajectory of a fluid element will be a spiral, which we can approximate with a succession of circles.
This is how an accretion disk forms.

Since \(M _{\text{disc}} \ll M_1 \), the self-gravity of the accretion disk is negligible. Therefore, the azimuthal velocity of matter in the disk will closely match the Keplerian velocity
%
\begin{align}
v_{\phi } = v_K = \sqrt{ \frac{GM_1}{R}}
\,.
\end{align}

We can already estimate the efficiency of the accretion process: the specific energy of the gas at the inner radius of the disk, \(R _{\text{in}}\), which is the star radius for a NS and the ISCO for a BH.
The specific energy is
%
\begin{align}
\epsilon (R _{\text{in}}) = - \frac{GM_1 }{R _{\text{in}}}
+ \frac{1}{2} v_K^2 = - \frac{1}{2} \frac{GM_1 }{R _{\text{in}}}
\,.
\end{align}

The variation of the energy can be calculated starting from infinity since \(R_1 \gg R _{\text{in}}\):\footnote{This is a classical estimate, but it works well enough: for example, for a Schwarzschild BH we have calculated explicitly \(\epsilon _\infty - \epsilon (R _{\text{in}}) = 1 - \sqrt{8/9} \approx \SI{6}{\percent}\), while this expression would give \(1/12 \approx \SI{8}{\percent}\). Not strictly correct, but in the right ballpark.}
%
\begin{align}
\epsilon_{\infty } - \epsilon (R _{\text{in}}) = \frac{1}{2} \frac{GM_1}{R _{\text{in}}}
\,,
\end{align}
%
therefore the luminosity of the disk will be
%
\begin{align}
L _{\text{disc}}= \frac{1}{2} \frac{GM_1 }{R _{\text{circ}}} \dot{M} c^2
\,,
\end{align}
%
only half of the accretion luminosity, defined as
%
\begin{align}
L _{\text{acc}} = \frac{GM_1 }{R _{\text{in}}} \dot{M} c^2
\,.
\end{align}

Now we want to make more detailed predictions.
A key point is viscosity: friction between the various gas elements.

Let us consider two layers of the disk.
They will have a macroscopic bulk motion, with \(v_\phi = R \Omega(R) \),
superimposed with a microscopic motion which can be at very small, up to mesoscopic scales.
We can have micro-scale motion of ions, but also
medium-scale structures can form: turbulent eddies, since the Reynolds number can be shown to be very large.

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/turbulent-eddies-accretion}
\caption{Turbulent eddies moving.}
\label{fig:turbulent-eddies-accretion}
\end{figure}

Suppose we have an eddy which starts in \(A\), moves radially, and then dissipates in \(A'\).
Further, let us say that the length scale of its motion is \(\lambda \), and the typical velocity of its motion across the disk is \(\overline{v}\).

Its radius and velocity at \(A\) will be \(R, \Omega(R) \times  R\); at \(A'\) they will be \(R + \lambda \) and still \(\Omega (R) \times R\).

In terms of specific angular momentum, when the eddy dies it will dissipate angular momentum \((R+\lambda) R \Omega (R) \).

For an eddy moving from \(B\) to \(B'\) in the opposite direction we will have \(R (R + \lambda ) \Omega (R + \lambda )\).
Since the motion is thermal, on average there will be as many particles going in both direction.

% \todo[inline]{But there is more volume at higher \(R\), so more matter!}

Suppose that the height of the disk is \(H\): then the mass per unit time carried by the eddies will be \(H 2 \pi R \overline{v} \rho \).

Then, the variation of angular momentum will be
%
\begin{align}
\frac{\Delta L}{\Delta t} &= 2 \pi R H \rho \overline{v}
\qty[R (R + \lambda ) \Omega (R) - R (R+\lambda ) \Omega (R + \lambda )]  \\
&\approx - 2 \pi R^2 (R+ \lambda ) H \rho \overline{v} \dv{\Omega }{R} \lambda  \\
&\approx - 2\pi R^3 H \rho \overline{v} \lambda \dv{\Omega }{R}
\,,
\end{align}
%
and if we introduce the surface density of the disk:
%
\begin{align}
\Sigma = \int_{- H/2 }^{H/2} \rho \dd{z} \approx \rho H
\,
\end{align}
%
we can write this torque as
%
\begin{align}
\frac{ \Delta L}{\Delta t} = \tau_{\text{partial}} \approx -2 \pi R \Sigma \qty(\overline{v} \lambda ) R^2 \dv{\Omega }{R}
\,.
\end{align}

For a Keplerian accretion disk we always have \(\dv*{\Omega }{R} < 0\), since \(\Omega _K = \sqrt{GM / R^3}\): this means that the torque is positive.
Note, however, that we are still only considering the effect on a certain layer of the one above it --- this is not the full picture yet.

This is the torque which the inner part of the disk exerts on the outer part, decelerating it.
We can then introduce a function \(G(R) = - \tau \), the torque exerted by the outer part of the disk on the inner part, accelerating it.

For a given layer rotating at \(R \Omega (R)\), the layers above it will try to accelerate it, while the ones below it will try to decelerate it. What will be the net effect? It will be\footnote{We use the same letter \(\tau \) as before, but we should specify that this time it accounts for all the contributions to a certain layer of the disk, while before it was only one-way.}
%
\begin{align}
\tau =  G(R + \dd{R}) - G(R) = \dv{G}{R} \dd{R}
\,.
\end{align}

These opposite effects will dissipate heat.
The differential work dissipated will be given by
%
\begin{align}
\dd{W} = \tau \dd{\phi } = \dv{G}{R} \dd{R} \dd{\phi }
\,,
\end{align}
%
so, since to a first approximation \(G\) can be taken to be a constant, the power will be
%
\begin{align}
\dv{W}{t} = \dv{G}{R} \dd{R} \Omega
\,.
\end{align}

Integrating to find the total power we get
%
\begin{align}
\dot{E} &= \int_{R _{\text{in}}}^{R _{\text{out}} } \dv{G}{R} \Omega \dd{R}
\,,
\end{align}
%
but we can integrate by parts to find
%
\begin{align}
\dot{E} &= \eval{G \Omega }_{R _{\text{in}}}^{R _{\text{out}}}
- \int_{R _{\text{in}}}^{R _{\text{out}}} G \dv{\Omega }{R} \dd{R}
\,,
\end{align}
%
so we can identify a global, \emph{convective term}: the variation of \(G \Omega \). On the other hand \(G \dv*{\Omega }{R} \dd{R}\) is a local dissipation term.

Let us introduce the radiated power per unit area of the disk (which is positive, we leave the minus sign out):
%
\begin{align}
D(R) = \frac{ \eval{\dd{(\dot{E})}}_{\text{local}}}{2 \times 2 \pi R \dd{R}}
&= G \dv{\Omega }{R} \frac{ \dd{R}}{2 \times 2 \pi R \dd{R}} = \frac{G}{4 \pi R} \dv{\Omega }{R} \marginnote{Divided by 2 since the disk has two faces.}
\,.
\end{align}

This is written as
%
\begin{align}
D(R) = \frac{G}{4 \pi R} \dv{\Omega }{R}
= \frac{1}{2} R^2 \overline{v} \lambda \Sigma \qty(\dv{\Omega }{R})^2
\,.
\end{align}

In order to dissipate energy the differential rotation \(\dv*{\Omega }{R}\) is crucial.
% We see next time that  \(\overline{v} \lambda = \nu \), the kinematic viscosity coefficient.

\end{document}


% !TEX root = ../thesis.tex

\chapter{Tests and Results}
% \label{cha:eva_tests_results}

In this chapter I will first present a few benchmarks. It is important for any simulation to be able to reproduce results that are predicted by theory. For this, I will test collision rates depending on temperature and scattering length as well as the relaxation of the cloud from an initial delta velocity distribution to a Maxwell-Boltzmann distribution.

Then I am going to show how our proposed solution of a compressing box potential compares to similar setups with harmonic trapping configurations in terms of evaporation efficiency and final atom numbers.

\section{Benchmarks}

\subsection{Collision Rates}
% Our first test is if the simulation can reproduce accurate collision rates that match the theoretical predictions. For the cross section given in \cref{eq:crosssection}, we have to take the average \meanProb over the Maxwell-Boltzmann distributions for both collision partners to find the mean collision rate.
% \begin{align*}
%     \meanProb &= \iint \multidiff{3}{c_1} \multidiff{3}{c_2}\; \frac{8\pi a^2\crel}{1 + a^2 k^2} \times n(\vec{c}_1) n(\vec{c}_2) \\
%     &= \frac{8\pi a^2}{(2\pi m \kB T)^3}\iint \multidiff{3}{c_1} \multidiff{3}{c_2}\; \frac{\crel}{1 + a^2 k^2} \exp\!\left(-\frac{m(\vec{c}_1^2 + \vec{c}_2^2)}{2\kB T}\right)
%     \intertext{We can now change variables to centre-of-mass and relative coordinates and integrate out the angular part}
%     &= (4\pi)^2 \frac{8\pi a^2}{(2\pi m \kB T)^3}\int_0^\infty \diff{\crel}\; \crel^2 \frac{\crel}{1 + a^2 k^2} \exp\!\left(-\frac{m\crel^2}{4\kB T}\right) \nonumber \\
%     &\phantom{=} \quad \times \int_0^\infty \diff{c_\text{COM}}\; c_\text{COM}^2 \exp\!\left(-\frac{mc_\text{COM}^2}{\kB T}\right) \\
%     &= 4\sqrt{\pi} a^2 \left(\frac{m}{\kB T}\right)^\frac{3}{2} \int_0^\infty \diff{\crel} \frac{\crel^2}{1 + a^2 \frac{m^2 \crel^2}{4\hbar^2}} \exp\!\left(-\frac{m\crel^2}{4\kB T}\right)
%     \intertext{where we have performed the integration over $c_\text{COM}$ and used the relation $k = \frac{m\crel}{2\hbar}$. Making the integral dimensionless and introducing the (also dimensionless) parameter $\chi = \sqrt{\frac{\hbar^2}{a^2 m \kB T}}$ we find}
%     &= 64\sqrt{\pi} \cdot \frac{a\hbar}{m} \cdot \chi \int_0^\infty \diff{u}\; \frac{u^3}{\chi^2 + u^2} \exp(-u^2) \\
%     &= 32\sqrt{\pi} \cdot \frac{a\hbar}{m} \cdot \chi \left(1 + \chi^2\exp(\chi^2)\text{Ei}(-\chi^2)\right)
%     \intertext{where Ei is the exponential integral \cite[Eq.~6.2.5]{NIST:DLMF}. Because $\chi^2$ can be much larger than 1, for calculation on a computer it is better to express this using the confluent hypergeometric function $U$ \cite[Eq.~13.2.6]{NIST:DLMF}:}
%     \meanProb &= 32\sqrt{\pi} \cdot \frac{a\hbar}{m} \cdot \chi \left(1 + \chi^2U(1,1,\chi^2)\right).
% \end{align*}
% We can now use our previous result for the mean spatial density in an arbitrary power-law trap from \cref{eq:spatial_density,eq:mean_density} to find the mean collision rate $\langle\Rcoll\rangle$ as
% \begin{align*}
%     \langle\Rcoll\rangle &= \langle n\rangle \meanProb \\
%     &= 4\sqrt{\pi} \frac{N}{x_0y_0z_0} \cdot \frac{a\hbar}{m} \cdot \chi \left(1 + \chi^2U(1,1,\chi^2)\right) \times \prod_{i\in\{x,y,z\}}\frac{1}{\Gamma\!\left(1 + \frac{1}{\alpha_i}\right)}\left(\frac{U_i}{2 \kB T}\right)^{\frac{1}{\alpha_i}}.
% \end{align*}
Our first test is if the simulation can reproduce accurate collision rates that match the theoretical predictions. For the cross section given in \cref{eq:crosssection}, we have to take the average \meanProb over the Maxwell-Boltzmann distributions for both collision partners to find the mean collision rate. This calculation is done in \cref{sec:appendix_average} and the result is
\begin{equation*}
    \meanProb = 32\sqrt{\pi} \cdot \frac{a\hbar}{m} \cdot \chi \left(1 + \chi^2U(1,1,\chi^2)\right),
\end{equation*}
where
\begin{equation*}
    \chi = \sqrt{\frac{\hbar^2}{a^2 m \kB T}}
\end{equation*}
is a dimensionless parameter that combines the scattering length $a$, the atomic mass $m$ and the temperature $T$. $U(1,1,\chi^2)$ is one of the confluent hypergeometric functions \cite[Eq.~13.2.6]{NIST:DLMF}.

We can now use our previous result for the mean spatial density in an arbitrary power-law trap from \cref{eq:spatial_density,eq:mean_density} to find the mean collision rate $\langle\Rcoll\rangle$ as
\begin{equation}\label{eq:meancollisionrate}
    \langle\Rcoll\rangle = \langle n\rangle \meanProb = 4\sqrt{\pi} \frac{N}{x_0y_0z_0} \cdot \frac{a\hbar}{m} \cdot \chi \left(1 + \chi^2U(1,1,\chi^2)\right) \times \prod_{i\in\{x,y,z\}}\frac{1}{\Gamma\!\left(1 + \frac{1}{\alpha_i}\right)}\left(\frac{U_i}{2 \kB T}\right)^{\frac{1}{\alpha_i}}.
\end{equation}

To validate the accuracy of the simulation, we test this for different scattering lengths and temperatures. We choose a (near) box potential with $\alpha_x = \alpha_y = \alpha_z = 1000$, side lengths of \SI{1}{mm} in all directions and a potential depth of $U_0 = \SI{e-26}{J} \sim \SI{725}{\micro\kelvin}\times\kB$. The atomic mass is set to \SI{87}{u}. We start each of the simulations with \num{4e8} atoms in a $(\num{0.995} \times \num{0.995} \times \num{0.995})\, \si{\milli\meter\cubed}$ cube with uniform density distribution, let them reach a steady state by waiting for 3 initial mean collision times and then let the simulation continue until 100 initial mean collision times have been elapsed.

The statistic weight is \num{32768}, meaning \num{12207} particles are simulated. The timestep is 1/50 of the mean collision time and for this test, the loss coefficients $K_{1,2,3}$ are all set to 0. The results are shown in \cref{fig:evap_test_rates} and the measured rates fit the prediction very well. Over all conducted tests, the maximum deviation of the measured from the theoretically predicted rate was \SI{.784}{\percent}, with an average of just \SI{.414}{\percent}.

\vfill
\begin{figure}[hbp]
    \centering
    \includegraphics[]{Evap/CollisionRates}
    \caption[Collision rate variation with temperature and scattering length]{\num{4e8} atoms are simulated in an approximate box potential with a volume of $\sim\!\SI{1}{\milli\meter\cubed}$ at different values of the scattering length $a$ and temperature $T$. The collision time is averaged over 100 initial mean collision times and compared to the theoretical result from \cref{eq:meancollisionrate}. The maximum deviation was measured to be \SI{.784}{\percent}.}
    \label{fig:evap_test_rates}
\end{figure}
\vfill

\subsection{Thermal Relaxation}
Next, we initialise a cloud of \num{3e8} atoms in the same potential as before and with a scattering length of $a = 100\, a_0$. The kinetic temperature is set to $T=\SI{20}{\micro\kelvin}$, but every particle is given the same speed initially. We record the speeds of every particle present for 10 initial mean collision times ${\langle \tau\rangle}_\text{i}$ and average the resulting speed distribution over 50 separate runs. The results are shown in \cref{fig:evap_relaxation}. After $\num{8.5}\,{\langle \tau\rangle}_\text{i}$, the resulting speed distribution matches the expected Maxwell-Boltzmann distribution.
\begin{figure}[htbp]
    \centering
    \includegraphics[]{Evap/Relaxation}
    \caption[Relaxation to a Maxwell-Boltzmann distribution]{The simulation is initialised with \num{3e8} atoms that all start with the same speed. Over a total of 10 initial mean collision times, the relaxation of the speeds to a Maxwell-Boltzmann distribution is observed.}
    \label{fig:evap_relaxation}
\end{figure}

% \subsection{Internal Energy per Atom}
% Our last test analyses the energy per particle. From the theoretical analysis, we expect \[\tilde{E} = \xi kB T, \quad \xi = \frac{3}{2} + \frac{1}{\alpha_x} + \frac{1}{\alpha_y} + \frac{1}{\alpha_z}\] per particle in a power-law potential with exponents $\alpha_{x,y,z}$.
% We let \[\alpha_x = \alpha_y = \alpha_z \equiv \alpha,\quad 1 \leq \alpha \leq 100.\] The starting conditions are: \todo[inline]{atom number, density, temperature} and we let the system reach equlibrium in \dots initial mean collision times, before we measure the energy per particle. The results of this can be seen in Figure~\todo{ref}. Again, we see excellent agreement with the theoretical prediction.

\section{Efficient Evaporation in a Box}
\label{sec:eva_test}
We now move on to test the proposed evaporation in a box potential. The simulation is partly based on the assumption that the atoms have been cooled to a high starting phase space density before the evaporation sequence. This goes hand in hand with our initial concept for evaporation in a box. Usually, atoms are pre-cooled before evaporative cooling in an optical dipole trap is carried out. It has been shown that $\Lambda$-enhanced grey molasses cooling is possible on the D2 line of $^{87}$Rb \cite{Rosi2018enhancedGM}. Here, a final phase space density of \num{4e-6} was achieved at a temperature of \SI{4}{\micro\kelvin}, corresponding to a density of \SI{4.9e9}{\per\centi\meter\cubed}. Starting from a density this low would be disadvantageous for evaporative cooling as it would incur high thermalisation times. Compressing the cloud however would heat the atoms again. Grey molasses cooling is mainly limited by time as the cloud can expand freely and is subject to gravity. With our proposed concept of a box potential, the cloud would not be able to expand indefinitely, given that the trap depth is high enough to contain the falling atoms. We could then repeatedly compress the gas and cool it again. Such an alternating cycle of compression and cooling has already been demonstrated with $^{85}$Rb using a near-resonant dark optical lattice, leading to a density of \SI{1.2e12}{\per\centi\meter\cubed} with a temperature of \SI{10}{\micro\kelvin}, equivalent to a phase space density of \num{2.6e-4} \cite{PhysRevA.72.043410}.

For the simulation, we use a box potential created from two ring beams that intersect each other at an angle. The functional form of this potential is
\begin{equation} \label{eq:eva_potential}
    U(\vec{r}) = U_0 \left[ \left( \frac{\sqrt{(-\sin(\frac{\alpha}{2})x + \cos(\frac{\alpha}{2})y)^2 + z^2}}{R} \right) ^ P + \left( \frac{\sqrt{(\sin(\frac{\alpha}{2})x + \cos(\frac{\alpha}{2})y)^2 + z^2}}{R} \right) ^ P \right]
\end{equation}
where $\alpha$ is the angle between the beams, $R$ is the radius of the ring and the exponent $P$ is given by $P = \num{87}$. This specific value was chosen following the results of Hueck et al.~\cite{PhysRevLett.120.060402}, where it was demonstrated that a ring beam made by using an axicon can be focused to achieve a power law potential with a similar exponent.
\Cref{fig:steinmetz_solid} shows the outline of the potential for the angles $\alpha=\SI{90}{\degree}$ and $\alpha=\SI{157.5}{\degree}$. The latter case is the configuration that will be used in the experiment and therefore also in the simulation below.
\vfill
\begin{figure}[htbp]
    \centering
    \begin{subfigure}[b]{.49\textwidth}
        \centering
        \input{TexContents/Figures/Evap/BoxTrapEvaporation/Steinmetz1.tikz}
        \caption{$\alpha = \SI{90}{\degree}$}
    \end{subfigure}
    \begin{subfigure}[b]{.49\textwidth}
        \centering
        \input{TexContents/Figures/Evap/BoxTrapEvaporation/Steinmetz2.tikz}
        \caption{$\alpha = \SI{157.5}{\degree}$}
    \end{subfigure}
    \caption[Common volume of two crossed cylinders]{It is important to note that the shapes shown here do not represent an equipotential surface of \cref{eq:eva_potential}. Instead, they simply show the intersection of two cylinders at the two different angles.}
    \label{fig:steinmetz_solid}
\end{figure}
\vfill

% \begin{figure}[htbp]
%     \centering
%     \begin{subfigure}[b]{.49\textwidth}
%         \centering
%         \includegraphics[trim=0 1.7ex 0 6ex,clip]{Evap/SteinMetzPython}
%         \caption{\SI{90}{\degree}}
%     \end{subfigure}
%     \begin{subfigure}[b]{.49\textwidth}
%         \centering
%         \includegraphics[trim=0 1.7ex 0 6ex,clip]{Evap/SteinMetzPython_Angle}
%         \caption{\SI{157.5}{\degree}}
%     \end{subfigure}
%     \caption{Common volume of two crossed cylinders}
%     \label{fig:steinmetz_solid}
% \end{figure}

\subsubsection*{Parameter Optimisation}
For all cases, we use a simple optimisation scheme.
The initial beam radius is fixed to \SI{360}{\micro\meter} and the initial trap depth is given by $\SI{50}{\micro\kelvin}\times \kB$. We then employ only one exponential ramp for the beam radius and the potential depth where we compress the beam to a final radius of \SI{25}{\micro\meter} and a final trap depth of $\SI{450}{\nano\kelvin}\times \kB$:
\begin{equation*}
    X(t) = \frac{X_\text{f} - X_\text{i}}{\euler^{-t_\text{d}/\tau} - 1} \times \left(\euler^{-t/\tau} - 1\right) + X_\text{i}.
\end{equation*}
Here, $X$ is the parameter to which the ramp is applied, $X_\text{i,f}$ are the initial and final values before and after the ramp, $t_\text{d}$ is the duration of the ramp and $\tau$ is the exponential time constant.
After an initial coarse search of the available parameter space for $t_\text{d}$ and $\tau$ for both parameters, we choose the values that yield the highest possible evaporation efficiency
\[
    \gamma = -\frac{\log(\tilde{\rho}_\text{f}/\tilde{\rho}_\text{i})}{\log(N_\text{f}/N_\text{i})},
\]
with the initial and final values for the phase space density $\tilde{\rho}_\text{i/f}$ and atom number $N_\text{i/f}$. Then we go on to vary all three parameters ($t_\text{d}$, $\tau$ for the radius $R$ and the trap depth $U_0$) in a smaller range around the previous optimum and try to find an improvement.

If a phase space density of $\PSD = 1$ is reached, the simulation is stopped prematurely because it is purely classical and results at higher phase space densities are not valid anymore.

\subsubsection*{Starting Conditions}
We simulate different initial phase space densities ranging from \num{5e-6} to \num{e-3} with atom numbers from \num{2e8} to \num{3e7} as well as temperatures from \SI{10}{\micro\kelvin} down to \SI{2.5}{\micro\kelvin} for the highest phase space density. We initialise the particles with a harmonic density distribution, where the RMS radius can be calculated from the peak phase space density, the atom number and the temperature.
This gives us a range of estimates on how effective this cooling method could be for different starting conditions and we will be able to tell how much pre-cooling is necessary for good results.
The cases with their respective fixed parameters are shown in \cref{tab:evap_cases}.
\begin{table}[bp]
    \centering
    \caption[Initial parameters for the simulated cases]{$\hat{\PSD}$ and $\hat{n}$ are the initial peak phase space and spatial densities, respectively. $\sigma$ is the RMS radius of the initially harmonic cloud.}
    \begin{tabular}{cS[table-format=1.1e-1]S[table-format=1.2]S[table-format=2.1]S[table-format=3]S[table-format=1.1e+2]}
        \toprule
        \# & \multicolumn{1}{c}{$\hat{\PSD}$} & \multicolumn{1}{c}{$N/\num{e8}$} & \multicolumn{1}{c}{$T$/\si{\micro\kelvin}} & \multicolumn{1}{c}{$\sigma$/\si{\micro\meter}} & \multicolumn{1}{c}{$\hat{n}$/\si[per-mode=reciprocal]{\per\meter\cubed}}\\
        \midrule
        1  & 5.0e-6 & 2.00 & 10.0  & 809 & 2.4e16 \\
        2  & 1.9e-5 & 1.20 & 7.1 & 528 & 5.4e16 \\
        3  & 7.1e-5 & 0.77 & 5.0   & 345 & 1.2e17 \\
        4  & 2.7e-4 & 0.48 & 3.5 & 225 & 2.7e17 \\
        5  & 1.0e-3 & 0.30 & 2.5 & 147 & 6.0e17 \\
        \bottomrule
    \end{tabular}
    \label{tab:evap_cases}
\end{table}
% We simulate two different scenarios for both angles: In the first scenario, we assume that the cycling scheme of compression and cooling works. In that case, we start at a phase space density of \todo{number} and a temperature of \todo{number}, corresponding to a density of \todo{number}. Our initial beam radius is given by \todo{number}, so we start with \todo{number} atoms.

% In the second scenario, we do not assume such a great amount of pre-cooling, so we instead start with a phase space density of only \todo{number} at a temperature of \todo{number}, corresponding to the results of \cite{Rosi2018enhancedGM}. At the same initial beam radius, this gives us an initial atom number of \todo{number}.
In all cases, we assume a trap lifetime of \SI{1}{min} (giving $K_1 = \SI{.017}{\per\second}$), no two-body losses and no influence of gravity. This can be achieved in an experiment with a sample prepared in the absolute ground state of $^{87}$Rb where gravity is compensated by a linear magnetic field. The three-body loss coefficient is taken from \cite{threebody} as $K_3 = \SI{1.8e-41}{m^6\per\second}$. At densities below \SI{e19}{\per\meter\cubed}, three body losses are negligible compared to the losses due to background collisions.

\subsubsection*{Findings}
In case 1, the initial density is so low that only a small fraction of the initial atom number can actually be captured in the box. Furthermore, this lower density results in a smaller collision rate and the compression is not fully able to compensate for this. We can achieve efficiencies $\gamma > 2$ only by making the evaporation ramp \SI{30}{s} long. Still, the final phase space density is $\PSD_\text{f}\ll 1$ and less than \num{200000} atoms remain in the trap after the ramp. We can conclude from this that either larger initial trapping beams or a higher initial density would be necessary.

At initial phase space densities above $\num{e-5}$, the situation improves drastically and efficiencies close to or above 3 can be achieved. However, this comes again at the expense of long ramp durations.

The results for all five cases are listed in \cref{tab:evap_results} and \cref{fig:evap_comparison} shows a comparison of the cases 2--5 against various results from other research groups. Here we can see that our achieved efficiency can compete with the compared results. In the cases 4 and 5, a large portion of the atoms remains in the trap at a phase space density of $\PSD = 1$. We also find that the achieved efficiency is very dependent on the initial atom number. This is expected as the initial atom number determines how strong the compression needs to be to achieve high densities and in turn high collision rates.

Lastly, we show the optimised trajectory for case 5 in \cref{fig:evap_trajectory}. During the first second of compression, no evaporation takes place, which is apparent by the relatively constant atom number and phase space density. Starting at a lower trap depth might reduce the total time necessary to reach $\PSD = 1$.

The trajectories for the other cases can be found in \cref{fig:eva_cases14}.
%
% \begin{table}[bp]
%     \centering
%     \caption{Results and optimised parameters for the simulated cases}
%     \begin{tabular}{cS[table-format=1.1e+1]S[table-format=1.1e+1]S[table-format=1.1e-1]S[table-format=1.3]S[table-format=2.1]S[table-format=3]S[table-format=1.2]}
%         \toprule
%         \# & \multicolumn{1}{c}{$N_\text{i}$} & \multicolumn{1}{c}{$N_\text{f}$} & \multicolumn{1}{c}{$\PSD_\text{i}$} & \multicolumn{1}{c}{$\PSD_\text{f}$} & \multicolumn{1}{c}{$T_\text{i}$/\si{\micro\kelvin}} & \multicolumn{1}{c}{$T_\text{f}$/\si{\nano\kelvin}} & \multicolumn{1}{c}{$\gamma$} \\
%         \midrule
%         1  & 1.1e7 & 1.3e5 & 3.7e-6 & 0.059  & 10 & 152 & 2.17 \\
%         2  & 1.9e7 & 5.5e5 & 1.2e-5 & 0.29 & 7.0 & 137 & 2.83 \\
%         3  & 2.8e7 & 1.3e6 & 3.9e-5 & 0.83 & 5.0 & 185 & 3.20 \\
%         4  & 3.3e7 & 2.0e6 & 1.2e-4 & 1    & 3.6 & 144 & 3.25 \\
%         5  & 2.8e7 & 2.3e6 & 3.4e-4 & 1    & 2.5 & 160 & 3.21 \\
%         \bottomrule
%     \end{tabular}
%     \newline
%     \vspace{3ex}
%     \newline
%     \begin{tabular}{cS[table-format=2.0]S[table-format=1.1]S[table-format=2.1]}
%         \toprule
%         \# & \multicolumn{1}{c}{$t_\text{d}$/s} & \multicolumn{1}{c}{$\tau_R$/s} & \multicolumn{1}{c}{$\tau_{U_0}$/s} \\
%         \midrule
%         1  & 30 & 4 & 30 \\
%         2  & 16 & 1.6 & 15 \\
%         3  & 14 & 1.4 & 13 \\
%         4  & 9 & 0.9 & 8.5 \\
%         5  & 7 & 0.7 & 6.5 \\
%         \bottomrule
%     \end{tabular}
%     \label{tab:evap_results}
% \end{table}
%

\clearpage
\vbox{
\noindent\begin{minipage}[c][.7518\textheight][t]{\textwidth}

% \begin{figure}[tp]
    % \centering
    % \begin{minipage}{1\textwidth}
        \input{TexContents/Figures/Evap/Comparison.pgf}
        \captionof{figure}[Comparison of the simulation results against other papers]{The atom numbers in the bottom left figure are extrapolations from the initial atom number and the average efficiency. For the comparison results, the phase space densities are peak values.}
        \label{fig:evap_comparison}
    % \end{minipage}
% \end{figure}
\end{minipage}

\nointerlineskip
\noindent\begin{minipage}[c][.1795\textheight][b]{\textwidth}
\singlespacing

% \begin{table}[b]
    \centering
    % \vspace*{3cm} % change this to align Table 10.1 and 10.2
    \captionof{table}[Results and optimised parameters for the simulated cases]{The indices i,f denote the initial and final values. $t_\text{d}$ is the duration of the simulation and $\tau_R$/$\tau_{U_0}$ the time constant for the expontential ramp of the trap radius/potential depth.}
    \label{tab:evap_results}
    \begin{tabular}{cS[table-format=1.1]S[table-format=1.2]S[table-format=1.1e-1]S[table-format=1.3]S[table-format=2.1]S[table-format=3]S[table-format=1.2]S[table-format=2.0]S[table-format=1.1]S[table-format=2.1]}
        \toprule
        \# & \multicolumn{1}{c}{$N_\text{i}/\num{e7}$} & \multicolumn{1}{c}{$N_\text{f}/\num{e6}$} & \multicolumn{1}{c}{$\PSD_\text{i}$} & \multicolumn{1}{c}{$\PSD_\text{f}$} & \multicolumn{1}{c}{$T_\text{i}$/\si{\micro\kelvin}} & \multicolumn{1}{c}{$T_\text{f}$/\si{\nano\kelvin}} & \multicolumn{1}{c}{$\gamma$} & \multicolumn{1}{c}{$t_\text{d}$/s} & \multicolumn{1}{c}{$\tau_R$/s} & \multicolumn{1}{c}{$\tau_{U_0}$/s} \\
        \midrule
        1  & 1.1 & 0.13 & 3.7e-6 & 0.059  & 10.0 & 152 & 2.17 & 30 & 4.0 & 30.0 \\
        2  & 1.9 & 0.55 & 1.2e-5 & 0.29 & 7.0 & 137 & 2.83 & 16 & 1.6 & 15.0 \\
        3  & 2.8 & 1.3 & 3.9e-5 & 0.83 & 5.0 & 185 & 3.20 & 14 & 1.4 & 13.0 \\
        4  & 3.3 & 2.0 & 1.2e-4 & 1    & 3.6 & 144 & 3.25 & 9 & 0.9 & 8.5 \\
        5  & 2.8 & 2.3 & 3.4e-4 & 1    & 2.5 & 160 & 3.21 & 7 & 0.7 & 6.5 \\
        \bottomrule
    \end{tabular}
% \end{table}
\end{minipage}
}

\clearpage
%
%
\begin{figure}[bp]
    \centering
    \includegraphics{Evap/Trajectory}
    \caption[Evaporation trajectory for case 5]{It can be seen that the first second does not contribute much to the evaporation. Here, the phase space density \PSD and atom number $N$ are nearly constant while the temperature $T$ increases due to the compression. The atom number and phase space density axes are logarithmic, the others linear.}
    \label{fig:evap_trajectory}
\end{figure}


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

\marginpar{Wednesday\\ 2021-12-1}

Last time we reached the expression for the plane-wave solution to GR.

Consider a wave propagating along the \(x^{1}\) direction.
Our equation is \(\square _F \overline{h}_{\mu \nu } = 0 \), to be solved together with our gauge condition \(\partial_{\mu } \overline{h}^{\mu }{}_\nu = 0\).

The solution will only depend on \(t - x /c\), which we denote as \(w\). We will have
%
\begin{align}
\pdv{}{x} \overline{h}^{\mu }{}_{\nu } &= - \frac{1}{c} \pdv{}{w } \overline{h}^{\mu }{}_\nu \\
\pdv{}{t} \overline{h}^{\mu }{}_{\nu } &=  \pdv{}{w } \overline{h}^{\mu }{}_\nu
\,,
\end{align}
%
so, the full condition reads
%
\begin{align}
\partial_{\mu }  \overline{h}^{\mu }{}_{\nu } = \frac{1}{c} \pdv{}{t} \overline{h}^{0}{}_\nu + \pdv{}{x} \overline{h}^{x }{}_\nu
= \frac{1}{c} \pdv{}{w} \qty[h^{0}{}_{\nu } - h^{x}{}_{\nu }]
= 0
\,.
\end{align}

The constant the difference of these perturbations are equal to is inessential --- it can be recovered with a rescaling of, say, background time --- so we have
%
\begin{align}
h^{0}{}_{\nu } = h^{x}{}_{\nu }
\,.
\end{align}

The gauge we chose did not fully determine our transformation: equation \eqref{eq:christoffel-gauge-transformation} will not change if we use an additional \(\xi \) such that \(\square \xi  =0 \).

It is possible to choose four more conditions thanks to this:
%
\begin{align}
0
= \overline{h}^{0}{}_{x}
= \overline{h}^{0}{}_{y}
= \overline{h}^{0}{}_{z}
= \overline{h}^{y}{}_{y} + \overline{h}^{z}{}_{z}
\,.
\end{align}

Together with the ones from before, we find
%
\begin{align}
0
= \overline{h}^{x}{}_{x}
= \overline{h}^{x}{}_{y}
= \overline{h}^{x}{}_{z}
= \overline{h}^{0}{}_{0}
\,,
\end{align}
%
which also means \(h = 0 = \overline{h}\) (since \(h = - \overline{h}\)), therefore \(\overline{h}_{\mu \nu } = h_{\mu \nu } \).

The only two nonvanishing components left are \(h^{y}{}_{y} = - h^{z}{}_z\) and \(h^{x}{}_{y} = h^{y}{}_{x}\).

We finally have
%
\begin{align}
h_{\mu \nu } = \left[\begin{array}{cccc}
0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 \\
0 & 0 & h_{+} & h_{\times } \\
0 & 0 & h_{\times } & -h_{+}
\end{array}\right]
\,.
\end{align}

This is the \textbf{transverse-traceless gauge}.

\subsection{The quadrupole approximation}

We will assume that \(T_{\mu \nu } \neq 0\), but that the source of the GW is all contained within a source such that \(\abs{x'} < \epsilon\), and such that \(\epsilon \ll \lambda_{GW} = 2 \pi c / \omega \).
This means that \(\omega \epsilon / 2 \pi \sim v _{\text{source}} \ll c\).

This line of reasoning assumes that \(\omega _{\text{source}} \sim \omega _{\text{GW}} \), which we do not know yet --- we will later find that it is in fact true within a factor 2.

The GW solution reads
%
\begin{align}
\overline{h}_{\mu \nu }(t, \vec{x}) &= \frac{4 G}{c^{4}}
\int_{V} \frac{T_{\mu \nu } (t - \abs{x - x'} / c, c') \dd[3]{x'}}{\abs{x - x'}}
\,,
\end{align}
%
while in Fourier space we can expand
%
\begin{align}
T_{\mu \nu } (t, \vec{x}) = \int \widetilde{T}_{\mu \nu } (\omega , \vec{x}) e^{-i \omega t} \dd{\omega }
\,.
\end{align}

We then get
%
\begin{align}
\int \overline{h}_{\mu \nu } (\omega , \vec{x}) e^{-i \omega t} \dd{\omega } = \frac{4 G}{c^{4}}
\int_{V} \frac{ \dd[3]{x'}}{\abs{x - x'}} \int T_{\mu \nu } (\omega , x') e^{-i \omega (t - \abs{x-x'} / c) } \dd{\omega }
\,,
\end{align}
%
which means that
%
\begin{align}
h_{\mu \nu } (\omega , x) = \frac{4G}{c^{4}} \int
\frac{\dd[3]{x'}}{\abs{x - x'}}
T_{\mu \nu }(\omega , x') e^{i \omega \abs{x-x'} / c}
\,,
\end{align}
%
where we factored out the \(e^{- i \omega t}\) and the integral in \(\dd{\omega }\).

With our assumption of slow speed we can expand:
%
\begin{align}
\frac{e^{i \omega \abs{x-x'} / c}}{\abs{x-x'}} \approx
\frac{e^{i \omega r}}{r}
\,,
\end{align}
%
where \(r = \abs{x}\).
This then yields
%
\begin{align}
h_{\mu \nu }(\omega , r) = \frac{4 G}{c^{4}} \frac{e^{i\omega r}}{r}
\int_{V} T_{\mu \nu } (\omega , x') \dd[3]{x'}
\,,
\end{align}
%
so we can come back to
%
\begin{align}
\overline{h}_{\mu \nu } (t, r) = \frac{4 G}{c^{4}r} \int T_{\mu \nu } (t- r/c, x') \dd[3]{x'}
\,.
\end{align}

We can simplify this thanks to the expression \(T^{\mu \nu }{}_{, \nu } = 0\), which means we have conservation laws in the form \(\int T^{\mu 0} \dd[3]{x}\).

We can put these constants to zero (since we are not interested in any non-wavelike behavior, like the stationary Kerr-like metric due to the source).

We can do an integral of \(\partial_{\mu } T^{\mu \nu }= 0\):
%
\begin{align}
\frac{1}{c} \pdv{}{t} \int _V T^{n  0} x^{k} \dd[3]{x} &= - \int \pdv{T^{ni}}{x^i} x^{k} \dd[3]{x}  \\
&= \underbrace{\int \dd{S^{i}} (T^{ni} x^{k})}_{ \to 0} + \int T^{nk} \dd[3]{x}  \\
\frac{1}{c} \pdv{}{t} \int x^{k} T^{n0} \dd[3]{x} &= \int T^{nk} \dd[3]{x}
\,.
\end{align}

We can write this as
%
\begin{align}
\frac{1}{2} \pdv{}{t} \int \qty[ T^{n0} x^{k} + T^{k0} x^{n}] = \int T^{nk} \dd[3]{x}
\,.
\end{align}

The time component of the conservation law can be multiplied by \(x^{n} x^{k}\):
%
\begin{align}
\frac{1}{c} \pdv{}{t} \int T^{00} x^{n} x^{k} \dd[3]{x}
&= - \int \pdv{}{x^{i}} T^{0i} x^{n} x^{k} \dd[3]{x}  \\
&= + \int T^{0i} \pdv{}{x^{i}} (x^{n} x^{k}) \dd[3]{x}  \\
&= \int T^{0n} x^{k} + T^{0k} x^{n}  \dd[3]{x}
\,.
\end{align}

We then take a second derivative:
%
\begin{align}
\frac{1}{c^2} \pdv[2]{}{t} \int T^{00} x^{n} x^{k} \dd[3]{x} &=
\frac{1}{c} \pdv{}{t} \int T^{n0} x^{k} + T^{k0} x^{n} \dd[3]{x}  \\
&= 2 \int T^{nk} \dd[3]{x}
\,.
\end{align}

This is the \textbf{virial theorem} in GR.

We will assume we are working on a \(t = \text{const}\) hypersurface.
The metric is purely Euclidean there.

The object
%
\begin{align}
\frac{1}{c^2} \int T^{00} x^{n} x^{k} \dd[3]{x} = q^{n k} (t)
\,,
\end{align}
%
the quadrupole tensor.
We then have
%
\begin{align}
\frac{1}{2} \ddot{q}^{n k} (t) = \int T^{nk} \dd[3]{x}
\,.
\end{align}

The result is therefore \(h^{\mu 0} = 0\), and
%
\begin{align}
\overline{h}^{n k} = \frac{2G}{c^{4} r} \ddot{q}^{n k}(t)
\,.
\end{align}

\end{document}


\documentclass{article}

\usepackage{amsmath}
\usepackage[a4paper,total={6in, 8in}]{geometry}
\begin{document}

		\title{Cardano's Formula for Cubic Equations}
		\author{Dumebi Valerie Duru}
		\maketitle
	\begin{center}
		\textbf{Abstract}
	\end{center}
	\paragraph{}
		Gerolamo Cardano was born in Pavia in 1501 as the illegitimate child of a jurist. He attended the University of Padua and became a physician in the town of Sacco, after being rejected by his home town of Milan. He became one of the most famous doctors in all of Europe, having treatwd the pope. He was also an astrologer and an avid gambler, to which he wrote the Book on Games of Chance, which was the first serious treatise on the mathematics of probability. \cite{cardanoformula}

	\section{Introduction to Cardano's Formula}
		Cardano's formula for solution of cubic equations for an equation like;
		\newline
		\begin{math}
			x^{3} + a_{1}x^{2} + a_{2}x + a_{3} = 0
		\end{math}
		\newline
		the parameters Q, R, S and T can be computed thus, \newline
		\begin{align*}
			Q = \frac{3a_{2}-a_{1}^{2}}{a} &&
			R = \frac{9a_{1}a_{2}-27a_{3}-2a_{1}^{3}}{54}
		\end{align*}

		\begin{align*}
			S = 3 \sqrt{R + \sqrt{-Q^{3} + R^{2}}} && T= \sqrt{R-\sqrt{Q^{3}+R^{2}}}
		\end{align*}
			\newline
			to give the roots;
			\newline
			x$_{1} = S + T- \frac{1}{3}a_{1}$
			\newline
			x$_{2} = \frac{-(S + T)}{2}$ - $\frac{a_{1}}{3}$ + i$\frac{sqrt{3}(s-T)}{2}$
			\newline
			x$_{3} = \frac{-(S+T)}{2}$
			\newline
			Note: x$_{3}$ must not have a co-efficient.

	\subsection{Some Examples}
	\begin{itemize}
		\item $x^{3} - 3x^{2} + 4 = 0$
		\item $2x^{3} + 6x^{2} + 1 = 0$
	\end{itemize}

	\bibliography{cardano.bib}
	\bibliographystyle{ieeetr}
\end{document}


\documentclass[a4paper,11pt]{article}

\usepackage{physics}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm, mathtools}
%\usepackage{hyperref}
\usepackage{color}
\usepackage{jheppub}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage[T1]{fontenc} % if needed

% My Documents
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
\newcommand{\bes}{\begin{equation*}}
\newcommand{\ees}{\end{equation*}}
\newcommand{\bea}{\begin{flalign*}}
\newcommand{\eea}{\end{flalign*}}

\usetikzlibrary{decorations.pathmorphing}

\tikzset{zigzag/.style={decorate, decoration=zigzag}}
\def \L {2.}
\definecolor{darkgreen}{HTML}{006622}
%\linespread{1.0}
%\setlength{\parindent}{0em}
%\setlength{\parskip}{0.8em}

\title{\textbf{AdS/CFT and Other Things}}
\author{Aditya Vijaykumar}
\affiliation{International Centre for Theoretical Sciences, Bengaluru, India.}
\emailAdd{aditya.vijaykumar@icts.res.in}
\abstract{This is one's effort to understand what the AdS/CFT Correspondence actually means, with explicit calculations and intuitive explanations of whatever is covered. In the course of one's journey, one hopes to review aspects of Quantum Field Theory as well as AdS spacetimes.

One shall mainly follow the path taken by Prof. Hong Liu in his MIT OCW course String Theory and Holographic Duality, supplementing it with one's own readings and observations. One shall also try to include as many references as possible.  }
\begin{document}
\maketitle
\section{Motivations}
\subsection{Spin-2}

From a field theory perspective, it is natural to ask whether a massless spin-$2$ particle \textcolor{red}{Ex : Why is gravity massless spin $ 2 $?} can arise as the bound state of a lower spin theory. If yes, that is equivalent to saying that gravity has effectively \textit{emerged}. Gluons and quarks can indeed form massive spin-$ 2 $ bound states which are unstable. \textcolor{red}{Ex : How do spin-$2$ particles arise in QCD?}.
\subsection{Weinberg-Witten Theorem}

But can one generate massless spin-$ 2 $ particles from this by maybe changing the theory a bit? Weinberg and Witten said no. They gave the following theorems

\begin{itemize}

	\item \textbf{Theorem 1} - A theory that allows the construction of a Lorentz covariant conserved current cannot contain a massless particle of spin $  > 1/2 $ with non-vanishing charge.
	\item \textbf{Theorem 2} - A theory that allows Lorentz covariant conserved stress tensor cannot contain massless particles of spin $ >1 $.
\end{itemize}
As GR need not have a conserved stress tensor \textcolor{red}{???}, these theorems do not forbid the graviton. But the second theorem also prohibits renormalizable theories in Minkowski spacetime in having an emergent gravity description. There is, however, a hidden assumption in this theory - it only applies to particles that live in the spacetime of the original theory. This seems like a straightforward, obvious assumption. But, in AdS/CFT, gravity\footnote{gh} lives in a different spacetime!

\textbf{\textcolor{red}{{Prove the Weinberg Witten Theorem}}}

\section{Black Holes ain't so Black}

In non-gravitational physics, in principle, one can probe arbitrarily large length scales. When gravity comes in, this stops being true. When $ E \gg m_p $, there will come a point when the Schwarzchild radius $ r_s \sim GE_{c} $ will become the fundamental distance scale.

\subsection{Classical Black Holes}
The geometry outside the Schwarzschild Black Hole is given by,
\bes
ds^2 = -\qty(1-\frac{2M}{r})dt^2 + \qty(1-\frac{2M}{r})^{-1} dr^2 + r^2(d\theta^2 + \sin^2 \theta d\phi^2)
\ees
This has the following properties,
\begin{itemize}
	\item The solution is time reversal symmetric \textit{ie.} symmetric under $t \rightarrow -t$. Real black holes form through gravitational collapse, and hence this is not valid for them. Nonetheless, this can be assumed for late time black holes, which really makes the Schwarzschild solution a mathematical idealization of the actual black hole.
	\item Spacetime is non-singular at the horizon. Written in the Schwarzschild coordinates, the horizon is a coordinate singularity, and one can easily verify that it indeed is not a real singularity by \textcolor{red}{calculating curvature invariants}.
	\item $ r=r_s $ is a null hypersurface.
	\item The horizon is a surface of infinite redshift with respect to far away observer. \textcolor{red}{Show this explicitly}
	\item There are two important geometric quantities associated with the horizon,
	\bes
	\qq{Horizon Area} A_s = 4\pi r_s^2 = 16 \pi M^2
	\ees
	\bes
	\qq{\textcolor{red}{Surface Gravity}} \kappa = \frac{1}{2}f'(r_s) = \frac{1}{2r_s} = \frac{1}{4M}
	\ees
\end{itemize}

\subsection{Causal Structure and Rindler Spacetime}
Consider the region just outside the black hole horizon,
\begin{equation*}
f(r) = f(r_s) + (r-r_s)f'(r_s) + \ldots= (r-r_s)f'(r_s) + \ldots
\end{equation*}
From the metric, we can see that the proper distance $ \rho $ is just given by,
\begin{equation*}
\rho = \int_{r_s}^r \dfrac{dr}{\sqrt{f(r)}} = \int_{r_s}^r \dfrac{dr}{\sqrt{(r-r_s)f'(r_s)}} = 2\sqrt{\frac{r-r_s}{f'(r_s)}}
\end{equation*}
Hence,
\begin{equation*}
f(r) = (f'(r_s))^2\rho^2/4 = \kappa^2 \rho^2
\end{equation*}
and the metric can be written as,
\begin{align*}
ds^2 &= - \kappa^2 \rho^2 dt^2 + d\rho^2 +  r_s^2(d\theta^2 + \sin^2 \theta d\phi^2)\\
&=   \underbrace{-\rho^2 d\eta^2 + d\rho^2}_{\text{(1+1)d Minkowski Spacetime in Rindler coordinates}} +  \underbrace{r_s^2(d\Omega^2)}_{\text{2-sphere}}
\end{align*}
\textbf{\textcolor{red}{Continue this from Hartman and other sources}}
\end{document}


\documentclass[aps,pra,notitlepage,amsmath,amssymb,letterpaper,12pt]{revtex4-1}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{listings}
\newenvironment{problem}[2][Problem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{solution}{\begin{proof}[Solution]}{\end{proof}}

\begin{document}

\title{Classwork 13}
\author{Frank Entriken and Grady Lynch}
\affiliation{PHYS 220, Schmid College of Science and Technology, Chapman University}
\date{\today}

\maketitle

\section{Sombrero Potential}

\begin{problem}{Specifications}
Simulate the $x$ and $y$ coordinates of a ball in a double well potential (also known as the "sombrero" potential). Variables to consider are the balls mass, $m$, and the ball's friction as it rolls, $f_{\text{drag}}(\dot{x}) = -\nu \dot{x}$. The "sombrero" will be shaken back and forth repeatedly with a driving force $f_{\text{drive}}(t) = F\cos(\omega t)$.

According to Newton's Second Law, the ball must satisfy the equation of motion: $$m\ddot{x} = f_{\text{hat}}(x) + f_{\text{drag}}(\dot{x}) + f_{\text{drive}}(t) = x - x^3 - \nu \dot{x} + F\cos(\omega t)$$
\end{problem}

\section{The Solution}

\begin{solution}
In order to compute the coordinates of the ball in motion we used the Runge-Kutta 4th Method. This method accurately predicts each subsequent $x$ and $x$ value by considering the approximations before and after the desired value. By using this method we were able to graphically represent the ball's $x$ and $x$ values over the course of its motion. The graphs below represent the ball at different starting values: $x0$ is the starting $x$ position of the ball, $y0$ is the starting $y$ position of the ball, and $F$ which is the force of the shake.

\subsection{Our Graphs}

\begin{figure}[h!]
  \includegraphics[width=0.4\textwidth]{p1.png}
  \caption{$x0=-0.9$, $y0=0$, $x0=0.18$}
  \label{fig:figlabel}
\end{figure}

\begin{figure}[h!]
  \includegraphics[width=0.4\textwidth]{p2.png}
  \caption{$x0=0.2$, $y0=0.1$, $x0=0.25$}
  \label{fig:figlabel}
\end{figure}

\begin{figure}[h!]
  \includegraphics[width=0.4\textwidth]{p3.png}
  \caption{$x0=0$, $y0=0$, $x0=0.4$ \\ The movement of the this graph uses a slightly modified version of the code from $RK4_2$, where our N value is multiplied by a value of 1000 up from 50.}
  \label{fig:figlabel}
\end{figure}

\end{solution}
\end{document}