\title{Tendon Robot Statics Model Variants}
\author{John Till}
\date{}

\documentclass[12pt]{article}

\usepackage[a4paper, margin=0.75in]{geometry}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}

\usepackage{xcolor}
\definecolor{OffWhite}{rgb}{0.93,0.93,0.93}
\definecolor{QtCommentColor}{rgb}{0,0.5,0}
\definecolor{QtKeywordColor}{rgb}{0.5,0.5,0}
\definecolor{QtPurpleColor}{rgb}{0.5,0,0.5}
\definecolor{QtGlobal}{rgb}{0.808,0.361,0}
\definecolor{QtFunctionColor}{rgb}{0,0.404,0.486}

\usepackage[T1]{fontenc} %for upquotes in listings
\usepackage{textcomp} %for upquotes in listings
\usepackage{listings}
\lstset{
		language=C++,
		escapeinside={!-}{-!},
		upquote=true,
		%
		otherkeywords={Vector3d, DiagonalMatrix, VectorXd, Matrix3d, Map, MatrixXd, Vector6d, Vector4d,
		              Matrix6d, Eigen, Upper, std, fstream, Matrix3Xd,
									UnitX, pow, inverse, transposeMultiply, segment, data, UnitZ, cross, hat_squared,
									hat_postmultiply, hat_premultiply, normalized,
									Zero, Identity, UnitY, cosseratRodOde, ode4, cols, row, main, shootingFunction,
									block, rotation_error, solveLevenbergMarquardt, cos, sin, toDenseMatrix,
									selfadjointView, llt, close, kirchhoffTendonRobotOde, cwiseProduct, cwiseMin,
									cwiseMax, getRouting},
    morekeywords=[2]{Vector3d, DiagonalMatrix, VectorXd, Matrix3d, Map, MatrixXd, Vector6d, Vector4d,
		                 Matrix6d, Eigen, Upper, std, fstream, Matrix3Xd},
		morekeywords=[3]{UnitX, UnitZ, pow, inverse, transposeMultiply, segment, data, cross, hat_squared,
		                 hat_postmultiply, hat_premultiply, normalized,
		                 Zero, Identity, UnitY, cosseratRodOde, ode4, cols, row, main, shootingFunction,
										 block, rotation_error, solveLevenbergMarquardt, cos, sin, toDenseMatrix,
										 selfadjointView, llt, close, kirchhoffTendonRobotOde, cwiseProduct, cwiseMin,
										 cwiseMax, getRouting},
    %
		frame = single,
		rulecolor=\color{black},
    tabsize=4, % tab space width
    showstringspaces=false, % don't mark spaces in strings
		%
		basicstyle=\footnotesize,%\color{QtIdentifier},
		backgroundcolor=\color{OffWhite},
    commentstyle=\color{QtCommentColor}, % comment color
    keywordstyle=\color{QtKeywordColor}, % keyword color
		keywordstyle=[2]{\color{QtPurpleColor}},
		keywordstyle=[3]{\color{QtFunctionColor}},
    stringstyle=\color{QtCommentColor} % string color
}

\begin{document}

\makeatletter
\renewcommand{\@maketitle}{
\newpage
\null
\vskip 2em
\begin{center}
{\LARGE \@title \par}
\end{center}
\par
} \makeatother

\maketitle

In the last example we implemented a relatively simple tendon robot model where the backbone was modeled as a Cosserat rod and the tendons were routed in parallel with the backbone. There is a plethora of potential modifications to the model, and three potential variations are considered in different sections here.

\section{Kirchhoff Rod Backbone}

There are significant simplifications to the model if we neglect the shear and extension modes as described in \href{https://ieeexplore.ieee.org/document/5957337}{``Statics and Dynamics of Continuum Robots With General Tendon Routing and External Loading''}. This results in $\boldsymbol{v} = \boldsymbol{e}_3$, which is the elastic rod problem as studied by Gustav Kirchhoff prior to the Cosserat brothers. The result for the tendon robot is that one only needs to solve a 3x3 linear system for $\dot{\boldsymbol{u}}$ instead of the 6x6 linear system considered previously for $\dot{\boldsymbol{v}}$ and $\dot{\boldsymbol{u}}$.

The state vector has $\boldsymbol{n}^b$ instead of $\boldsymbol{v}$, and the ODE function is changed accordingly:
\begin{lstlisting}
void kirchhoffTendonRobotOde(VectorXd& y_s_out, VectorXd& y){
    //Unpack state vector
    Matrix3d R = Map<Matrix3d>(&y[3]);
    Vector3d nb = Map<Vector3d>(&y[12]);
    Vector3d u = Map<Vector3d>(&y[15]);
\end{lstlisting}
Of course calculations involving shear or extension are modified so that $\boldsymbol{v} = \boldsymbol{e}_3$. The ODEs are also changed so that there is only a 3x3 linear system as in Equation (17):
\begin{lstlisting}
    //Pack state vector derivative
    Map<Vector3d> p_s(&y_s_out[0]);
    Map<Matrix3d> R_s(&y_s_out[3]);
    Map<Vector3d> nb_s(&y_s_out[12]);
    Map<Vector3d> u_s(&y_s_out[15]);

    //ODEs
    p_s = R.col(2);
    R_s = hat_postmultiply(R,u);
    u_s = H.inverse()*(-u.cross(Kbt*u) - Vector3d::UnitZ().cross(nb) - b);
    nb_s = -u.cross(nb) - G*u_s - a - transposeMultiply(R,rho*area*g);
}
\end{lstlisting}
An inverse is used instead of a linear solver because Eigen has specialized methods to take efficient inverses of small fixed-size matrices.
We also make some minor changes to the objective function since $\boldsymbol{n}^b$ is a state variable instead of $\boldsymbol{v}$:
\begin{lstlisting}
y0 << p0, Map<VectorXd>(Matrix3d(R0).data(), 9), guess;

//Numerically integrate the Cosserat rod equations
Y = ode4<kirchhoffTendonRobotOde>(y0, L);

//Find the internal forces in the backbone prior to the final plate
Vector3d nb = Y.block<3,1>(12,Y.cols()-1);
Vector3d uL = Y.block<3,1>(15,Y.cols()-1);
Vector3d mb = Kbt*uL;
\end{lstlisting}
If we rendered the solution, we would see no visible difference compared the Cosserat model.

\section{Non-parallel Tendon Routing}

The examples so far have assumed the tendons are routed parallel with the backbone. However, the model in
\href{https://ieeexplore.ieee.org/document/5957337}{``Statics and Dynamics of Continuum Robots With General Tendon Routing and External Loading''} is formulated for any general routing path, and helical routing strategies are demonstrated. The Cosserat backbone model is altered to have a helical routing strategy here.

There are a multitude of options for how to represent the tendon routing functions. Lambda functions might be the most straightforward way, and if we were willing to implement our own numerical integration function, the most efficient way would be to precompute all the values at grid points. The approach here is somewhere in between; we'll calculate all the vectors at a given point on the backbone:
\begin{lstlisting}
//Helical routing
const double offset = 0.01506;
void getRouting(double arclength, Vector3d* r, Vector3d* r_s, Vector3d* r_ss){
    const double f = 2*pi/L; //tendons make a full revolution

    double c = offset*cos(f*arclength);
    double s = offset*sin(f*arclength);
    double fc = f*c;
    double fs = f*s;
    double ffc = f*fc;
    double ffs = f*fs;

    r[0] = Vector3d(c, s, 0);
    r[1] = Vector3d(-s, c, 0);
    r[2] = Vector3d(-c, -s, 0);
    r[3] = Vector3d(s, -c, 0);

    r_s[0] = Vector3d(-fs, fc, 0);
    r_s[1] = Vector3d(-fc, -fs, 0);
    r_s[2] = Vector3d(fs, -fc, 0);
    r_s[3] = Vector3d(fc, fs, 0);

    r_ss[0] = Vector3d(-ffc, -ffs, 0);
    r_ss[1] = Vector3d(ffs, -ffc, 0);
    r_ss[2] = Vector3d(ffc, ffs, 0);
    r_ss[3] = Vector3d(-ffs, ffc, 0);
}
\end{lstlisting}
The tendons are still separated by $90^\circ$, but they are routed in helices around the backbone with a frequency ``f''. There are three arrays passed in having four vectors each. ``r'', ``r\_s'', and ``r\_ss'' are set based on the arc length. The ODE includes the derivatives of $\boldsymbol{r}$:
\begin{lstlisting}
Vector3d r[num_tendons], r_s[num_tendons], r_ss[num_tendons];
getRouting(s, r, r_s, r_ss);

for(int i = 0; i < num_tendons; i++){
    Vector3d ri = r[i];
    Vector3d ri_s = r_s[i];
    Vector3d ri_ss = r_ss[i];

    Vector3d pb_si = u.cross(ri) + ri_s + v;
    double pb_s_norm = pb_si.!-\textcolor{QtFunctionColor}{norm}-!();
    Matrix3d A_i = -hat_squared(pb_si)*(tau(i)/pow(pb_s_norm,3));
    Matrix3d G_i = -hat_postmultiply(A_i,ri);
    Vector3d a_i = A_i*(u.cross(pb_si + ri_s) + ri_ss);
\end{lstlisting}
The tendon routing vectors are calculated for the current arclength ``s'' before setting up the linear system. Over in the objective function, we also need to use the tendon routing vectors at the tip when finding the equilibrium error:
\begin{lstlisting}
//Find the equilibrium error at the tip, considering tendon forces
Vector3d force_error = -nb;
Vector3d moment_error = -mb;
Vector3d r[num_tendons], r_s[num_tendons], r_ss[num_tendons];
getRouting(L, r, r_s, r_ss);
for(int i = 0; i < num_tendons; i++){
    Vector3d pb_si = uL.cross(r[i]) + r_s[i] + vL;
    Vector3d Fb_i = -tau(i)*pb_si.normalized();
    force_error += Fb_i;
    moment_error += r[i].cross(Fb_i);
}
\end{lstlisting}
Then we can solve the problem and visualize the effects of helical routing:
\begin{figure}[h]
	\centering
		\includegraphics[width=0.8\textwidth]{fig/Helical.jpg}
\end{figure}

We could also implement a converging tendon strategy like in the paper \href{https://ieeexplore.ieee.org/document/8606257}{``Continuum Robot Stiffness Under External Loads and Prescribed Tendon Displacements''}. We revise the tendon function:
\begin{lstlisting}
//Converging routing
const double offset = 0.01506;
const double routing_slope = -offset/L;
void getRouting(double s, Vector3d* r, Vector3d* r_s, Vector3d* r_ss){
    double b = (1 - s/L)*offset;

    r[0] = Vector3d(b, 0, 0);
    r[1] = Vector3d(0, b, 0);
    r[2] = Vector3d(-b, 0, 0);
    r[3] = Vector3d(0, -b, 0);

    r_s[0] = Vector3d(routing_slope, 0, 0);
    r_s[1] = Vector3d(0, routing_slope, 0);
    r_s[2] = Vector3d(-routing_slope, 0, 0);
    r_s[3] = Vector3d(0, -routing_slope, 0);

    r_ss[0] = r_ss[1] = r_ss[2] = r_ss[3] = Vector3d(0, 0, 0);
}
\end{lstlisting}
Then solving with converging routing yields the following solution:
\begin{figure}[h]
	\centering
		\includegraphics[width=0.8\textwidth]{fig/Converging.jpg}
\end{figure}

\section{Tendon Displacement Control}

In the examples so far, the forward kinematics input has been the tendon tensions. However, most actuator control position instead of force. This scenario is also considered in the paper \href{https://ieeexplore.ieee.org/document/8606257}{``Continuum Robot Stiffness Under External Loads and Prescribed Tendon Displacements''}. There are additional unknowns since the tendon tensions are not given, and additional constraints since the backbone must take a shape so that the tendon lengths are correct. For example, increasing the distance $q_i$ the tendon extends below the baseplate will cause the backbone to bend so that the arc length of the tendon above the baseplate is reduced, and the total tendon length remains constant (assuming an inextensible tendon).

\begin{figure}[h]
	\centering
		\includegraphics[width=0.5\textwidth]{fig/DisplacementControl.jpg}
\end{figure}

We declare additional independent parameters for the displacement control:
\begin{lstlisting}
const VectorXd q = Vector4d(5e-3, 0, -5e-3, 0);
const VectorXd l_star = Vector4d(L,L,L,L);
\end{lstlisting}
The length a tendon extends behind the baseplate is $q_i$, and the total length of a tendon before stretching is $l_i^*$. We're careful when setting the actuator displacements because it is especially easy to have an \emph{ill-posed} problem. For instance, pulling all the tendons back by half the length of the backbone is simply not realistic, and the solver would probably fail to find a solution.
The tendon tensions are now dependent variables, so they are declared as static:
\begin{lstlisting}
static VectorXd tau;
\end{lstlisting}
These tensions will be guessed, so we change the guess initialization in the main function:
\begin{lstlisting}
VectorXd init_guess = VectorXd::Zero(6 + num_tendons); //nb, u, and tau
\end{lstlisting}
and we unpack the last elements of the guess as the tendon tensions:
\begin{lstlisting}
tau = guess.segment<num_tendons>(6);
\end{lstlisting}
Based on how the backbone deforms, each tendon will have some arc length it is routed along the backbone, with errors resulting from incorrect lengths. Calculating the errors requires modifying the ODE function to also integrate the tendon arc lengths. We extend the state vector so that the last entries are the tendon arc lengths:
\begin{lstlisting}
Map<VectorXd> pb_s_norm(&y_s_out[18], num_tendons);
\end{lstlisting}
Now the change in tendon arc length with respect to the change in reference arc length is stored as part of the state vector derivative:
\begin{lstlisting}
pb_s_norm(i) = pb_si.!-\textcolor{QtFunctionColor}{norm}-!();
Matrix3d A_i = -hat_squared(pb_si)*(tau(i)/pow(pb_s_norm(i),3));
\end{lstlisting}
We modify the initial conditions to include the arc lengths of the tendons behind the base plate:
\begin{lstlisting}
VectorXd y0(18+num_tendons);
y0 << p0, Map<VectorXd>(Matrix3d(R0).data(),9), v0, u0, q;
\end{lstlisting}
Then we have some error in the integrated lengths of the tendons versus the known lengths specified as design parameters:
\begin{lstlisting}
//Find the length violation error
VectorXd integrated_lengths = Y.block<num_tendons,1>(18,Y.cols()-1);
VectorXd length_error = integrated_lengths - l_star;

VectorXd distal_error(6 + num_tendons);
distal_error << force_error, moment_error, length_error;
\end{lstlisting}

Now if we run the program, the robot is solved using tendon displacement as the forward kinematics input. However, our approach currently assumes the tendons are inextensible and capable of supporting compression. We address the former first by adding compliance as an independent variable:
\begin{lstlisting}
const VectorXd C = Vector4d(1e-4,1e-4,1e-4,1e-4);
\end{lstlisting}
Then the length error is revised to include the tendon stretch, which is calculated from Hooke's law:
\begin{lstlisting}
VectorXd stretch = l_star.cwiseProduct( C.cwiseProduct(tau) );
VectorXd length_error = integrated_lengths - (l_star + stretch);
\end{lstlisting}
Now the tendons will stretch under tension. Unfortunately, they will also contract under compression.
To disallow compression, we include the effects of slack. Since slack and tension are mutually exclusive effects, we use a single variable to represent them both when we unpack the guess:
\begin{lstlisting}
tau = guess.segment<num_tendons>(6).cwiseMax(0);
VectorXd slack = -(guess.segment<num_tendons>(6).cwiseMin(0));
\end{lstlisting}
Depending on the sign, we have either tension or slack. Hopefully the shooting method optimization space is smooth around the transition; it seems to work well. Then the length error is revised to include slack:
\begin{lstlisting}
VectorXd length_error = integrated_lengths + slack - (l_star + stretch);
\end{lstlisting}
Now we have a model with displacement controlled tendons which stretch under tension and go slack when necessary.

\end{document}


\documentclass[p.tex]{subfiles}
\begin{document}
\section{Background}\label{sec:background}

\subsection{Target Language}\label{sec:language}

\begin{figure}
\begin{spreadlines}{5pt}
\begin{gather*}
  \inference[\textsc{E-Assert}]{%
    \eeval{b}{\sigma}{\btrue}
  }{%
    \ceval{\cassert{b}}{\sigma}{\sigma}
  }
  \qquad
  \inference[\textsc{E-SumLeft}]{%
    \ceval{c_0}{\sigma_0}{\sigma_1}
  }{%
    \ceval{\csum{c_0}{c_1}}{\sigma_0}{\sigma_1}
  }
  \qquad
  \inference[\textsc{E-SumRight}]{%
    \ceval{c_1}{\sigma_0}{\sigma_1}
  }{%
    \ceval{\csum{c_0}{c_1}}{\sigma_0}{\sigma_1}
  }
  \\
  \inference[\textsc{E-Assign}]{%
  }{%
    \ceval{\cassign{x}{a}}{\sigma}{\subst{x}{a}{(\sigma)}}
  }
  \qquad
  \inference[\textsc{E-Sequence}]{%
    \ceval{c_0}{\sigma_0}{\sigma_1}&
    \ceval{c_1}{\sigma_1}{\sigma_2}&
  }{%
    \ceval{\cseq{c_0}{c_1}}{\sigma_0}{\sigma_2}
  }
  \\
  \inference[\textsc{E-Skip}]{%
  }{%
    \ceval{\cskip}{\sigma}{\sigma}
  }
  \qquad
  \inference[\textsc{E-Loop}]{%
    \ceval{c}{\sigma_0}{\sigma_1}&
    \ceval{\cloop{c}}{\sigma_1}{\sigma_2}
  }{%
    \ceval{\cloop{c}}{\sigma_0}{\sigma_2}
  }
  \qquad
  \inference[\textsc{E-Break}]{%
  }{%
    \ceval{\cloop{c}}{\sigma}{\sigma}
  }
\end{gather*}
\end{spreadlines}
  \caption{%
    The formal semantics of the target language $\lang$, defined in
    terms of the constituent imperative commands in \com.
    Metavariables $\sigma, \sigma_0, \ldots$ denote program states in
    \state, metavariable $x$ denotes a variable in \var, metavariables
    $c, c_0, \ldots$ denote commands in \com, $a$ denotes an
    integer-valued expression in $\aexpr$, and $b$ denotes a
    boolean-valued expression in $\bexpr$.
  }\label{fig:semantics}
\end{figure}

In this section we present the imperative language, $\lang$, that we will extend
and analyze for the remainder of this paper.
$\lang$ includes
assignments, branches, loops, and assertions.
%
$\lang$ makes use of expressions with boolean and integer
value, denoted $\bexpr$ and $\aexpr$ respectively.
%
We denote the space of program variables as \var.
%
Each program in $\lang$ is an imperative command.
We define the space of imperative commands inductively:
\begin{align*}
  \com ::=&~\cskip\\
         |&~\cassign{\var}{\aexpr}\\
         |&~\cassert{\bexpr}\\
         |&~\cseq{\com}{\com}\\
         |&~\csum{\com}{\com}\\
         |&~\cloop{\com}
\end{align*}

The command $\cseq{c_0}{c_1}$ is the command which first executes
$c_0$ and then executes $c_1$ and the command $\cskip$ is a no-op. The
command $\cassert{b}$ is a static claim that the boolean expression
$b$ evaluates to true in every possible run of the command. We define
the formal semantics of the space of commands in \cref{fig:semantics}.
%
The program semantics are defined with reference to members of the
space of program states, which we denote $\state$. A state
is a map from a variables to integer values:
%
\[\state ::= \var \rightarrow \mathbb{Z}\]

\subsection{Hoare Logic}
\begin{figure}
\begin{spreadlines}{5pt}
\begin{gather*}
  \inference[\textsc{Skip}]{%
  }{%
    \hoare{P}{\cskip}{P}
  }
  \qquad
  \inference[\textsc{Assign}]{%
  }{%
    \hoare{\subst{x}{a}{P}}{\cassign{x}{a}}{P}
  }
  \qquad
  \inference[\textsc{Assert}]{%
  }{%
    \hoare{P}{\cassert{b}}{P \land b}
  }
  \\
  \inference[\textsc{Seq}]{%
    \hoare{P}{c_0}{R}&
    \hoare{R}{c_1}{Q}
  }{%
    \hoare{P}{\cseq{c_0}{c_1}}{Q}
  }
  \qquad
  \inference[\textsc{Sum}]{%
    \hoare{P}{c_0}{Q}&
    \hoare{P}{c_1}{Q}
  }{%
    \hoare{P}{\csum{c_0}{c_1}}{Q}
  }
  \\
  \inference[\textsc{Loop}]{%
    \hoare{P}{c}{P}
  }{%
    \hoare{P}{\cloop{c}}{P}
  }
  \qquad
  \inference[\textsc{Cons}]{%
    P \Rightarrow P'&
    \hoare{P'}{c}{Q'}&
    Q' \Rightarrow Q
  }{%
    \hoare{P}{c}{Q}
  }
  \end{gather*}
\end{spreadlines}
\caption{%
  Hoare Logic judgements over $\lang$.
  Metavariables $P, Q, R\ldots$ represent program
  assertions. Other metavariables are consistent with
  \cref{fig:semantics}
}\label{fig:base-proof-system}
\end{figure}

Hoare Logic is a framework for reasoning about imperative commands by
relating them to program \emph{assertions}.
An assertion is a proposition over a program state. Formally, we
define the space of assertions as functions from program states to
propositions.
\[ \textsf{Assert} ::= \state \rightarrow \textsf{Prop} \]
Typically, a Hoare logic system provides a set of judgements over
\emph{Hoare Triples}.
If $P, Q \in \textsf{Assert}$ are assertions and $c \in \com$ is a
command, then \hoare{P}{c}{Q} is a Hoare Triple.
%
Informally, this triple can be interpreted as stating \textbf{(1)} if
the assertion $P$ holds over some program state $\sigma$ and
\textbf{(2)} the command $c$ takes $\sigma$ to $\sigma'$, then
\textbf{(3)} the assertion $Q$ must hold over $\sigma'$.
%
This definition can be formalized as follows:
\[
  \hoare{P}{c}{Q} ::= \forall \sigma,
  \sigma'.~\ceval{c_0}{\sigma}{\sigma'} \Rightarrow P~\sigma \Rightarrow Q~\sigma'
\]
By establishing a set of sound rules, a Hoare logic system provides a
composable framework for structuring program proofs.
We provide a set of typical Hoare logic rules for $\lang$ in
\Cref{fig:base-proof-system}.

\end{document}


\chapter{\label{ch1-intro}Introduction}

\minitoc

\section{Cherenkov Radiation}

\begin{figure}
  \begin{subfigure}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth]{dipole_slow}
    \caption{$v < \frac{c}{n}$}
    \label{fig:dipole_slow}
  \end{subfigure}
  \hfill
  \begin{subfigure}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth]{dipole_fast}
    \caption{$v \ge \frac{c}{n}$}
    \label{fig:dipole_fast}
  \end{subfigure}
  \caption[Polarisation produced in a dielectric medium due to the presence of a charged particle.]{Polarisation produced in a dielectric medium due to the presence of a charged particle, for the cases of a non-relativistic (a) and relativistic particle (b). Where $v$ is the speed of the particle and $c/n$ is the speed light travels in a medium with refractive index $n$.}
\end{figure}

\begin{figure}
	\centering\includegraphics[width=0.5\textwidth]{cherenkov_geom}
	\caption[Geometry of the wavefronts involved in Cherenkov radiation production.]{Geometry of the wavefronts involved in Cherenkov radiation production. The particle travels at a greater speed than the wavefronts propagate.}
	\label{fig:cherenkov_geom}
\end{figure}

When a charged particle moves slowly through a dielectric medium, the electric field of the particle distorts the nearby atoms. Momentarily, these atoms are transformed into elementary dipoles where the charged particles that constitute the atom are aligned with respect to the electric field of the travelling particle (Figure~\ref{fig:dipole_slow}). Due to the complete symmetry of this polarisation around the travelling particle, no net field is produced by the dielectric medium. However, if instead the velocity of the charged particle is faster than the speed light travels in that medium, an asymmetry along the particle trajectory is formed in the polarisation of the surrounding atoms (Figure~\ref{fig:dipole_fast}), resulting in a net dipole field. As the particle continues through the medium, elements of the polarised medium will release a brief burst of electromagnetic radiation. Generally these electromagnetic waves interfere destructively, except in the forward direction along the particle's trajectory in an opening angle $\theta$. Although the full characterisation of this relativistic effect is complex, a simple consideration of the geometry involved, shown in Figure~\ref{fig:cherenkov_geom}, can be used to describe $\theta$ \cite{Jelley1958a}. In a time $\Delta t$ a particle travels a distance $\beta c \Delta t$ where $\beta = \frac{v}{c}$, while the emitted light will travel a distance $\frac{c}{n} \Delta t$ in a medium with refractive index $n$. This results in the relation:
\begin{equation} \label{eq:cherenkov_angle}
\cos \theta = \frac{c}{vn}.
\end{equation}
The blue light emitted in this constrained opening angle, via this phenomena, is known as Cherenkov radiation.

\section{Atmospheric Cherenkov Showers} \label{section:cherenkov_shower_intro}

\begin{figure}
	\centering\includegraphics[width=\textwidth]{cascade}
	\caption[Production of an extended electromagnetic particle cascade.]{Production of a extended electromagnetic particle cascade, demonstrating the different components and interactions.}
	\label{fig:cascade}
\end{figure}

The Earth's atmosphere is effectively opaque to photons with energy above \SI{10}{eV} \cite{Weekes2003}. To conduct astronomical observations at higher energies, one must usually leave the Earth's atmosphere, as was done by the Fermi Gamma-ray Space Telescope. However, at energies above \SI{\ge 10}{GeV}, a ``gamma-ray window'' in the atmosphere exists where the pursuit of gamma-ray observations can be performed using the Cherenkov radiation produced by the cascade of particles resulting from the interaction between the gamma ray and the atmosphere.

Two electromagnetic interactions are responsible for the creation of this cascade:
\begin{description}
\item [Pair Production] The conversion of a photon into an electron-positron pair in the presence of an atom (such as an atmospheric particle). The energy of the photon must exceed the sum of the rest masses of an electron and positron (\SI{1.022}{MeV}). The electron-positron pair share the energy of the progenitor photon, and continue on a similar trajectory. This is the dominating interaction process for photons above \SI{\ge 10}{MeV} \cite{Weekes2003}.
\item [Bremsstrahlung Radiation] The emission of a photon due to the interaction of a charged particle with the electric field of an atom (such as an atmospheric particle). This process allows further gamma rays to be produced.
\end{description}
The interplay between these two processes, occurring after each traversal of a radiation length, produces an extensive cascade of energetic electromagnetic particles. This is illustrated in Figure~\ref{fig:cascade}. The charged particles produced in this cascade are responsible for the generation of the Cherenkov light. This cascade is often known as a ``Cherenkov shower''.

This cascade continues until the ionisation energy losses are equal to the radiation losses. The number of remaining particles after this point, known as the ``shower maximum'', begins to diminish. For a \SI{1}{TeV} shower, this occurs at \SI{\sim 8.4}{km} altitude~\cite{Weekes2003}. The produced Cherenkov light is collimated along the progenitor gamma ray trajectory, and produces a pool of blue light on the ground, with a radius of \SI{\sim 120}{m}~\cite{Hillas1996a}. If the direction of the Cherenkov shower is extrapolated back to the cosmic sphere, the location of the source that produced the gamma ray can be inferred. Although the amount of energy that goes into Cherenkov photon production is a tiny fraction of the total energy, the atmosphere acts as a consistent calorimeter, therefore allowing an accurate reconstruction of the progenitor's energy from the amount of Cherenkov photons produced.

A further characteristic of the Cherenkov shower is the time profile. The total Cherenkov light observed from the entire shower has a duration of \SI{\sim 5}{ns}. Therefore, despite the abundance of showers in the sky, and the visible wavelength of the Cherenkov light, they are imperceivable by the human eye. Furthermore, due to the faster-than-light velocities of the particles inside the cascade, the last Cherenkov photons produced at the end of the shower reach the ground before the first Cherenkov photons produced at the start of the shower. With different sections of the showers arriving at different times, the Cherenkov shower measurements display a time gradient across the image.

\section{Imaging Atmospheric Cherenkov Telescopes}

\begin{figure}
	\centering\includegraphics[width=\textwidth]{nsb}
	\caption[Comparison of Cherenkov and NSB spectrum.]{Comparison of Cherenkov and NSB spectrum. The Cherenkov spectrum shown is expected at an altitude of \SI{2200}{m}. The NSB spectrum shown was measured at La Palma \cite{Bouvier2013}.}
	\label{fig:nsb}
\end{figure}

\begin{figure}
	\centering
	\begin{subfigure}[b]{0.35\textwidth}
		\includegraphics[width=\textwidth]{hess}
		\caption{H.E.S.S.}
		\label{fig:hess}
	\end{subfigure}
	~
	\begin{subfigure}[b]{0.35\textwidth}
		\includegraphics[width=\textwidth]{magic}
		\caption{MAGIC}
		\label{fig:magic}
	\end{subfigure}
	~
	\begin{subfigure}[b]{0.45\textwidth}
		\includegraphics[width=\textwidth]{veritas}
		\caption{VERITAS}
		\label{fig:veritas}
	\end{subfigure}
	\caption{Images of modern IACTs.}
	\label{fig:iacts}
\end{figure}

A primary issue in \gls{vhe} astronomy is the low flux (${\sim} 0.2$ per \si{m \squared} per year \cite{Franco2016}), requiring a collection area that is not feasible for space telescopes. If instead the Cherenkov showers are used to detect the gamma rays, large arrays of optical telescopes can be built to provide stereoscopic imaging of the Cherenkov showers. These telescopes are known as \glspl{iact}. The multiple stereoscopic views of individual showers provided by arrays of \glspl{iact} allow accurate reconstruction of the properties of the shower, such as direction and energy. The topic of reconstruction is discussed in Chapter~\ref{ch6-reduction}.

As the \gls{iact} technique involves imaging the Cherenkov showers, which are much larger than typical astronomy targets, \glspl{iact} do not require the resolving power of typical optical telescopes. Instead, the priorities of an \gls{iact} optical system are to maximise:
\begin{itemize}
\item Mirror collection area, such that more photons can be collected. This enables fainter showers to be detected, thereby lowering the energy threshold.
\item \gls{fov}, which improves the surveying capabilities and eases the study of extended sources.
\end{itemize}
Furthermore, the large collection area provided by the light pool of the Cherenkov shower enables a modest telescope to still make a large amount of gamma ray detections, enabling this technique to be viable despite the small flux.

Two major background components need to be accounted for in \glspl{iact}:
\begin{description}
\item [Cosmic Ray Background] Protons (and heavier hadronic nuclei) are also capable of producing Cherenkov showers that are not entirely dissimilar to electromagnetic showers. As these particles are charged, they have been deflected by interstellar magnetic fields on their journey from their source, and therefore cannot be used to reconstruct the location of its source on the sky. These showers provide an isotropic background whose rate is $10^3$~-~$10^4$ times as numerous than the shower rate received from the discreet gamma-ray sources. However, a hadronic shower exhibits a morphology that is broader and less symmetric than that obtained from gamma-ray showers. Additionally, distinct features such as ``muon rings'', produced by highly penetrating muons reaching low altitudes such that the full Cherenkov cone is visible in a single telescope, accompany hadronic showers. Parametrisations of the Cherenkov shower image therefore enable the discrimination between the hadronic and gamma-induced showers (see Chapter~\ref{ch6-reduction}).
\item [Night Sky Background] Due to the optical sensitivity of the cameras used by \glspl{iact}, the measurements taken are susceptible to starlight, moonlight, and artificial light pollution. To minimise this interference, \glspl{iact} are built in locations with minimal light pollution. One such location is La Palma, for which the \gls{nsb} spectrum, compared to the expected Cherenkov spectrum at an altitude of \SI{2200}{m}, is displayed in Figure~\ref{fig:nsb}. This background is also excluded from signal readout in three ways. Firstly, smart trigger logic and strict thresholds (such as the one described in Chapter~\ref{ch2-mechanics}) prevent triggering on \gls{nsb} photons. Secondly, unbiased charge extraction techniques (described in Chapter~\ref{ch6-reduction}) exclude this noise from the signal.
\end{description}

The application of the \gls{iact} technique was first attempted in the 1960s. The first large optical reflector built with the purpose of gamma-ray astronomy was the Whipple 10 m telescope in southern Arizona, 1968. At first, gamma-ray astronomy suffered from a number of unsubstantial claims of transient signals from a variety of pulsars and binaries, but these signals had marginal statistical significance \cite[][p.~9]{Weekes2003}. It wasn't until 20 years later, after further refinement of the technique, that the Crab Nebula was detected by Whipple in 1989, thus reigniting interest in gamma-ray astronomy.

\begin{figure}
	\centering\includegraphics[width=\textwidth]{sensitivity}
	\caption[Differential sensitivity of CTA.]{Differential sensitivity of CTA predicted by Monte Carlo simulations, compared to the performance of other gamma-ray instruments. Obtained from the CTA website \cite{cta-performance}. ``LAT'' refers to the Fermi Large Area Telescope, a gamma-ray space telescope. HAWC is the High-Altitude Water Cherenkov array. The differential sensitivity has been defined as the minimum flux needed by CTA to obtain a 5-standard-deviation detection of a point-like source.}
	\label{fig:sensitivity}
\end{figure}

Modern \glspl{iact} include \gls{magic}, \gls{veritas}, and the most recent, \gls{hess} (Figure~\ref{fig:iacts}). All three of these telescope systems operate with the advantage of stereoscopic collaboration.

\section{The Cherenkov Telescope Array}

In order to improve on the current \glspl{iact}, an array of ${\sim} 100$ telescopes was proposed, called the \gls{cta}. This array will have \cite{Acharya2013}:
\begin{itemize}
\item an improved sensitivity of 10 times over previous \glspl{iact} ,
\item an observable gamma-ray energy range of \SI{20}{GeV} to \SI{300}{TeV},
\item a large (\SI{\sim 8}{\degree}) field of view for surveys,
\item improved angular and energy resolution,
\item and will be the first \gls{iact} to operate as an open observatory.
\end{itemize}

Figure~\ref{fig:sensitivity} highlights the improvements in sensitivity \gls{cta} aims to provide, relative to existing gamma-ray instruments. Non-\gls{iact} instruments are included in the comparison, such as the Fermi LAT (Large Area Telescope) and \gls{hawc}. Fermi LAT is the principle instrument on the Fermi Gamma-Ray Satellite, providing direct detection of gamma rays in the energy range of \SIrange{0.02}{300}{GeV} \cite{Atwood2009}. \gls{hawc} is a facility which utilises the water Cherenkov technique, an alternative to \glspl{iact}, to detect the particle showers produced by gamma rays within the energy range of \SIrange{0.1}{100}{TeV} \cite{Abeysekara2018}.

\begin{figure}
	\centering\includegraphics[width=\textwidth]{sensitivity_tel}
	\caption[Differential sensitivity of the different CTA telescope types.]{Contribution of each telescope type within \gls{cta} to the total differential sensitivity, obtained from \textcite{Marano2014}.}
	\label{fig:sensitivity_tel}
\end{figure}

\gls{cta} will consist of three different sized telescopes:
\begin{itemize}
\item The \gls{lst}, with a mirror diameter of about \SI{23}{m} to enable the collection of as many photons as possible from the low energy showers (\SIrange{20}{150}{GeV}). Only a few \glspl{lst} are needed, as these low-energy showers are relatively frequent.
\item The \gls{mst}, covering the mid-range energies between \SIrange{0.1}{10}{TeV}, with mirror diameters of \SI{12}{m}.
\item The \gls{sst}, measuring the high energies of \SIrange{1}{300}{TeV}, with mirror diameters of around \SI{4}{m}. Only a small mirror area is necessary as the showers at these energies are very bright. However, due to the rarity of higher energy showers, many \glspl{sst} need to be spread over an area of several square kilometres, to increase the chance of a detection \cite{Acharya2013}.
\end{itemize}
The contributions of each telescope type to the sensitivity of \gls{cta} is shown in Figure~\ref{fig:sensitivity_tel}.

\begin{figure}
	\centering\includegraphics[width=\textwidth]{cta_south}
	\caption[The southern-hemisphere Cherenkov Telescope Array.]{Computer-rendered graphic of the southern hemisphere site for CTA, obtained from the CTA website \cite{cta-south}.}
	\label{fig:cta_south}
\end{figure}

\gls{cta} will be hosted at two different sites. A northern hemisphere site for extragalactic observations will be built at La Palma, and is planned to contain 4 \glspl{lst} and 16 \glspl{mst}. As this site will focus on the energy range from \SI{20}{GeV} to \SI{20}{TeV}, no \glspl{sst} are included on the northern site. A southern hemisphere site will provide observations of the galactic plane, spanning the full energy range of \gls{cta}. Planned to be built nearby the Paranal Observatory in the Atacama Desert in Chile, the southern array is intended to feature 4 \glspl{lst}, 15 \glspl{mst}, and 70 \glspl{sst}, spread over \SI{4}{km \squared}. A visualisation of the \gls{cta} southern array is shown in Figure~\ref{fig:cta_south}.

\section{Small-Sized Telescopes}

\begin{figure}
	\centering\includegraphics[width=\textwidth]{ssts}
	\caption[The three SST designs.]{Computer-rendered graphics of the three SST designs: GCT, ASTRI and SST-1M. Obtained from the CTA website \cite{cta-sst}.}
	\label{fig:ssts}
\end{figure}

Three designs for an \gls{sst} have been proposed:
\begin{itemize}
\item The SST-1M design, a single-mirror Davies-Cotton telescope developed in collaboration between the Czech Republic, Ireland, Poland, Switzerland and Ukraine \cite{cta-sst}. The prototype structure was installed at the Institute of Nuclear Physics in Kraków, Poland in November 2013.
\item The \gls{astri} design features a dual-mirror Schwarzschild-Couder telescope structure. \gls{astri} is predominantly developed by Italy, however contributions were provided from Brazil and South Africa \cite{cta-sst}. The \gls{astri} prototype completed construction on Mt. Etna, Italy in 2014.
\item The \gls{gct} design also features a dual-mirror Schwarzschild-Couder telescope structure. \gls{gct} is being developed through collaboration between Australia, France, Germany, Japan, the Netherlands and the United Kingdom \cite{cta-sst}. The prototype telescope structure was inaugurated at the Observatoire de Paris-Meudon, France in November 2015. \gls{gct} is the telescope which I have been associated with during my DPhil study. The focus of this thesis is on the cameras designed for the \gls{gct}.
\end{itemize}
Pictures of all three telescopes are shown in Figure~\ref{fig:ssts}.

The Schwarzschild-Couder optical design was first proposed by German astrophysicist Karl Schwarzschild to eliminate optical aberrations across the \gls{fov} \cite{Scharzschild1905}. This optical design has since gone through many iterations, however it was never utilised for a reflector telescope due to the complexity and cost required to construct the mirrors \cite{Giro2017}. However, interest in this optical design was recently reawaken by \textcite{Vassiliev2007}, especially as it enables the utilisation of novel compact photosensors. Due to the adoption of similar Schwarzschild-Couder optics, the telescopes of \gls{astri} and \gls{gct} have been specifically designed to accommodate the cameras from both dual-mirror \glspl{sst}. This increases the possibilities for the final \gls{sst} design for \gls{cta}.

\section{Science with the SSTs}

As shown in Figures~\ref{fig:sensitivity}~and~\ref{fig:sensitivity_tel}, the \glspl{sst} are responsible for exploring beyond the current energy frontier in gamma-ray astronomy. Within 50 hours of observation time, the \glspl{sst} will be able provide the same sensitivity as five years of observations with the \gls{hawc} observatory \cite{Consortium2018}. This enables \gls{cta} to provide insights into the most energetic processes in the universe, and address prevalent topics of debate in \gls{vhe} astronomy and particle physics.

The high energy science cases of \gls{cta} are mostly concerned with the acceleration mechanisms that produce high energy cosmic rays. This has been an active topic of discussion in the past 100 years since their initial detection. It is therefore hoped that the \gls{cta} \glspl{sst} can provide new insight into these mechanisms. The different investigations related to this topic can be loosely consolidated into the following categories:
\begin{description}
\item [Supernova Remnants] It is known that the galactic population of \glspl{snr} plays an important role in the acceleration of cosmic rays to high energies. The detection of \si{TeV} photons from \glspl{snr} (suggesting an efficient acceleration mechanism), and the description of the diffusive shock acceleration mechanism, both corroborate with the detection of high-energy cosmic rays in the Earth's atmosphere \cite{Cristofari2017}. However, the detection of \si{TeV} photons from \glspl{snr} could instead be explained by the inverse-Compton scattering between accelerated electrons and the ambient photon background. Therefore, the debate between a leptonic or hadronic origin is still ongoing \cite{Acharya2013}. While studies of individual \glspl{snr} have improved our understanding of the acceleration mechanisms, a population wide study may help constrain the parameters involved \cite{Cristofari2017}. The probe into higher energies with the \glspl{sst} will provide further information about the spectral energy distribution of the currently known \glspl{snr}, and the enhanced sensitivity of \gls{cta} will increase the population of \glspl{snr} known to emit at these energies.
\item [Origin of Cosmic Rays] Another important question regarding the locally measured flux of high-energy cosmic rays is their origin \cite{Bigongiari2016}. As just described, \glspl{snr} appear to be a dominant source for these particles, but are they the only major contributor to the galactic cosmic rays? Expanding on the discovered \gls{vhe} galactic source population is the key to answering this question.
\item [Pevatrons] A further capability of \gls{cta} (provided by the \glspl{sst}) is the detection of extreme accelerators that power particles up to the \si{PeV} scale. As a result of the acceleration of hadronic cosmic rays to these energies, gamma rays with energies of \SI{100}{TeV} should be detectable from the accelerator. However, as the cross-section for inverse-Compton electron-photon interactions decreases very quickly above a few tens of \si{TeV} \cite{Consortium2018}, the absence of \SI{100}{TeV} gamma rays from these accelerators would suggest a leptonic origin. The identification of even one Pevatron accelerator would therefore provide a huge breakthrough in the investigations into the origins of \gls{vhe} gamma rays.
\end{description}

\section{Thesis Outline}

The focus of this thesis is on the camera for the \gls{gct} \gls{sst}. I begin with a detailed description of the camera's components and waveform readout in Chapter~\ref{ch2-mechanics}. Specific focus is given to the Silicon Photomultiplier (SiPM), the photosensor utilised in the latest camera implementation. This photosensor exhibits high photoelectron counting resolution for a large dynamic range, but suffers from a phenomena known as optical crosstalk, which degrades the ability to resolve the number of incident photons detected with the photosensor.

I provide background on the \gls{cta} system architecture in Chapter~\ref{ch3-architecture} in order to introduce the performance requirements the camera must meet. The most important requirement in the context of this thesis is the Charge Resolution, a measure of how accurately the signal contained in waveform can be resolved.

Chapter~\ref{ch4-software} outlines the software packages relevant to the processing pipeline for the Cherenkov shower data recorded by the camera, many of which I have been actively involved in developing. This includes the low-level \cpp~libraries used to read out and calibrate the waveforms from the camera, the Python packages responsible for reconstructing the Cherenkov shower parameters from the waveforms, and finally the science tools developed to analyse the reduced photon event lists provided by the \gls{cta} Observatory to the public.

The calibration procedures I have developed for the camera are described in Chapter~\ref{ch5-calibration}. These procedures remove the artefacts that are particular to the camera's electronics, transforming the waveform readout into a state ready for common signal processing techniques. The calibration procedures for the photosensor are also covered, which act to unify the illumination response between the different pixels in the camera.

Chapter~\ref{ch6-reduction} describes the signal processing techniques commonly utilised by \glspl{iact} to extract the Cherenkov shower signal from the waveforms. The \textit{cross-correlation} approach I have developed and adopted for signal extraction is also described. Within this chapter I continue on to describe how the information extracted from the waveform is used to reconstruct the properties of the Cherenkov shower progenitor.

I assess the cumulative performance of the camera (resulting from its components, calibration, and waveform processing) in Chapter~\ref{ch7-performance}. The requirements introduced in Chapter~\ref{ch3-architecture} are used as the benchmarks to assess the performance against, as the requirements must be met for the camera to be accepted as a contribution to \gls{cta}. I also highlight the significance of the optical crosstalk on the Charge Resolution, and explore the impact of future improvements to the photosensor.

In Chapter~\ref{ch8-onsky} I report on the on-telescope campaigns performed with an earlier iteration of the \gls{gct} camera, demonstrating the application of Cherenkov shower parametrisation techniques introduced in Chapter~\ref{ch6-reduction}.


\section{(Initial) Causal Graph Construction}
\label{sec:graph-construction}

Construction of an initial causal graph typically proceeds as follows.
At a high level, we
\begin{enumerate}
   \item adopt a population perspective,
   \item brainstorm all variables that we think affect the system that generates our observations,
   \item remove any variables that could cause bias in our causal inferences,
   \item connect all variables in our graph according to our a-priori beliefs about causal relations amongst them
   \item consider how the graph structure may differ between individuals and subgroups within the population.
\end{enumerate}
The following paragraphs describe these steps in detail.

To begin, we adopt the position of a researcher concerned about population level relationships.
This means we will think through what is a likely generative model for all individuals.
Later in this section, we will devote time to thinking about how subgroups and individual heterogeneity may affect our causal graphs.

Now, we add our first variable(s) to our graph, the outcome variable(s) of interest in our problem.
Note that we should consider relations and dependencies between these outcomes, and we should draw these onto our graphs.
Such inter-outcome dependencies may be of great relevance or even focus.
Recall, for example, the case of activity-based modellers that was mentioned in Section \ref{sec:choice-graphs}.
Similarly, medical researchers with data on multiple health measures or companies with multiple business metrics may all be interested in how the outcomes cause each other.

After adding our outcomes to our graph, we list all the variables we believe to cause them.
We refer to these influencing variables as our initial explanatory variables.

Next, we iterate through these initial explanatory variables.
For each current explanatory variable in the iteration, we think of variables that may modify the effect of the current explanatory variable on the outcome(s) of interest.
We refer to these variables as effect modifiers\footnote{Note, effect modifiers and confounders are easily confused. Both variables cause the outcome. The difference is that effect modifiers do not cause the explanatory / treatment variables. Confounders do. For discussion and classification of the different types of effect modification, based on one's causal graph, see \citet{vanderweele_2007_four}}.
Note that some effect modifiers may be a part of our list of initial explanatory variables.
For any effect modifiers that we think of, outside of the list of initial explanatory variables, we add them to our causal graph.

Overall, modifiers are important because our treatment effects systematically vary with them.
Accordingly, if we better understand when our treatments will be effective, then we can better target them.
% For instance, the effect of a transit voucher on increasing an individual's probability of using transit is likely modified by the recipients income.
% We expect a smaller treatment effect on wealthy individual's than on individual's with low income
For instance, imagine that a region-wide lockdown reduces the 14-day rolling average of new COVID-19 cases by X\% (on average).
Of course, we know that a lockdown's effectiveness is modified by the percentage of workers who must continue going out to work.
If most residents in an area are essential workers, then a lockdown will be less effective there, as compared with other locales.
We might wish to target other interventions for that region, as a replacement or supplement for the lockdown.
Targeting aside, knowledge of modifiers is also crucial to generalizing treatment effect inferences from one population to another.
To credibly transport our inferences, we must know what variables cause the treatment effects to differ between populations, and we must know how the distributions of those variables differs across populations \citep{pearl_2014_external}.
In general, see \citet{zheng_2018_automated} for a thorough introduction to moderation, its differences from other variables in one's causal graph, and for instructions on how to find moderators through data analysis alone.

After adding explanatory and effect modifying variables to the graph, we turn our attention to mediating variables.
A mediating variable is one through which an explanatory variable influences our outcome(s) of interest.
Such variables have multiple uses.
Under certain instances of confounding, mediators enable the ``front-door'' criterion to identify one's causal effect \citep{glynn_2018_front, bellemare_2019_paper, gupta_2020_estimating}.
Similarly, subject to particular causal assumptions, mediating variables permit inference on long-term outcomes of a selected intervention, given only its short-term proxies \citep{athey_2019_estimating, yang_2020_targeting}.

To find these mediators, we again iterate through each explanatory variable.
On each iteration, we brainstorm variables along paths of influence from our explanatory variable to our outcome.
For instance, consider how the presence of a bike lane influences bicycle mode choice.
We hypothesize that an individual's subjective perception of safety is the primary (or sole) mediator through which bicycle lane presence influences mode choice.
Accordingly, we add subjective perception of safety to our causal graph for travel mode choice.

After considering the variables above, we turn our attention to variables that complicate our analyses.
To begin with, we think of confounding variables.
The process is similar to how we generated effect modifying variables.
We iterate through each of the explanatory, mediating, and effect modifying variables, thinking specifically of any variables that both cause the current variable in the iteration and cause the outcome variable(s).
We call these variables, which cause our outcome and current variables in the iteration, confounding variables \citep{elwert_2013_graphical, greenland_1999_confounding}.
As an example, consider a person's attitude towards environmental conservation.
This attitude may cause both that individual's observed distance to their workplace (another explanatory variable) and that individual's choice of travel mode.
Both in this example and in general, we should add such confounding variables to our causal graph.

Next, we consider the effects of selection.
As noted by \citet{greenland_2020_causal}, all datasets have a causal graph that implicitly conditions on a selection node.
I.e., we only analyze data that has been selected to be a part of our dataset.
We should therefore consider how all of the other nodes in our causal graph relate to the selection node.
In particular, will we suffer any selection bias due to the outcomes influencing whether an observation is selected for inclusion in our dataset?
Selection bias, if present, can cause our estimated causal effects to differ greatly from their population counterparts.
This stems from systematic differences between the observations that have been selected into our dataset and the observations in our population of interest.
For more details, see \citet{heckman_1979_sample} and \citet{hernan_2004_structural} as canonical references.

Another universally implied yet only implicitly described element of one's causal graph is the prior data and code that led to one's dataset \citep[Pg.7]{greenland_2020_causal}.
Presumably, prior data and potentially code-enabled-analysis influenced the sample design that led to your dataset.
Perhaps some data transformations and code to implement those transformations was used to convert a raw dataset into the dataset being used for causal inference.
And at all times, one uses computer programs to compute your reported results.
In each case, the prior data is variable that influences your current data, and your code is computational (sub)graph that is implicit in your causal graph.
These elements should perhaps be made explicit, and their influence on your causal effect estimates should definitely be assessed and reported.

Next, we should explicitly consider the role of time, even in research that may be cross-sectional due to the data that is available to us or due to the problem itself.
In reality, how do we think our system evolves over time?
If we consider multiple observations of a given decision maker, how does that decision maker's observed variables at time $t$ partially cause future variables important to the context or outcome(s) for that decision maker at time $t' > t$?
How do the actions of a decision maker $i$ at time $t$ partially cause the future context or outcomes of a decision maker $j$?
We should add explicit nodes to our graph, subscripted or denoted by time, to show the cross-time causal relationships in our system.
For in-depth discussion of time-related causal inference topics, see papers such as \citet{gill_2001_causal}, \citet{eichler_2007_granger}, and \citet{peters_2013_causal}.
Please note that the literature on this topic is vast, and the cited authors are not at all exhaustive or representative of all papers in this space.
Interested readers are encouraged to perform further literature searches on their own.

Similarly, we will frequently want to consider the role of space.
In the context of choice modelling, this includes questions such as ``how does a decision maker's existence in a particular geographical area shape their choices?''
For example, consider multinational corporations where the business operates differently across state borders.
Here, the borders associated with space directly causes a difference in the causal graph of how these businesses deliver their goods and services to customers.
In other instances, one can consider space as a noisy proxy for unobserved confounders, such as cultural attitudes of a region's inhabitants \citep{paciorek_2010_importance}.
Rooted in the causal problem of unobserved confounding, this results in known statistical issues for choice modellers such as spatial correlation of model residuals \citep{fleming_2004_techniques}.
Fortunately, some progress has been made in dealing with such problems.
For general discussion of recent techniques in causal inference for spatial-causal modelling to deal with such issues, see \citet{osama_2019_inferring}.

At this point, we have added to our causal graph all the
outcome, explanatory, effect modifying, mediating, confounding, selection, data/code, time-indexed, and space-indexed variables that we believe are relevant for our problem.
However, many of these variables may be disconnected nodes, i.e., singletons in the graph.
We now focus on pruning nodes from this graph, before drawing our final hypothesized connections.
In particular, we focus on pruning ``post-outcome'' variables that are not part of the causal graph for future time periods or other observations.
The reason for this is that conditioning on such post-outcome variables would bias our causal effect estimates.
Our pruning exception is the selection variable which we have no choice but to condition on.
It may unfortunately be a post-outcome.

To remove the problematic variables, we iterate through each of the non-outcome variables in our graph, and we assess whether each variable is actually a result of the outcome (perhaps in combination with other variables in our graph).
These post-outcome variables temporally follow the outcome variable(s) but do not cause variables in the causal graph for other observations.
We remove all such post-outcome variables from our graph.

Now is a good time to step back and consider what other researchers have thought about our problem.
Specifically, we should conduct a literature review to see how other researchers have conceptualized the topic that we are working on.
Have they included variables that we have not?
Were those variables related our outcomes of interest?
If so, should we add these variables to our causal graph? How should these variables enter our graph?
Do the included variables of other researchers suggest the existence of confounders in their work that we should include in our graph?
Have other researchers ascribed differing roles to our graph's current variables than we have?
For example, have other researchers judged a variable to be a confounder, when we solely thought of the variable as an effect modifier?
As we answer these questions, we should critically examine the evidence for these alternative decisions to see if we should also reconsider how we're judging our variables.

Finally, we need to connect the variables in our graph.
\begin{enumerate}
   \item Draw direct arrows from our explanatory variables, confounders, and effect modifiers to the outcomes.
   \item Draw arrows from the explanatory variables to the mediators, and then draw arrows from the mediators to the outcomes.
   \item Draw arrows from the confounders to the explanatory variables and mediators that they may cause.
   \item Draw arrows from the variables in time $t$ to the variables that they cause in time $t+1$.
   \item Draw arrows from the variables that cause one's location in space to spatial variable nodes, and draw arrows to variables that are caused by one's location in space.
   \item Draw arrows from all other nodes in one's graph to the selection node, based on which variables cause inclusion in one's dataset.
\end{enumerate}
After drawing in all arrows, we should now have a fully connected causal graph.
Pause.
Look over the graph to ensure there are no remaining singletons, and ensure that we have not drawn any spurious connections.
Then, stop briefly to celebrate.
Drawing a project's first causal graph is hard work!

After celebrating, take a moment to pursue the following graph editing exercises.
First, think about how the graph might differ across sub-populations.
What sub-populations, if any, exist in your population of interest?
Are there any causal relationships that should, or should not, not exist for a given sub-population?
For instance, are the outcomes in some sub-populations independent of a given explanatory variable?
Can you think of any inverted causal relationships that are specific to this sub-population?
(I.e., for a given sub-population, does $B \rightarrow A$ instead of $A \rightarrow B$?)
As explained in \citet[Sec. 4]{druzdzel_2003_combining},
add these sub-populations to one's initial causal graph via a ``selection node,''
or if this is not clear enough,
draw modified causal graphs for each sub-population of interest.
Now, one can actually relax.
This concludes the ``purely mental'' drafting of one's causal graph.
In the next section, we'll look at testing this graph against data, and making any edits deemed empirically necessary.


\chapter{DNA Models}
\label{chap:dna}

\section{3SPN.2C}
\label{sec:dna_3spn2c}

The series of the 3SPN.x DNA models have been developed by de Pablo's
group~\cite{Freeman2011, Hinckley2013, Freeman2014}.  The 3SPN.2C model is the
one for modeling sequence-dependent curvature of double-stranded DNA
(dsDNA)~\cite{Freeman2014}.  Particularly, the model has been well-tuned to
reproduce both mechanical and geometrical properties, such as persistent length
and major/minor groove widths~\cite{Hinckley2013, Freeman2014}.

\subsection{Topology}
\label{subsec:dna_3spn2c_top}

In this model, each nucleotide is represented by three CG particles, P
(phosphate), S (sugar), and B (base), as shown in \autoref{fig:dna_3spn2c_top}.
B has four types: A (adenine), C (cytosine), G (guanine), and T (thymine).  The
CG particles are put at the center-of-mass of each chemical moiety.

\begin{figure}[ht]
  \centering
  \includegraphics[width=0.3\textwidth]{figures/DNA_3spn2c_top.png}
  \caption{Topology of the 3SPN.2C DNA model: each nucleotide is represented by
    3 sites corresponding to phosphate (P), deoxyribose sugar (S), and
    nitrogenous base (B).  A typical nucleotide ``residue'' is enclosed by the
    dashed line.}
  \label{fig:dna_3spn2c_top}
\end{figure}

\begin{table}[ht]
  \centering
  \begin{tabular}{lc}
    \toprule
    Particle Type    & Mass (amu) \\
    \midrule
    P  &  94.97 \\
    S  &  83.11 \\
    A  &  134.1 \\
    C  &  110.1 \\
    G  &  150.1 \\
    T  &  125.1 \\
    \bottomrule
  \end{tabular}
  \caption{Mass of the 3SPN.2C DNA particles.}
  \label{tab:dna_3spn2c_top_mass}
\end{table}

\subsection{Potentials}
\label{subsec:dna_3spn2c_potential}

The 3SPN.2C potentials can be devided into two parts, as usual, bonded, and
nonbonded:
\begin{displaymath}
  U = U_b + U_{nb}.
\end{displaymath}

The bonded potentials include the following terms:
\begin{itemize}
\item bonds ($U_{bond}$),
\item angles ($U_{ang}$),
\item dihedral angles ($U_{dih}$).
\end{itemize}
\begin{equation}
  \label{eq:dna_3spn2c_local}
  U_b = U_{bond} + U_{ang} + U_{dih}.
\end{equation}

The nonbonded potentials include these terms:
\begin{itemize}
\item base-base interactions:
  \begin{itemize}
  \item base stacking ($U_{bstk}$),
  \item base pairing ($U_{bp}$),
  \item cross base stacking ($U_{cstk}$),
  \end{itemize}
\item excluded volume interactions ($U_{exv}$),
\item electrostatic interactions ($U_{ele}$).
\end{itemize}
\begin{equation}
  \label{eq:dna_3spn2c_nonlocal}
  U_{nb} = U_{bstk} + U_{bp} + U_{cstk} + U_{exv} + U_{ele}.
\end{equation}

\subsubsection{Bond}
\label{sec:dna_3spn2c_potential_bond}

\begin{smallpage}{3SPN.2C bond potential}<white>
  \begin{equation}
    \label{eq:dna_3spn2c_local_bond}
    U_{bond} = \sum_{i}^{bonds} k_b (r_i - r_{i,0})^2 + 100 k_b (r_i - r_{i,0})^4.
  \end{equation}
  \tcblower
  \begin{itemize}
  \item Bonds involved:
    \begin{itemize}
    \item P-S
    \item S-B
    \item S-P
    \end{itemize}
  \item $r_{i, 0}$: based on the structure of B-form DNA.
  \item $k_b = 0.6\ \mathrm{kJ/mol/\angstrom^2}$.
  \end{itemize}
\end{smallpage}

\subsubsection{Angle}
\label{sec:dna_3spn2c_potential_angle}

\begin{smallpage}{3SPN.2C bond angle potential}<white>
  \begin{equation}
    \label{eq:dna_3spn2c_local_angle}
    U_{ang} = \sum_{i}^{angles} k_\theta (\theta_i - \theta_{i,0})^2.
  \end{equation}
  \tcblower
  \begin{itemize}
  \item Angles involved:
    \begin{itemize}
    \item P-S-P
    \item S-P-S
    \item P-S-B
    \item B-S-P
    \end{itemize}
  \item $\theta_{i, 0}$: based on the structure of B-form DNA.
  \item $k_\theta$: see the table below: (unit: $\mathrm{kJ/mol/rad^2}$)
  \end{itemize}
  \begin{center}
    \begin{tabular}{l|cl|cl|cl|cl}
      \toprule
      \emph{PSP} & all & \multicolumn{7}{l}{300}\\
      \midrule
      \multirow{4}{*}{\emph{SPS}} &
                                    AA & 355 & AT & 147 & AC & 464 & AG & 368 \\
                 & TA & 230 & TT & 355 & TC & 442 & TG & 273 \\
                 & CA & 273 & CT & 368 & CC & 165 & CG & 478 \\
                 & GA & 442 & GT & 464 & GC & 228 & GG & 165 \\
      \midrule
      \multirow{4}{*}{\emph{PSB}} &
                                    AA & 460 & TA & 120 & CA & 206 & GA & 383 \\
                 & AT & 370 & TT & 460 & CT & 358 & GT & 442 \\
                 & AC & 442 & TC & 383 & CC & 278 & GC & 336 \\
                 & AG & 358 & TG & 206 & CG & 278 & GG & 278 \\
      \midrule
      \multirow{4}{*}{\emph{BSP}} &
                                    AA & 460 & AT & 370 & AC & 442 & AG & 358 \\
                 & TA & 120 & TT & 460 & TC & 383 & TG & 206 \\
                 & CA & 206 & CT & 358 & CC & 278 & CG & 278 \\
                 & GA & 383 & GT & 442 & GC & 336 & GG & 278 \\
      \bottomrule
    \end{tabular}
  \end{center}
\end{smallpage}

\subsubsection{Dihedral Angle}
\label{sec:dna_3spn2c_potential_dihedral_angle}

The dihedral angle potential in the 3SPN.2C model contains two parts:
\begin{enumerate}
\item A strong Gaussian type potential applied on the backbone dihedrals
  ($U_{dih, Gaussian}$);
\item A weak periodic potential applied on all dihedral angles ($U_{dih, periodic}$).
\end{enumerate}
\begin{equation}
  \label{eq:dna_3spn2c_local_dihedral}
  U_{dih} = U_{dih, Gaussian} + U_{dih, periodic}.
\end{equation}

\begin{smallpage}{3SPN.2C dihedral angle potential (Gaussian)}<white>
  \begin{equation}
    \label{eq:dna_3spn2c_local_dihedral_Gaussian}
    U_{dih, Gaussian} = \sum_{i}^{dihedrals} -k_{ \phi, Gaussian } \exp\big( \frac{-(\phi_i - \phi_{i,0})^2}{2\sigma_{\phi}^2} \big).
  \end{equation}
  \tcblower
  \begin{itemize}
  \item Dihedral angles involved:
    \begin{itemize}
    \item P-S-P-S
    \item S-P-S-P
    \end{itemize}
  \item $\phi_{i, 0}$: based on the structure of B-form DNA.
  \item $k_{\phi, Gaussian} = 7.0\ \mathrm{kJ/mol}$.
  \item $\sigma_\phi = 0.3$.
  \end{itemize}
\end{smallpage}

\begin{smallpage}{3SPN.2C dihedral angle potential (periodic)}<white>
  \begin{equation}
    \label{eq:dna_3spn2c_local_dihedral_periodic}
    U_{dih, periodic} = \sum_{i}^{dihedrals} k_{\phi, periodic} \big[ 1+\cos(\phi_i - \phi_{ i,0 }) \big].
  \end{equation}
  \tcblower
  \begin{itemize}
  \item Dihedral angles involved:
    \begin{itemize}
    \item P-S-P-S
    \item S-P-S-P
    \item S-P-S-B
    \item B-S-P-S
    \end{itemize}
  \item $\phi_{i, 0}$: based on the structure of B-form DNA.
  \item $k_{\phi, periodic} = 2.0\ \mathrm{kJ/mol}$.
  \end{itemize}
\end{smallpage}

\subsubsection{Base Stacking}
\label{sec:dna_3spn2c_potential_bstk}

Before we introduce the nonbonded terms, we would like to first show the
topology of the double stranded DNA and clarify the CG particles involved in the
base-base interaction terms (see \autoref{fig:DNA_3spn2c_nonbonded_all}).

\begin{figure}[ht]
  \centering
  \includegraphics[width=0.45\textwidth]{figures/DNA_3spn2c_nonbonded_all.png}
  \caption{The base-related nonbonded interactions among DNA CG particles.  Here
    we introduce local indices (circled numbers) for easy understanding.  The
    base-stacking interactinos are calculated for the neighboring bases
    ($U_{bstk}$).  The base-pairing interactions are considered for Watson-Crick
    pairs, namely, the A-T and G-C pairs ($U_{bp}$).  Whereas the cross-stacking
    terms are only considered for bases next to the pairsing bases ($U_{cstk}$).}
  \label{fig:DNA_3spn2c_nonbonded_all}
\end{figure}

We would like to also define several common functions used by the
base-interaction potentials:
\begin{equation}
  \label{eq:dna_3spn2c_nonlocal_base_rep}
  U_m^{rep}(\epsilon_{ij}, \alpha_{ij}, r_{ij}) =
  \begin{cases}
    \epsilon_{ij} \Big( 1-e^{\big(-\alpha_{ij}(r_{ij}-r_{ij,0})\big)} \Big)^2 & r_{ij} < r_{ij, 0}, \\[.5em]
    0 & r_{ij} \ge r_{ij, 0}.
  \end{cases}
\end{equation}

\begin{equation}
  \label{eq:dna_3spn2c_nonlocal_base_attr}
  U_m^{attr}(\epsilon_{ij}, \alpha_{ij}, r_{ij}) =
  \begin{cases}
    -\epsilon_{ij} & r_{ij} < r_{ij, 0}, \\[.5em]
    \epsilon_{ij} \Big(1-e^{\big(-\alpha_{ij}(r_{ij}-r_{ij,0})\big)} \Big)^2 - \epsilon_{ij} & r_{ij} \ge r_{ij, 0}.
  \end{cases}
\end{equation}

In ~\autoref{eq:dna_3spn2c_nonlocal_base_rep} and
\autoref{eq:dna_3spn2c_nonlocal_base_attr}, $r_{ij}$ is the distance between
particle $i$ and $j$, whereas $\epsilon_{ij}$ and $\alpha_{ij}$ are sequence
dependent parameters.

\begin{equation}
  \label{eq:dna_3spn2c_nonlocal_base_angle_mod}
  f(K, \Delta \theta) =
  \begin{cases}
    1 & \displaystyle -\frac{\pi}{2K} < \Delta \theta < \frac{\pi}{2K}, \\[.7em]
    1 - \cos^2(K\Delta\theta) & \displaystyle -\frac{\pi}{K} < \Delta \theta < -\frac{\pi}{2K} \textrm{ or } \frac{\pi}{2K} < \Delta \theta < \frac{\pi}{K}, \\[.7em]
    0 & \displaystyle \Delta \theta < -\frac{\pi}{K} \textrm{ or }  \Delta \theta > \frac{\pi}{K}. \\
  \end{cases}
\end{equation}

The $\theta$ in \autoref{eq:dna_3spn2c_nonlocal_base_angle_mod} has
different definitions in $U_{bstk}$, $U_{bp}$, and $U_{cstk}$.

For the base-stacking interactions, $\theta_{BS}$ is the angle formed by
\circled{1}-\circled{2}-\circled{6}
(\autoref{fig:DNA_3spn2c_nonbonded_bstk}).

Practically, we treat the $U_{bstk}$ as a ``local'' potential, because all the
interactions can be determined by the topology, regardless of the conformation.
Besides, the order of magnitude of computational cost of $U_{bstk}$ is only
$\mathcal{O}(n)$, where $n$ is the number of basepairs in DNA.

\begin{figure}[ht]
  \centering
  \includegraphics[width=0.2\textwidth]{figures/DNA_3spn2c_nonbonded_bstk.png}
  \caption{Definition of $\theta_{BS}$ in the base-stacking interactions.}
  \label{fig:DNA_3spn2c_nonbonded_bstk}
\end{figure}

\begin{smallpage}{3SPN.2C base-stacking potential}<white>
  \begin{equation}
    \label{eq:dna_3spn2c_nonlocal_base_stacking}
    U_{bstk} = \sum^{n_{bstk}} U_m^{rep}(\epsilon_{BS}, \alpha_{BS}, r_{ij}) +
    f(K_{BS}, \Delta\theta_{BS})
    U_m^{attr} (\epsilon_{BS}, \alpha_{BS}, r_{ij}).
  \end{equation}
  \tcblower
  \begin{itemize}
  \item Particles involved (see \autoref{fig:DNA_3spn2c_nonbonded_bstk}):
    \begin{itemize}
    \item $r_{ij}$: \circled{2}-\circled{6}
    \item $\theta_{BS}$: \circled{1}-\circled{2}-\circled{6}
    \end{itemize}
  \item $\alpha_{BS} = 3.0$.
  \item $K_{BS} = 6.0$.
  \item $\epsilon_{BS}$, $r_{ij, 0}$, and $\theta_{BS, 0}$: see the table below:
  \end{itemize}
  \begin{center}
    \begin{footnotesize}
      \begin{tabular}{ll|rrrr|rrrr|rrrr}
        \toprule
        & &  \multicolumn{12}{c}{\circled{6}}\\
        & & A & T & G & C & A & T & G & C & A & T & G & C \\
        \midrule
        & &  \multicolumn{4}{c|}{$\epsilon_{BS}$ (kJ/mol)} & \multicolumn{4}{c|}{$r_{ij, 0}$ (\angstrom)} & \multicolumn{4}{c}{$\theta_{BS, 0}$ ($^\circ$)}\\
        \multirow{4}{*}{\circled{2}}
        & A & 13.82 & 15.05 & 13.32 & 15.82 & 3.58 & 3.56 & 3.85 & 3.45 & 100.13 & 90.48 & 104.39 &  93.23  \\
        & T &  9.15 & 12.44 &  9.58 & 13.11 & 4.15 & 3.93 & 4.32 & 3.87 & 102.59 & 93.32 & 103.70 &  94.55  \\
        & G & 13.76 & 14.59 & 14.77 & 15.17 & 3.51 & 3.47 & 3.67 & 3.42 &  95.45 & 87.63 & 106.36 &  83.12  \\
        & C &  9.25 & 12.42 &  8.83 & 14.01 & 4.15 & 3.99 & 4.34 & 3.84 & 102.69 & 96.05 & 100.46 & 100.68 \\
        \bottomrule
      \end{tabular}
    \end{footnotesize}
  \end{center}
\end{smallpage}

\subsubsection{Base Pairing and Cross-Stacking}
\label{sec:dna_3spn2c_potential_bp_cstk}

It is convenient to consider the $U_{bp}$ and $U_{cstk}$ potentials at the same
time, since $U_{cstk}$ only applies to bases next to the pairsing bases.  There
are also several angles and dihedral angles involved in the calculation of these
potentials (\autoref{fig:DNA_3spn2c_nonbonded_bp_cstk}).

\begin{figure}[ht]
  \centering
  \includegraphics[width=0.4\textwidth]{figures/DNA_3spn2c_nonbonded_bp_cstk.png}
  \caption{Angles and dihedral angles involved in the $U_{bp}$ (red terms) and
    $U_{cstk}$ (blue terms) calculations.}
  \label{fig:DNA_3spn2c_nonbonded_bp_cstk}
\end{figure}

Note that the base pairsing interactions are considered when two bases satisfy
the following conditions:
\begin{itemize}
\item Base types can form Watson-Crick pairs: A-T, T-A, C-G, or G-C;
\item Base indices $i$ and $j$ are ``nonlocal'':
  \begin{itemize}
  \item $i$ and $j$ are in different strands;
  \item $i$ and $j$ are in the same strand, but $| i - j | > 10$.
  \end{itemize}
\end{itemize}

\begin{smallpage}{3SPN.2C base-pairing and cross-stacking potential}<white>
  \vspace{-1em}
  \begin{align}
    U_{bp} &= \sum^{n_{bp}} U_m^{rep}(\epsilon_{BP}, \alpha_{BP}, r_{ij}) \nonumber \\
           &+ \frac{1}{2} \big( 1+\cos(\Delta \phi_1) \big)
             f(K_{BP}, \Delta\theta_{1})
             f(K_{BP}, \Delta\theta_{2})
             U_m^{attr} (\epsilon_{BP}, \alpha_{BP}, r_{ij}).
             \label{eq:dna_3spn2c_nonlocal_base_pairing} \\[.5em]
    U_{cstk} &= \sum^{n_{cstk}} f(K_{BP}, \Delta\theta_{3})
               f(K_{CS}, \Delta\theta_{CS})
               U_m^{attr} (\epsilon_{CS}, \alpha_{CS}, r_{kl}).
               \label{eq:dna_3spn2c_nonlocal_cross_stacking}
  \end{align}
  \tcblower
  \begin{itemize}
  \item Particles involved (see \autoref{fig:DNA_3spn2c_nonbonded_bp_cstk}):
    \begin{itemize}
    \item $r_{ij}$: \circled{2}-\circled{4}
    \item $r_{kl}$: \circled{2}-\circled{5} and \circled{4}-\circled{6}, if available
    \item $\theta_{1}$: \circled{1}-\circled{2}-\circled{4}
    \item $\theta_{2}$: \circled{3}-\circled{4}-\circled{2}
    \item $\theta_{3}$: angle between vectors conecting \circled{1}-\circled{2} and \circled{3}-\circled{4}
    \item $\phi_{1}$: dihedral angle \circled{1}-\circled{2}-\circled{4}-\circled{3}
    \item $\theta_{CS}$: \circled{1}-\circled{2}-\circled{5} or \circled{3}-\circled{4}-\circled{6}
    \end{itemize}
  \item $\alpha_{BP} = 2.0$.
  \item $K_{BP} = 12.0$.
  \item $\alpha_{CS} = 4.0$.
  \item $K_{CS} = 8.0$.
  \item All the other parameters are listed in the table below:
  \end{itemize}
  \begin{center}
    \begin{footnotesize}
      \begin{tabular}{l|rrrrrr}
        \toprule
        \circled{2}-\circled{4} & $\theta_{1, 0}$ ($^\circ$) & $\theta_{2, 0}$  ($^\circ$) & $\theta_{3, 0}$  ($^\circ$) & $\phi_{1, 0}$  ($^\circ$) & $r_{ij, 0}$ ($\angstrom$) & $\epsilon_{BP}$ (kJ/mol) \\
        \midrule
        A-T & 153.17 & 133.51 & 110.92 & -38.18 & 5.82 & 14.41 \\
        T-A & 133.51 & 153.17 & 110.92 & -38.18 & 5.82 & 14.41 \\
        G-C & 159.50 & 138.08 & 120.45 & -35.75 & 5.52 & 18.24 \\
        C-G & 138.08 & 159.50 & 120.45 & -35.75 & 5.52 & 18.24 \\
        \bottomrule
      \end{tabular}
    \end{footnotesize}
  \end{center}

  \begin{center}
    \begin{footnotesize}
      \begin{tabular}{ll|rrrr|rrrr|rrrr}
        \toprule
        & &  \multicolumn{12}{c}{\circled{5}}\\
        & & A & T & G & C & A & T & G & C & A & T & G & C \\
        \midrule
        & &  \multicolumn{4}{c|}{$\epsilon_{CS}$ (kJ/mol)} & \multicolumn{4}{c|}{$r_{kl, 0}$ (\angstrom)} & \multicolumn{4}{c}{$\theta_{CS, 0}$ ($^\circ$)}\\
        \multirow{4}{*}{\circled{2}}
        & A & 1.882 & 2.388 & 2.439 & 1.680 & 6.42 & 6.77 & 6.27 & 6.84 & 154.04 & 158.77 & 153.88 & 157.69 \\
        & T & 2.388 & 1.882 & 2.187 & 2.566 & 6.77 & 7.21 & 6.53 & 7.08 & 148.62 & 155.05 & 147.54 & 153.61 \\
        & G & 2.439 & 2.187 & 3.250 & 0.972 & 6.27 & 6.53 & 5.74 & 6.86 & 153.91 & 155.72 & 151.84 & 157.80 \\
        & C & 1.680 & 2.566 & 0.972 & 4.135 & 6.84 & 7.08 & 6.86 & 6.79 & 152.04 & 157.72 & 151.65 & 154.49 \\
        \bottomrule
      \end{tabular}
    \end{footnotesize}
  \end{center}

  \begin{center}
    \begin{footnotesize}
      \begin{tabular}{ll|rrrr|rrrr|rrrr}
        \toprule
        & &  \multicolumn{12}{c}{\circled{6}}\\
        & & A & T & G & C & A & T & G & C & A & T & G & C \\
        \midrule
        & &  \multicolumn{4}{c|}{$\epsilon_{CS}$ (kJ/mol)} & \multicolumn{4}{c|}{$r_{kl, 0}$ (\angstrom)} & \multicolumn{4}{c}{$\theta_{CS, 0}$ ($^\circ$)}\\
        \multirow{4}{*}{\circled{4}}
        & A & 1.882 & 2.388 & 2.566 & 2.187 & 5.58 & 6.14 & 5.63 & 6.18 & 116.34 & 119.61 & 115.19 & 120.92 \\
        & T & 2.388 & 1.882 & 1.680 & 2.439 & 6.14 & 6.80 & 6.07 & 6.64 & 107.40 & 110.76 & 106.33 & 111.57 \\
        & G & 2.566 & 1.680 & 4.135 & 0.972 & 5.63 & 6.07 & 5.87 & 5.66 & 121.61 & 124.92 & 120.52 & 124.88 \\
        & C & 2.187 & 2.439 & 0.972 & 3.250 & 6.18 & 6.64 & 5.66 & 6.80 & 112.45 & 115.43 & 110.51 & 115.80 \\
        \bottomrule
      \end{tabular}
    \end{footnotesize}
  \end{center}
\end{smallpage}

\subsubsection{Excluded-Volume Interactions}
\label{sec:dna_3spn2c_potential_exv}

\begin{smallpage}{3SPN.2C excluded volume interaction}<white>
  \begin{equation}
    \label{eq:dna_3spn2c_nonlocal_exv}
    U_{exv} = \sum_{i<j}
    \begin{cases}\displaystyle
      \epsilon_r\bigg[ \Big(\frac{\sigma_{ij}}{r_{ij}} \Big)^{12} - 2 \Big(\frac{\sigma_{ij}}{r_{ij}} \Big)^6 \bigg]+ \epsilon_r & r_{ij} < \sigma_{ij},  \\
      0 & r_{ij} > \sigma_{ij}.
    \end{cases}
  \end{equation}
  \tcblower
  \begin{itemize}
  \item $i, j$ are all pairs of CG particles that are \emph{not} in the
    following list:
    \begin{itemize}
    \item bonded (involved in bonds, angles, or dihedrals);
    \item particles in the neighboring nucleotides;
    \item Watson-Crick base pairs.
    \end{itemize}
  \item $\epsilon_{r} = 1.0$ kJ/mol.
  \item $\displaystyle \sigma_{ij} = \frac{1}{2}\big( \sigma_i + \sigma_j
    \big)$, where $\sigma_i$ ($\sigma_j$) is listed below:
  \end{itemize}
  \begin{center}
    \begin{tabular}{lc}
      \toprule
      Particle Type    & $\sigma$ ($\angstrom$) \\
      \midrule
      P  &  4.5 \\
      S  &  6.2 \\
      A  &  5.4 \\
      C  &  6.4 \\
      G  &  4.9 \\
      T  &  7.1 \\
      \bottomrule
    \end{tabular}
  \end{center}
\end{smallpage}

\subsubsection{Electrostatic Interactions}
\label{sec:dna_3spn2c_potential_ele}

\begin{smallpage}{3SPN.2C electrostatic interaction}<white>
  \begin{equation}
    \label{eq:dna_3spn2c_nonlocal_ele}
    U_{ele} = \sum_{i<j}^{n_{ele}}\frac{q_i q_j e^{-r_{ij}/\lambda_D}}{4\pi \epsilon_0 \epsilon(T, C) r_{ij}}.
  \end{equation}
  \tcblower
  \begin{itemize}
  \item Particles involved:
    \begin{itemize}
    \item all non-neighboring phosphates.
    \end{itemize}
  \item $q_{i} = -0.6 e_c$.
  \item The Debye length $\displaystyle \lambda_D = \sqrt{\frac{\epsilon_0 \epsilon(T, C)}{2\beta
        N_A e_c^2 I}}$, where $\beta=( k_B T )^{-1}$, $N_A$ is Avogadro's
    number, $I$ is ionic strength, $T$ is temperature, and $C$ is the molarity of NaCl.
  \item The solution dieletric permittivity $\displaystyle \epsilon(T, C) = \epsilon(T)a(C)  $, where:
    \begin{itemize}
    \item $\epsilon(T) = 249.4 - 0.788T + 7.20\times10^{-4} T^2 $.
    \item $a(C) = 1.000 - 0.2551 C + 5.151\times10^{-2} C^2 - 6.889\times 10^{-3} C^3 $.
    \end{itemize}
  \end{itemize}
\end{smallpage}


% This file describes the general structure of some of our sm_sir models.
% Note that it is possible to construct models in many different ways using the sm_sir code.
% Therefore, this description should be used with caution, because it only describes one possible model configuration.

\section{Model Structure}

\subsection{General features}

Our COVID-19 model is a series of compartments representing transitions between states relevant to infection with SARS-CoV-2 and onward transmission of this virus.
Unlike previous iterations of this model (including our past publications on the epidemics in the Philippines \cite{caldwell-2021-a}, Malaysia \cite{jayasundara-2021} and Victoria, Australia \cite{trauer-2021-a}), our current model considers only states relevant to transmission.
Hospitalisation, admission to ICU and death are no longer represented as explicit model states, but are now calculated from model outputs through a convolution process.
The rationale for this approach is that the explicitly modelled states are reserved for the representation of processes relevant to epidemic transmission dynamics only.
Any other relevant outcomes are then calculated from the quantities that are tracked during the process of numerically solving the dynamic system (``derived outputs''), including through convolutions.
It should be noted that the process of calculating derived outputs is done after each model iteration, such that these quantities can still be compared to empirically observed outcomes and so used for calibration.

\subsection{Compartments}
Model compartments represent sequential progressions through the processes of infection with, progression through and recovery from the phases of SARS-CoV-2.
Reinfection is permitted in our model code structure, which is represented as transition from the recovered compartments back to the first infected compartment.
The following compartments are implemented:
\begin{itemize}
    \item Susceptible
    \begin{itemize}
        \item Persons never previously infected with SARS-CoV-2 during the model simulation period
    \end{itemize}
    \item Latent
    \begin{itemize}
        \item Persons recently infected with SARS-CoV-2, but not yet infectious
        \item This phase is divided into two sequential compartments
    \end{itemize}
    \item Infectious
    \begin{itemize}
        \item Persons with active COVID-19 who are potentially infectious to others
        \item This phase is divided into two sequential compartments
        \item The second of these two sequential compartments includes any persons who are identified through the health system and asked to isolate
        \item The infectiousness of the second compartment will be reduced to capture the effect of case isolation
    \end{itemize}
    \item Recovered
    \begin{itemize}
        \item Persons recovered from COVID-19 during the model simulation period
        \item This phase is divided into two sequential compartments
        \item Reinfection from these compartments is permitted and occurs at a different rate for the two sequential phases (if the reinfection rate is greater than zero)
        \item This compartment retains the stratification by strain (or variant of concern (``VoC'')), with the strain of the last infection episode used for classification
    \end{itemize}
\end{itemize}


\section{Event Selection}
\label{sec:eventselection}

The baseline dataset for the lep-had and had-had channels is taken from the \htt coupling analysis with full Run 2 data, where the event selection is performed level by level. First at preselection level, events are selected by High-level Trigger (HLT) requirements according to the $\tau$ decay channels (\taulh and \tauhh), where HLT is a refined trigger that conducts a very detailed analysis using the data in specific layers or regions of the detector\footnote{\url{https://atlas.cern/discover/detector/trigger-daq}}. After preselection, events are categorized by the signal region and control region.

The MMC is an advanced likelihood-based algorithm taking the unmeasurable mass of neutrinos into account using the missing transverse energy (MET, \MET)[Elagin:2010aw]. The reconstructed mass \MMC distribution in \ditau system peaks at 125 GeV and 82 GeV approximately, corresponding to the mass of Higgs and Z boson respectively (Fig.~\ref{fig:selection:MMC}).

Signal region (SR) is defined to be in a window in window 110 GeV < \MMC < 150 GeV to select the Higgs boson produced by vector boson fusion (VBF) and the other three main production modes (ggF, VH and ttH). The VBF category in signal region requires that there are at least two jets with $p_T$> 30 GeV and > 70 GeV respectively. A cut point of BDT (Boost Decision Tree) is set for enhancing the ratio of VBF process over ggF and \ztt +jets processes, and VBF region is therefore separated into VBF\_0 (BDT > -0.1) and VBF\_1 (BDT(VBF) < -0.1) regions. The boost category in SR selects the events that failed the VBF requirements, that is, the events from other three main Higgs production modes. Two boost categories are defined to target topologies where the Higgs boson is recoiling from a jet. The boost tight category is defined by requiring $\Delta R<= 1.5$ and $p_T(H) >$140GeV. Events failing this criteria are assigned to the boost loose category ($\Delta R > 1.5$ and $p_T(H) < $140GeV).

Control region for \ztt (ZCR) selects the events in window 60 GeV < \MMC < 110 GeV, which is used for extracting the \ztt normalisation in the fit (ZCR 0), as well as for estimating the \phistarCP shape uncertainty in \ztt events (ZCR 1). The preselection, VBF and boost regions for ZCR share the same requirements except with the \MMC window.
%
\begin{figure}[h!]
	\begin{center}
		\begin{tabular}{ccc}
			\subfigure[hh]{\includegraphics[width=.3\textwidth]{plot_ditau_mmc_mlm_m_hh_preselection.pdf}} \subfigure[lh]{\includegraphics[width=.3\textwidth]{plot_ditau_mmc_mlm_m_l1p_preselection.pdf}}
		\end{tabular}
	\end{center}
	\caption{MMC distributions in the preselection region in the hadhad and lephad channels.}
	\label{fig:selection:MMC}
\end{figure}
%


\documentclass{beamer}
\usepackage{blindtext}
\usepackage{graphicx}

\title[Short Title]{Longer Full Sample Title}
\subtitle{Sample Subtitle}
\author{Ben Morcos}
\date{October 15, 2018}

\usetheme{SimplePurple}
\begin{document}

	\frame {
		\titlepage
	}

	\section{First Section}

	\frame {
		\frametitle{Mathmode}
		This is the quadratic equation:
		\begin{align}
			\frac{-b \pm \sqrt{b^2 - c}}{2a}
		\end{align}
	}
	\frame{
		\frametitle{Some bullet points}
		\framesubtitle{And a list!}
		\begin{itemize}
			\item 1
			\begin{itemize}
				\item 1.1
			\end{itemize}
			\item 2
			\item 3
		\end{itemize}

		Text between? \\

		Why not.

		\begin{enumerate}
			\item A thing
			\begin{enumerate}
				\item A related thing
				\item \alert{An important thing}
			\end{enumerate}
			\item Another thing
		\end{enumerate}
	}

	\section{Another Section}

	\frame{
	    \frametitle{Paragraph Content}
	    \framesubtitle{Latin is cool}
	    \blindtext
	}

	\frame{
		\frametitle{Figures}
		\framesubtitle{With caption}
		\begin{figure}
			\centering
	    	\includegraphics[height=0.6\textheight]{example-image}
	    	\vspace{-10pt}
	    	\caption{Built in examples are \alert{\textbf{genius}}}
	    \end{figure}
	}
\end{document}


\section{The output of the simulator}
\label{sec:mskoutput}

Any report produced by the simulator contains the following elements:
\begin{itemize}
\item General information about the experiment
\item Statistics for each selected performance measure
\end{itemize}

\subsection{The contents of a report}

General information includes the names of the parameter files, the
date at which the experiment started, the CPU time required to carry
out the complete simulation, the sample size, etc.  This information
is presented in the form of one (key: value) pair per line.
The main part of the report contains statistics for performance
measures.

Several quantities are computed during the simulation: event
counts, average times, and integrals.  Each time a call exits
the system, counters are updated to keep track of various quantities.
All these random variables can be regrouped into a random vector
$\boldX=(X_0,\ldots,X_{d-1})$ we will call
an \emph{observation}.  Using some experimental techniques
presented in section~\ref{sec:mskexp}, the simulator can obtain $n$
copies of $\boldX$ which is called a \emph{sample}.  Statistics are
computed by applying some functions on this sample
$\boldX_0,\ldots,\boldX_{n-1}$, where $\boldX_r=(X_{0, r}, \ldots,
X_{d-1, r})$ is the $r$th observation.
Let
\[\bar{\boldX}_n=(\bar X_{0, n}, \ldots, \bar X_{d-1, n})=\frac1n\sum_{r=0}^{n-1}\boldX_r\]
the \emph{average} of $\boldX_r$,
which is used to estimate the expected value of $\boldX$, denoted as
\[\E[\boldX]=(\E[X_0], \ldots, \E[X_{d-1}]).\]
The vector
$\bar{\boldX}_n$ is an unbiased estimator of $\E[\boldX]$ if the
observations are independent and identically distributed (i.i.d.).
We are also interested in functions $g(\boldX)$ such as ratios.
The function of averages $g(\bar{\boldX}_n)$ is used to estimate the
function
of expectations $g(\E[\boldX])$.  This estimator is biased, unless
$g(\boldX)$ is a linear function of $\boldX$.
Subsection~\ref{javadoc:umontreal.iro.lecuyer.contactcenters.app.PerformanceMeasureType}
explains how these quantities are regrouped in matrices for easier reporting.

For each performance measure, i.e., element $\E[X_j]$ or function
$g(\E[\boldX])$, the simulator outputs the following
statistics (all statistics are of course undefined when $n=0$):
\begin{description}
\item[Minimum] The minimal value of $X_j$ among all observations.  No
  minimum is available for functions of multiple averages.
\item[Maximum] The maximal value of $X_j$ among all observations.  No
  maximum is available for functions of multiple averages.
\item[Average] The average $\bar X_{j, n}$, or function of averages
  $g(\bar{\boldX}_n)$, of the
  observations.
\item[Standard deviation] The sample standard deviation of the observations,
  i.e., $\sqrt{\Var[X_j]}$ or $\sqrt{n\Var[g(\bar{\boldX}_n)]}$.  This
  corresponds to the asymptotic standard deviation in the case of a
  function of several averages.
  The value is undefined if $n<2$.
\item[Confidence interval] An interval $[a, b]$ containing $\E[X_j]$ (or
  $g(\E[\boldX])$) with probability $1-\alpha$, where $1-\alpha$
  is a \emph{confidence level} that can be adjusted via a simulation
  parameter.
  The interval is computed using the normality assumption.
  The value is undefined if $n<2$.
\end{description}
Using the element \texttt{printed\-Stat\-Params} in the parameters of
the report, %(see
%section~\ref{javadoc:umontreal.iro.lecuyer.contactcenters.app.PrintedStatParams})
one can decide which performance measures appear in the report, and
determine if all the statistics or only the averages are needed.

We now explain the last two statistics in more details.
Let
\[
\boldS_n = \frac1{n-1}\sum_{r=0}^{n-1} (\boldX_r -
\bar{\boldX}_n)^\tr(\boldX_r - \bar{\boldX}_n),
\]
be the \emph{sample covariance} of the $\boldX_r$'s,
which is used to estimate the covariance matrix
\[\boldSigma = \E[(\boldX - \E[\boldX])^\tr(\boldX - \E[\boldX])].\]
The simulator computes only parts of this sample covariance matrix, in
particular
elements $(j, j)$ estimating $\Var[X_j]=n\Var[\bar X_{j, n}]$,
which can be used to estimate the error on $\bar X_{j,
  n}$.
% To estimate the error on $\bar X_{j, n}$ for $j=0,\ldots,d-1$, the
% simulator computes the \emph{sample variance}
% \[S_{X_j, n}^2=\frac1{n-1}\sum_{r=0}^{n-1} (X_{j, r} - \bar X_{j,
%   n})^2\]
% which estimates the variance of the random variate $X_j$, defined as
% \[\Var(X_j)=\E[X_j^2] - \E[X_j]^2.\]

The sample variance is used to compute a confidence interval on the
true mean $\E[X_j]$ for any $j\in\{0, \ldots, d-1\}$.  Assuming that
$X_{j, r}$ follows the normal distribution,
\[\sqrt{n}(\bar X_{j, n} - \E[X_j])/S_{X_j, n}\]
follows the Student-$t$ distribution with $n-1$ degrees of freedom.
Here, $S_{X_j, n}$ is the sample standard deviation of $X_j$.
If the desired probability that this (random)
interval covers the true mean $\E[X_j]$ (a constant) is $1-\alpha$,
the interval is given by $\bar X_{j, n}\pm t_{n-1, 1-\alpha/2}S_{X_j,
  n}/\sqrt{n}$, where $t_{n-1,1-\alpha/2}$ is the inverse of the
Student-$t$ distribution function with $n-1$ degrees of freedom,
evaluated at $1-\alpha/2$.

Confidence intervals on functions of means are computed
using the delta theorem \cite{tSER80a}.
Here, we explain the special case of ratios used by the simulator.
One can refer to \cite{tSER80a,sLEC06a,iBUI05b} for the general case.
Let $(X,Y)$ be a random vector for which the simulator can
generate a sample $((X_0, Y_0), \ldots, (X_{n-1}, Y_{n-1}))$.  Let
$\bar X_n$ be the average for $X$ and $\bar Y_n$ the average for $Y$;
these quantities estimate $\mu_1=\E[X]$, and $\mu_2=\E[Y]$,
respectively.
Then, the function $\bar\nu_n=\bar X_n/\bar Y_n$
estimates the ratio of means $\nu=\mu_1/\mu_2$.  By a Taylor expansion
of the ratio of averages,
%if $(\bar X_n, \bar Y_n)$ is a multinormal vector,
the asymptotic variance of $\bar X_n/\bar Y_n$, i.e., the variance
when $n$ is large, is given by $\sigma^2/n$, where
\[\sigma^2=(\Var[X] + \nu^2\Var[Y] - 2\nu\Cov[X, Y])/\mu_2^2.\]
The variance
$\sigma^2$ can be estimated by using sample means, variances and covariance.
%as follows:
%\[\hat\sigma_n^2=(S_{X,n}^2+\bar\nu_n^2S_{Y,n}^2
%-2\bar\nu_nS_{XY, n})/\bar Y_n^2\]
%where $S_{X, n}$ estimates the variance of $X$, $S_{Y, n}$ estimates
%the variance of $Y$, and $S_{XY, n}$ estimates the covariance of $X$
%and $Y$.
%\[S_{XY, n}=\frac1{n-1}\sum_{r=0}^{n-1} (X_r - \bar X_n)(Y_r - \bar
%Y_n).\]

Assuming that $(\bar X_n, \bar Y_n)$ follows the multinormal
distribution,
the confidence interval on the ratio of expectations with confidence
level $1-\alpha$ is given by $\bar\nu_n\pm
z_{1-\alpha/2}\sigma_n/\sqrt{n}$, where
$\Phi(z_{1-\alpha/2})=1-\alpha/2$, $\Phi(x)$ being the distribution
function of a standard normal variable.

Note that each confidence interval is computed for a single mean or
ratio of means, independently of other performance measures of the
system.  As a result, if $d>1$ output values are analyzed
simultaneously, the confidence level of the $d$ intervals
is $1-d\alpha<1-\alpha$.
The confidence level for individual performance measures must then be
higher to get the same overall confidence level.

The value of $0/0$ is usually undefined and assigned the NaN (Not a Number) flag.
However, in some ratios, $0/0$ can have some meaning.
In our simulator, $0/0$ is defined as 0 for most performance measures except service level.
For example, if there is no arrival, it is sensible to set the
abandonment ratio and the average waiting time to 0, and
the service level to 1.

For expectations of ratios, $0/0$ observations are not collected,
because fixing an arbitrary value would result in biased estimators.  As a
result, the average is made on less observations, and the average is
NaN if all observations are rejected.

\subsection{The format of the report}
\label{sec:reportformat}

At this moment, four file formats are supported for reports:
XML, plain text, \LaTeX, and
Microsoft Excel.
The first format is intended to be readable by programs while
the last three formats are human-readable.

\subsubsection{Program-readable format}

The XML format is intended to be parsed by Java programs
using the ContactCenters library.
It could also be parsed and processed by any other program
compatible with XML.
Produced XML output files have root element
\texttt{Contact\-Center\-Sim\-Results}, in
namespace URI
\path{http://www.iro.umontreal.ca/lecuyer/contactcenters/app}.
The XML schema for output files can be found in the \texttt{schemas}
subdirectory of ContactCenters, and HTML documentation is available
in \path{doc/schemas}.
%The binary format, using Java
%serialization, may be faster to read, but the XML format may be
%more easily
%reusable by other programs not using ContactCenters, even not using
%Java.

Alternatively, the program can export to a XML file
and compress the file using GZip to save
disk space.
This can be done by giving a file name with the \texttt{.xml.gz}
extension rather than \texttt{.xml}.

\subsubsection{Plain text}

When exporting to plain text, the simulator uses the
platform-default character encoding and line separator.
As a result, the created text file can be opened in any text editor
such as Notepad, GNU Emacs, etc.
After the general information, the report contains a table of summary
results, e.g., the performance measures concerning every call type,
agent group, and period.  Then, for each group of performance
measures, a table of detailed results appear in the report.
Note that the formatting of numbers is locale-specific.  For example,
if the current locale is set to French, the decimal separator
is the comma while the separator is a period for the US locale.

The \LaTeX\ output, which is also plain text but with formatting
instructions,
is intended to be processed by \LaTeX\ to generate printable tables of
results.

\subsubsection{Microsoft Excel}

The Microsoft Excel format is used to transfer results to spreadsheets
for further analysis and reporting.
One is not restricted to Microsoft Excel since
many other spreadsheets, e.g., OpenOffice.org and KOffice,
can read and write Excel files.

The Excel report is divided in at most three sheets.
The first sheet provides summary information only: the general
information, and summary statistics, i.e., statistics for aggregate
performance measures.
The latter are split in two groups: source-related (or call-related)
statistics and destination-related (agent-related and waiting
queue-related) statistics.
The second sheet provides a detailed report for all time-aggregate
performance measures.  This includes, e.g., the service level for
each individual call type but not for each period.
The last sheet contains a detailed report for all performance
measures, including statistics for individual periods.

\subsubsection{Localized format for reports}

Some aspects of the reports produced by \texttt{mskcallcentersim}
depend on the host environment of the JVM.
These aspects include the character encoding of the report,
the line delimiters, strings describing types of performance measures,
and the format of the numbers.
The last two elements are influenced by the locale of the virtual
machine which executes the simulator, which corresponds to the default
locale of the host environment.
At this moment, only English and French are supported as languages for
reports. If the current locale corresponds to another language,
all text in the report will be in English, with locale-specific
formatting for numbers.

Some of these aspects can be customized using OS-specific options.
For example, calling \texttt{LC\_ALL=en\_US.UTF-8 mskcallcentersim}
launches the simulator with the US English locale, and UTF-8 encoding;
this is the default for most UNIX/Linux distributions.
However, on other operating systems, such as Microsoft's Windows,
there is no built-in way to alter the default locale for a given
program without changing the system-wide regional settings.
However, Java properties can be changed to alter the default locale,
and other parameters, in a platform-independent way.
Table~\ref{tab:repjavaprop} lists such properties.
The properties can be modified through the \texttt{-D} JVM option.
For example, setting the \texttt{CCJVMOPT} environment variable
to \texttt{-Duser.language=en} sets the language of reports to
English.

\begin{table}
\caption{Most common Java properties affecting reporting}
\label{tab:repjavaprop}

\centering\begin{tabular}{|l|ll|}\hline
Property & Action & Sample value \\ \hline
\texttt{user.language} & Language of strings in reports & \texttt{en}
\\
\texttt{user.region} & Region affecting number and date format &
\texttt{US} \\
\texttt{file.encoding}  & Character encoding for reports &
\texttt{UTF-8} \\
\hline
\end{tabular}
\end{table}