%!TEX root = ../thesis.tex
%*******************************************************************************
%*********************************** Statistics *********
%*******************************************************************************

\chapter{Statistical data analysis}\label{ch:statistics}

\graphicspath{{chapter-statistics/Figs/Vector/}{chapter-statistics/Figs/}}

In \gls{hep}, statistical models are used to quantify the correspondence between theoretical predictions and the experimental observations.
This chapter introduces the statistical concepts, methods and formulae used for statistical inference in this thesis.
A frequentist approach is employed, interpreting probabilities as the frequencies of the outcomes of repeatable experiments that may either be real, based on computer simulations, or originate from mathematical abstraction~\cite{pdg2020}.
The following description largely adheres to \references\cite{Cranmer:2015nia, Cowan:2010js}.

\section{The likelihood function}\label{sec:likelihood_function}

In measurements in \gls{hep}, a \textit{statistical model} $f(\makemebold{x}\vert\makemebold{\phi})$ is a parametric family of \glspl{pdf} describing the probability of observing data $\makemebold{x}$ given a set\footnote{Sets of parameters (as opposed to single parameters) will henceforth be written using bold face.} of model parameters $\makemebold{\phi}$.
The latter typically describe parameters of the physical theory or unknown detector effects. The \textit{likelihood function} $L(\makemebold{\phi})$ is then numerically equivalent to $f(\makemebold{x}\vert\makemebold{\phi})$ with $\makemebold{x}$ fixed.
As opposed to the \gls{pdf} $f(\makemebold{x})$, describing the value of $f$ as a function of $\makemebold{x}$ given a set of fixed parameters $\makemebold{\phi}$, the likelihood refers to the value of $f$ as a function of $\makemebold{\phi}$ given a fixed\footnote{This important difference is why the likelihood is written here as $L(\makemebold{\phi})$ instead of the equally common $L(\makemebold{x}\vert\makemebold{\phi})$.} value of $\makemebold{x}$.

Searches for \gls{bsm} physics are often\footnote{While searches for \gls{bsm} physics using unbinned distributions also exist, only binned searches are considered in the following.} centred around the measurement of several disjoint binned distributions, called \textit{channels} $c$, each associated with different event selection criteria yielding observed event counts $\makemebold{n}$.
In such counting experiments, where each event is independently drawn from the same underlying distribution, each bin is described by a Poisson term.
The Poisson probability to observe $n$ events with an expectation of $\nu$ events, $\mathrm{Pois}(n\vert\nu)$, is given by
\begin{equation}
	\mathrm{Pois}(n\vert\nu) = \frac{\nu^n}{n!}\mathrm{e}^{-\nu}.
\end{equation}
The expectation $\nu_{cb}$ in each channel $c$ and bin $b$ is a sum over the set of physics processes considered, called \textit{samples} in the following,
\begin{equation}
	\nu_{cb} = \sum_{s\in\mathrm{samples}}\nu_{csb}(\makemebold{\eta},\makemebold{\chi}),
\end{equation}
where $\nu_{csb}$ is the expected sample rate in a given bin of a given channel. The sample-wise rates are in general a function of the model parameters $\makemebold{\phi}$ that can be either \textit{free parameters} $\makemebold{\eta}$ or \textit{constrained parameters} $\makemebold{\chi}$. Possible modifications of the expected sample rates due to model parameters are considered to be either multiplicative or additive changes to the nominal estimate $\nu_{csb}^0$ of the form
\begin{equation}
	\nu_{csb}(\makemebold{\eta},\makemebold{\chi}) = \left(\prod_i f^i_{csb}(\makemebold{\eta},\makemebold{\chi}) \right)\left(\nu^0_{csb} + \sum_j {\upDelta^j_{csb}(\makemebold{\eta},\makemebold{\chi})} \right).
\end{equation}
Here, $\makemebold{f}(\makemebold{\phi})$ and $\makemebold{\upDelta}(\makemebold{\phi})$ are the multiplicative and additive \textit{rate modifiers}, respectively, modifying the nominal estimates. Although in practice often only a function of a single model parameter, the rate modifiers can in general be a function of a set of model parameters.

Free parameters directly determined by the data observations are called \textit{normalisation factors}.
The constrained parameters represent the systematic uncertainties considered in the model, which---in frequentist statistics---have fixed but unknown true values.
The degree to which they cause a deviation of the expected event rates from the nominal event rates is limited through \textit{constraint terms} $c_{\makemebold{\chi}}(a_{\makemebold{\chi}}\vert\makemebold{\chi})$ that can be viewed as \textit{auxiliary measurements} with global observed data $\makemebold{a}$.

For a given observation $\makemebold{x} = (\makemebold{n},\makemebold{a})$ of observed events $\makemebold{n}$ and auxiliary data $\makemebold{a}$, the likelihood then reads
\begin{equation}
	L (\makemebold{\eta}, \makemebold{\chi}) = \prod_{c\in\mathrm{channels}} \prod_{b\in\mathrm{bins_c}} \mathrm{Pois}(n_{cb}\vert\nu_{cb}(\makemebold{\eta},\makemebold{\chi})) \prod_{\chi\in\makemebold{\chi}}c_\chi (a_\chi\vert\chi),
\end{equation}
where, given a certain integrated luminosity, $n_{cb}$ and $\nu_{cb}$ refer to the corresponding observed and expected rate of events, respectively~\cite{ATL-PHYS-PUB-2019-029}.
Most of the systematic uncertainties are so-called \textit{interpolation parameters} $\makemebold{\alpha}$ representing either normalisation uncertainties or correlated shape uncertainties.
Their constraint terms $c_{\makemebold{\alpha}}(a_{\makemebold{\alpha}}\vert\makemebold{\alpha})$ are parametrised by a Gaussian\footnote{Other parameterisations are also possible and discussed in \reference\cite{Cranmer:1456844}, but not used in the following.} with mean $a = 0$ and variance $\sigma = 1$, with $\alpha = 0$ representing the nominal value.
The \textit{up} and \textit{down} variations are then given by $\alpha=\pm 1$, thereby representing $\pm 1\sigma$ variations.
The impact of any given value of the parameter on the event rates is subsequently evaluated through polynomial interpolation and exponential extrapolation\footnote{Different interpolation and extrapolation strategies are discussed in \reference\cite{Cranmer:1456844} but not mentioned herein as they will not be used in the following.}, a method that avoids discontinuous first and second derivatives at $\alpha = 0$ and ensures positive values for the predicted event rates~\cite{Cranmer:1456844}.

Sample rates derived directly from theory calculations (\ie \gls{mc} simulation), are scaled to the integrated luminosity corresponding to the observed data.
As discussed in~\cref{sec:lumi_datataking}, the integrated luminosity is itself a measurement that is subject to uncertainties, requiring an additional constraint term in the likelihood.
It is parametrised by a Gaussian with mean corresponding to the nominal integrated luminosity measurement and standard deviation equal to the integrated luminosity measurement uncertainty.
Uncertainties arising from the finite size of the \gls{mc} datasets used to derive estimated event rates are modelled by bin-wise scale factors $\gamma_b$.
The constraint terms are Gaussian distributions with central value equal to unity and standard deviations calculated from the individual statistical uncertainties of the samples defined in the respective channel.

As the event rate in a given bin can depend on multiple parameters, and likewise, a single parameter can affect the expected event rate in multiple bins across different channels, correlations between the model parameters $\makemebold{\phi}$ can occur.

The above prescription for building binned likelihoods is called the \textsc{HistFactory} template~\cite{Cranmer:1456844}. In this work, two independent implementations of the \textsc{HistFactory} template are used.
The first implementation, predominantly used in~\cref{part:simplified_model_analysis}, relies on \textsc{RooFit}~\cite{RooFit:2003ir} (using the \texttt{Minuit}~\cite{James:310399} package) and \textsc{RooStats}~\cite{RooStats:2010pm} for model parameter estimation and hypothesis tests, and is fully integrated into the \textsc{Root} data analysis framework~\cite{ROOT:1997pa,ROOT-2}. The user interface and the steering of statistical fits, as well as the bookkeeping of their results, is provided by \textsc{HistFitter}~\cite{HistFitter:2014wma}.
The second implementation, used in~\cref{part:reinterpretation}, makes use of \texttt{pyhf}~\cite{pyhf_joss,pyhf}, a recent pure-\texttt{python} implementation of \textsc{HistFactory} that is independent of the \textsc{Root} environment.
The \texttt{pyhf} implementation of \textsc{HistFactory} relies on \textsc{Numpy}~\cite{numpy} and uses computational graph libraries like \textsc{PyTorch}~\cite{pytorch}, \textsc{TensorFlow}~\cite{tensorflow2015-whitepaper} and \textsc{JAX}~\cite{jax2018github} to significantly speed up the parameter estimation process by leveraging the computational advantages of tensor algebra and automatic differentiation.

Apart from separating the model parameter set into free and constrained parameters $\makemebold{\phi} = (\makemebold{\eta},\makemebold{\chi})$, a separate partition $\makemebold{\phi} = (\makemebold{\psi},\makemebold{\theta})$ is frequently used in the context of hypothesis testing.
Here, $\makemebold{\psi}$ are so-called \textit{parameters of interests} of the model for which hypothesis tests are performed, and $\makemebold{\theta}$ are \textit{nuisance parameters} that are not of immediate interest but need to be accounted for to correctly model the data.
In the search presented in this work, the only \gls{poi} is the \textit{signal strength} parameter $\mu$, representing the ratio of the signal process cross section to its reference cross section as expected from theory.
The expected event rate $\nu_i$ in each bin $i$ can then be parametrised through
\begin{equation}
	\nu_b = \mu S_b + B_b,
\end{equation}
where $S_b$ and $B_b$ are the bin-wise expected signal and background rates, respectively. Fixing $\mu = 0$ thus yields an expected event rate containing only \gls{sm} processes, which is why this is also called a \textit{background-only} configuration. Setting $\mu = 1$ represents a \textit{signal-plus-background} description at nominal signal cross section. Scanning multiple values of $\mu$ allows to set limits on the visible cross sections of the signal models considered in the search.

\section{Parameter estimation}

Given a likelihood $L(\makemebold{\phi})$ for a fixed set of observations $\makemebold{x}$, a measurement can be understood as a parameter estimation. In general, an estimator $\hat{\phi}$ is a function of the observed data used to estimate the true value of the model parameter $\phi$.

In particle physics, the most commonly used estimator is the \gls{mle}. The \glspl{mle} for the model parameters $\makemebold{\hat{\phi}}$ are defined to be the parameter values that maximise $L(\makemebold{\phi})$, or equivalently, maximise $\ln{L(\makemebold{\phi})}$ and minimise $-\ln{L(\makemebold{\phi})}$. The logarithm of the likelihood is used for computational reasons, as it not only reduces the computational complexity by avoiding exponentials and products, but also avoids potential problems arising from finite floating point precision. As the logarithm is a monotonically increasing function, $\ln{L(\makemebold{\phi})}$ has maxima at the same parameter values as ${L(\makemebold{\phi})}$. The negative logarithm of the likelihood is chosen in order to stick to the convention of optimisers in statistical packages typically minimising the result of a \textit{loss function}.

The \glspl{mle} $\makemebold{\hat{\phi}}$ can, in general, be found by solving the system of equations
\begin{equation}
 \frac{\uppartial \ln L}{\uppartial\phi_i} = 0,
\end{equation}
where the index $i$ runs over all parameters. Due to the complexity of the likelihood, a solution typically needs to be found numerically using minimisation algorithms. In the following, the parameter estimation is referred to as a \textit{fit} of the model to data, and the maximum likelihood estimates of the parameters are consequently called \textit{best-fit values}.

\section{Statistical tests}

In addition to estimating the values of model parameters, searches for \gls{susy} are naturally interested in claiming discovery (or exclusion) of hypothesised signal models.
In the frequentist approach, this can be formulated in terms of hypothesis tests, evaluating a \textit{null hypothesis} $H_0$ against an \textit{alternative hypothesis} $H_1$, with the goal of rejecting the null hypothesis.
For discovering a new signal process, $H_0$ is defined to describe only known \gls{sm} processes and thus called \textit{background-only} hypothesis.
The alternative hypothesis $H_1$ is then the \textit{signal-plus-background} hypothesis describing both \gls{sm} background processes as well as the signal process considered. When excluding a signal model, the signal-plus-background hypothesis takes over the role of $H_0$ and is tested against the background-only hypothesis.

The degree of agreement of observed data with a certain hypothesis $H$ is quantified by calculating a $p$-value, representing the probability of finding data of greater or more extreme incompatibility under assumption of $H$. The hypothesis can then be considered to be excluded if its observed $p$-value is below a specified threshold. It is common to convert the $p$-value into a \textit{significance} $Z$, defined in such a way that a Gaussian distributed observable with measured value $Z$ standard deviations above its mean gives a one-sided upper tail probability equal to $p$. This yields the expression
\begin{equation}
	Z = \upPhi^{-1}(1-p),
	\label{eq:significance}
\end{equation}
where $\upPhi^{-1}$ is the quantile of the standard Gaussian. In \gls{hep}, claiming discovery of a signal conventionally requires a significance of at least $Z=5$. If the significance is lower but still $Z>3$, it is classified as a hint or evidence. For exclusion of a signal hypothesis at 95\% confidence level, a $p$-value of 0.05, \ie $Z = 1.64$, is required~\cite{Cowan:2010js}.

The $p$-values are calculated using a \textit{test statistic} that parameterises the compatibility between the hypothesis and data in a single value. At the LHC experiments, the test statistics used for hypothesis testing are based on the \textit{profile likelihood ratio} $\lambda(\mu)$, defined to be
\begin{equation}
	\lambda(\mu) = \frac{L(\mu,\makemebold{\hat{\hat{\theta}}}(\mu))}{L(\hat{\mu},\hat{\makemebold{\theta}})},
	\label{eq:profile_likelihood}
\end{equation}
where the \glspl{cmle} $\makemebold{\hat{\hat{\theta}}}$ are the values of $\makemebold{\theta}$ that maximise the likelihood with $\mu$ fixed. The distribution of the profile likelihood ratio depends explicitly on $\mu$, and implicitly on $\makemebold{x} = (\makemebold{n},\makemebold{a})$, but is asymptotically  (\ie in the limit of a large number of events) independent of the nuisance parameters $\makemebold{\theta}$\footnote{Eliminated by choosing specific values of the nuisance parameters for a given $\makemebold{x}$ and $\mu$, often referred to as \textit{profiling}.} in the case where the tested value of $\mu$ is the true value $\mu'$~\cite{Cranmer:2015nia}. The asymptotic independence from $\makemebold{\theta}$ follows from Wilks' theorem~\cite{wilks1938} and is one of the main motivations for using the profile likelihood ratio, as it avoids the problem of having to compute $p$-values for all possible values of $\makemebold{\theta}$. A generalisation to tested values of $\mu$ not corresponding to the true value $\mu'$ can be derived using Wald's theorem~\cite{wald10.2307/1990256}, allowing to obtain the distribution $f(\lambda(\mu)\vert \mu',\makemebold{\theta})$. The profile likelihood ratio takes values between 0 and 1, with $\lambda(\mu) = 1$ corresponding to cases where the tested value of $\mu$ is in good agreement with the observed data. In \cref{eq:profile_likelihood}, the nuisance parameters result in a broadening of the profile likelihood distribution, reflecting the loss of information about $\mu$ due to systematic uncertainties~\cite{Cowan:2010js}.

As the rate of signal processes considered in the following is in general non-negative, an estimator for $\mu$ should satisfy $\hat{\mu}\geq 0$. In order to avoid the formal complications of having a boundary at $\mu = 0$, it is convenient to consider an effective estimator $\hat{\mu}$ that is allowed to become negative, provided that the respective Poisson terms for $\mu S_b + B_b$ remain positive. Imposing a constraint equivalent to requiring $\mu \geq 0$ on the test statistic itself, leads to the alternative definition of the profile likelihood as
\begin{equation}
	\tilde{\lambda}(\mu)=
\begin{cases}
     \frac{L(\mu,\makemebold{\hat{\hat{\theta}}}(\mu))}{L(\hat{\mu},\hat{\makemebold{\theta}})}, & \hat{\mu} \geq 0,\\
     \frac{L(\mu,\makemebold{\hat{\hat{\theta}}}(\mu))}{L(0,\makemebold{\hat{\hat{\theta}}}(0))},              & \hat{\mu} < 0,
\end{cases}
\label{eq:lambda_tilde}
\end{equation}
where $\makemebold{\hat{\hat{\theta}}}(0)$ and $\makemebold{\hat{\hat{\theta}}}(\mu)$ are the \glspl{cmle} of $\makemebold{\theta}$ given a signal strength parameter of 0 and $\mu$, respectively.

\subsubsection{Discovery}
For the important special case where $\mu = 0$ is tested in a model with $\mu \geq 0$, \ie discovery of a non-negative signal (rejection of the background-only hypothesis), the profile likelihood $\tilde{\lambda}(\mu)$ is used to build the test statistic
\begin{equation}
	q_0 = -2\ln{\tilde{\lambda}(0)} =
\begin{cases}
    -2\ln{\lambda(0)}, & \hat{\mu} \geq 0,\\
    0,              & \hat{\mu} < 0.
\end{cases}
\label{eq:disc_test_stat}
\end{equation}
This definition ensures that the background-only hypothesis is not rejected due to a downward fluctuation in data, causing $\hat{\mu} < 0$. In case more events are seen in data than expected based on the background-only hypothesis, \cref{eq:disc_test_stat} produces increasingly large values of $q_0$, corresponding to an increasing incompatibility between data and the background-only hypothesis. The $p$-value quantifying the disagreement between the $\mu = 0$ hypothesis and data can then be computed using
\begin{equation}
		p_0 = \int_{q_{0,\mathrm{obs}}}^{\infty}{f(q_0\vert 0)\diff q_0},
		\label{eq:disc_pvalue}
\end{equation}
with $q_{0,\mathrm{obs}}$ the observed value of the test statistic $q_0$ in data and $f(q_0\vert 0)$ the \gls{pdf} of $q_0$ under assumption of the background-only hypothesis. In the asymptotic limit~\cite{Cowan:2010js} with a single \gls{poi}, the test statistic $q_0$ can be  written as
\begin{equation}
	q_0 = \begin{cases}
    \hat{\mu}^2/\sigma^2, & \hat{\mu} \geq 0,\\
    0,              & \hat{\mu} < 0,
\end{cases}
\label{eq:test_stat_disc_asymptotic}
\end{equation}
where $\hat{\mu}$ has a Gaussian distribution with mean $\mu '$ and variance $\sigma^2$. In the case of $\mu'=0$, the \gls{pdf} of $q_0$ has the form of a half $\chi^2$ distribution with one degree of freedom, and its cumulative distribution is $F(q_0 \vert 0) = \Phi(\sqrt{q_0})$~\cite{Cranmer:2015nia}. Using \cref{eq:significance}, the $p$-value obtained with \cref{eq:disc_pvalue} can be expressed with the significance $Z_0$ as
\begin{equation}
	Z_0 = \sqrt{q_0}.
\end{equation}

\subsubsection{Exclusion and upper limits}
If the background-only ($\mu = 0$) hypothesis cannot be rejected, the hypotheses can be switched around and instead the signal-plus-background ($\mu = 1$) hypothesis can be tested against a hypothesis where signal events are produced at a rate smaller than $\mu$. For excluding the signal-plus-background hypothesis and setting upper limits on the signal strength $\mu$, the test statistic is defined as
\begin{equation}
	\tilde{q}_\mu =
\begin{cases}
    -2\ln{\tilde{\lambda}(\mu)}, & \hat{\mu} \leq \mu				\\
    0,              & \hat{\mu} > \mu
\end{cases} =
\begin{cases}
    -2 \ln{\frac{L(\mu,\makemebold{\hat{\hat{\theta}}}(\mu))}{L(\hat{\mu},\hat{\makemebold{\theta}})}}, & \hat{\mu} < 0,\\
    -2 \ln{\frac{L(\mu,\makemebold{\hat{\hat{\theta}}}(\mu))}{L(0,\makemebold{\hat{\hat{\theta}}}(0))}},              & 0 \leq \hat{\mu} \leq \mu, \\
    0  & \hat{\mu} > \mu.
\end{cases}
\label{eq:upper_limit_test_statistic}
\end{equation}
Setting $\tilde{q}_\mu = 0$ in the case where $\hat{\mu} > \mu$ ensures that an overfluctuation of data is not considered as evidence against the signal hypothesis. This is opposed to the definition of $q_0$, where an underfluctuation of data ($\hat{\mu} < \mu$) is not regarded to be evidence against the background-only hypothesis.
It is worth highlighting that the discovery test statistic $q_0$ in \cref{eq:disc_pvalue} is not just the special case of $\tilde{q}_\mu$ with $\mu=0$, but hinges on a different definition.

The $p$-value, quantifying the level of agreement between data and the tested value of $\mu$ is then given by
\begin{equation}
		p_\mu = \int_{\tilde{q}_{\mu,\mathrm{obs}}}^{\infty}{f(\tilde{q}_\mu\vert \mu)\diff \tilde{q}_\mu},
		\label{eq:pmu}
\end{equation}
where, as before, $\tilde{q}_{\mu,\mathrm{obs}}$ is the observed value of the test statistic in data and $f(\tilde{q}_\mu\vert \mu)$ is the \gls{pdf} of $\tilde{q}_\mu$ given the hypothesis $\mu$.
In the asymptotic limit~\cite{Cowan:2010js}, the test statistic $\tilde{q}_\mu$ can be written as
\begin{equation}
	\tilde{q}_\mu =
\begin{cases}
    \mu^2/\sigma^2 - 2\mu\hat{\mu}/\sigma^2, & \hat{\mu} < 0,\\
    (\mu-\hat{\mu})^2/\sigma^2,              & 0 \leq \hat{\mu} \leq \mu, \\
    0  & \hat{\mu} > \mu,
\end{cases}
\end{equation}
which yields for the significance $Z_\mu$ the expression
\begin{equation}
	Z_\mu =
\begin{cases}
    \sqrt{\tilde{q}_\mu}, & 0 < \tilde{q}_\mu \leq \mu^2/\sigma^2 \\
    \frac{\tilde{q}_\mu + \mu^2/\sigma^2}{2\mu/\sigma},              & \tilde{q}_\mu > \mu^2/\sigma^2 .
\end{cases}
\end{equation}

\section[CL$_s$ approach]{CL$\makemebold{_s}$ approach}\label{sec:cls_approach}

\begin{figure}
	\centering
	\begin{subfigure}[b]{0.46\linewidth}
		\centering\includegraphics[width=\textwidth]{cls_1}
		\vspace{-1.5em}
		\caption{\label{fig:cls_close}}
	\end{subfigure}\hfill
	\begin{subfigure}[b]{0.47\linewidth}
		\centering\includegraphics[width=\textwidth]{cls_2}
		\vspace{-1.5em}
		\caption{\label{fig:cls_far}}
	\end{subfigure}%
	\caption{Distribution of the \glspl{pdf} of the signal plus background (in orange) and background-only (in blue) models. The orange and blue coloured areas represent the $p_{s+b}$ and $p_{b}$ values, respectively. Figure~\subref{fig:cls_close} shows a case where both \glspl{pdf} are close together, while figure \subref{fig:cls_close} shows a case where they are well separated. Figures created by the author but based on \reference\cite{Cowan:2013pha}.}\label{fig:cls_method}
\end{figure}

In the CL$_{s+b}$ method, a signal-plus-background model is excluded if $p_{s+b} < \alpha$, where $\alpha$ is defined by the desired confidence level, typically $\mathrm{CL} = 1 - \alpha = 95\%$, and $p_{s+b}$ can be calculated using the test statistic $\tilde{q}_\mu$ (with $\mu = 1$) introduced in~\cref{eq:upper_limit_test_statistic}. If the experiment has very low sensitivity to a specific signal-plus-background model, \eg because the production cross section of the signal process is too low, the distribution of the test statistic of the signal-plus-background model will be very close to that of the background-only model. In case of an underfluctuation in data, the $\mu = 1$ model can then be falsely excluded, even though no sensitivity is expected. \Cref{fig:cls_method} illustrates this with a simple example. In fact, the exclusion of models to which the experiment has no sensitivity has a probability of at least $\alpha$~\cite{Cowan:2013pha}.

This problem can be remedied by adopting the CL$_s$ method~\cite{Read:2002hq}, altering the threshold for excluding a model in a way to avoid exclusion of models to which the experiment has very low sensitivity. The CL$_s$ value is defined as
\begin{equation}
	\mathrm{CL}_s = \frac{p_{s+b}}{1-p_b},
\end{equation}
where $p_b$ is the $p$-value of the background-only hypothesis\footnote{It is worth highlighting that $p_b$ is equal to $p_\mu$ from \cref{eq:pmu} with $\mu=0$. This is strictly different from $p_0$ in \cref{eq:disc_pvalue} as it relies on a different test statistic.}. If the distributions of the test statistics for the signal-plus-background and the background-only models are close to each other (as illustrated in~\cref{fig:cls_close}) a small value of $p_{s+b}$ due to an underfluctuation in data will entail a large value of $p_b$. Consequently, in the calculation of the CL$_s$ value, $p_{s+b}$ will be penalised by $1-p_b$ (that will be close to 0), resulting in CL$_s > p_{s+b}$, preventing the exclusion of the signal-plus-background model. Conversely, in the case where the two test statistics are well-separated (see~\cref{fig:cls_far}) and $p_{s+b} < \alpha$, then $p_b$ will also be small and thus CL$_s$ will be close to $p_{s+b}$ obtained by the frequentist approach.

\section{Asimov dataset}

Searches for \gls{bsm} physics are not only interested in the significance obtained using the dataset measured by the experiment, but also in the expected (or median) significance obtained for rejecting different values of $\mu$.
For example, for rejecting the $\mu = 1$ hypothesis, searches are interested in the expected significance obtained assuming data generated according to the $\mu = 0$ hypothesis.

The expected experimental sensitivity can be determined using an artificial dataset called the \textit{Asimov dataset}, defined such that \glspl{mle} of all parameters determined using Asimov data correspond to the true parameter values.
This is achieved by constructing a dataset where the number of events in each bin is exactly equal to the expected event rate in that bin. Using Asimov data, the Asimov likelihood $L_\mathrm{A}$ as well as the corresponding profile likelihood $\lambda_\mathrm{A}$ can be evaluated, and thus a median significance can be determined.
Non-integer values for data counts are not an issue as factorial terms from the Poisson probabilities are cancelled in the profile likelihood and can thus be dropped altogether.

\section{Sensitivity estimation}\label{sec:sensitivity_estimation}

When designing search regions for an analysis, it is necessary to achieve an optimal signal-to-background separation power.
A significance metric is needed in order to quantify the separation power and to have a metric to optimise for.
In the following, the expected discovery significance introduced in \reference\cite{Cousins:2007bmb} is used. As the full statistical model is in general not yet known when designing the search regions, appropriate assumptions have to be made. In a \textit{cut-and-count} selection where only the total number of events after a selection are relevant (and not \eg their distribution), the significance is determined by the total number of signal events $S$, the total number of background events $B$ and the uncertainty on the expected number of background events $\upDelta B$.
This can be modelled as a so-called \textit{on/off problem}\footnote{The \textit{on/off} nomenclature originates from gamma ray astronomy where \textit{on} refers to the telescope pointing on-source (measuring signal and background photons), while \textit{off} refers to it pointing off-source (measuring only background photons). This problem is an exact analogue to the \gls{hep} problem herein, where the off-source measurement typically corresponds to some \textit{sideband} measurement, \ie a measurement of events in a region of a parameter disjoint from the parameter range where the signal might exist.}~\cite{Cousins:2007bmb, Cranmer:2005hi}, where the \textit{cut-and-count} experiment uses two bins, a \gls{sr} enriched in signal events, and a \gls{cr} containing only background events.
In the background-only hypothesis, the parameter $\tau = n_\mathrm{CR} / n_\mathrm{SR}$ then denotes the ratio between the event rate in the \gls{cr}, $n_\mathrm{CR}$, and the event rate in the \gls{sr}, $n_\mathrm{SR}$.

If $\tau$ is known, then the likelihood of this simple configuration can be written in terms of the expected background event rate
\begin{equation}
	L (\mu,B) = \mathrm{Pois}(n_{\mathrm{SR}}\vert\mu S + B) \cdot \mathrm{Pois}(n_{\mathrm{CR}}\vert\tau B),
\end{equation}
where $\mu$ is again the signal strength parameter. The relative background uncertainty can thus be treated as coming from a Poisson-distributed auxiliary measurement containing only background (\ie in the \gls{cr}) with corresponding uncertainty $\sqrt{\tau B}$, leading to the approximation
\begin{equation}
	\tau = \frac{B}{\upDelta B^2}.
\end{equation}
As $n_{\mathrm{SR}}$ and $n_{\mathrm{CR}}$ are each drawn from a Poisson probability with unknown means $\nu_\mathrm{SR}$ and $\nu_\mathrm{CR}$, the background-only hypothesis corresponds exactly to the case where the ratio of Poisson means \mbox{$\lambda = \nu_\mathrm{CR} / \nu_\mathrm{SR}$} is equal to $\tau$~\cite{Cousins:2007bmb}. The two Poisson terms can then be written as the product of a single Poisson term with mean $n_\mathrm{tot} = n_\mathrm{SR} + n_\mathrm{CR}$ and the binomial probability $B(n_\mathrm{SR}\vert\rho,n_\mathrm{tot})$ of picking $n_\mathrm{SR}$ events out of $n_\mathrm{tot}$ with probability $\rho = \nu_\mathrm{SR} / \nu_\mathrm{tot} = 1 / (1+\lambda)$. The likelihood can therefore be written as
\begin{equation}
\begin{split}
	L(\mu, B) & = \mathrm{Pois} (n_\mathrm{tot}\vert\lambda_\mathrm{tot})\cdot B(n_\mathrm{SR}\vert\rho,n_\mathrm{tot}) \\
	& = \frac{\mathrm{e}^{-\lambda_\mathrm{tot}}\lambda_{\mathrm{tot}}^{n_\mathrm{tot}}}{n_\mathrm{tot}\,!} \cdot{n_\mathrm{tot}\choose n_\mathrm{SR}} \rho^\lambda_\mathrm{tot} (1-\rho)^{n_\mathrm{tot}-n_\mathrm{SR}}.
\end{split}
\end{equation}

Since the background-only hypothesis cannot only be expressed as $\mu = 0$ but also as $\nu_\mathrm{SR} = \nu_B$, $\lambda = \tau$, and especially also as $\rho = 1/(1+\tau)$~\cite{Cousins:2007bmb}, its $p$-value can be calculated using the well-known frequentist binomial test,
\begin{equation}
	p_\mathrm{B} = \sum_{j=n_\mathrm{SR}}^{n_\mathrm{tot}} B (j\vert n_\mathrm{tot}, \rho).
\end{equation}
The significance corresponding to $p_\mathrm{B}$ can be derived using~\cref{eq:significance} and is computable in a numerically fast way using the incomplete beta function. The algorithm used for calculating $Z_\mathrm{B}$ in this work is implemented in the \texttt{RooStats::NumberCountingUtils} methods in \textsc{Root}~\cite{ROOT:1997pa,ROOT-2}.


%% State Space Modelling of Dynamic Systems
%% Lecture 17: Transformation of States and System Diagonalization
\def\FileDate{10/01/31}
\def\FileVersion{1.0}
% ----------------------------------------------------------------
% Notes pages *********************************************************
% ----------------------------------------------------------------

The canonical forms described in the last lecture give different descriptions of the same transfer function (TF) and are therefore equivalent in their overall input-output relationship. This means that it should be possible to convert one canonical form into another by the operation of simple matrix operations. Furthermore, by transforming a system to the \emph{normal form}, determining the response and mapping back, it is possible to determine the total system response of any state space system.

The \emph{eigenvalues} of the state matrix $\mathbf{A}$ have an important influence on the system response and understanding them is key to understanding the general solution of state-space systems.

In this lecture we define eigenvalues and eigenvectors, show the system transformation method and prove that it has no impact on the system eigenvalues, show how it can be used to transform an arbitrary state-space model into one with a diagonal (normal) structure, and finally we use these results to find a general time-response solution to the state space equations.

\ifslidesonly
\begin{slide}
   \heading{Pre-Class Presentation: Transformation of State Models}
\begin{itemize}
	\item For a given transfer function the canonical forms are equivalent in their input-output relationships.
	\item We can convert one form of canonical system into another by the application of simple matrix operations.
	\item Transforming to normal form simplifies the calculation of system response.
	\item The \emph{eigenvalues} of the $\mathbf{A}$ matrix are key to the process.
	\item Knowledge of a system's eigenvalues means that we can determine the system response of any LTI system.
\end{itemize}
\end{slide}
\begin{slide}
   \heading{Session Contents}
\begin{itemize}
	\item Eigenvalues and eigenvectors
	\item System transformation
	\item Diagonalization of a state space model
	\item Solution to the general state equations
\end{itemize}
\end{slide}
\fi

\section*{Eigenvalues and Eigenvectors} % (fold)
\label{sub:eigenvalues_and_eigenvectors}

\subsection*{Definitions} % (fold)
\label{ssub:Definitions}

\emph{Eigenvector}:\footnote{The world \emph{eigen} is from the German for ``characteristic'' so another name for eigenvalue might be \emph{characteristic value}. There is a very close relationship between the eigenvalues and the characteristic equation we have discussed in earlier lectures. Indeed as we shall see, the equation $\det(\lambda\mathbf{I}-\mathbf{A})=0$ that is used to find the eignenvalues of a system is almost identical to $\det(s\mathbf{I}-A)=0$ that determines the poles of the system defined in transfer function form. From this is should be clear that the eigenvalues of the $\mathbf{A}$ matrix are the same as the poles of the corresponding transfer function.} \input{frag4}
\ifslidesonly
\begin{slide}
   \heading{Definition of an Eigenvector}
   \input{frag4}
\end{slide}
\fi
\sref{slide:eigenvector} illustrates this definition of eigenvectors. If $\mathbf{Ax}$ is not collinear with $\mathbf{x}$ after the transformation, $\mathbf{x}$ is not an eigenvector. If $\mathbf{Ax}$ is collinear with $\mathbf{x}$ after the transformation, $\mathbf{x}$ is  an eigenvector.

\begin{slide}\label{slide:eigenvector}
   \heading{Eigenvectors and Transformations}
	\begin{center}
		\resizebox{280pt}{!}{\includegraphics{pictures/eigenvectors.pdf}}
	\end{center}
   To be an eigenvector, the transformation $\mathbf{Ax}$ must be collinear with $\mathbf{x}$. Thus, in (a), $\mathbf{x}$ is not an eigenvector: in (b), it is.
\end{slide}

\emph{Eigenvalues}: The eigenvalues of the matrix $\mathbf{A}$ are the values of $\lambda_i$ that satisfy (\ref{eq:eigenvector}) for $\mathbf{x}_i\ne \mathbf{0}$.

To find the eigenvectors, we arrange equation (\ref{eq:eigenvector}). Eigenvectors, $\mathbf{x}_i$, satisfy
\begin{equation}\label{eq:581}
	\mathbf{0}=(\lambda_i\mathbf{I}-\mathbf{A})\mathbf{x}_i
\end{equation}
Solving for $\mathbf{x}_i$ by premultiplying both sides by $(\lambda_i\mathbf{I}-\mathbf{A})^{-1}$ yields
\[
	\mathbf{x}_i = (\lambda_i\mathbf{I}-\mathbf{A})^{-1}\mathbf{0} =
	       \frac{\textrm{adj}(\lambda_i\mathbf{I}-\mathbf{A})^{-1}}{\det(\lambda_i\mathbf{I}-\mathbf{A})^{-1}}\mathbf{0}
\]
Since $\mathbf{x}_i\ne \mathbf{0}$, a nonzero solution exists if
\begin{equation}\label{eq:eigenvalue}
	\det(\lambda_i\mathbf{I}-\mathbf{A}) = \mathbf{0} \label{eq:eigenvalue}
\end{equation}
From which $\lambda_i$, the eigenvalues, can be found.
\ifslidesonly
\begin{slide}
   \heading{Eigenvalues}
The eigenvalues of the matrix $\mathbf{A}$ are the values of $\lambda_i$ that satisfy (\ref{eq:eigenvector}) for $\mathbf{x}_i\ne \mathbf{0}$.

The eigenvectors, $\mathbf{x}_i$, satisfy
\begin{equation}
	\mathbf{0}=(\lambda_i\mathbf{I}-\mathbf{A})\mathbf{x}_i \label{eq:581}
\end{equation}
Solving for $\mathbf{x}_i$ (see notes), a nonzero solution exists if
\begin{equation}\label{eq:eigenvalue}
	\det(\lambda_i\mathbf{I}-\mathbf{A}) = \mathbf{0} \label{eq:eigenvalue}
\end{equation}
From which $\lambda_i$, the eigenvalues, can be found.
\end{slide}
\fi

We are now ready to show how to find the eigenvectors $\mathbf{x}_i$.
First we find the eigenvalues, $\lambda_i$, using
$\det(\lambda_i\mathbf{I}-\mathbf{A} = \mathbf{0})$, and then we
use equation (\ref{eq:eigenvector}) to find the eigenvectors.

\ifslidesonly
\begin{slide}
   \heading{Finding the eigenvectors of a system}
   To find the eigenvectors $\mathbf{x}_i$ of a system matrix $\mathbf{A}$
\begin{enumerate}
   	\item First find the eigenvalues, $\lambda_i$, using $\det(\lambda_i\mathbf{I}-\mathbf{A}) = \mathbf{0}$
   	\item Use $\mathbf{A}\mathbf{x}_i=\lambda_i\mathbf{x}_i$ to find the eigenvectors.
   \end{enumerate}
   We will work through an example in class.
\end{slide}
\fi

\subsection*{Example 1: finding eigenvectors} % (fold)
\label{ssub:example_1}

\textbf{Problem}: Find the eigenvectors of the matrix
\begin{equation}
	{\bf{A}} = \left[ {\begin{array}{*{20}c}
	   { - 3} & 1  \\
	   1 & { - 3}  \\
	\end{array}} \right]
\end{equation}

\textbf{SOLUTION}: The eigenvectors, $\mathbf{x}_i$, satisfy Eq. (\ref{eq:581}). First, use $\det(\lambda_i\mathbf{I}-\mathbf{A})=0$ to find the eigenvalues, $\lambda_i$, for Eq. (\ref{eq:581}):
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaabbeaaciGGKbGaaiyzaiaacshacaGGOa
% Gaeq4UdWMaaCysaiabgkHiTiaahgeacaGGPaGaeyypa0ZaaqWaaeaa
% daWadaqaauaadeqaciaaaeaacqaH7oaBaeaacaaIWaaabaGaaGimaa
% qaaiabeU7aSbaaaiaawUfacaGLDbaacqGHsisldaWadaqaauaadeqa
% ciaaaeaacqGHsislcaaIZaaabaGaaGymaaqaaiaaigdaaeaacqGHsi
% slcaaIZaaaaaGaay5waiaaw2faaaGaay5bSlaawIa7aaqaaiabg2da
% 9maaemaabaqbamqabiGaaaqaaiabeU7aSjabgUcaRiaaiodaaeaacq
% GHsislcaaIXaaabaGaeyOeI0IaaGymaaqaaiabeU7aSjabgUcaRiaa
% iodaaaaacaGLhWUaayjcSdaabaGaeyypa0Jaeq4UdW2aaWbaaSqabe
% aacaaIYaaaaOGaey4kaSIaaGOnaiabeU7aSjabgUcaRiaaiIdaaaaa
% !6018!
\[
\begin{array}{c}
 \det (\lambda {\bf{I}} - {\bf{A}}) = \left| {\left[ {\begin{array}{*{20}c}
   \lambda  & 0  \\
   0 & \lambda   \\
\end{array}} \right] - \left[ {\begin{array}{*{20}c}
   { - 3} & 1  \\
   1 & { - 3}  \\
\end{array}} \right]} \right| \\
  = \left| {\begin{array}{*{20}c}
   {\lambda  + 3} & { - 1}  \\
   { - 1} & {\lambda  + 3}  \\
\end{array}} \right| \\
  = \lambda ^2  + 6\lambda  + 8 \\
 \end{array}
\]

from which the eigenvalues are $\lambda_1 = -2$ and $\lambda_2 = -4$.

Using Eq. (\ref{eq:eigenvector}) successively with each eigenvalue, we have
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaqabeaacaWHbbGaaCiEamaaBaaaleaaca
% WGPbaabeaakiabg2da9iabeU7aSjaahIhadaWgaaWcbaGaamyAaaqa
% baaakeaadaWadaqaauaadeqaciaaaeaacqGHsislcaaIZaaabaGaaG
% ymaaqaaiaaigdaaeaacqGHsislcaaIZaaaaaGaay5waiaaw2faamaa
% dmaabaqbamqabiqaaaqaaiaadIhadaWgaaWcbaGaaGymaaqabaaake
% aacaWG4bWaaSbaaSqaaiaaikdaaeqaaaaaaOGaay5waiaaw2faaiab
% g2da9iabgkHiTiaaikdadaWadaqaauaadeqaceaaaeaacaWG4bWaaS
% baaSqaaiaaigdaaeqaaaGcbaGaamiEamaaBaaaleaacaaIYaaabeaa
% aaaakiaawUfacaGLDbaaaaaa!4B20!
\[
\begin{array}{l}
 {\bf{Ax}}_i  = \lambda {\bf{x}}_i  \\
 \left[ {\begin{array}{*{20}c}
   { - 3} & 1  \\
   1 & { - 3}  \\
\end{array}} \right]\left[ {\begin{array}{*{20}c}
   {x_1 }  \\
   {x_2 }  \\
\end{array}} \right] =  - 2\left[ {\begin{array}{*{20}c}
   {x_1 }  \\
   {x_2 }  \\
\end{array}} \right] \\
 \end{array}
\]
or
\begin{eqnarray*}
-3x_1+x_2 & = & -2x_1 \\
x_1-3x_2 & = & -2x_2
\end{eqnarray*}
from which $x_1 = x_2$. Thus,
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGcbaGaaCiEaiabg2da9maadmaabaqbamqabi
% qaaaqaaiaadogaaeaacaWGJbaaaaGaay5waiaaw2faaaaa!33EA!
\begin{equation}\label{ex1:ev1}
{\bf{x}} = \left[ {\begin{array}{*{20}c}
   c  \\
   c  \\
\end{array}} \right]
\end{equation}
Using the other eigenvalue, $-4$, we have
\begin{equation}\label{ex1:ev2}
{\bf{x}} = \left[ {\begin{array}{*{20}c}
   c  \\
   -c  \\
\end{array}} \right]
\end{equation}
Using Eqs. (\ref{ex1:ev1}) and (\ref{ex1:ev2}), one choice of eigenvectors is
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGcbaGaaCiEamaaBaaaleaacaaIXaaabeaaki
% abg2da9maadmaabaqbamqabiqaaaqaaiaaigdaaeaacaaIXaaaaaGa
% ay5waiaaw2faaiaaywW7caqGHbGaaeOBaiaabsgacaaMf8UaaCiEam
% aaBaaaleaacaaIYaaabeaakiabg2da9maadmaabaqbamqabiqaaaqa
% aiaaigdaaeaacqGHsislcaaIXaaaaaGaay5waiaaw2faaaaa!41B6!
\begin{equation}\label{ex1:solution}
{\bf{x}}_1  = \left[ {\begin{array}{*{20}c}
   1  \\
   1  \\
\end{array}} \right]\quad {\rm{and}}\quad {\bf{x}}_2  = \left[ {\begin{array}{*{20}c}
   1  \\
   { - 1}  \\
\end{array}} \right]
\end{equation}

% subsection example_1 (end)

% section eigenvalues_and_eigenvectors (end)

\section*{Transformation of State Space Models}

\input{frag1}
\ifslidesonly
\begin{slide}
	\heading{State Transformation}
   \input{frag1}
\end{slide}
\fi

\input{frag2}
\ifslidesonly
\begin{slide}
	\heading{Output Transformation}
   \input{frag2}
\end{slide}
\fi

\input{frag3}
\ifslidesonly
\begin{slide}
	\heading{Transformed Model}
   \input{frag3}
\end{slide}
\fi

\begin{itemize}
	\item Notice that the state matrix $\mathbf{A}'$for the new model is a \emph{similarity transformation} on the $\mathbf{A}$ matrix of the original system and therefore they share the same set of eigenvalues.
	\item This should not be surprising since the poles of the system being modelled correspond to the eigenvalues of the state matrix, whatever the choice of states.
\end{itemize}

\subsection*{Proof} % (fold)
\label{sub:invariance_of_system_transformation}

\input{frag5}
\ifslidesonly
\begin{slide}
	\heading{Similarity Transform Preserves Eigenvalues}
	The transformation $\mathbf{T}^{-1}\mathbf{AT}$ is a \emph{similarity transform}. That is the eigenvalues are the same as for $\mathbf{A}$.

\emph{Proof}
   \input{frag5}
\end{slide}
\fi

Therefore if $\lambda$ is an eigenvalue of $\mathbf{A}$ the it is also one of $\mathbf{A}'=\mathbf{T}^{-1}\mathbf{AT}$.

\emph{QED}.

% subsection invariance_of_system_transformation (end)

\subsection*{Example 2: Similarity transformations on state equations}
\label{sub:similarity_transforms_on_state_equations}

\textbf{Problem}: Given the system represented in state space by the following equations
\input{example2}

\textbf{SOLUTION}: Expressing the transformed states in vector-matrix form,
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGcbaGaaC4Daiabg2da9maadmaabaqbamqabm
% WaaaqaaiaaikdaaeaacaaIWaaabaGaaGimaaqaaiaaiodaaeaacaaI
% YaaabaGaaGimaaqaaiaaigdaaeaacaaI0aaabaGaaGynaaaaaiaawU
% facaGLDbaacaWH4bGaeyypa0JaaCivamaaCaaaleqabaGaeyOeI0Ia
% aGymaaaakiaahIhaaaa!3E82!
\[
{\bf{w}} = \left[ {\begin{array}{*{20}c}
   2 & 0 & 0  \\
   3 & 2 & 0  \\
   1 & 4 & 5  \\
\end{array}} \right]{\bf{x}} = {\bf{T}}^{ - 1} {\bf{x}}
\]

Thus
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaabbeaacaWHubWaaWbaaSqabeaacqGHsi
% slcaaIXaaaaOGaaCyqaiaahsfacqGH9aqpdaWadaqaauaadeqadmaa
% aeaacaaIYaaabaGaaGimaaqaaiaaicdaaeaacaaIZaaabaGaaGOmaa
% qaaiaaicdaaeaacaaIXaaabaGaaGinaaqaaiaaiwdaaaaacaGLBbGa
% ayzxaaGaaGjbVpaadmaabaqbamqabmWaaaqaaiaaicdaaeaacaaIXa
% aabaGaaGimaaqaaiaaicdaaeaacaaIWaaabaGaaGymaaqaaiabgkHi
% TiaaikdaaeaacqGHsislcaaI1aaabaGaeyOeI0IaaG4naaaaaiaawU
% facaGLDbaacaaMe8+aamWaaeaafaWabeWadaaabaGaaGimaiaac6ca
% caaI1aaabaGaaGimaaqaaiaaicdaaeaacqGHsislcaaIWaGaaiOlai
% aaiEdacaaI1aaabaGaaGimaiaac6cacaaI1aaabaGaaGimaaqaaiaa
% icdacaGGUaGaaGynaaqaaiabgkHiTiaaicdacaGGUaGaaGinaaqaai
% aaicdacaGGUaGaaGOmaaaaaiaawUfacaGLDbaaaeaacqGH9aqpdaWa
% daqaauaadeqadmaaaeaacqGHsislcaaIXaGaaiOlaiaaiwdaaeaaca
% aIXaaabaGaaGimaaqaaiabgkHiTiaaigdacaGGUaGaaGOmaiaaiwda
% aeaacaaIWaGaaiilaiaaiEdaaeaacaaIWaGaaiOlaiaaisdaaeaacq
% GHsislcaaIYaGaaiOlaiaaiwdaaeaacaaIWaGaaiOlaiaaisdaaeaa
% cqGHsislcaaI2aGaaiOlaiaaikdaaaaacaGLBbGaayzxaaaaaaa!76AB!
\[
\begin{array}{c}
 {\bf{T}}^{ - 1} {\bf{AT}} = \left[ {\begin{array}{*{20}c}
   2 & 0 & 0  \\
   3 & 2 & 0  \\
   1 & 4 & 5  \\
\end{array}} \right]\;\left[ {\begin{array}{*{20}c}
   0 & 1 & 0  \\
   0 & 0 & 1  \\
   { - 2} & { - 5} & { - 7}  \\
\end{array}} \right]\;\left[ {\begin{array}{*{20}c}
   {0.5} & 0 & 0  \\
   { - 0.75} & {0.5} & 0  \\
   {0.5} & { - 0.4} & {0.2}  \\
\end{array}} \right] \\
  = \left[ {\begin{array}{*{20}c}
   { - 1.5} & 1 & 0  \\
   { - 1.25} & {0.7} & {0.4}  \\
   { - 2.5} & {0.4} & { - 6.2}  \\
\end{array}} \right] \\
 \end{array}
\]

% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGcbaGaaCivamaaCaaaleqabaGaeyOeI0IaaG
% ymaaaakiaahkeacqGH9aqpdaWadaqaauaadeqadmaaaeaacaaIYaaa
% baGaaGimaaqaaiaaicdaaeaacaaIZaaabaGaaGOmaaqaaiaaicdaae
% aacaaIXaaabaGaaGinaaqaaiaaiwdaaaaacaGLBbGaayzxaaGaaGjb
% VpaadmaabaqbamqabmqaaaqaaiaaicdaaeaacaaIWaaabaGaaGymaa
% aaaiaawUfacaGLDbaacqGH9aqpdaWadaqaauaadeqadeaaaeaacaaI
% WaaabaGaaGimaaqaaiaaiwdaaaaacaGLBbGaayzxaaaaaa!4640!
\[
{\bf{T}}^{ - 1} {\bf{B}} = \left[ {\begin{array}{*{20}c}
   2 & 0 & 0  \\
   3 & 2 & 0  \\
   1 & 4 & 5  \\
\end{array}} \right]\;\left[ {\begin{array}{*{20}c}
   0  \\
   0  \\
   1  \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
   0  \\
   0  \\
   5  \\
\end{array}} \right]
\]

% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGcbaGaaC4qaiaahsfacqGH9aqpdaWadaqaau
% aadeqabmaaaeaacaaIXaaabaGaaGimaaqaaiaaicdaaaaacaGLBbGa
% ayzxaaGaaGjbVpaadmaabaqbamqabmWaaaqaaiaaicdacaGGUaGaaG
% ynaaqaaiaaicdaaeaacaaIWaaabaGaeyOeI0IaaGimaiaac6cacaaI
% 3aGaaGynaaqaaiaaicdacaGGUaGaaGynaaqaaiaaicdaaeaacaaIWa
% GaaiOlaiaaiwdaaeaacqGHsislcaaIWaGaaiOlaiaaisdaaeaacaaI
% WaGaaiOlaiaaikdaaaaacaGLBbGaayzxaaGaeyypa0ZaamWaaeaafa
% WabeqadaaabaGaaGimaiaac6cacaaI1aaabaGaaGimaaqaaiaaicda
% aaaacaGLBbGaayzxaaaaaa!50FA!
\[
{\bf{CT}} = \left[ {\begin{array}{*{20}c}
   1 & 0 & 0  \\
\end{array}} \right]\;\left[ {\begin{array}{*{20}c}
   {0.5} & 0 & 0  \\
   { - 0.75} & {0.5} & 0  \\
   {0.5} & { - 0.4} & {0.2}  \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
   {0.5} & 0 & 0  \\
\end{array}} \right]
\]

Therefore the transformed system is
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaqabeaaceWH3bGbaiaacqGH9aqpdaWada
% qaauaadeqadmaaaeaacqGHsislcaaIXaGaaiOlaiaaiwdaaeaacaaI
% XaaabaGaaGimaaqaaiabgkHiTiaaigdacaGGUaGaaGOmaiaaiwdaae
% aacaaIWaGaaiOlaiaaiEdaaeaacaaIWaGaaiOlaiaaisdaaeaacqGH
% sislcaaIYaGaaiOlaiaaiwdaaeaacqGHsislcaaIWaGaaiOlaiaais
% daaeaacaaIWaGaaiOlaiaaikdaaaaacaGLBbGaayzxaaGaaC4Daiab
% gUcaRmaadmaabaqbamqabmqaaaqaaiaaicdaaeaacaaIWaaabaGaaG
% ynaaaaaiaawUfacaGLDbaacaWG1baabaGaamyEaiabg2da9maadmaa
% baqbamqabeWaaaqaaiaaicdacaGGUaGaaGynaaqaaiaaicdaaeaaca
% aIWaaaaaGaay5waiaaw2faaiaahEhaaaaa!56FE!
\[
\begin{array}{l}
 {\bf{\dot w}} = \left[ {\begin{array}{*{20}c}
   { - 1.5} & 1 & 0  \\
   { - 1.25} & {0.7} & {0.4}  \\
   { - 2.5} & { 0.4} & {-6.2}  \\
\end{array}} \right]{\bf{w}} + \left[ {\begin{array}{*{20}c}
   0  \\
   0  \\
   5  \\
\end{array}} \right]u \\
 y = \left[ {\begin{array}{*{20}c}
   {0.5} & 0 & 0  \\
\end{array}} \right]{\bf{w}} \\
 \end{array}
\]

% subsection similarity_transforms_on_state_equations (end)

\section*{Diagonalization of a System Matrix} % (fold)
\label{sec:diagonalization_of_a_system_matrix}

If we choose the eigenvectors of a system matrix $\mathbf{A}$ to be the basis of a transformation, $\mathbf{T}$, the resulting system matrix will be in the diagonal normal form. Let the transformation matrix $\mathbf{T}$ consist of the eigenvectors of $\mathbf{A}$, $\mathbf{x}_i$.
\begin{equation}\label{eq:591}
	\mathbf{T}=[\mathbf{x}_1, \mathbf{x}_2, \mathbf{x}_3, \ldots, \mathbf{x}_n]
\end{equation}
Since $\mathbf{x}_i$ are eigenvectors, $\mathbf{A}\mathbf{x}_i=\lambda_i\mathbf{x}_i$, which can be written equivalently as a set of equations expressed by
\begin{equation}\label{eq:592}
	\mathbf{AT}=\mathbf{T\Lambda}
\end{equation}
where $\mathbf{\Lambda}$ is a matrix which has the eigenvalues $\lambda_i$ on the diagonal in some order and zeros elsewhere, and $\mathbf{T}$ is as defined in Eq. (\ref{eq:591}). Solving Eq. (\ref{eq:592}) for $\mathbf{\Lambda}$ by premultiplying by $\mathbf{T}^{-1}$, we get
\begin{equation}\label{eq:593}
	\mathbf{\Lambda}=\mathbf{T}^{-1}\mathbf{AT}
\end{equation}
which is the system matrix in normal canonical form.\footnote{Note we need to perform some additional manipulations if there are repeated or complex eigenvalues. We leave the discovery of these extra steps as an exercise for the interested student. It will not be examined!}
\ifslidesonly
\begin{slide}
   \heading{To Diagonalize a State Space Model}
   Choose the eigenvectors of a system matrix $\mathbf{A}$ to be the basis of a transformation $\mathbf{T}$.
\begin{equation}\label{eq:591}
	\mathbf{T}=[\mathbf{x}_1, \mathbf{x}_2, \mathbf{x}_3, \ldots, \mathbf{x}_n]
\end{equation}
$\mathbf{A}\mathbf{x}_i=\lambda_i\mathbf{x}_i$, can be written equivalently as a set of equations expressed by
\begin{equation}\label{eq:592}
	\mathbf{AT}=\mathbf{T\Lambda}
\end{equation}
Solving Eq. (\ref{eq:592}) for $\mathbf{\Lambda}$
\begin{equation}\label{eq:593}
	\mathbf{\Lambda}=\mathbf{T}^{-1}\mathbf{AT}
\end{equation}
which is the system matrix in normal canonical form.
\end{slide}
\fi
In summary, under the transformation $\mathbf{T}$, consisting of the eigenvalues of the system matrix, the transformed system is identical to that obtained using the partial fraction expansion of the transfer function with distinct real roots.
% section diagonalization_of_a_system_matrix (end)

\subsection*{Example 3: Diagonalization of a system in state space} % (fold)
\label{ssub:example_2}
\textbf{Problem}: Given the system shown below, find the diagonal (normal form) system that is similar.
\input{example3}

\textbf{SOLUTION}: First find the eigenvalues and the eigenvectors. This step was performed in Example~1. Next form the transformation matrix $\mathbf{T}$, whose columns are the eignevectors.
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGcbaGaaCivaiabg2da9maadmaabaqbamqabi
% GaaaqaaiaaigdaaeaacaaIXaaabaGaaGymaaqaaiabgkHiTiaaigda
% aaaacaGLBbGaayzxaaaaaa!35D2!
\[
{\bf{T}} = \left[ {\begin{array}{*{20}c}
   1 & 1  \\
   1 & { - 1}  \\
\end{array}} \right]
\]
finally form the similar systems's system matrix, input matrix and output matrix respectively.
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaabbeaacaWHqbWaaWbaaSqabeaacqGHsi
% slcaaIXaaaaOGaaCyqaiaadcfacqGH9aqpdaWadaqaauaadeqaciaa
% aeaadaWcgaqaaiaaigdaaeaacaaIYaaaaaqaamaalyaabaGaaGymaa
% qaaiaaikdaaaaabaWaaSGbaeaacaaIXaaabaGaaGOmaaaaaeaacqGH
% sisldaWcgaqaaiaaigdaaeaacaaIYaaaaaaaaiaawUfacaGLDbaaca
% aMe8+aamWaaeaafaWabeGacaaabaGaeyOeI0IaaG4maaqaaiaaigda
% aeaacaaIXaaabaGaeyOeI0IaaG4maaaaaiaawUfacaGLDbaacaaMe8
% UaaGzaVpaadmaabaqbamqabiGaaaqaaiaaigdaaeaacaaIXaaabaGa
% aGymaaqaaiabgkHiTiaaigdaaaaacaGLBbGaayzxaaGaeyypa0Zaam
% WaaeaafaWabeGacaaabaGaeyOeI0IaaGOmaaqaaiaaicdaaeaacaaI
% WaaabaGaeyOeI0IaaGinaaaaaiaawUfacaGLDbaaaeaacaWHqbWaaW
% baaSqabeaacqGHsislcaaIXaaaaOGaaCOqaiabg2da9maadmaabaqb
% amqabiGaaaqaamaalyaabaGaaGymaaqaaiaaikdaaaaabaWaaSGbae
% aacaaIXaaabaGaaGOmaaaaaeaadaWcgaqaaiaaigdaaeaacaaIYaaa
% aaqaaiabgkHiTmaalyaabaGaaGymaaqaaiaaikdaaaaaaaGaay5wai
% aaw2faaiaaysW7daWadaqaauaadeqaceaaaeaacaaIXaaabaGaaGOm
% aaaaaiaawUfacaGLDbaacqGH9aqpdaWadaqaauaadeqaceaaaeaada
% WcgaqaaiaaiodaaeaacaaIYaaaaaqaaiabgkHiTmaalyaabaGaaGym
% aaqaaiaaikdaaaaaaaGaay5waiaaw2faaaqaaiaahoeacaWHqbGaey
% ypa0ZaamWaaeaafaWabeqacaaabaGaaGOmaaqaaiaaiodaaaaacaGL
% BbGaayzxaaGaaGjbVlaaygW7daWadaqaauaadeqaciaaaeaacaaIXa
% aabaGaaGymaaqaaiaaigdaaeaacqGHsislcaaIXaaaaaGaay5waiaa
% w2faaiabg2da9maadmaabaqbamqabeGaaaqaaiaaiwdaaeaacqGHsi
% slcaaIXaaaaaGaay5waiaaw2faaaaaaa!840A!
\[
\begin{array}{c}
 {\bf{T}}^{ - 1} {\bf{A}}T = \left[ {\begin{array}{*{20}c}
   {{1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}} & {{1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}}  \\
   {{1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}} & { - {1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}}  \\
\end{array}} \right]\;\left[ {\begin{array}{*{20}c}
   { - 3} & 1  \\
   1 & { - 3}  \\
\end{array}} \right]\;\left[ {\begin{array}{*{20}c}
   1 & 1  \\
   1 & { - 1}  \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
   { - 2} & 0  \\
   0 & { - 4}  \\
\end{array}} \right] \\
 {\bf{T}}^{ - 1} {\bf{B}} = \left[ {\begin{array}{*{20}c}
   {{1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}} & {{1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}}  \\
   {{1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}} & { - {1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}}  \\
\end{array}} \right]\;\left[ {\begin{array}{*{20}c}
   1  \\
   2  \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
   {{3 \mathord{\left/
 {\vphantom {3 2}} \right.
 \kern-\nulldelimiterspace} 2}}  \\
   { - {1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}}  \\
\end{array}} \right] \\
 {\bf{CT}} = \left[ {\begin{array}{*{20}c}
   2 & 3  \\
\end{array}} \right]\;\left[ {\begin{array}{*{20}c}
   1 & 1  \\
   1 & { - 1}  \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
   5 & { - 1}  \\
\end{array}} \right] \\
 \end{array}
\]
Substituting this result into the equivalent state equations gives
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaabbeaaceWH3bGbaiaacqGH9aqpdaWada
% qaauaadeqaciaaaeaacqGHsislcaaIYaaabaGaaGimaaqaaiaaicda
% aeaacqGHsislcaaI0aaaaaGaay5waiaaw2faaiaahEhacqGHRaWkda
% WadaqaauaadeqaceaaaeaadaWcgaqaaiaaiodaaeaacaaIYaaaaaqa
% aiabgkHiTmaalyaabaGaaGymaaqaaiaaikdaaaaaaaGaay5waiaaw2
% faaiaadwhaaeaacaWG5bGaeyypa0ZaamWaaeaafaWabeqacaaabaGa
% aGynaaqaaiabgkHiTiaaigdaaaaacaGLBbGaayzxaaGaaC4Daaaaaa!4749!
\[
\begin{array}{c}
 {\bf{\dot w}} = \left[ {\begin{array}{*{20}c}
   { - 2} & 0  \\
   0 & { - 4}  \\
\end{array}} \right]{\bf{w}} + \left[ {\begin{array}{*{20}c}
   {{3 \mathord{\left/
 {\vphantom {3 2}} \right.
 \kern-\nulldelimiterspace} 2}}  \\
   { - {1 \mathord{\left/
 {\vphantom {1 2}} \right.
 \kern-\nulldelimiterspace} 2}}  \\
\end{array}} \right]u \\
 y = \left[ {\begin{array}{*{20}c}
   5 & { - 1}  \\
\end{array}} \right]{\bf{w}} \\
 \end{array}
\]

Notice that the transformed system matrix is diagonal, with the eigenvalues on the diagonal.
% subsubsection example 2 (end)

\section*{Using Diagonalization to Solve State Equations}

It is possible to obtain solutions for the state equations in any set of states, $\mathbf{x}$, by transforming to normal canonical form and solving the latter's states, $\mathbf{w}$, as shown in Lecture 16.

The initial states are found, using the inverse transformation, as:
\[
\mathbf{w}_0=\mathbf{T}^{-1}\mathbf{x}_0
\]

The solutions to the original states can then be found from $\mathbf{w}$ using the transformation
\[
\mathbf{x}=\mathbf{Tw}
\]

Since the state space model for $\mathbf{w}$ is in normal form then the state matrix, $\mathbf{A}' = \mathbf{\Lambda}$, is diagonal with the eigenvalues of $\mathbf{A}$ in some order on the diagonal.

As demonstrated above, the columns of the transformation matrix,  $\mathbf{T}$  will be formed by concatenation of the corresponding eigenvectors of $\mathbf{A}$ in the same order.
\ifslidesonly
\begin{slide}
   \heading{Solution of General State Equations}
   \begin{itemize}
   	\item In Lecture 16 we showed how we could determine the solution to a state equation in normal (diagonal form).
   	\item Here we have demonstrated how to use the eignenvalues and eigenvectors to transform a model in state space form to the normal form.
   	\item Thus if we have $\mathbf{w}$ the initial states will be $\mathbf{w}_0=\mathbf{T}^{-1}\mathbf{x}_0$, and
   	\item The solutions to the original states can then be found from $\mathbf{w}$ using the transformation $\mathbf{x}=\mathbf{Tw}$
\end{itemize}
Example 4 illustrates the procedure.
\end{slide}
\fi

\subsection*{Example 4} % (fold)
\label{sub:example_3}
\textbf{Problem}: Solve the state equations
\input{example4}

\textbf{SOLUTION}: \emph{First find the eigenvalues}:
The eigenvalues of the state matrix are the roots of:
\[
\det(\lambda\mathbf{I}-\mathbf{A})=0
\]
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaqabeaaciGGKbGaaiyzaiaacshadaqada
% qaamaadmaabaqbamqabiGaaaqaaiabeU7aSbqaaiaaicdaaeaacaaI
% WaaabaGaeq4UdWgaaaGaay5waiaaw2faaiabgkHiTmaadmaabaqbam
% qabiGaaaqaaiabgkHiTiaaiodaaeaacqGHsislcaaIYaaabaGaaGym
% aaqaaiaaicdaaaaacaGLBbGaayzxaaaacaGLOaGaayzkaaGaeyypa0
% ZaaqWaaeaafaWabeGacaaabaGaeq4UdWMaey4kaSIaaG4maaqaaiaa
% ikdaaeaacqGHsislcaaIXaaabaGaeq4UdWgaaaGaay5bSlaawIa7ai
% abg2da9iaaicdaaeaacaGGOaGaeq4UdWMaey4kaSIaaG4maiaacMca
% cqaH7oaBcqGHRaWkcaaIYaGaeyypa0Jaeq4UdW2aaWbaaSqabeaaca
% aIYaaaaOGaey4kaSIaaG4maiabeU7aSjabgUcaRiaaikdacqGH9aqp
% caGGOaGaeq4UdWMaey4kaSIaaGymaiaacMcacaGGOaGaeq4UdWMaey
% 4kaSIaaGOmaiaacMcacqGH9aqpcaaIYaaaaaa!6B24!
\[
\begin{array}{l}
 \det \left( {\left[ {\begin{array}{*{20}c}
   \lambda  & 0  \\
   0 & \lambda   \\
\end{array}} \right] - \left[ {\begin{array}{*{20}c}
   { - 3} & { - 2}  \\
   1 & 0  \\
\end{array}} \right]} \right) = \left| {\begin{array}{*{20}c}
   {\lambda  + 3} & 2  \\
   { - 1} & \lambda   \\
\end{array}} \right| = 0 \\
 (\lambda  + 3)\lambda  + 2 = \lambda ^2  + 3\lambda  + 2 = (\lambda  + 1)(\lambda  + 2) = 2 \\
 \end{array}
\]
Thus $\lambda_1=-1$ and $\lambda_2=-2$.

\emph{Next, find the transformation matrix}: The eigenvectors are the solutions of $\mathbf{A}\mathbf{x}_i=\lambda_i\mathbf{x}_i$ for $i=1,2$.

For $i=1$
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaqabeaadaWadaqaauaadeqaciaaaeaacq
% GHsislcaaIZaaabaGaeyOeI0IaaGOmaaqaaiaaigdaaeaacaaIWaaa
% aaGaay5waiaaw2faamaayaaabaWaamWaaeaafaWabeGabaaabaGaam
% iEamaaBaaaleaacaaIXaaabeaaaOqaaiaadIhadaWgaaWcbaGaaGOm
% aaqabaaaaaGccaGLBbGaayzxaaaaleaacaWH4bWaaSbaaWqaaiaaig
% daaeqaaaGccaGL44pacqGH9aqpdaagaaqaaiaacIcacqGHsislcaaI
% XaGaaiykaaWcbaGaeq4UdW2aaSbaaWqaaiaaigdaaeqaaaGccaGL44
% padaWadaqaauaadeqaceaaaeaacaWG4bWaaSbaaSqaaiaaigdaaeqa
% aaGcbaGaamiEamaaBaaaleaacaaIYaaabeaaaaaakiaawUfacaGLDb
% aaaeaacaqGhbGaaeyAaiaabAhacaqGPbGaaeOBaiaabEgaaeaacqGH
% sislcaaIZaGaamiEamaaBaaaleaacaaIXaaabeaakiabgkHiTiaaik
% dacaWG4bWaaSbaaSqaaiaaikdaaeqaaOGaeyypa0JaeyOeI0IaamiE
% amaaBaaaleaacaaIXaaabeaaaOqaaiaadIhadaWgaaWcbaGaaGymaa
% qabaGccqGHRaWkcaaIWaGaamiEamaaBaaaleaacaaIYaaabeaakiab
% g2da9iabgkHiTiaadIhadaWgaaWcbaGaaGOmaaqabaaaaaa!6707!
\begin{eqnarray*}
 \left[ {\begin{array}{*{20}c}
   { - 3} & { - 2}  \\
   1 & 0  \\
\end{array}} \right]\underbrace {\left[ {\begin{array}{*{20}c}
   {x_1 }  \\
   {x_2 }  \\
\end{array}} \right]}_{{\bf{x}}_1 } & = & \underbrace {( - 1)}_{\lambda _1 }\left[ {\begin{array}{*{20}c}
   {x_1 }  \\
   {x_2 }  \\
\end{array}} \right] \\
  - 3x_1  - 2x_2  & = &  - x_1  \\
 x_1  + 0x_2  & = &  - x_2  \\
 \end{eqnarray*}
These equations are linearly dependent, and if we let $x_1 =1$ then $x_2 = -1$ giving $\mathbf{x}_1=[1,\ -1]^T$.

Similarly, for $i=2$ we obtain $\mathbf{x}_2=[1, -0.5]^T$.

Then
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGceaqabeaacaWHubGaeyypa0ZaamWaaeaafa
% WabeqadaaabaGaaCiEamaaBaaaleaacaaIXaaabeaaaOqaaiabl6Ui
% nbqaaiaahIhadaWgaaWcbaGaaGOmaaqabaaaaaGccaGLBbGaayzxaa
% Gaeyypa0ZaamWaaeaafaWabeGacaaabaGaaGymaaqaaiaaigdaaeaa
% cqGHsislcaaIXaaabaGaeyOeI0IaaGimaiaac6cacaaI1aaaaaGaay
% 5waiaaw2faaaqaaiaahsfadaahaaWcbeqaaiabgkHiTiaaigdaaaGc
% cqGH9aqpdaWadaqaauaadeqaciaaaeaacqGHsislcaaIXaaabaGaey
% OeI0IaaGOmaaqaaiaaikdaaeaacaaIYaaaaaGaay5waiaaw2faaaaa
% aa!4BA1!
\[
\begin{array}{l}
 {\bf{T}} = \left[ {\begin{array}{*{20}c}
   {{\bf{x}}_1 } &  \vdots  & {{\bf{x}}_2 }  \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
   1 & 1  \\
   { - 1} & { - 0.5}  \\
\end{array}} \right] \\
 {\bf{T}}^{ - 1}  = \left[ {\begin{array}{*{20}c}
   { - 1} & { - 2}  \\
   2 & 2  \\
\end{array}} \right] \\
 \end{array}
\]

\emph{Finally solve the state equations of the transformed system}

Transform the initial states:
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGcbaGaaC4DamaaBaaaleaacaaIWaaabeaaki
% abg2da9iaahsfadaahaaWcbeqaaiabgkHiTiaaigdaaaGccaWH4bWa
% aSbaaSqaaiaaicdaaeqaaOGaeyypa0ZaamWaaeaafaWabeGacaaaba
% GaeyOeI0IaaGymaaqaaiabgkHiTiaaikdaaeaacaaIYaaabaGaaGOm
% aaaaaiaawUfacaGLDbaadaWadaqaauaadeqaceaaaeaacaaIXaaaba
% GaaGimaaaaaiaawUfacaGLDbaacqGH9aqpdaWadaqaauaadeqaceaa
% aeaacqGHsislcaaIXaaabaGaaGOmaaaaaiaawUfacaGLDbaaaaa!4669!
\[
{\bf{w}}_0  = {\bf{T}}^{ - 1} {\bf{x}}_0  = \left[ {\begin{array}{*{20}c}
   { - 1} & { - 2}  \\
   2 & 2  \\
\end{array}} \right]\left[ {\begin{array}{*{20}c}
   1  \\
   0  \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
   { - 1}  \\
   2  \\
\end{array}} \right]
\]

Solve for the transformed states:
\begin{eqnarray*}
	w_1 & = & w_{1,0}e^{\lambda_1t} \\
	w_1 & = & (-1)e^{-t} \\
\end{eqnarray*}
and
\begin{eqnarray*}
	w_2 & = & w_{2,0}e^{\lambda_2t} \\
	w_2 & = & (2)e^{-2t} \\
\end{eqnarray*}

Transform the answers back to the original states:
% MathType!MTEF!2!1!+-
% faaagaart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj
% 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x
% bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq
% pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa
% aiaabeqaamaabaabaaGcbaGaaCiEaiabg2da9iaahsfacaWH3bGaey
% ypa0ZaamWaaeaafaWabeGacaaabaGaaGymaaqaaiaaigdaaeaacqGH
% sislcaaIXaaabaGaeyOeI0IaaGimaiaac6cacaaI1aaaaaGaay5wai
% aaw2faamaadmaabaqbamqabiqaaaqaaiabgkHiTiaadwgadaahaaWc
% beqaaiabgkHiTiaadshaaaaakeaacaaIYaGaamyzamaaCaaaleqaba
% GaeyOeI0IaaGOmaiaadshaaaaaaaGccaGLBbGaayzxaaaaaa!45AA!
\[
{\bf{x}} = {\bf{Tw}} = \left[ {\begin{array}{*{20}c}
   1 & 1  \\
   { - 1} & { - 0.5}  \\
\end{array}} \right]\left[ {\begin{array}{*{20}c}
   { - e^{ - t} }  \\
   {2e^{ - 2t} }  \\
\end{array}} \right]
\]

Therefore
\begin{eqnarray*}
	x_1 & = & -e^{-t} + 2e^{-2t} \\
	x_2 & = & e^{-t}-e^{-2t} \\
\end{eqnarray*}

% Session marker slides
\ifslidesonly
\begin{slide}
\heading{Summary of Pre-Class Presentation}
\begin{itemize}
\item Eigenvalues and eigenvectors
\item System transformation
\item Diagonalization of a state space model
\item Solution to the general state equations
\end{itemize}
\end{slide}
\begin{slide}
\heading{Activities for Class}
\begin{itemize}
\item Worked Examples (solutions in notes)
\item System Transformations in Matlab
\end{itemize}
\end{slide}
\fi

% Examples to be done in class
\ifslidesonly
\begin{slide}
\heading{Worked Examples}
\end{slide}
\begin{slide}
\heading{Example 1: Eigenvalues and Eigevectors}
Find the eigenvectors of the matrix
\begin{displaymath}
	{\bf{A}} = \left[ {\begin{array}{*{20}c}
	   { - 3} & 1  \\
	   1 & { - 3}  \\
	\end{array}} \right]
\end{displaymath}
\end{slide}
\begin{slide}
\heading{Example 2: System Transformation}
Given the system represented in state space by the following equations
\input{example2}
\end{slide}
\begin{slide}
\heading{Example 3: Diagonalization of a system in state space}
Given the system shown below, find the diagonal (normal form) system that is similar.
\input{example3}
\end{slide}
\begin{slide}
\heading{Example 4: Solution of General State Equations}
Solve the state equations
\input{example4}
\end{slide}
\fi

\section*{System Transforms in Matlab}

Matlab provides a rich set of tools for finding eigenvalues and eigenvectors, transforming state equations using similarity transforms and solving state space equations. We conclude this lecture by reworking the first three examples in Matlab. You should repeat these examples during the self-directed learning session.

\subsection*{Eigenvalues and eigenvectors}

\ifslidesonly
\begin{slide}
\heading{System Transformations in Matlab}
\end{slide}
\fi
\begin{slide}
   \heading{Eigenvalues and eigenvectors}
   Solution of Example 1
   \begin{verbatim}
	A = [-3 1; 1 -3]
	[T, Lambda] = eig(A)
   \end{verbatim}
	Note $\mathbf{T}$ is the transform matrix whose columns are the eigenvectors, $\mathbf{\Lambda}$ is the diagonal matrix of eigenvalues.
\end{slide}

\subsection*{Similarity transforms}

\begin{slide}
   \heading{Similarity Transform in Matlab}
	Solution of Example 2
	\begin{verbatim}
		Tinv = [2 0 0; 3 2 0; 1 4 5];
		T = inv(Tinv)
		Ax = [0 1 0; 0 0 1; -2 -5 -7];
		Bx = [0; 0; 1];
		Cx = [ 1 0 0];
		% Transform
		Aw = Tinv*Ax*T
		Bw = Tinv*Bx
		Cw = Cx*T
	\end{verbatim}
\end{slide}

\begin{slide}
   \heading{Using Control System Toolbox}
	\begin{verbatim}
		Tinv = [2 0 0; 3 2 0; 1 4 5];
		% Ax, Bx, Cx as previously defined
		sysx = ss(Ax, Bx, Cx, 0) % Dx = 0
		% Perform transformation
		sysw = ss2ss(ss, Tinv)
	\end{verbatim}
\end{slide}

\subsection*{Diagonalization}

\begin{slide}
   \heading{Diagonalization}
Example 3
\begin{verbatim}
	A = [-3 1; 1 -3]; B = [1; 2]; C = [2 3];
	[T,Lambda] = eig(A)
	Adt = inv(T)*A*T
	Bdt = inv(T)*B
	Cdt = C*T
\end{verbatim}
\end{slide}

\begin{slide}
   \heading{Diagonalization using CST canon function}
Example 3
\begin{verbatim}
	A = [-3 1; 1 -3]; B = [1; 2]; C = [2 3];
	S = ss(A, B, C, 0)
	Sp = canon(S, 'modal')
\end{verbatim}
\end{slide}

% subsection example_3 (end)  Solve the state equations

%----------------------------------------------------------------
% The end of notes
% ----------------------------------------------------------------
\endinput

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:


% declare document class and geometry
\documentclass[12pt]{article} % use larger type; default would be 10pt
\usepackage[margin=1in]{geometry} % handle page geometry

% import packages and commands
\input{../header2.tex}

\title{Math 217 -- Geometry and Physics -- Lec08}
\author{UCLA, Fall 2014}
\date{\formatdate{20}{10}{2014}} % Activate to display a given date or no date (if empty),
         % otherwise the current date is printed

\begin{document}
\maketitle

\section{Local basis on $\Gamma(E|_U)$}

Since $E|_U \cong U \times \C^r$, let $\set{s_1, \dots, s_r}$ be a local basis of sections on $U$, and $\set{s'_1, \dots, s'_r}$ another basis of sections on $V$. Then on $U \cap V$, we have $s' = gs$ for some
\begin{eqn}
g : U \cap V \rightarrow GL(n, \C).
\end{eqn}
Then we can write $\nabla s = \omega s$ for all $s$, where $\omega$ is an $r \times r$ matrix called the connection matrix.

\begin{lemma}
\begin{eqn}
\omega' = g \omega g^{-1} + \dif{g} g^{-1}.
\end{eqn}
\end{lemma}

\begin{proof}
\begin{align}
\nabla s' &= \dif{g} \, s + g \nabla s \\
	&= \dif{g} \, s + g \omega s \\
	&= \dif{g} \, g^{-1} s' + g \omega g^{-1} s' \\
	&= \underbrace{(g \omega g^{-1} + \dif{g} \, g^{-1})}_{\omega'} s'
\end{align}
\end{proof}

\begin{lemma}
\begin{eqn}
\Omega = \nabla^2 = \dif{\omega} - \omega \wedge \omega = \dif{\omega} - \frac{1}{2} [\omega, \omega].
\end{eqn}
\end{lemma}

\begin{proof}
\begin{align}
\Omega(s) &= \nabla^2 s = \nabla (\omega s) \\
	&= \dif{\omega} \, s - \omega \wedge \nabla s \\
	&= (\dif{\omega} - \omega \wedge \omega) s.
\end{align}
\end{proof}

\begin{remark}[Bianchi identity]
\begin{align}
\dif \Omega &= \dif (\dif{\omega} - \omega \wedge \omega) \\
	&= -\dif{\omega} \wedge \omega + \omega \wedge \dif{\omega} \\
	&= -(\dif{\omega} - \omega \wedge \omega) \wedge \omega + \omega \wedge (\dif{\omega} - \omega \wedge \omega) \\
	&= \omega \wedge \Omega - \Omega \wedge \omega \\
	&= [\omega, \Omega].
\end{align}
\end{remark}

\begin{lemma}
\begin{eqn}
\Omega' = g \Omega g^{-1}.
\end{eqn}
This implies that $\det(tI + (i / 2\pi) \Omega)$ is globally defined, which implies that Chern forms are globally defined.
\end{lemma}

\begin{proof}
\begin{align}
\Omega' &= \dif \omega' - \omega' \wedge \omega' \\
	&= \dif (g \omega g^{-1} + \dif g \, g^{-1}) - (g \omega g^{-1} + \dif g \, g^{-1}) \wedge (g \omega g^{-1} + \dif g \, g^{-1}) \\
	&= \cancel{\dif g \wedge \omega g\inv} + g \dif\omega \, g\inv - \cancel{g \omega \wedge \dif g\inv} - \cancel{\dif g \wedge \dif g^{-1}} \\
	&\qquad - \cancel{\dif g \, g\inv \wedge \dif g \, g\inv} - \cancel{\dif g \wedge \omega g\inv} - \cancel{g \omega g\inv \wedge \dif g \, g\inv} - g \omega \wedge \omega g\inv \\
	&= g \underbrace{(\dif\omega - \omega \wedge \omega)}_{\Omega} g\inv.
\end{align}
\end{proof}

\section{Metric connections}

Now consider a metric $\inner{\cdot}{\cdot}$ on $E$. We say that a connection $\nabla$ is compatible with $\inner{\cdot}{\cdot}$ if
\begin{eqn}
\dif \inner{s}{t} = \inner{\nabla s}{t} + \inner{s}{\nabla t}.
\end{eqn}
Consider an orthonormal basis $\set{s_1, \dots, s_r}$ on $E$. Then
\begin{eqn}
0 = \dif \inner{s_i}{s_j} = \inner{\nabla s_i}{s_j} + \inner{s_i}{\nabla s_j} = \omega_{ij} + \bar{\omega}_{ji},
\end{eqn}
thus $\omega$ is anti-hermitian, $\omega^\dagger = -\omega$. We find
\begin{align}
\Omega^\dagger &= \dif \omega^\dagger + \omega^\dagger \wedge \omega^\dagger \\
	&= -\dif \omega + \omega \wedge \omega \\
	&= - \Omega,
\end{align}
so $\Omega$ is also anti-Hermitian.

\subsection{Example: Yang-Mills theory (non-Abelian gauge theory)}

Suppose we have a complex vector bundle $E \rightarrow M^4$ with metric $\inner{\cdot}{\cdot}$ on $E$ and compatible connection $\nabla$. Given the curvature
\begin{eqn}
F = \nabla^2 \in \Gamma(\Lambda^2 T^*M \otimes \opname{End} E),
\end{eqn}
we define the Yang-Mills functional by
\begin{eqn}
YM(\nabla) = \int_M \inner{F}{F} \dif \nu,
\end{eqn}
where $\dif \nu$ is the volume form on $M$ and the inner product here is the induced metric on $\Gamma(\Lambda^2 T^*M \otimes \opname{End} E)$. So $YM : \mathcal{A} \rightarrow \reals$ is a functional on the space $\mathcal{A}$ of metric connections on $E$.

\begin{lemma}
Critical points of $YM$ are given by
\begin{eqn}
\nabla^\dagger F = 0,
\end{eqn}
where $\nabla^\dagger$ is the adjoint of $\nabla$ with respect to the metric.
\end{lemma}

\begin{proof}
Define a collection of connections
\begin{eqn}
\nabla_t = \nabla + t B,
\end{eqn}
where $B \in \Omega^*(\opname{End} E)$ [$\Omega'$?]. Then we find
\begin{eqn}
YM(\nabla_t) = \int_M \inner{F_t}{F_t} \dif \nu
\end{eqn}
where
\begin{eqn}
F_t = (\nabla + tB)^2 = \nabla^2 + t \underbrace{(\nabla B + B \nabla)}_{\nabla B [?]} + t^2 B \wedge B.
\end{eqn}
Thus, we find
\begin{eqn}
YM(\nabla_t) = YM(\nabla) + 2t \int_M \inner{\nabla B}{F} \dif\nu + \bigO(t^2),
\end{eqn}
so
\begin{eqn}
\eval{\od{}{t}}_{t=0} YM(\nabla_t) = 2 \int_M \inner{\nabla B}{F} = 2 \int_M \inner{\nabla B}{\nabla^\dagger F} \dif\nu
\end{eqn}
which in general will vanish iff $\nabla^\dagger F = 0$.
\end{proof}

\begin{definition}
The Hodge star is a map $* : \Omega^p(M) \rightarrow \Omega^{r-p}(M)$ [not giving full definition here]. If $*F = F$, we call $F$ a self-dual connection. If $*F = -F$, it is called anti-self-dual.
\end{definition}

\begin{theorem}
(Anti-) Self-dual connections are solutions of Yang-Mills.
\end{theorem}

\begin{proof}
Since $\nabla^\dagger = \pm * \nabla *$, we know that $\nabla^\dagger F = 0$ occurs when $F$ is (anti-) self-dual. (Note that $** = \pm 1$.)
\end{proof}

\end{document}


\documentclass[../PaulGanssle-Thesis.tex]{subfiles}

\begin{document}
\chapter{Proofs}
% This section should be moved to an appendix.
\label{Proofs}
As it is sometimes useful to see the proofs behind equations, but rarely sufficiently compelling that it justifies a treatment in the main text, the proofs of many analyses have been relegated to this appendix.

\section{Circuit Analyses}
\label{proofs.circuits}

% \subsection{Shim Coils}
% \label{proofs.circuits.shim}

% \subsection{Pulse Circuit}
% \label{proofs.circuits.pulse}
\subsubsection{Pulse Angle Error from Rise Times}
\label{proofs.pulses.rise.times}
The tip angle ($\theta_p$) from an induced pulse is given by:

\begin{equation}
\theta_p = -\gamma \int B_p(t) \dif t
\end{equation}

Where $\gamma$ is the gyromagnetic ratio of the spin and $B_p(t)$ is the magnetic field used for the pulse along the pulse direction in the spin's frame of reference (generally this is given in the rotating frame, but at zero field the rotating frame coincides with the lab frame). For a DC pulse with a characteristic time constant $\tau$, applying a pulse of duration $t_p$, the tip angle as a function of time is thus:

\begin{equation}
\theta(t) =\begin{cases}
-\gamma B_{0}\int_{0}^{t}\left(1-e^{-\sfrac{\hat{t}}{\tau}}\right)\dif\hat{t} & 0 \leq t \leq \hat{t_p}.\\
-\gamma B_{0}\int_{0}^{t_p}\left(1-e^{-\sfrac{\hat{t}}{\tau}}\right)\dif\hat{t} + \gamma B_0\left(1-e^{-\sfrac{t_p}{\tau}}\right)\int_{t_p}^{t}e^{-\sfrac{\hat{t}}{\tau}}\dif \hat{t} & t > t_p
\end{cases}
\end{equation}

Solving the integral for the first case (during the rise time):
\begin{eqnarray}
\int_0^t\left(1-e^{-\sfrac{\hat{t}}{\tau}}\right)\dif\hat{t} & = & \left[\hat{t} - \tau e^{-\sfrac{\hat{t}}{\tau}}\right]^{t}_{0} \\
& = & \left(t-\tau e^{-\sfrac{t}{\tau}}\right) - \left(0 - e^{0}\right)\\
& = & t - \tau\left(1 -e^{-\sfrac{t}{\tau}}\right)
\end{eqnarray}

And for the decay time:

\begin{eqnarray}
\left(1-e^{-\sfrac{t_p}{\tau}}\right)\int_{t_p}^{t}e^{-\sfrac{\left(\hat{t}-t_p\right)}{\tau}}\dif \hat{t} & = & \left(1-e^{-\sfrac{t_p}{\tau}}\right)\left[\hat{t}-\tau e^{-\sfrac{\hat{t}}{\tau}}\right]^{t}_{t_{p}} \\
& = & \tau\left(1-e^{-\sfrac{t_{p}}{\tau}}\right)\left[1-e^{-\sfrac{\left(t-t_p\right)}{\tau}}\right]
\end{eqnarray}

So combining these two (assume $t > t_p$):

\begin{equation}
\int_{0}^{t} B(\hat{t})\dif\hat{t} = t_p + \tau e^{-\sfrac{\left(t-t_p\right)}{\tau}}\left(1 - e^{-\sfrac{t_p}{\tau}}\right)
\end{equation}

And for $t \gg \tau$, $e^{-\sfrac{\left(t-tp\right)}{\tau}} \approx 0$ and the second term drops out, indicating that for sufficiently long inter-pulse spacing relative to $\tau$, deviations from perfect square pulses have no effect on the tip angle.

\subsubsection{Calculation of $V_O$}
For convenience, define the effective resistance of the coil output stage (after the noise-limiting diodes) $R_M$ as:

\begin{eqnarray}
R_M & = & \left(\frac{1}{R_1} + \frac{1}{R_C}\right)^{-1} + R_2 \\
R_M & = & \frac{R_1R_C}{R_1 + R_C} + R_S \\ \label{eqn:RM_EffectiveResistance}
\end{eqnarray}

Then, as nearly all circuit proofs do, start from Kirchoff's rules and Ohm's law:

\begin{eqnarray}
I_S & = & I_{SH} + I_{M} \\
\frac{V_P}{R_S} & = & \frac{V_o - V_P}{R_{SH}} + \frac{V_C - V_P}{R_M}\\
\frac{V_P}{R_S} & = & V_o\left(\frac{R_{SH} + R_{M}}{R_{SH}R_{M}}\right) - V_P\left(\frac{R_{SH} + R_{M}}{R_{SH}R_{M}}\right) - \frac{\Delta V_D}{R_{M}} \\
V_o\left(\frac{R_{SH} + R_{M}}{R_{SH}R_{M}}\right) & = & V_P\left(\frac{R_{SH} + R_{M}}{R_{SH}R_{M}} + \frac{1}{R_S}\right) + \frac{\Delta{V_D}}{{R_M}} \\
V_o & = & V_P\left[1 + \frac{R_{M}R_{SH}}{R_S(R_M + R_{SH})}\right] + \frac{\Delta V_D R_{SH}}{R_M + R_{SH}}
\end{eqnarray}

This applies only when $V_o \geq \Delta V_D$, otherwise treat $R_M$ as effectively open and $I_M$ as 0. When (as should likely be the case), $R_{SH} \gg R_M$, the last equation simplifies to:

\begin{equation}
V_o \approx V_P\left(1 + \frac{R_M}{R_S}\right) + \Delta V_D
\end{equation}

\subsubsection{Calculation of Shunt Resistor Current Loss}
\label{proofs.circuits.pulse.shunt}

Start with the convenient definition:

\begin{equation}
\Delta V = V_o - V_P
\end{equation}

\begin{eqnarray}
\frac{I_{SH}}{I_{SH} + I_{M}} & = & \frac{\Delta V}{R_{SH}}\left(\frac{\Delta V}{R_{SH}} + \frac{\Delta V - \Delta V_D}{R_M}\right)^{-1} \\
& = & \left(\frac{R_{SH} + R_M}{R_M} - \frac{\Delta V_{D} R_{SH}}{R_M\Delta V}\right)^{-1} \\
\end{eqnarray}

Now calculate $\Delta V$:

\begin{eqnarray}
\Delta V & = & V_P\left[1 + \frac{R_MR_{SH}}{R_S(R_M + R_{SH})}\right] - \frac{\Delta V_D}{R_M} - V_P \\
& = & \frac{V_PR_MR_{SH}}{R_S(R_M + R_{SH})} - \frac{\Delta V_D}{R_M}
\end{eqnarray}

Finally substitute and simplify:

\begin{equation}
\frac{I_{SH}}{I_{SH} + I_{M}} = \left[1 + \frac{R_{SH}}{R_M} - \frac{\Delta V_{D}R_{SH}}{\frac{V_P R_{SH}}{R_S(R_{M}+R_{SH})} - \Delta V_{D}}\right]^{-1}
\end{equation}

Again, this holds only when $V_o \geq \Delta V_D$, otherwise the fraction is 1.

\subsubsection{Calculation of $I_C$}
\label{proofs.circuits.pulse.coil}
First, defining the voltage drop across the coil as $\Delta V_C$:

\begin{eqnarray}
\frac{I_C}{I_1 + I_C} & = & \frac{\frac{\Delta V_C}{R_C}}{\frac{\Delta V_C}{R_C} + \frac{\Delta V_C}{R_1}} \\
& = & \frac{1}{R_{C}\left(\frac{1}{R_C} + \frac{1}{R_1}\right)} \\
& = & \frac{1}{\left(1 + \frac{R_C}{R_1}\right)} \\
& = & \frac{R_1}{R_1 + R_C} \label{eqn:IC_EqnArrayResult}
\end{eqnarray}

Now calculate the current $I_M = I_1 + I_C$:

\begin{eqnarray}
I_M & = & \frac{\Delta V - \Delta V_D}{R_M} \\
 & = & \frac{1}{R_M}\left(\frac{V_{P}R_{M}R_{SH}}{R_{S}(R_{M} + R_{SH}} - \frac{\Delta V_D}{R_M} - \Delta V_D\right) \\
 & = & \frac{V_P R_{SH}}{R_{S}(R_{M} + R_{SH})} - \frac{\Delta V_{D}}{R_{M}}\left(1 + \frac{1}{R_{M}}\right)
\end{eqnarray}

Now substitute in $R_M$ from Eqn. \ref{eqn:RM_EffectiveResistance}:

\begin{equation}
I_M = \frac{V_P R_{SH}}{R_{S}\left(\frac{R_{1}R_{C}}{R_{1} + R_{C}} + R_2 + R_{SH}\right)} - \frac{\Delta V_D}{\frac{R_{1}R_{C}}{R_{1} + R_{C}} + R_{2}}\left[1 + \frac{R_{1} + R_{C}}{R_{2}(R_{1} + R_{C}) + R_{1}R_{C}}\right]
\end{equation}

And finally, we can multiply this result by the result from \ref{eqn:IC_EqnArrayResult} to obtain $I_C$:

\begin{equation}
I_C = \frac{V_{P}R_{SH}R_{1}}{R_{S}\left(R_{1}+R_{C}\right)\left(\frac{R_{1}R_{C}}{R_{1} + R_{C}} + R_{2} + R_{SH}\right)} - \frac{\Delta V_{D} R_{1}}{R_{1}R_{C} + R_{2}}\left[1 + \frac{R_{1} + R_{C}}{R_{2}(R_{1} + R_{C}) + R_{1}R_{C}}\right]
\end{equation}

\subsection{Balanced polarimeter}
\label{proofs.circuits.balancedpolarimeter}
The voltage signal from channels 1 and 2 are given by Eqns \ref{eqn:PhotoDiodeChannel1Voltage} and \ref{eqn:PhotoDiodeChannel2Voltage}, respectively:

\begin{align}
\label{eqn:PhotoDiodeChannel1Voltage}
V_{1} & = I_{1}R_{L1}\sin^{2}(\theta) \\
\label{eqn:PhotoDiodeChannel2Voltage}
V_{2} & = I_{2}R_{L2}\cos^{2}(\theta)
\end{align}

The difference voltage signal from the balanced polarimeter is thus:

\begin{equation}
\label{eqn:PhotoDiodeSubtractionVoltage}
\Delta V = I_{1}R_{L1}\sin^2(\theta - \sfrac{\pi}{4}) - I_{2}R_{L2}\cos^2(\theta - \sfrac{\pi}{4})
\end{equation}

\subsubsection{False balance from imbalanced load resistors.}
\label{proofs.circuits.balancedpolarimeter.imbalancedresistors}
Even with identical responses in each channel ($I_{1} = I_{2} = I_{0}$), a false balance can still be induced from a difference in the load resistors. To determine the extent that imbalanced load resistances affect the output signal, start with Eqn \ref{eqn:PhotoDiodeSubtractionVoltage} in the identical response, ``balanced'' ($\Delta V = 0$) condition, given by Eqn \ref{eqn:PhotoDiodeBalancedIdenticalResponse}:

\begin{equation}
\label{eqn:PhotoDiodeBalancedIdenticalResponse}
R_{L1}\sin^2\left(\theta_e - \sfrac{\pi}{4}\right) - R_{L2}\cos^2\left(\theta_e-\sfrac{\pi}{4}\right) = 0
\end{equation}

Rearranging this we get the following:
\begin{align}
\label{eqn:PDLoadImbalance1}
R_{L1}\left[1-\sin(2\theta_{e})\right] - R_{L2}\left[1 + \sin(\theta_{e})\right] = 0 \\
\label{eqn:PDLoadImbalance2}
(R_{L1} - R_{L2}) - (R_{L1} + R_{L2})\sin(2\theta_{e}) = 0 \\
\label{eqn:PDLoadImbalance3}
\sin(2\theta_{e}) = \frac{R_{L1} - R_{L2}}{R_{L1}+R_{L2}}
\end{align}

Which gives Eqn \ref{eqn:PDLoadImbalanceAngle} for the angle as a function of the load imbalance:
\begin{equation}
\label{eqn:PDLoadImbalanceAngle}
\theta_e = \frac{1}{2}\mathrm{asin}\left(\frac{R_{L1} - R_{L2}}{R_{L2} + R_{L1}}\right)
\end{equation}

And taking each resistor as deviations from the mean resistance such that $R_{L1} = R_{L} + \sigma_{R}$ + $R_{L2} = R_{L} - \sigma_{R}$, this equation simplifies to Eqn \ref{eqn:PDLoadImbalanceAngleFromError}:

\begin{equation}
\label{eqn:PDLoadImbalanceAngleFromError}
\theta_{e} = \frac{1}{2}\mathrm{asin}\left(\frac{\sigma_{R}}{R_{L}}\right)
\end{equation}

\section{Quantum Mechanics}
% \subsection{General}
% \label{proofs.qm.general}
% \subsubsection{Cyclic Commutators}
% \label{proofs.qm.general.cycliccommutation}

\subsection{J-Couplings}
\subsubsection{Commutation of the J-Coupling Hamiltonian with Scalar Polarization}
\label{proofs.qm.jcoupling.initialrhocommutation}
The initial density matrix for a set of thermally polarized spins (Eqn. \ref{eqn:InitialDensityMatrix}) is:

\begin{equation*}
\rho_{0} = \frac{B_{z}}{k_{B}T}\sum_{i}\gamma_{i}I_{iz}
\end{equation*}

Where the $z$ axis is defined as the direction of the polarization of the spins. And the Hamiltonian is given by:

\begin{equation*}
H_{J} = \sum_{i}\sum_{j\neq i}J_{ij}\mathbf{I_{i}}\cdot\mathbf{I}_{j} = \sum_{ij}I_{ix}I_{jx} + I_{iy}I_{jy} + I_{iz}I_{jz}
\end{equation*}

The commutator of the density matrix and the Hamiltonian can be calculated from the cyclic commutation relationship:

\begin{equation}
\label{eqn:CyclicCommutation}
\left[I_{ia}, I_{jb}\right] = 2i\delta_{i,j}\varepsilon_{abc}I_{ic}
\end{equation}

The commutator is thus:

\begin{align}
\label{eqn:DMCommutation1}
\left[\rho_{0}, H_{J}\right] & = \frac{\bar{h}\gamma B_{0}}{2k_{B}T}\sum_{i}\sum_{j \neq i}J_{ij}\left[I_{iz}, I_{ix}I_{jx} + I_{iy}I_{jy} + I_{iz}I_{jz}\right]\\
\label{eqn:DMCommutation2}
 & = \frac{\bar{h}\gamma B_{0}}{2k_{B}T}\sum_{i}\sum_{j \neq i}J_{ij}\left(\left[I_{iz}, I_{ix}I_{jx}\right] + \left[I_{iz}, I_{iy}I_{jy}\right]\right) \\
\label{eqn:DMCommutation3}
 & = \frac{\bar{h}\gamma B_{0}}{2k_{B}T}\sum_{i}\sum_{j \neq i}J_{ij}\left(I_{iy}I_{jx} - I_{ix}I_{jy}\right) \\
\end{align}

Taking advantage of the fact that J-couplings are always symmetric (i.e. $J_{ij} = J_{ji}$), we can see that for each term $J_{ij}\left(I_{ix}I_{jy} - I_{iy}I_{jx}\right)$, there is a corresponding term $J_{ji}\left(I_{jx}I_{iy} - I_{jy}I_{ix}\right) = -J_{ij}\left(I_{ix}I_{jy} - I_{iy}I_{ix}\right)$. Using this, Eqn. \ref{eqn:DMCommutation3} can be re-written as Eqn. \ref{eqn:DMCommutationResult}:

\begin{equation}
\left[\rho_{0}, H_{J}\right]  = \frac{i\Delta E}{k_{B}T}\left(\sum_{i}\sum_{j \neq i} I_{ix}I_{jy} - \sum_{i}\sum_{j \neq i} I_{ix}I_{jy}\right)
\label{eqn:DMCommutationResult}
\end{equation}

And thus $\left[\rho_{0}, H_{J}\right]$ = 0.

\subsubsection{Evolution of the initial density matrix for heteronuclei with non-identical $\gamma$}
\label{proofs.qm.jcoupling.densitymatheteronuclei}
For a thermally polarized ensemble of spins $\mathbf{I}_{i}$ and $\mathbf{S}_{n}$, the initial density matrix is given by:

\begin{gather}
\rho_{0}  = \frac{\gamma_{I}B_0}{2k_{B}T}\sum_{i}I_{iz} + \frac{\gamma_{S}B_{0}}{2k_{B}T}\sum_{n}S_{nz} \\
\rho_0 = \frac{\hbar B_{0}}{2k_{B}T}\left(\gamma_{i}\sum_{i}I_{iz} + \gamma_{S}\sum_{n}S_{nz}\right) \\
\rho_0 = \frac{\hbar B_{0}(\gamma_{I}+\gamma_{S})}{2k_{B}T}\left(\sum_{in}I_{iz} + S_{nz}\right) + \frac{\hbar B_{0}(\gamma_{I}-\gamma_{S})}{2k_{B}T}\left(\sum_{in}I_{iz} - S_{nz}\right)
\end{gather}

It is known from Sec. \ref{proofs.qm.jcoupling.initialrhocommutation} that terms of the form $I_{iz} + S_{nz}$ will commute with the Hamiltonian, but terms of the form $I_{iz} - S_{nz}$ have significant, detectable precession under the J-coupling Hamiltonian.

\subsubsection{Evolution of a two-spin heteronuclear system under a pulse}
\label{proofs.qm.jcoupling.pulseapplied}
For a two-spin system initially polarized in a state $I_{z} + S_{z}$, the application of a pulse along the $y$ direction with pulse angle $\theta_{I} = \theta - \Delta$ for the $\mathbf{I}$ spins will apply a (possibly) different type angle $\theta_{S} = \theta + \Delta$ to the $\mathbf{S}$ spins, creating zero-quantum and double-quantum coherences by introducing a relative tip angle $2\Delta$ between the spins. After the pulse, the density matrix is given by:

\begin{align}
\rho(\theta) = & \cos(\theta - \Delta)I_{z} - \sin(\theta - \Delta)I_{x} + \cos(\theta + \Delta)S_{z} - \sin(\theta + \Delta)S_{x} \\
\phantom{\rho(\theta)} = & \phantom{-}\frac{\cos(\theta - \Delta) + \cos(\theta + \Delta)}{2}(I_{z} + S_{z}) + \frac{\cos(\theta - \Delta) - \cos(\theta + \Delta)}{2}(I_{z} - S_{z}) \\
& - \frac{\sin(\theta - \Delta) + \sin(\theta + \Delta)}{2}(I_{x} + S_{x}) - \frac{\sin(\theta - \Delta) - \sin(\theta + \Delta)}{2}(I_{x} - S_{x}) \\
\phantom{\rho(\theta)} = & \phantom{-}\cos(\theta)\cos{\Delta}(I_{z} + S_{z}) - \sin(\theta)\sin(\Delta)(I_{z} - S_{z}) \\
& - \sin(\theta)\cos(\Delta)(I_{x} + S_{x}) + \cos(\theta)\sin(\Delta)(I_{x} - S_{x})
\end{align}

And this is probably best represented by breaking it out into antiparallel terms (which evolve under the Hamiltonian), and parallel terms (which commute with the Hamiltonian):

\begin{align}
\rho(\theta) = & \cos(\Delta)\left[\cos(\theta)(I_{z} + S_{z}) - \sin(\theta)(I_{x} + S_{x})\right] \\
			& - \sin(\Delta)\left[\sin(\theta)(I_{z} - S_{z}) - \cos(\theta)(I_{x} - S_{x})\right]
\end{align}

And of course $\Delta$ is a function of $\theta$, $\gamma_{I}$ and $\gamma_{S}$:

\begin{align}
\theta & = \theta_{I} + \Delta \\
\theta & = \theta_{S} - \Delta \\
\Delta & = \frac{\theta_{I} - \theta_{S}}{2}
\end{align}

And this is further constrained by the fact that $\theta_{I}$ and $\theta_{S}$ are functions of the same underlying process:

\begin{align}
\theta_{I} & = \gamma_{I}B_{1}t \\
\theta_{S} & = \gamma_{S}B_{1}t \\
& = \frac{\gamma_{S}}{\gamma_{I}}\gamma_{I}B_{1}t = \frac{\gamma_{S}}{\gamma_{I}}\theta_{I}
\end{align}

Now substituting into $\Delta$:

\begin{align}
\Delta & = \left[\theta_{I} - \theta_{I}\left(1 - \frac{\gamma_{S}}{\gamma_{I}}\right)\right] \\
& = \frac{\theta_{I}\gamma_{S}}{2\gamma_{I}}
\end{align}

And from this follows $\theta$:

\begin{equation}
\theta = \theta_{I} - \Delta = \theta_{I}\left(1- \frac{\gamma_{S}}{2\gamma_{I}}\right)
\end{equation}

\section{Pulse Sequences}
\subsection{Pulse Error corrections in multiphase $\pi$ trains.}
\label{proofs.pulses.multiphasepi}
When applying a $\pi$ train while alternating phase between $\vec{x}$ and $\vec{y}$ pulses, the $\pi$ pulses have a multually correcting effect. For errors $\epsilon_{x}$ and $\epsilon_{y}$ on $\pi_{x}$ and $\pi_{y}$, respectively, the density matrix after $n$ pulses may have some components along $I_{x}$, $I_{y}$ and $I_{z}$, these coefficients are defined as:

\begin{equation}
\label{eqn:DensityMatrixAfterNMultiphase}
\rho_{n} = c_{n,x}I_{x} + c_{n,y}I_{y} + c_{n,z}
\end{equation}

The effect of the pulses with error are:

\begin{align*}
&       && \specialcell{\hfill{}\pi_{x} + \epsilon_{x}\hfill{}}  &&                                                    &\hspace*{15mm}&  && \pi_{y} + \epsilon_{y}     && & \\
& I_{x} && \xrightarrow{\hspace*{1cm}}                           && \specialcell{\hfill{}I_{x}\hfill{}}                && I_{x}         && \xrightarrow{\hspace*{1cm}} && -I_{x}\cos(\epsilon{y}) + I_{z}\sin(\epsilon{y}) &\\
& I_{y} && \xrightarrow{\hspace*{1cm}}                           && -I_{y}\cos(\epsilon_{x}) - I_{z}\sin(\epsilon_{x}) && I_{y}         && \xrightarrow{\hspace*{1cm}} && \specialcell{\hfill{}I_{y}\hfill{}} &\\
& I_{z} && \xrightarrow{\hspace*{1cm}}                           && -I_{z}\cos(\epsilon_{x}) + I_{y}\sin(\epsilon_{x}) && I_{z}         && \xrightarrow{\hspace*{1cm}} && -I_{z}\cos(\epsilon_{y}) - I_x\sin(\epsilon_{y})&
\end{align*}

And so the terms of the density matrix at $2n$ and $2n+1$ (for $n\in[0,\inf]$) can be determined recursively:
\begin{gather*}
\vec{c}_{2n+1} =
\begin{bmatrix}
c_{2n,x} \\
-c_{2n,y}\cos(\epsilon_{x}) + c_{2n,z}\sin(\epsilon_{x}) \\
-c_{2n,z}\cos(\epsilon_{x}) - c_{2n,y}\sin(\epsilon_{x})
\end{bmatrix}\\
\vec{c}_{2n} =
\begin{bmatrix}
-c_{2n-1,x}\cos(\epsilon_{y} - c_{2n-1,z}\sin(\epsilon_{y}) \\
c_{2n-1,y} \\
-c_{2n,z}\cos(\epsilon_{y}) + c_{2n,x}\sin(\epsilon_{y})
\end{bmatrix}
\end{gather*}

The pulses follow a 4-pulse cycle, and maximum symmetry is achieved on the $4n$ pulses. Taking $n=0$, we can derive $c_{4}$:

\[
\vec{c}_{4} =
\begin{bmatrix}
\sin(\epsilon_{y}\left[\cos(\epsilon_{x})\cos(\epsilon_{y})+\cos^2(\epsilon_{x})\cos(\epsilon_{y})+\sin^2(\epsilon_{x})\right]\\
-\sin(\epsilon_{x})\cos(\epsilon_{x})\left[\cos(\epsilon_{y})-1\right] \\
\cos^2(\epsilon_{x})\cos^2(\epsilon_{y}) + \sin^2(\epsilon_{x})\cos(\epsilon_{y}) + \cos(\epsilon_{x})\sin^2(\epsilon_{y})
\end{bmatrix}
\]

The signal should be all in $c_z$, and so we can take as our measure of the error $1-c_{z}$. Expanding the terms of $c_{4z}$ in a MacLaurin series:

\begin{align*}
\cos^2(\epsilon_{x}) & =  \left(\sum_{n=0}(-1)^{n}\frac{\epsilon_{x}^{2n}}{(2n)!}\right)\left(\sum_{m=0}(-1)^{m}\frac{\epsilon_{x}^{2m}}{(2m)!}\right) \\
 & =  \sum_{n=0}\sum_{m=0}(-1)^{n+m}\frac{\epsilon_{x}^{2(n+m)}}{(2n)!(2m)!} \\
 &  \\
\sin^2(\epsilon_{x}) & = \left(\sum_{n=0}(-1)^{n}\frac{\epsilon{x}^{2n+1}}{(2n+1)!}\right)\left(\sum_{m=0}(-1)^{m}\frac{\epsilon_{x}^{2m+1}}{(2m+1)!}\right) \\
 & =  \sum_{n=0}\sum_{m=0}(-1)^{n+m}\frac{\epsilon_{x}^{2(n+m+1)}}{(2n+1)!(2m+1)!}
\end{align*}

And adding in the cross-terms:

\begin{equation}
\cos^2(\epsilon_{x})\cos(\epsilon_{y}) = \sum_{k,l,m,n=0}(-1)^{k+l+m+n}\frac{\epsilon_{x}^{2(n+m)}\epsilon_{y}^{2(k+l)}}{(2n)!(2m)!(2k)!(2l)!}
\end{equation}

\begin{equation}
\sin^2(\epsilon_{x})\cos(\epsilon_{y}) = \dots
\end{equation}

The first several of these terms cancel out:

\begin{equation*}
\begin{split}
 \cos^2(\epsilon_{x})\cos^2(\epsilon_{y}) + \sin^2(\epsilon_{x})\cos(\epsilon_{y}) + \cos(\epsilon_{x})\sin^2(\epsilon_{y})  =  1 - \epsilon_{x}^2 - \epsilon_{y}^2 + \\
 \epsilon_{x}^2\epsilon_{y}^2 +  \frac{\epsilon_{x}^4 + \epsilon_{y}^4}{3} -\frac{\epsilon_{x}^2\epsilon_{y}^2}{3}\left(\epsilon_{y}^2 + \epsilon_{x}^2\right) + \frac{\epsilon_{x}^4\epsilon_{y}^4}{9} + \epsilon_{x}^2 + \frac{\epsilon_{x}^2\epsilon_{y}^2}{2} + \frac{x^2y^2}{24}\left(4\epsilon_{x}^2 + \epsilon_{y}^2\right) - \\
 \frac{\epsilon_{x}^4\epsilon_{y}^4}{72} + \epsilon_{y}^2 + \frac{\epsilon_{x}^2\epsilon_{y}^2}{2} + \frac{x^2y^2}{24}\left(\epsilon_{x}^2 + 4\epsilon_{y}^2\right) - \frac{\epsilon_{x}^4\epsilon_{y}^4}{72} + O(\epsilon^{10})\\
 = 1 + \frac{\epsilon_{x}^2\epsilon_{y}^2}{8}\left(\epsilon_{x}^2+\epsilon_{y}^2\right) - \frac{\epsilon_{x}^4\epsilon_{y}^4}{12}+O\left(\epsilon^{10}\right)
\end{split}
\end{equation*}

And for $\epsilon_{x},\epsilon_{y} \ll 1$, the total error in the angle is:

\begin{equation}
\theta_{e} \approx \frac{\epsilon_{x}^2\epsilon_{y}^2}{8}\left(\epsilon_{x}^2+\epsilon_{y}^2\right)
\end{equation}
\end{document}