%!TEX root = ../notes.tex
\section{March 24, 2022}
\subsection{Algebraic Integers \emph{continued}}
\recall our definition for algebraic integers\dots
\begin{definition*}[Algebraic Integer]
    A complex number that satisfies $f(x) = 0$ for a non-constant \emph{monic} polynomial $f(x)\in\ZZ[x]$ is an \ul{algebraic integer}.

    An algebraic number is an algebraic number whose minimal polynomial over $\QQ$ has integer coefficients.

    We denote this set by $\ZZbar$.
\end{definition*}

Clearly, we have that $\ZZbar \subseteq \QQbar$.
\begin{claim*}
    We want to show that $\ZZbar$ is, in fact, a subring of $\QQbar$.
\end{claim*}

\begin{lemma}[Setup Lemma, p.44 \cite{stewart2015algebraic}]
    $\theta\in\CC$ is an algebraic integer iff the additive group generated by all powers $1, \theta, \theta^2, \dots$, $\ZZ[\theta, \theta^2, \dots]$, is finitely generated.
\end{lemma}
\begin{proof}
    \begin{description}
        \item[Forward Direction.] Suppose $\theta\in\ZZbar$. Then for some $n$,
            \[\theta^n  + a_{n-1}\theta^{n-1} + \cdots + a_0 = 0,\]
            where $a_i\in\ZZ, \forall\ 0\leq i\leq n-1$.
            \begin{claim*}
                Every power of $\theta$ lies in the additive group $\Gamma$ generated by $1, \theta, \theta^2, \dots, \theta^{n-1}$.
            \end{claim*}
            Suppose inductively that $m\geq n$, and that $1, \theta, \theta^2, \dots, \theta^m\in\Gamma$. We express
            \begin{align*}
                \theta^{n+1} = \theta^{m+1-n}\theta^n & = \theta^{m+1-n}(-a_{n-1}\theta^{n-1} - \cdots - a_0)     \\
                                                      & = -a_{n-1}\theta^m - \text{lower degree stuff} \in \Gamma
            \end{align*}
        \item[Backward Direction.] Suppose every power of $\theta$ lies in a finitely generated additive group $G$. Then the subgroup $\Gamma$ of $G$ generated by $\left\{ 1, \theta, \theta^2, \dots \right\}$ must also be finitely generated.

            Let $v_1, \dots, v_n$ be generators of $\Gamma$. (\textsc{wlog} can assume not all zero). Each $v_i \in\ZZ[\theta]$ (polynomial in $\theta$ with integer coefficients), so $\theta v_i\in\ZZ[\theta]\ \forall i$. Hence there exists integers $b_{ij}$ such that
            \[\theta v_i = \sum_{j=1}^n b_{ij}v_j\quad \forall i.\]
            This gives us a system of linear equations
            \begin{align*}
                (b_{11}-\theta)v_1 + b_{12}v_2 + \cdots + b_{1n}v_n & = 0    \\
                b_{21}v_1 + (b_{22}-\theta)v_2 + \cdots + b_{2n}v_n & = 0    \\
                                                                    & \vdots \\
                b_{n1}v_1 + b_{n2}v_2 + \cdots + (b_{nn}-\theta)v_n & = 0
            \end{align*}
            So now we have $A\vec{v} = \vec{0}$ so $\det{A} = 0$.

            The $v_1, \dots, v_n\in \CC$ give a nontrivial solution to the obvious associated system of linear equations, so the determinant
            \[\left|\begin{array}{cccc}
                    b_{11} - \theta & b_{12}          & \cdots & b_{1n}          \\
                    b_{21}          & b_{22} - \theta & \cdots & b_{2n}          \\
                    \vdots          & \vdots          & \ddots & \vdots          \\
                    b_{n1}          & b_{n2}          & \cdots & b_{nn} - \theta
                \end{array}\right|\]
            is zero. So the determinant, expanding as minors as a polynomial, is a monic\footnote{The highest degree of $\theta$ comes from the diagonal which monic up to sign. We also have that this is the characteristic of the $b_{ij}$ matrix which is monic.} polynomial (in $\theta$) with integral entries $b_{ij}$ of which $\theta$ satisfies. So $\theta$ is an algebraic integer.
    \end{description}
    Both directions of which are as desired.
\end{proof}

Note we prove something stronger and more intuitive:
\begin{lemma*}
    $\theta\in\CC$ is an algebraic integer iff the additive subgroup generated by $1, \theta, \theta^2, \dots$ is in fact generated by $1, \theta, \theta^2, \dots, \theta^{n-1}$ for some $n$.
\end{lemma*}
\begin{theorem}
    $\ZZbar$ is a subring of $\QQbar$.
\end{theorem}
\begin{proof}
    Suppose that $\theta, \phi\in\ZZbar$. We want to show that $\theta + \phi, \theta\phi\in\ZZbar$.

    By the lemma, all powers of $\theta$ lie in a finitely generated subgroup $\Gamma_\theta$ of $\CC$ and similarly, all powers of $\phi$ lie in a finitely generated subgroup $\Gamma_\phi$ of $\CC$.

    \otoh, all powers of $\theta + \phi$ and $\theta\phi$ are integer linear combinations of the elements
    \[\theta^k \phi^l\in \Gamma_\theta\Gamma_\phi\]
    where $\Gamma_\theta\Gamma_\phi := $ the additive group generated by $v_iw_j$ where $1\leq i\leq n$ and $1\leq j\leq m$ with
    \begin{align*}
        \Gamma_\theta & = \langle v_1, \dots, v_n\rangle \\
        \Gamma_\phi   & = \langle w_1, \dots, w_m\rangle
    \end{align*}
    We note that $\Gamma_\theta\Gamma_\phi$ is finitely generated, and since each power of $\theta+\phi$ and $\theta\phi$ lie in this finitely generated subgroup\footnote{The subgroup that they generate had better be finitely generated.}, by our lemma $\theta + \phi$ and $\theta\phi$ are both algebraic integers.
\end{proof}

\begin{theorem}[p.44 or p.45 \cite{stewart2015algebraic}]
    Let $\theta\in\CC$ satisfy a monic polynomial equation with coefficients in $\ZZbar$ (not just in $\ZZ$). Then $\theta$ is an algebraic integer.
\end{theorem}
\begin{proof}
    \emph{One imitates the proof of the forward direction in our previous setup lemma, applying a bit of module theory.}
\end{proof}

\subsection{Ring of Integers of a Number Field}
\begin{definition}[Ring of Integers of Number Field $K$]
    If $K$ is a number field, then
    \[\riO_K := K\cap \ZZbar\]
    is called the \ul{ring of integers of $K$}.\footnote{In textbooks, it's \emph{fraktor} $\mathfrak{O}$. In papers, usually mathcal $\mathcal{O}$. In handwriting, usually fancy loopy $O$.}
\end{definition}
$\riO_K$ is a ring because $K$ and $\ZZbar$ are subrings of $\CC$. The relationship between $K$ and $\riO_K$ is the same as that of $\QQ$ and $\ZZ$.

\begin{lemma}
    If $\alpha\in K$, then $c\alpha\in \riO_K$ for some $c\in\ZZ$.
\end{lemma}
\begin{proof}
    Let $\alpha\in K$ and $f(x) = \minpoly_\QQ(\alpha)$, with $\deg f = n$. Let $0\neq c\in \ZZ$ and let $g_c := c^n\cdot f\left( \frac{x}{c} \right)$.

    Observe:
    \begin{enumerate}[1)]
        \item The roots of $g_c$ are the $c\alpha_i$ where $\alpha_i$ are the roots of $f$.
        \item $g_c$ is monic.
        \item If we choose $c$ to be the lcm of the denominators of the coefficients of $f$ implies that $g_c$ has integer coefficients.
    \end{enumerate}
    So $c\alpha$ is an element of $\riO_K$ since it is also an algebraic integer.
\end{proof}

\begin{corollary}
    If $K$ is a number field, then $K = \QQ(\theta)$, for some algebraic integer $\theta\in\ZZbar$.
\end{corollary}

\textbf{Warning!} (pp.46-47 \cite{stewart2015algebraic}) Though it is often the case that if $K = \QQ(\theta)$ with $\theta\in\ZZbar$, then $\riO_K = \ZZ[\theta]$, this need not be true.
\begin{example}
    Let $K = \QQ(\sqrt{5})$. However,
    \[\ZZ[\sqrt{5}]\subsetneq \riO_K\]
    In fact, \[\ZZ\left[ \frac{1+\sqrt{5}}{2} \right] = \riO_K.\]
\end{example}
Furthermore, is it always the case that $\riO_K$ is generated by a single element? \emph{No!} $\riO_K$ need \ul{not} be of the form $\ZZ[\theta]$ for some $\theta\in\ZZbar$.
\begin{example}
    The counterexample of this is
    \[K = \QQ(\theta)\]
    when $\theta$ is a root of $x^3 - x^2 - 2x - 8$.
\end{example}
Number fields where such a $\theta$ does exist are called \ul{monogenic}.


\documentclass[11pt]{article}
\usepackage{geometry}
\geometry{a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\usepackage{natbib}
\usepackage{color}
\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
\usepackage{epsfig}
\usepackage{amssymb,amsmath}
\usepackage{enumerate}
\usepackage{enumitem}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{mathtools}

\newcommand{\ssd}{\text{ssd}}
\newcommand{\sS}{\mathsf{S}}
\newcommand{\tot}{\text{tot}}

\begin{document}

\input{symbols}

\section*{Linear stability analysis}

With $h_b = 0$, the linear eigenproblem is

\begin{equation}
 \sA \, \mathsf{\Phi} = \omega \, \sB\, \mathsf{\Phi}\,,
\end{equation}
where

\begin{equation}
\sA \equiv \mathsf{B}(\mathsf{U}\, k + \mathsf{V}\,l) + \mathsf{I}\left(k\,\mathsf{Q}_y - l\,\mathsf{Q}_x\right) + \mathsf{I}\,\delta_{\mathsf{N}\mathsf{N}}\, \mathrm{i} \,r_{ek}\,\kappa^2\,,
\end{equation}
where $\delta_{\mathsf{N}\mathsf{N}} = [0,0,\dots,0,1]\,,$
and
\begin{equation}
\mathsf{B} \equiv  \mathsf{S} - \mathsf{I} \kappa^2\,.
\end{equation}
The growth rate is Im$\{\omega\}$.

\end{document}


\documentclass[letterpaper]{article}

\usepackage{fullpage}
\usepackage{nopageno}
\usepackage{amsmath}
\usepackage{amssymb}
\allowdisplaybreaks

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

\begin{document}
\title{Notes}
\date{September 5, 2014}
\maketitle
\section*{proposition 2.5.1}
last time we got to $|a_nb_n-AB|\le ...\le |a_n||b_n-B|+|a_n-A||B|$, where $|b_n-B|=|a_n-A|=\epsilon$. $L-1\le a_n\le L+1$.

let $\{a_n\}_{n=1}^\infty$ be a convergent sequence of real numbers, them $\{a_n:n\in\mathbb{N}\}$ is bounded above and below.

\subsection*{proof}
let $L=\lim_{n\to\infty}a_n$. set $\epsilon=1$ then there is a $N_1\in\mathbb{N}$ such that $|a_n-L|<1$ if $n\ge N_1$. Hence for $n=N_1,N_{1}+1,N_1+2,...$ etc $L-1\le a_n\le L+1$. $N_1$ is a fixed natural set. $B=\{a_z,a_2,...,a_{N_1-1}\}$. let $M=\max B, m=\min B$. $\forall n\ge1, \min\{L-1,m\}\le a_n\le\max\{L+1,M\}$.

\subsection*{example 2.4Ac}
\begin{align*}
  0\le\lim_{n\to\infty}\frac{3^n}{n!}&=\lim_{n\to\infty}\frac{3\cdot3\cdot3\cdot...\cdot3\cdot3\cdot3}{n(n-1)(n-2)...4\cdot3\cdot2\cdot1}\\
  &=\lim_{n\to\infty}\frac{3\cdot3\cdot3\cdot...\cdot3\cdot3\cdot3\cdot27}{n(n-1)(n-2)...4\cdot(3\cdot2\cdot1)}\\
  &\le \lim_{n\to\infty}\frac{3}{n}\cdot1\cdot...\cdot1\cdot\frac{9}{2}
\end{align*}
so by squeeze it's zero
\section*{excercise}
if $a_n\le b_n\forall n$ then $\lim_{n\to\infty}a_n\le\lim_{n\to\infty}b_n$
\end{document}


\section{Preliminaries}
\label{sec:HomographyPreliminaries}

We define a marker as an object with a known, easy-to-detect shape. Such an object can be either naturally occurring or artificially placed on the planar surface of the scene we want to remove perspective distortion from. The marker contains keypoints, which is a set of distinct, independent, visual feature points (for instance, corners). The chosen keypoints visible in the perspectively deformed image are called the \mbox{warped keypoints}. The set of the \mbox{rectified keypoints} is represented in the desired image (not subjected to perspective distortion) and is produced from the warped keypoints using the homography projection. Last but not least, the \mbox{point correspondence} is a relationship between the warped and the \mbox{target keypoints} and it is necessary for homography estimation. In an ideal case, the rectified keypoints match the target keypoints in terms of their pixel positions (\figtext{}~\ref{fig:HomographyTerminology}).

% ------------------------------------------------------------------------------
\begin{figure}[t]
    \centering
    \includegraphics[width=0.6\linewidth]{figures/homography/terminology.pdf}
    \caption[Homography ranking terminology]{Visualization of relationships within our established terminology. This diagram also depicts the hierarchical dependence between individual terms. In addition, the dotted elements represent processes with arrows denoting their input and output.}
    \label{fig:HomographyTerminology}
\end{figure}
% ------------------------------------------------------------------------------

Unless stated otherwise, a \mbox{\textbf{similarity transformation}} denotes a limited affine transformation with $4$ \gls{dof} which encompasses translation, rotation and uniform scaling (\eqtext{}~\ref{eq:SimilarityMatrices}). Specifically, let $\mset{K}_1$ and $\mset{K}_2$ be sets of feature keypoints belonging to objects $O_1$ and $O_2$. We refer to the objects $O_1$ and $O_2$ as \mbox{\textbf{similar}} if there exists a similarity transformation $\psi$, such that $\mset{K}_1 = \func{\psi}{\mset{K}_2}$ and $\mset{K}_2 = \func{\psi^{-1}}{\mset{K}_1}$. For instance, $O_1$ and $O_2$ may represent rectangles of different sizes whilst having a equal aspect ratio.

Let $m$ denote the number of markers and $k$ represent the number of keypoints belonging to each marker in consideration. We describe each $i$-th marker using a $3 \times k$ matrix $\suprbrackets{\mtx{W}}{i}$ that stores the warped keypoints as
\begin{equation}
    \suprbrackets{\mtx{W}}{i} =
    \begin{bmatrix}
        \subsuprbrackets{x}{1}{i} & \subsuprbrackets{x}{2}{i} & \dots & \subsuprbrackets{x}{k}{i} \\
        \subsuprbrackets{y}{1}{i} & \subsuprbrackets{y}{2}{i} & \dots & \subsuprbrackets{y}{k}{i} \\
        1                         & 1                         & \dots & 1
    \end{bmatrix},
    i = 1, \dots, m.
\end{equation}
Analogivally, we describe the target keypoints using a $3 \times k$ matrix $\mtx{T}$. Owing to the many-to-one point correspondence, only one specification is sufficient. Just beware that the ordering of keypoints had to match the warped keypoints defined above, so
\begin{equation}
    \mtx{T} =
    \begin{bmatrix}
        \tilde{x}_1 & \tilde{x}_2 & \dots & \tilde{x}_k \\
        \tilde{y}_1 & \tilde{y}_2 & \dots & \tilde{y}_k \\
        1           & 1           & \dots & 1
    \end{bmatrix},
\end{equation}
with the point correspondence relationship formulated as
\begin{equation}
    \subsuprbrackets{x}{j}{i} \simeq \tilde{x}_j, \subsuprbrackets{y}{j}{i} \simeq \tilde{y}_j, i = 1, \dots, m, j = 1, \dots, k.
\end{equation}


\documentclass{article}
\usepackage{amsmath}  %for the align environment
\usepackage{xfrac}    %for pretty swing fractions
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{mathtools}
\usepackage{esint}

\newcommand*\VF[1]{\mathbf{#1}}
\newcommand*\dif{\mathop{}\!\mathrm{d}}

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\paren}{\lparen}{\rparen}

\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\makeatother

\begin{document}

\title{Spectrum and Position Decomposition}
\author{James T. Matta}
\date{21 July 2017}
\maketitle
\tableofcontents

\section{The Algorithm}
Frequently one is presented with a matrix equation that looks something like
\begin{align}
	Y_{i} = \sum\limits_{\alpha}X_{\alpha}\times{}M_{\alpha,i}
\end{align}
Where
\begin{itemize}
\item $Y=$ Some know vector of data
\item $X=$ An unknown vector of multipliers
\item $M=$ Some matrix
\end{itemize}

In many cases simple linear algebra can be used to solve this problem. However, there are a number of cases where the linear algebra solution is incorrect because it will yield negative values which are unphysical.

In these cases the problem can be solved in a numerically stable and positive definite way [Taín and Ott, NIMA 571 (2007) 728–738] as shown in the equation below.

\begin{align}
	f_{\mu}^{(s+1)} = \frac{1}{\sum\limits_{j}R_{\mu{}j}} \sum\limits_{i}\frac{f_{\mu{}}^{(s)} R_{\mu{}i}d_i}{\sum\limits_{\alpha}R_{\alpha{}i}f_{\alpha}^{(s)}} \\
\end{align}
Where:
\begin{itemize}
\item $m=$ Number of response functions
\item $n=$ Number of data bins
\item $R=$ Matrix of Response functions $(m \times n)$
\item $d=$ Input spectrum vector $(n \times 1)$
\item $f^{(s)}=$ Decomposed spectrum in the $i^{th}$ iteration $(1 \times m)$
\end{itemize}

To simplify this, somewhat, let:
\begin{align}
r_{\mu} & = \sum\limits_{j}R_{\mu{},j} \\
c & = f^{(s)T}\times{}R\\
m_i &= \frac{d_i}{c_i}\\
\rho{}_{\mu{}} & = \frac{f_{\mu}^{(s)}}{r_{\mu}}
\end{align}

Then we can rewrite the equation to:
\begin{align}
f_{\mu}^{(s+1)} = \rho{}_{\mu} R_{\mu}\times{}m
\end{align}

The use of this formula can then be expressed as the following two algorithms

\begin{algorithm}[H]
\caption{Decomposition algorithm for converting observed spectra into incident spectra for a given response matrix. $\odot$ is the element-wise multiplication operator and $\oslash$ is the element-wise division operator. $m$ is the number of response functions, $n$ is the number of data bins.}\label{alg_decomp}
\begin{algorithmic}
\Procedure{DecomposeSpectrum}{$d, R, f^{(0)}, L, \tau{}$}
\BState \textbf{Input}:
\State $s \gets \text{Input spectrum}$
\State $R \gets \text{Repsonse matrix}$
\State $f^{(0)} \gets \text{Initial decomposition guess}$
\State $L \gets \text{Convergence Limit}$
\State $\tau \gets \text{Value Threshold For Convergence Test}$
\BState \textbf{Start}:
\State $T \gets R^T$
\State $r \gets \sum\limits_{j}R_{\mu{}j}$
\State $d \gets \textit{False}$
\For{$i \gets 0$; $!d$; $i \gets i+1$}
\State $c \gets T \cdot f^{(i)}$
\State $m \gets s \oslash c$
\State $\Gamma \gets R \cdot m$
\State $f^{(i+1)} \gets f^{(i)} \oslash r \odot \Gamma$
\State $d \gets$ \Call{TestConvergence}{$f^{(i)}, f^{(i+1)}, L, \tau{}$}
\EndFor
\State \Return{$f^{(i+1)}$}
\EndProcedure
\end{algorithmic}
\end{algorithm}

Where Algorithm \ref{alg_decomp} has the following requirements for its inputs:
\begin{itemize}
\item $s_j \geq 0$; $\forall{}j \text{ s.t. } 0\leq{}j<n$
\item $\sum\limits_{j=0}^{n}s_j \geq 0$
\item $f^{(0)}_j > 0$; $\forall{}j \text{ s.t. } 0\leq{}j<m$
\item $\sum\limits_{j=0}^{m}R_{\mu{}j}$; $\forall{}\mu \text{ s.t. } 0\leq{}\mu<n$
\item $\sum\limits_{j=0}^{n}R_{j\mu{}}$; $\forall{}\mu \text{ s.t. } 0\leq{}\mu<m$
\item $L > 0$
\item $\tau > 0$
\end{itemize}

Typical values chosen for the convergence limit $L$ are in the range $[0.001, 0.005]$. Typical values chose for the convergence limit testing threshold are in the range $Min(s_j) \cdot{} [10^{-3}, 10^{-4}]$.

\begin{algorithm}[H]
\caption{Convergence testing algorithm for decomposition.}\label{alg_conv}
\begin{algorithmic}
\Function{TestConvergence}{$f^{(i)}, f^{(i+1)}, L, \tau{}$}
\BState \textbf{Input}:
\State $f^{(i)} \gets \text{Decomposition vector before iteration i}$
\State $f^{(i+1)} \gets \text{Decomposition vector after iteration i}$
\State $L \gets \text{Convergence Limit }$
\State $\tau \gets \text{Value Threshold For Convergence Test}$
\BState \textbf{Start}:
\For{$j \gets 0$; $j<Length(f^{(i)})$; $j \gets j+1$}
\If{$f^{(i+1)}_j > \tau$ and $f^{(i)}_j > \tau$}
\If{ $\abs{\frac{2 \paren{f^{(i+1)}_j - f^{(i)}_j}}{f^{(i+1)}_j + f^{(i)}_j}} > L$}
\State \Return{$\textit{False}$}
\EndIf
\EndIf
\EndFor
\State \Return{$\textit{True}$}
\EndFunction
\end{algorithmic}
\end{algorithm}

Where Algorithm \ref{alg_conv} has the following requirements for its inputs:
\begin{itemize}
\item $f^{(i)}_j > 0$; $\forall{}j \text{ s.t. } 0\leq{}j<m$
\item $f^{(i+1)}_j > 0$; $\forall{}j \text{ s.t. } 0\leq{}j<m$
\item $L > 0$
\item $\tau > 0$
\end{itemize}

\section{Use Cases}
\subsection{Energy Decomposition}
Decomposition of a detected gamma-ray energy spectrum is a straightforward use of the algorithm presented above. The spectrum observed in a detector can be expressed as a weighted sum of the detector response to bombardment by mono-energetic gamma rays. This process converts the observed spectrum in a detector into the spectrum incident upon the detector. The necessary reponses can either be measured using a tagged bremsstrahlung facility or simulated (a much easier approach). In the case of simulation one can even simulate only the energy deposition probabilities and then convolve that histogram with a function representing the detectors peak width as a function of energy (as opposed to also simulating the light or charge production of the detector and then simulating its collection.)
\begin{align}
	d_{i} = \sum\limits_{\alpha}f_{\alpha}\times{}R_{\alpha,i}
\end{align}
Where:
\begin{itemize}
\item $d_{i}=$ The $i^{th}$ energy bin of the input spectrum
\item $f_{\alpha}=$ Decomposition weight for the $\alpha^{th}$ mono-energetic response function
\item $R_{\alpha,i}=$ Observed counts at energy bin $i$ for the $\alpha^{th}$ response function, a.k.a the Response Matrix
\end{itemize}

Applying the algorithm in Section 1 yields the spectrum incident upon the detector.

\subsection{Position Decomposition}
The spectrum observed at a position $i$ ($d_j$) can be expressed as weighed sum of spectra from a set of sources $S_{j}$ for sources at a set of positions $\alpha$.
\begin{align}
	d_{j,i} = \sum\limits_{\alpha}S_{j,\alpha}\times{}W_{\alpha,i}
\end{align}
Where:
\begin{itemize}
\item $d_{j,i}=$ Energy bin $j$ of the decomposed spectrum at position $i$
\item $S_{j,\alpha}=$ Energy bin $j$ of the source spectrum for source $\alpha$
\item $W_{\alpha,i}=$ Contribution weight of source $\alpha$ at position $i$
\end{itemize}

The $W_{\alpha,i}$, essentially solid angle contributions, can be defined as follows:
\begin{equation}
	W_{\alpha,i} = \oiint\limits_{D} \oiint\limits_{S} \frac{SN(x_s, x_d)\cdot{}Atten(x_s, x_d)}{4\pi{} \mid{} \vec{x_d}-\vec{x_s} \mid{}^2} \dif \vec{x_s} \dif \vec{x_d}
\end{equation}
\begin{equation}
	F(x_s, x_d) =
	\begin{cases}
		0 & \vec{N_D}(x_d)\cdot{}(\vec{x_s}-\vec{x_d}) \leq{} 0\\
		1 & \text{otherwise}
	\end{cases}
\end{equation}
Where:
\begin{itemize}
\item $x_s=$ Position detector to the source.
\item $x_d=$ Position detector to the volume.
\item $D=$ Surface of the detector segment being considered
\item $S=$ Surface/Volume/Whatever of the source being considered.
\item $\vec{N_D}(x_d)=$ Vector normal to the surface of the detector at $\vec{x_d}$, pointing outward.
\item $Atten(x_s, x_d)=$ Function accounting for shielding attenuation between $\vec{x_s}$ and $\vec{x_d}$. This function is one if only air is between the source and detector.
\end{itemize}

Considering a single energy bin $j$ gives an equation that is equivalent to the energy decomposition equation:
\begin{align}
	d_{i} = \sum\limits_{\alpha}S_{\alpha}\times{}W_{\alpha,i}
\end{align}
Where:
\begin{itemize}
\item $d_{i}=$ Single energy bin of the decomposed spectrum at position $i$
\item $S_{\alpha}=$ Single energy bin of the source spectrum for source $\alpha$
\item $W_{\alpha,i}=$ Contribution weight of source $\alpha$ at position $i$
\end{itemize}

Therefore a set of spectra taken at multiple positions can be decomposed into contributions from a finite number of stationary sources, a single energy bin at a time, using the same solution we used for energy decomposition. By analogy, the list of weights at each position for a given source would constitute a response function, the set of bin contents for a given energy for the decomposed spectra are the input spectrum, and the set of bin contents for each source would be the ``decomposed spectrum''. Repeating this at every energy bin would build up the spectrum from each source.

\end{document}


\subsection{Inequalities, Intervals and Solving Basic Inequalities}\label{subsec:IneqInterval}

\subsection*{Inequality Notation}
Recall that we use the symbols $<,>,\leq,\geq$ when writing an inequality.
In particular,
\begin{itemize}
	\item $a<b$ means $a$ is to the \ifont{left} of $b$ (that is,
				$a$ is \ifont{strictly less} than $b$),
	\item $a\leq b$ means $a$ is to the \ifont{left of or the same}
				as $b$ (that is, $a$ is \ifont{less than or equal} to $b$),
	\item $a>b$ means $a$ is to the \ifont{right} of $b$ (that is, $a$
				is \ifont{strictly greater} than $b$),
	\item $a\geq b$ means $a$ is to the \ifont{right of or the same}
				as $b$ (that is, $a$ is \ifont{greater than or equal} to $b$).
\end{itemize}

\noindent To keep track of the difference between the symbols, some students use the following mnemonic.\\

\begin{formulabox}[Mnemonic]
The $<$ symbol looks like a slanted \ifont{L} which stands for ``\ifont{L}ess than''.
\end{formulabox}

\bigskip

\begin{example}{Inequalities}{Inequalities}
The following expressions are true:
\[ 1<2,\quad
   -5<-2,\quad
   1\leq 2,\quad
   1\leq 1,\quad
   4\geq\pi>3,\quad
   7.23\geq -7.23.
\]
\vspace{-0.5cm}
\end{example}

The real numbers are ordered and are often illustrated using the \dfont{real number line}:
\[
\includegraphics[width=5in]{images/real-number-line}
\]

\subsection*{Intervals}
Assume $a,b$ are real numbers with $a<b$ (i.e., $a$ is strictly
less than $b$). An \dfont{interval} is a set of every real number
between two indicated numbers and may or may not contain the two numbers themselves.
When describing intervals we use both round brackets and square brackets.

(1) Use of round brackets in intervals: $(~,~)$.
The notation \dfont{(a,b)} is what we call the \dfont{open interval from a to b}
and consists of all the numbers between $a$ and $b$, but does \ifont{not} include $a$ or $b$.
Using set-builder notation we write this as:
\[ (a,b)=\{x\in\mathbb{R}\, \ssep \,a<x<b\} \]
We read $\{x\in\mathbb{R}\,\ssep \,a<x<b\}$ as ``the set of real numbers $x$ such that $x$ is greater than $a$ and less than $b$''. On the real number line we represent this with the following diagram:
\[
\includegraphics[width=2in]{images/interval-open}
\]
Note that the circles on $a$ and $b$ are not shaded in, we call these \dfont{open circles} and use them to denote that $a$,$b$ are \ifont{omitted} from the set.

(2) Use of square brackets in intervals: $[~,~]$.
The notation \dfont{[a,b]} is what we call the \dfont{closed interval from a to b}
and consists of all the numbers between $a$ and $b$ and \ifont{including} $a$ and $b$.
Using set-builder notation we write this as
\[ [a,b]=\{x\in\mathbb{R}\,|\,a\leq x\leq b\} \]
On the real number line we represent this with the following diagram:
\[
\includegraphics[width=2in]{images/interval-closed}
\]
Note that the circles on $a$ and $b$ are shaded in, we call these \dfont{closed circles} and use them to denote that $a$ and $b$ are \ifont{included} in the set.

To keep track of when to shade a circle in, you may find the following mnemonic useful:\\

\begin{formulabox}[Mnemonic]
The round brackets $(,)$ and non-shaded circle both form an ``O'' shape which stands for ``Open and Omit''.
\end{formulabox}

Taking combinations of round and square brackets, we can write different
possible types of intervals.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{formulabox}[Interval Notation]

Let $a$ and $b$ be real numbers with $a<b$.\\

\vspace{2mm}
	\begin{tabular}{|c|c|c|} \hline
		&& \\ [-1em]
		Set of Real Numbers & Interval Notation &  Region on the Real Number Line  \\
		\hline

		&  & \\
		\shortstack{$\{x\,\ssep \,a<x<b\}$ \\ \hfill}& \shortstack{$(a,b)$ \\ \hfill} &

		  \includegraphics[width=1.8in]{images/interval-open}  \\ \hline

		& &  \\
		\shortstack{$\{x\,\ssep \,a\leq x<b\}$ \\ \hfill}& \shortstack{$[a,b)$ \\ \hfill} &

		 \includegraphics[width=1.8in]{images/interval-1} \\
		\hline

		&  & \\
		\shortstack{$\{x\,\ssep \,a<x\leq b\}$ \\ \hfill}&\shortstack{$(a,b]$ \\ \hfill} &

		\includegraphics[width=1.8in]{images/interval-2} \\
		\hline

		&  & \\
		\shortstack{$\{x\,\ssep \,a\leq x \leq b\}$ \\ \hfill}& \shortstack{$[a,b]$ \\ \hfill}&

		\includegraphics[width=1.8in]{images/interval-closed} \\
		\hline

		& & \\
		\shortstack{$\{x\, \ssep \, x<b\}$ \\ \hfill}& \shortstack{$(-\infty,b)$ \\ \hfill}&

		\includegraphics[width=1.8in]{images/interval-5} \\
		\hline

		&  & \\

		\shortstack{$\{x\, \ssep \, x \leq b\}$ \\ \hfill} & \shortstack{$(-\infty,b]$ \\ \hfill}&

		\includegraphics[width=1.8in]{images/interval-6}

		  \\
		\hline

		&  & \\
		\shortstack{$\{x\, \ssep \, x>a\}$ \\ \hfill}& \shortstack{$(a,\infty)$ \\ \hfill}&

		 \includegraphics[width=1.8in]{images/interval-3} \\
		\hline

		&  & \\
		\shortstack{$\{x\, \ssep \, x \geq a \}$ \\ \hfill}& \shortstack{$[a,\infty)$ \\ \hfill} &

		\includegraphics[width=1.8in]{images/interval-4}

		 \\
		\hline

		&  & \\
		\shortstack{$\mathbb R$ \\ \hfill}& \shortstack{$(-\infty,\infty)$ \\ \hfill} &

		\includegraphics[width=1.8in]{images/interval-7}

		   \\
		\hline

	\end{tabular}

\end{formulabox}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\[
%\begin{array}{|c|c|c|}
%\hline
%&& \\
%(a,b)=\{x\in\mathbb{R}\,\ssep \,a<x<b\}
%	& [a,b]=\{x\in\mathbb{R}\, \ssep \,a\leq x\leq b\}
%	& [a,b)=\{x\in\mathbb{R}\, \ssep \,a\,\leq x<b\}\\
%	~&~&~\\
%\includegraphics[width=1.8in]{images/interval-open}
%	& \includegraphics[width=1.8in]{images/interval-closed}
%	& \includegraphics[width=1.8in]{images/interval-1}\\
%
%\hline
%&& \\
%(a,b]=\{x\in\mathbb{R}\, \ssep \,a<x\leq b\}
%	& (a,\infty)=\{x\in\mathbb{R}\, \ssep \,x>a\}
%	& [a,\infty)=\{x\in\mathbb{R}\, \ssep \,x\geq a\}\\
%	~&~&~\\
%\includegraphics[width=1.8in]{images/interval-2}
%	& \includegraphics[width=1.8in]{images/interval-3}
%	& \includegraphics[width=1.8in]{images/interval-4}\\
%
%\hline
%&& \\
%(-\infty,b)=\{x\in\mathbb{R}\, \ssep \,x<b\}
%	& (-\infty,b]=\{x\in\mathbb{R}\, \ssep \,x\leq b\}
%	& (-\infty,\infty)=\mathbb{R}=\mbox{all real numbers}\\
%	~&~&~\\
%\includegraphics[width=1.8in]{images/interval-5}
%	& \includegraphics[width=1.8in]{images/interval-6}
%	& \includegraphics[width=1.8in]{images/interval-7}\\
%\hline
%\end{array}
%\]

\textit{Note}: Any set which is bound at positive and/or negative infinity is an open interval.\\

For an example, consider the sets of real numbers described below.

\begin{example}{Interval Notation}{IntervalNotation}
	\begin{tabular}{|c|c|c|} \hline

		Set of Real Numbers & Interval Notation &  Region on the Real Number Line  \\
		\hline
		& &  \\
		\shortstack{$\{x\, \ssep \,1\leq x< 3\}$ \\ \hfill} & \shortstack{$[1,3)$ \\ \hfill} &
		  \includegraphics[width=2.3in]{images/interval-1ex} \\
		\hline

		&  & \\
		\shortstack{$\{x\, \ssep \,-1\leq x \leq 4\}$ \\ \hfill}& \shortstack{$[-1,4]$ \\ \hfill} &
		\includegraphics[width=2.3in]{images/interval-closedex}  \\
		\hline

		&  & \\

		\shortstack{$\{x\, \ssep  \, x \leq 5 \}$ \\ \hfill} & \shortstack{$(-\infty, 5]$ \\ \hfill} &
		\includegraphics[width=2.3in]{images/interval-6ex}  \\
		\hline

		&  & \\
		\shortstack{$\{x\, \ssep  \, x > -2 \}$ \\ \hfill} & \shortstack{$(-2, \infty)$ \\ \hfill} &
	\includegraphics[width=2.3in]{images/interval-3ex}  \\
		\hline

	\end{tabular}
\end{example}

We will often have occasion to combine sets.  There are two basic ways to combine sets:  \textbf{intersection}
and \textbf{union}.  We define both of these concepts below.

\begin{definition}

	SSuppose $A$ and $B$ are two sets.

		\begin{itemize}

			\item The \textbf{intersection}\index{set ! intersection}\index{intersection of two sets} of $A$ and $B$:  $A \cap B = \{ x \, \ssep  \, x \in A \, \text{and} \,\, x \in B \}$

			\item The \textbf{union}\index{set ! union}\index{union of two sets} of $A$ and $B$: $A \cup B = \{ x \, \ssep  \, x \in A \, \text{or} \,\, x \in B \, \, \text{(or both)} \}$

		\end{itemize}

\end{definition}

Said differently, the intersection of two sets is the overlap of the two sets -- the elements which the sets have in common.  The union of two sets consists of the totality of the elements in each of the sets, collected together.

\begin{example}{Union and Intersection}{UI1}
If $A = \{ 1,2,3 \}$ and $B = \{2,4,6 \}$, then $A \cap B = \{2\}$ and $A \cup B = \{1,2,3,4,6\}$.
\end{example}

\begin{example}{Union and Intersection}{UI2}
  If $A = [-5,3)$ and $B = (1, \infty)$, find $A \cap B$ and $A\cup B$.
\end{example}
\begin{solution}
	To find $A\cap B$, we shade  the overlap of the two and obtain $A \cap B = (1,3)$. \\
	$$\includegraphics[scale=0.2]{images/interval-unionex}$$

	 To find $A \cup B$, we shade each of $A$ and $B$ and describe the resulting shaded region to find  $A \cup B = [-5,\infty)$.\\
	 $$\includegraphics[scale=0.2]{images/interval-unionex2}$$

\end{solution}

While both intersection and union are important, we have more occasion to use union in this text than intersection, simply because most of the sets of real numbers we will be working with are either intervals or are unions of intervals, as the following example illustrates.

%%%%%%%%%%%%%%%
%%%%%%%%%%%%
\begin{example}{Union}{union}

Express the following sets of numbers using interval notation.\\

	\begin{tabular}{lcl}
			(a) \hspace{2mm}  $\{ x \, \ssep  \, x \leq -2 \, \, \text{or} \, \,  x \geq 2 \}$
			& \hspace{2cm}
			& (b) \hspace{2mm} $\{ x \, \ssep  \, x \neq 3 \}$ \\
			&& \\ [-1em]
			(c) \hspace{2mm} $\{ x \, \ssep  \, x \neq \pm 3 \}$
			&
			&(d) \hspace{2mm} $\{ x \, \ssep  \, -1 < x \leq 3 \,\, \text{or} \,\, x = 5\}$ \\
	\end{tabular}

\end{example}
\begin{solution}

	\begin{enumerate}

		\item  The best way to proceed here is to graph the set of numbers on the number line and glean the answer from it.  The inequality $x \leq -2$ corresponds to the interval $(-\infty, -2]$ and the inequality $x \geq 2$ corresponds to the interval $[2, \infty)$.  Since we are looking to describe the real numbers $x$ in one of these \textit{or} the other, we have $\{ x \, | \, x \leq -2 \, \, \text{or} \, \,  x \geq 2 \} = (-\infty, -2] \cup [2, \infty)$.\\
		 $$\includegraphics[scale=0.3]{images/intervals-ex1}$$

		\item For the set $\{ x \, | \, x \neq 3 \}$, we shade the entire real number line except $x=3$, where we leave an open circle.  This divides the real number line into two intervals, $(-\infty, 3)$ and $(3,\infty)$.  Since the values of $x$ could be in either one of these intervals \textit{or} the other, we have that $\{ x \, | \, x \neq 3 \} = (-\infty, 3) \cup (3,\infty)$\\
		$$\includegraphics[scale=0.3]{images/intervals-ex2}$$

		\item  For the set $\{ x \, | \, x \neq \pm 3 \}$, we proceed as before and exclude both $x=3$ and $x=-3$ from our set.  This breaks the number line into \textit{three} intervals, $(-\infty, -3)$, $(-3,3)$ and $(3, \infty)$.   Since the set describes real numbers which come from the first, second \textit{or} third interval, we have $\{ x \, | \, x \neq \pm 3 \} = (-\infty, -3) \cup (-3,3) \cup (3, \infty)$.\\
		$$\includegraphics[scale=0.3]{images/intervals-ex3}$$

		\item  Graphing the set $\{ x \, | \, -1 < x \leq 3 \,\, \text{or} \,\, x = 5\}$, we get one interval, $(-1,3]$ along with a single number, or point, $\{ 5\}$.  While we \textit{could} express the latter as $[5,5]$ (Can you see why?), we choose to write our answer as $\{ x \, | \, -1 < x \leq 3 \,\, \text{or} \,\, x = 5\} = (-1,3] \cup \{ 5\}$.\\
		$$\includegraphics[scale=0.3]{images/intervals-ex4}$$

	\end{enumerate}

\end{solution}

%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%

\subsection*{Inequality Rules}\label{sec:Inequalities}
Before solving inequalities, we start with the properties and rules of inequalities.\\

%\begin{definition}{Inequality Rules}{Inequalityrules}
\begin{formulabox}[Inequality Rules]
{\bf Add/subtract a number to both sides:}\vspace{-0.2cm}
\begin{itemize}
	\item If $a<b$, then $a+c<b+c$ and $a-c<b-c$.
\end{itemize}
{\bf Adding two inequalities of the \red{same} type:}\vspace{-0.2cm}
\begin{itemize}
	\item If $a<b$ and $c<d$, then $a+c<b+d$.\\
				\ifont{Add the left sides together, add the right sides together.}
\end{itemize}
{\bf Multiplying by a \red{positive} number:}\vspace{-0.2cm}
\begin{itemize}
	\item Let $c>0$. If $a<b$, then $c\cdot a<c\cdot b$.
\end{itemize}
{\bf Multiplying by a \red{negative}  number:}\vspace{-0.2cm}
\begin{itemize}
	\item Let $c<0$. If $a<b$, then $c\cdot a>c\cdot b$.\\
		\ifont{Note that we reversed the inequality symbol!}
\end{itemize}
\end{formulabox}
%\end{definition}

Similar rules hold for each of $\leq$, $>$ and $\geq$.

\subsection*{Solving Basic Inequalities}
We can use the inequality rules to solve some simple inequalities. \\

\begin{example}{Basic Inequality}{BasicInequality}
Find all values of $x$ satisfying
\[ 3x+1>2x-3. \]
Write your answer in both interval and set-builder notation.
Finally, draw a number line indicating your solution set.
\end{example}

\begin{solution}
Subtracting $2x$ from both sides gives $x+1>-3$.
Subtracting $1$ from both sides gives $x>-4$.
Therefore, the solution is the interval $(-4,\infty)$.
In set-builder notation the solution may be written as $\{x\in\mathbb{R}\, \ssep \,x>-4\}$.
We illustrate the solution on the number line as follows:
\[
\includegraphics[width=2in]{images/ineq-ex-1}
\]
\end{solution}

Sometimes we need to split our inequality into two cases as the next example demonstrates. \\

\begin{example}{Double Inequalities}{DoubleInequalities}
Solve the inequality
\[ 4>3x-2\geq 2x-1. \]
\vspace{-0.5cm}
\end{example}

\begin{solution}
We need both $\,\,4>3x-2\,\, $ and $\,\,3x-2\geq 2x-1\,\,$ to be true:
\[\begin{array}{rclcrcl}
	4 & > & 3x-2 & \hspace{5mm} \text{and} \hspace{5mm} & \hspace{3mm} 3x-2 & \geq & 2x-1\\
	6 & > & 3x & & x-2 & \geq & -1\\
	2 & > & x &  & x & \geq & 1\\
	x & < & 2 & & x & \geq & 1\\
\end{array}\]
Thus, we require $\,\,x\geq 1\,\,$ but also $\,\,x<2\,\,$ to be true.
This gives all the numbers between $1$ and $2$, including $1$ but not including $2$.
That is, the solution to the inequality $\,\,4>3x-2\geq 2x-1\,\,$ is the interval $[1,2)$.
In set-builder notation this is the set $\,\,\{x\in\mathbb{R}\, \ssep \,1\leq x<2\}$.
\end{solution}

\bigskip

\begin{example}{Positive Inequality}{4x-inequality}
Solve $4x-x^2>0$.
\end{example}

\begin{solution}
We provide two methods to solve this inequality.

\bigskip
\noindent
\ifont{First method.} Factor $4x-x^2$ as $x(4-x)$.  The product of two numbers
is positive when either both are positive or both are negative, i.e., if
either $x>0$ and $4-x>0$, or else $x<0$ and $4-x<0$.  The latter alternative
is impossible, since if $x$ is negative, then $4-x$ is greater than 4, and
so cannot be negative.  As for the first alternative, the condition $4-x>0$
can be rewritten (adding $x$ to both sides) as $4>x$, so we need:
$x>0$ and $4>x$ (this is sometimes combined in the form $4>x>0$, or,
equivalently, $0<x<4$).  In interval notation, this says that the solution
is the interval $(0,4)$.

\bigskip
\noindent
\ifont{Second method.}  Write $4x-x^2$ as $-(x^2-4x)$, and then complete
the square, obtaining
$$-\Bigl((x-2)^2-4\Bigr)=4-(x-2)^2.$$
For this to be positive we need $(x-2)^2<4$, which means that $x-2$ must be less
than 2 and greater than $-2$:  $-2<x-2<2$.  Adding 2 to everything gives
$0<x<4$.

\bigskip
\noindent
Both of these methods are equally correct; you may use either
in a problem of this type.
\end{solution}

We next present another method to solve more complicated looking inequalities.
In the next example we will solve a rational inequality by using
a number line and test points. We follow the guidelines below.\\

\begin{formulabox}[Guidelines for Solving Rational Inequalities]
\begin{enumerate}\itemsep0em
	\item Move everything to \ifont{one side} to get a $0$ on the other side.
	\item If needed, combine terms using a \ifont{common denominator}.
	\item \ifont{Factor} the numerator and denominator.
	\item Identify points where either the numerator or denominator is $0$. Such points
				are called \dfont{split points}.
	\item Draw a \ifont{number line} and indicate your split points on the number line.
				Draw \ifont{closed/open circles} for each split point depending on
				if that split point satisfies the inequality (division by zero is not allowed).
	\item The split points will split the number line into subintervals. For each
				subinterval pick a \ifont{test point} and see if the expression in Step 3
				is positive or negative. Indicate this with a $+$ or $-$ symbol on the
				number line for that subinterval.
	\item Now write your answer in set-builder notation. Use the union symbol
				$\cup$ if you have multiple intervals in your solution.
\end{enumerate}
\end{formulabox}

\begin{example}{Rational Inequality}{RationalInequality1}
Write the solution to the following inequality using interval notation:
\[\frac{2-x}{2+x}\geq 1.\]
\vspace{-0.5cm}
\end{example}

\begin{solution}
One method to solve this inequality is to multiply both sides by $2+x$, but because we do not know if $2+x$ is positive or negative we must split it into two cases (\ifont{Case 1:} $2+x>0$ and \ifont{Case 2:} $2+x<0$).

Instead we follow the guidelines for solving rational inequalities:
\[
\begin{array}{rcl}
\mbox{Start with original problem:}& ~ & \displaystyle{\frac{2-x}{2+x}\geq 1}\\
\\
\mbox{Move everything to one side:}& ~ & \displaystyle{\frac{2-x}{2+x}-1 \geq 0}\\
\\
\mbox{Find a common denominator:}& ~ & \displaystyle{\frac{2-x}{2+x}-\frac{2+x}{2+x} \geq 0}\\
\\
\mbox{Combine fractions:}& ~ & \displaystyle{\frac{(2-x)-(2+x)}{2+x} \geq 0}\\
\\
\mbox{Expand numerator:}& ~ & \displaystyle{\frac{2-x-2-x}{2+x} \geq 0}\\
\\
\mbox{Simplify numerator:}& ~ & \displaystyle{\frac{-2x}{2+x} \geq 0\quad(*)}\\
\end{array}
\]
Now we have the numerator and denominator in fully factored form.
The split points are $x=0$ (makes the numerator $0$) and $x=-2$ (makes the denominator $0$).
Let us draw a number line with the split points indicated on it:
\[
\includegraphics[width=2in]{images/ineq-rational-1}
\]
The point $x=0$ is included since if we sub $x=0$ into (*) we get $0\geq 0$ which is true.
The point $x=-2$ is not included since we cannot divide by zero.
We indicate this with open/closed circles on the number line (remember that open means omit):
\[
\includegraphics[width=2in]{images/ineq-rational-2}
\]
Now choosing a test point from each of the three subintervals we can determine if the expression $-2x /(2+x) $ is positive or negative.
When $x=-3$, it is negative.
When $x=-1$, it is positive.
When $x=1$, it is negative.
Indicating this on the number line gives:
\[
\includegraphics[width=2in]{images/ineq-rational-3}
\]
Since we wish to solve $\displaystyle{\frac{-2x}{2+x}\geq 0}$, we look at where the $+$ signs are and shade that area on the number line:
\[
\includegraphics[width=2in]{images/ineq-rational-4}
\]
Since there is a closed circle at $0$, we include it.
Therefore, the solution is $(-2,0]$.
\end{solution}

\begin{example}{Rational Inequality}{RationalInequality2}
Write the solution to the following inequality using interval notation:
\[ \frac{2}{x+2}>{3}{x+3}. \]
\vspace{-0.5cm}
\end{example}

\begin{solution}
We provide a brief outline of the solution.
By subtracting $(3x+3)$ from both sides and using a common denominator of $x+2$,
we can collect like terms and simplify to get:
\[ \frac{-(3x^2+9x+4)}{x+2}>0. \]
The denominator is zero when $x=-2$.
Using the quadratic formula, the numerator is zero when
$x=(-9\pm\sqrt{33})/6$ (these two numbers are approximately $-2.46$ and $-0.54$).
Since the inequality uses ``$>$'' and $0>0$ is false,
we do not include any of the split points in our solution.
After choosing suitable test points and determining the sign of
$-(3x^2+9x+4)/(x+2)$ we have
\[
\includegraphics[width=2.5in]{images/ineq-ex-2}
\]
Looking where the $+$ symbols are located gives the solution:
$$\left(-\infty,\frac{-9-\sqrt{33}}{6}\right) \cup\left(-2,\frac{-9+\sqrt{33}}{6}\right).$$
When writing the final answer we use \ifont{exact} expressions for numbers in mathematics, not
approximations (unless stated otherwise).
\end{solution}


\section{Interpreter}

\subsection{Testclass}

\begin{lstlisting}[language=Scala]
import Interpreter.evalBExpr
import scala.collection.mutable.Map

object Test {
  def main(args: Array[String]) {
    val bExpr = DyaBExpr(CondAnd, LitBExpr(true), LitBExpr(false)); //Comparision of true AND false
    println(evalBExpr(bExpr, Map[String, Int]())); //Returns false

    //Command to test interpreter
    val intDiv = CpsCmd(List(
      AssiCmd("q", LitAExpr(0)),
      AssiCmd("r", IdAExpr("m")),
      WhileCmd(
        RelBExpr(GreaterEq, IdAExpr("r"), IdAExpr("n")),
        CpsCmd(List(
          AssiCmd("q", DyaAExpr(Plus, IdAExpr("q"), LitAExpr(1))),
          AssiCmd("r", DyaAExpr(Minus, IdAExpr("r"), IdAExpr("n")))))),
      SkipCmd));
    val map = Map[String, Int]("m" -> 5, "n" -> 2) // initial values for m and n
    println("map = " + map);
    println("res = " + Interpreter.interpret(intDiv, map))
  }
}
\end{lstlisting}

\subsection{Syntax definition}

\begin{lstlisting}[language=Scala]
//Abstract class with only case objects. Case objects can be used if there are cases which take no parameter.
abstract class RelOperator
case object LessEq extends RelOperator
case object GreaterEq extends RelOperator

abstract class BoolOperator
case object CondAnd extends BoolOperator
case object CondOr extends BoolOperator

abstract class BoolExpr
case class LitBExpr(value: Boolean) extends BoolExpr
case class NegBExpr(expr: BoolExpr) extends BoolExpr
case class DyaBExpr(operator: BoolOperator, op1: BoolExpr, op2: BoolExpr) extends BoolExpr // dyadic, means two
case class RelBExpr(relOp: RelOperator, aExp1: ArithExpr, aExp2: ArithExpr) extends BoolExpr

//Also working with different objects, no classes
abstract class ArithOperator
case object Times extends ArithOperator
case object Div extends ArithOperator
case object Mod extends ArithOperator
case object Plus extends ArithOperator
case object Minus extends ArithOperator

abstract class ArithExpr
case class LitAExpr(value: Int) extends ArithExpr
case class IdAExpr(ident: String) extends ArithExpr
case class DyaAExpr(op: ArithOperator, exp1: ArithExpr, exp2: ArithExpr) extends ArithExpr

abstract class Command
case class AssiCmd(ident: String, aExpr: ArithExpr) extends Command
case class CpsCmd(commands: List[Command]) extends Command
case class WhileCmd(bExpr: BoolExpr, command: Command) extends Command
case object SkipCmd extends Command
\end{lstlisting}

\subsection{Interpreter}

\begin{lstlisting}[language=Scala]
//import scala.collection.Map  //This would be the immutable map (default)
import scala.collection.mutable.Map //We need the mutable map

object Interpreter {

  type Value = Int
  type State = Map[String, Value]

  //Boolean Expressions
  def evalBExpr(expr: BoolExpr, state: State): Boolean =
    expr match {
      case LitBExpr(value) => value
      case NegBExpr(op) => !evalBExpr(op, state)
      case DyaBExpr(CondAnd, op1, op2) => evalBExpr(op1, state) && evalBExpr(op2, state)
      case DyaBExpr(CondOr, op1, op2) => evalBExpr(op1, state) || evalBExpr(op2, state)
      case RelBExpr(LessEq, aExp1, aExp2) => evalAExpr(aExp1, state) <= evalAExpr(aExp2, state)
      case RelBExpr(GreaterEq, aExp1, aExp2) => evalAExpr(aExp1, state) >= evalAExpr(aExp2, state)
    }

  //Arithmetic Expressions
  def evalAExpr(aExpr: ArithExpr, state: State): Int =
    aExpr match {
      case LitAExpr(value) => value
      case IdAExpr(ident) => state(ident)
      case DyaAExpr(Times, exp1, exp2) => evalAExpr(exp1, state) * evalAExpr(exp2, state)
      case DyaAExpr(Div, exp1, exp2) => evalAExpr(exp1, state) / evalAExpr(exp2, state)
      case DyaAExpr(Mod, exp1, exp2) => evalAExpr(exp1, state) % evalAExpr(exp2, state)
      case DyaAExpr(Plus, exp1, exp2) => evalAExpr(exp1, state) + evalAExpr(exp2, state)
      case DyaAExpr(Minus, exp1, exp2) => evalAExpr(exp1, state) - evalAExpr(exp2, state)
    }

  //Interpreter to interpret different commands
  def interpret(commands: Command, state: State): State =
    commands match {
      case SkipCmd => state
      case AssiCmd(ident, aExpr) => state(ident) = evalAExpr(aExpr, state); state
      case CpsCmd(Nil) => state
      case CpsCmd(x :: xs) => interpret(CpsCmd(xs), interpret(x, state))
      case WhileCmd(bExpr, command) => if (evalBExpr(bExpr, state)) interpret(command, state) else state
    }
}
\end{lstlisting}

\clearpage


\section{Approximation Rates for ReLU$^k$ Networks}\label{relu-result-section}
In this section, we consider approximation by neural networks with activation function $$\sigma_k(x) = [\max(0,x)]^k$$ for $k=\mathbb{Z}_{\geq 0}$ (here we set $0^0 = 0$, i.e. $\sigma_0(x)$ is the Heaviside function). Specifically, we consider approximating a function $f$ by elements of the set
\begin{equation}
 \Sigma^k_{n} = \left\{\sum_{i=1}^n a_i\sigma_k(\omega_i\cdot x + b_i):~\omega_i\in S^{d-1},~b_i\in \mathbb{R},~a_i\in\mathbb{C}\right\},
\end{equation}
where we allow the coefficients $a_i$ to have arbitrarily large $\ell^1$-norm.

We will use Lemma \ref{fourier-representation-lemma} to obtain an improved approximation rate for such networks on the spectral Barron space $\mathcal{B}^m(\Omega)$. To do this, we introduce a multiscale approximation of the complex exponentials $e^{2\pi {\mathrm{i}\mkern1mu} x}$ using splines. We begin by recalling some facts about spline interpolation which will be important in the following analysis. We will refer to \cite{devore1993constructive} for most of this material.

Instead of working directly with $\sigma_k$ it is much more convenient to introduce the cardinal B-splines
\begin{equation}\label{card-b-splines-def}
 N_k(x) = \frac{1}{k!}\sum_{i=0}^{k+1}(-1)^i\binom{k+1}{i}\sigma_k(x-i) \in \Sigma_{k+1}^k,
\end{equation}
which are compactly supported on $[0,k+1]$.

Let $\mathcal{S}^k_\lambda$ denote the Schoenberg space of piecewise degree $k$ splines on $\mathbb{R}$ with knots at $\lambda \mathbb{Z}$. It is well known that every spline $S\in\mathcal{S}^k_1$ can be written as
\begin{equation}\label{eq_963}
 S(x) = \sum_{j=-\infty}^\infty c_j(S)N_k(x-j),
\end{equation}
where $c_j$ are the de Boor-Fix functionals (see \cite{devore1993constructive}, section 5.3). Since the knots of the spline are all evenly spaced, the functionals $c_j(S)$ are all translations of the functional $c_0$, i.e.
\begin{equation}\label{eq_967}
 c_j(S) = c_0(S(\cdot-j)).
\end{equation}
Moreover, consider change the spacing between the knots, i.e. consider $\mathcal{S}^k_\lambda$. Then, if $S\in \mathcal{S}^k_\lambda$, $S(\lambda x)\in \mathcal{S}^k_1$ and equations \eqref{eq_963} and \eqref{eq_967} imply that
\begin{equation}
 S(\lambda x) = \sum_{j=-\infty}^\infty c_j(S(\lambda\cdot))N_k(x-j),
\end{equation}
so that
\begin{equation}
 S(x) = \sum_{j=-\infty}^\infty c_{j,\lambda}(S)N_k(\lambda^{-1}x-j),
\end{equation}
where the functionals $c_{j,\lambda}$ are given by $c_{j,\lambda}(S) = c_0(S(\lambda(\cdot - j)))$.

Now, we see from \cite{devore1993constructive}, Lemma 4.1 of Chapter 5, that
\begin{equation}\label{eq_983}
 |c_{j,\lambda}(S)| \leq C\|S\|_{L^\infty([\lambda j, \lambda (j+k+1)])},
\end{equation}
for a fixed constant $C$. Thus, by the Hahn-Banach theorem, we can extend the de Boor-Fix functionals $c_{j,\lambda}$ to functionals $\gamma_{j,\lambda}$ on $L^\infty([\lambda j, \lambda (j+k+1)])$ which satisfy the same bound. This allows us to define the quasi-interpolation operators
\begin{equation}\label{quasi-interpolation}
 Q_\lambda(f) = \sum_{j=-\infty}^\infty \gamma_{j,\lambda}(f)N_k(\lambda^{-1}x-j),
\end{equation}
which are bounded in $L^\infty$ (uniformly in $\lambda$) and satisfy $Q(S) = S$ for all splines $S\in \mathcal{S}^k_\lambda$ (see \cite{devore1993constructive}, section 5.4). Note that here and in what follows, we suppress the dependence on $k$ of the operators $Q_\lambda$ and the de Boor-Fix functions $\gamma_{j,\lambda}$ to simplify notation.

We are now in the position to introduce the following multiscale piecewise degree $k$ approximation to $e^{2\pi {\mathrm{i}\mkern1mu}   x}$. We write
\begin{equation}\label{multiscale-approx}
 e^{2\pi {\mathrm{i}\mkern1mu}  x} = Q_{2^{-1}}(e^{2\pi {\mathrm{i}\mkern1mu}   x}) + \sum_{l=2}^\infty [Q_{2^{-l}}(e^{2\pi {\mathrm{i}\mkern1mu}   x}) - Q_{2^{-(l-1)}}(e^{2\pi {\mathrm{i}\mkern1mu}   x})] = \sum_{l=1}^\infty h_l(x),
\end{equation}
where
\begin{equation}
 h_l(x) = Q_{2^{-l}}(e^{2\pi {\mathrm{i}\mkern1mu}   x}) - Q_{2^{-(l-1)}}(e^{2\pi {\mathrm{i}\mkern1mu}   x}),
\end{equation}
for $l > 1$ and $h_1(x) = Q_{2^{-1}}(e^{2\pi {\mathrm{i}\mkern1mu}   x})$. Since we clearly have $\mathcal{S}^k_{2^{-(l-1)}} \subset \mathcal{S}^k_{2^{-l}}$, we see that
$$Q_{2^{-l}}(Q_{2^{-(l-1)}}(e^{2\pi {\mathrm{i}\mkern1mu}   x})) = Q_{2^{-(l-1)}}(e^{2\pi {\mathrm{i}\mkern1mu}   x}),$$
so that we can rewrite $h_l$ as

\begin{equation}\label{eq_995}
h_l(x) = Q_{2^{-l}}\left(e^{2\pi {\mathrm{i}\mkern1mu}   x} - Q_{2^{-(l-1)}}(e^{2\pi {\mathrm{i}\mkern1mu}   x})\right) = Q_{2^{-l}}(e_{l-1}(x)) = \sum_{j=-\infty}^\infty \alpha_{j,l}N_k(2^{l}x-j),
\end{equation}
where the error $e_{l-1}$ is given by $e_{l-1}(x) = e^{2\pi {\mathrm{i}\mkern1mu}   x} - Q_{2^{-(l-1)}}(e^{2\pi {\mathrm{i}\mkern1mu}   x})$ and the coefficients $\alpha_{j,l}$ are given by $\alpha_{j,l} = \gamma_{j,2^{-l}}(e_{l-1})$.

We have the following lemma concerning this this piecewise degree $k$ approximation of $e^{2\pi {\mathrm{i}\mkern1mu}   x}$.
\begin{lemma}\label{multilevel-spline}
 The above expansion of $e^{2\pi {\mathrm{i}\mkern1mu} x}$ has the following properties.
 \begin{itemize}
  \item $\|e_l\|_{\infty} \lesssim 2^{-(k+1)l}$.
  \item The coefficients $\alpha_{j,l}$ in equation \eqref{eq_995} satisfy $|\alpha_{j,l}| \lesssim 2^{-(k+1)l}$.
  \item The series in \eqref{multiscale-approx} converges in $W^{m,\infty}(\mathbb{R})$ for $0 \leq m \leq k$.
 \end{itemize}
\end{lemma}
Note that the implied constants in the above lemma and the following proof only depend upon $k$ and not upon $l$ or $j$.
\begin{proof}
 The first statement follows immediately from Theorem 4.5 in \cite{devore1993constructive}, since $e_l(x) = e^{2\pi {\mathrm{i}\mkern1mu}   x} - Q_{2^{-l}}(e^{2\pi {\mathrm{i}\mkern1mu}   x})$ and $e^{2\pi {\mathrm{i}\mkern1mu} x}\in W^{k+1,\infty}(\mathbb{R})$.

%  Let $z\in \mathbb{R}$. We will show that $|e_{l-1}(z)| \lesssim 2^{-(k+1)l}$. Choose an index $j$ so that $z\in I^k_{l,j}:=[2^{-l}j, 2^{-l}(j+k+1)]$.
%
%  We first note that
%  \begin{equation}\label{eq_1018}
%   e_l(x) = e^{2\pi {\mathrm{i}\mkern1mu}   x} - \sum_{s=1}^{l}h_s(x) = e_{l-1}(x) - Q_{2^{-l}}(e_{l-1}(x)).
%  \end{equation}
%  Since $\|e^{2\pi {\mathrm{i}\mkern1mu} x}\|_{W^{k+1,\infty}(\mathbb{R})}\lesssim 1$ (here the constant only depends upon $k$), we get
%  \begin{equation}
%   \|e^{2\pi {\mathrm{i}\mkern1mu}   x} - T_{l,j}^k(x)\|_{L^\infty(I^k_{l,j})} \lesssim |I^k_{l,j}|^{k+1}\lesssim 2^{-(k+1)l},
%  \end{equation}
%  where $T_{l,j}^k(x)$ is the degree $k$ Taylor polynomial of $e^{2\pi {\mathrm{i}\mkern1mu} x}$ centered at the left endpoint $2^{-l}j$. We thus obtain
%  \begin{equation}
%   \left\|e_{l-1}(x) - S_{l,j}^k(x)\right\|_{L^\infty(I^k_{l,j})} \lesssim 2^{-(k+1)l},
%  \end{equation}
%  where
%  \begin{equation}
%   S_{l,j}^k(x) = T_{l,j}^k(x) - \sum_{s=1}^{l-1}h_s(x) \in \mathcal{S}^k_{2^{-l}},
%  \end{equation}
%  since $T_{l,j}^k(x)$ is a polynomial and $h_s(x) \in \mathcal{S}^k_{2^{-s}}\subset \mathcal{S}^k_{2^{-l}}$ (since $s < l$).
%
%  As $Q_{2^{-l}}$ leaves the space $\mathcal{S}^k_{2^{-l}}$ invariant, i.e. $S_{l,j}^k(x) = Q_{2^{-l}}(S_{l,j}^k(x))$, we obtain
%  \begin{equation}
%  \begin{split}
%   \|e_{l-1}(x) - Q_{2^{-l}}(e_{l-1}(x))\|_{L^\infty(I^k_{l,j})} &\leq \|e_{l-1}(x) - S_{l,j}^k(x)\|_{L^\infty(I^k_{l,j})} + \|Q_{2^{-l}}(S_{l,j}^k(x) - e_{l-1}(x))\|_{L^\infty(I^k_{l,j})} \\
%   & \leq (1 + \|Q_{2^{-l}}\|_{L^\infty\rightarrow L^\infty})\|e_{l-1}(x) - S_{l,j}^k(x)\|_{L^\infty(I^k_{l,j})} \lesssim 2^{-(k+1)l}.
%   \end{split}
%  \end{equation}
%  Here it is important to note that the operator norm $\|Q_{2^{-l}}\|_{L^\infty\rightarrow L^\infty}$ is bounded independently of $l$ since the quasi-interpolation operators $Q_\lambda$ are bounded uniformly in $\lambda$.
%
%  By equation \eqref{eq_1018} we then obtain
%  \begin{equation}
%   \|e_l(x)\|_{L^\infty(I^k_{l,j})} = \|e_{l-1}(x) - Q_{2^{-l}}(e_{l-1}(x))\|_{L^\infty(I^k_{l,j})} \lesssim 2^{-(k+1)l}.
%  \end{equation}
%  Since $z\in I^k_{l,j}$, we thus have $|e_{l}(z)| \lesssim 2^{-(k+1)l}$ and the first statement follows.

 For the second statement, we note that
 \begin{equation}
  |\alpha_{j,l}| = |\gamma_{j,2^{-l}}(e_{l-1})| \leq C\|e_{l-1}\|_{L^\infty(\mathbb{R})} \lesssim 2^{-(k+1)(l-1)} \lesssim 2^{-(k+1)l},
 \end{equation}
 where the first inequality is due to the fact that $\gamma_{j,2^{-j}}$ is a Hahn-Banach extension of the de Boor-Fix functional $c_{j,2^{-j}}$ which satisfies \eqref{eq_983}.

 Finally, note that since $\|e_l\|_{L^\infty(\mathbb{R})} \lesssim 2^{-(k+1)l}\rightarrow 0$, we have that the series in \eqref{multiscale-approx} converges in $L^\infty(\mathbb{R})$ to $e^{2\pi {\mathrm{i}\mkern1mu} x}$. We now claim that
 \begin{equation}
  \|h_l\|_{W^{m,\infty}(\mathbb{R})} \lesssim 2^{-(k+1-m)l}.
 \end{equation}
 First, we note that simply by taking derivatives, we get
 \begin{equation}
  \|N_p(2^lx-j)\|_{W^{m,\infty}(\mathbb{R}, dx)} \lesssim 2^{ml}.
 \end{equation}
 Second, the B-splines $N_k(2^lx-j)$ are compactly supported and each point $x$ is covered by at most $p+1$ of them. Hence
 \begin{equation}
  \|h_l\|_{W^{m,\infty}} = \left\|\sum_{j=-\infty}^\infty \alpha_{j,l}N_k(2^{l}x-j)\right\|_{W^{m,\infty}} \leq (k+1)\sup_{j}|\alpha_{j,l}|\|N_k(2^lx-j)\|_{W^{m,\infty}(\mathbb{R}, dx)} \lesssim 2^{-(k+1-m)l},
 \end{equation}
 since $\alpha_{j,l}\lesssim 2^{-(k+1)l}$.

 This means that if $m\leq k$, then $\sum_{l=1}^\infty \|h_l\|_{W^{m,\infty}}$ is summable and hence the sum in \eqref{multiscale-approx} converges in $W^{m,\infty}(\mathbb{R})$. Clearly, its limit must be the same as the limit in $L^\infty$ and thus it converges to $e^{2\pi {\mathrm{i}\mkern1mu} x}$.
\end{proof}

Combining the multiscale expansion \eqref{multiscale-approx} with Lemma \ref{fourier-representation-lemma} and some ideas from \cite{makovoz1996random}, we obtain the following theorem.

\begin{theorem}\label{piecewise-poly-approx-theorem}
 Let $\Omega = [0,1]^d$ and $f\in \mathcal{B}^s(\Omega)$ for $s \geq \frac{1}{2}$. Let $k \in \mathbb{Z}_{\geq 0}$ and $m\geq 0$, with $m\leq s-\frac{1}{2}$ and $m < k + \frac{1}{2}$. Then for $n\geq 2$,
 \begin{equation}\label{bound-equation}
  \inf_{f_n\in \Sigma^k_{n}}\|f - f_n\|_{H^m(\Omega)} \lesssim \|f\|_{\mathcal{B}^s}n^{-t}\log(n)^q,
 \end{equation}
 where the exponent $t$ is given by
 $$t = \min\left(\frac{1}{2}+\frac{2(s-m)-1}{2(d+1)}, k-m+1\right) = \begin{cases}
            \frac{1}{2}+\frac{2(s-m)-1}{2(d+1)} & \text{if}~s < (d+1)\left(k-m+\frac{1}{2}\right) + m + \frac{1}{2} \\
            k-m+1 & \text{if}~s \geq (d+1)\left(k-m+\frac{1}{2}\right) + m + \frac{1}{2}
                                        \end{cases}
$$
 and $q$ is given by $$q = \begin{cases}
            0 & \text{if}~s < (d+1)\left(k-m+\frac{1}{2}\right) + m + \frac{1}{2} \\
            1 & \text{if}~s > (d+1)\left(k-m+\frac{1}{2}\right) + m + \frac{1}{2}\\
            1 + (k-m+\frac{1}{2}) & \text{if}~s = (d+1)\left(k-m+\frac{1}{2}\right) + m + \frac{1}{2}
           \end{cases}.$$
\end{theorem}
Before beginning the proof, we remark that all of the implied constants in the $\eqsim$, $\gtrsim$, and $\lesssim$ can be seen to depend only on $s,k,m,d,L$ and $\delta$ ($L$ and $\delta$ chosen during the course of the proof), but not on $f$ or $n$. Further, we remark that the suppressed constant may depend exponentially on the dimension, i.e. as $A^d$ for some $A$. Finally, note that the maximal possible rate of $s-m+1$, which is achieved for sufficiently large $s$, is exactly the best achievable rate in one dimension. In Theorem \ref{relu-lower-bound} we use this fact the show that the rate of $s-m+1$ cannot be improved upon no matter how large $s$ is. It is an open problem whether such a rate can be obtained with less smoothness.

Comparing with other results in the literature, we see for instance that the results in \cite{klusowski2018approximation} apply to the cases $k=1,m=0$ (ReLU) and $k=2,m=0$ (ReLU$^2$). Furthermore, in \cite{CiCP-28-1707}, the general case $0\leq m\leq k$ is considered. In all of these cases the rate previously obtained was $O(n^{-\frac{1}{2}-\frac{1}{d}})$, while the rates in Theorem \ref{piecewise-poly-approx-theorem} are $O(n^{-\frac{1}{2}-\frac{2k+1}{2(d+1)}})$, which are significantly better for large $k$ and large $d$. However, the rates in Theorem \ref{piecewise-poly-approx-theorem} were obtained without the $\ell^1$-norm bound on the coefficients as in \cite{klusowski2018approximation} and \cite{CiCP-28-1707}. It is open whether the same rates can also be obtained with $\ell^1$-bounded  coefficients.

\begin{proof}
   Choose $L > 1$. Using Corollary \ref{fourier-representation-lemma}, we see that there exists an $a\in L^{-1}[0,1]^d$ and coefficients $a_\xi$ such that
 \begin{equation}\label{eq_675}
  f(x) = \sum_{\xi\in L^{-1}\mathbb{Z}^d} a_\xi (1+|a+\xi|)^{-s}e^{2\pi {\mathrm{i}\mkern1mu}  (a + \xi)\cdot x}
 \end{equation}
 and $\sum |a_\xi|\lesssim \|f\|_{\mathcal{B}^s}$. Here the suppressed constant depends potentially exponentially on the dimension, by the remarks in the previous section.

 We expand $e^{2\pi {\mathrm{i}\mkern1mu}   (a+\xi)\cdot x}$ using \eqref{multiscale-approx} to get
 \begin{equation}
  e^{2\pi {\mathrm{i}\mkern1mu}  (a + \xi)\cdot x} = \sum_{l=1}^\infty h_l((a + \xi)\cdot x),
 \end{equation}
 which holds in $W^{m,\infty}(\mathbb{R}^d)$ and thus in $H^m(\Omega)$ since $\Omega$ is bounded.

 Expanding $h_l$ using equation \eqref{eq_995} and plugging this into equation \eqref{eq_675}, we obtain (in $H^m(\Omega)$)
 \begin{equation}
  f(x) = \sum_{\xi\in L^{-1}\mathbb{Z}^d}\sum_{l=1}^\infty \sum_{j=-\infty}^\infty a_\xi \alpha_{j,l} (1+|a+\xi|)^{-s}N_k(2^l(a+\xi)\cdot x - j).
 \end{equation}

 Now, since $x\in \Omega$, $\Omega$ is a bounded set, and $N_k$ is compactly supported, the number of non-zero terms in the inner-most sum above is finite. Indexing the values of $j$ for which $N_k(2^l(a+\xi)\cdot x - j)$ is non-zero for $x\in \Omega$ as $j_1,...,j_{n_{\xi, l}}$, we get
 \begin{equation}
  f(x) = \sum_{\xi\in L^{-1}\mathbb{Z}^d}\sum_{l=1}^\infty \sum_{p=1}^{n_{\xi,l}} a_\xi \alpha_{j_p,l} (1+|a+\xi|)^{-s} \psi_{\xi,l,p}(x),
 \end{equation}
 where
 \begin{equation}\label{psi-definition}
  \psi_{\xi,l,p}(x) = N_k(2^l(a+\xi)\cdot x - j_p).
 \end{equation}
 A straightforward calculation utilizing the compact support of $N_k$ implies that
 \begin{equation}\label{eq_454}
  \|\psi_{\xi,l,p}\|_{H^m(\Omega)} \lesssim 2^{l\left(m-\frac{1}{2}\right)}(1 + |\xi|)^{\left(m-\frac{1}{2}\right)}.
 \end{equation}
 Further, note that the number of terms $n_{\xi,l}$ satisfies
 \begin{equation}\label{eq_452}
  n_{\xi,l} \lesssim 2^l(1 + |\xi|).
 \end{equation}
This follows since for $x\in \Omega$, $y = 2^l(a + \xi)\cdot x$ takes on values in an interval of length at most $2^l|a + \xi|\text{diam}(\Omega)$ and $N_k$ has compact support of size $k+1$.

Let $\delta > 0$ to be specified later. We proceed to write
\begin{equation}\label{eq_458}
  f(x) = \sum_{\xi\in L^{-1}\mathbb{Z}^d}\sum_{l=1}^\infty \sum_{p=1}^{n_{\xi,l}} a_\xi 2^{-l(1+\delta)}(1+|\xi|)^{-1} \phi_{\xi,l,p}(x),
 \end{equation}
 where
 \begin{equation}\label{eq_463}
  \phi_{\xi,l,p}(x) = 2^{l(1+\delta)}(1+|\xi|)\alpha_{j_p,l} (1+|a+\xi|)^{-s} \psi_{\xi,l,p}(x).
 \end{equation}
 Using \eqref{eq_463} and \eqref{eq_454} combined with the bound on $|\alpha_{j,l}|$ from Lemma \ref{multilevel-spline}, we calculate
 \begin{equation}\label{eq_470}
  \|\phi_{\xi,l,p}\|_{H^m(\Omega)} \lesssim 2^{-l(k-m+\frac{1}{2}-\delta)}(1+|\xi|)^{m-s+\frac{1}{2}}.
 \end{equation}

 We now observe that  by \eqref{eq_452} the $\ell^1$ norm of the coefficients of the $\phi_{\xi,l,p}$ in \eqref{eq_458} is bounded, namely
 \begin{equation}
 \begin{split}
  \sum_{\xi\in L^{-1}\mathbb{Z}^d}\sum_{l=1}^\infty \sum_{p=1}^{n_{\xi,l}} |a_\xi 2^{-l(1+\delta)}(1+|\xi|)^{-1}| =
  \sum_{\xi\in L^{-1}\mathbb{Z}^d}|a_\xi|\sum_{l=1}^\infty n_{\xi,l}2^{-l(1+\delta)}(1+|\xi|)^{-1} &\lesssim \sum_{\xi\in L^{-1}\mathbb{Z}^d}|a_\xi|\sum_{l=1}^\infty 2^{-l\delta} \\
  & \lesssim \delta^{-1}\|f\|_{\mathcal{B}^m(\Omega)}.
  \end{split}
 \end{equation}
 We can now apply Theorem 1 in \cite{makovoz1996random} (note that this theorem still applies even though the coefficients in \eqref{eq_458} are potentially complex) to $f$ to conclude that there exists an
 \begin{equation}
  f_n = \sum_{i=1}^n a_i\phi_{\xi_i,l_i,p_i}(x)
 \end{equation}
 with $\sum_{i=1}^n|a_i| \lesssim \|f\|_{\mathcal{B}^s(\Omega)}$ such that
 \begin{equation}\label{bound_equation}
  \|f - f_n\|_{H^m(\Omega)} \lesssim \delta^{-1}\|f\|_{\mathcal{B}^s(\Omega)}\epsilon_n(\Phi)n^{-\frac{1}{2}},
 \end{equation}
 where $\Phi = \{\phi_{\xi,l,p}\}$ and $\epsilon_n(\Phi) = \inf\{\epsilon > 0:\Phi~\text{is covered by $n$ balls of diameter $\epsilon$}\}$ is the $n$-covering width of $\Phi$.

 By choosing $\delta = k-m+\frac{1}{2} > 0$ we obtain the result at the endpoint $s = m+\frac{1}{2}$ (where the desired rate is $O(n^{-\frac{1}{2}})$) since by \eqref{eq_470} $$\epsilon_n(\Phi)\leq \epsilon_1(\Phi)\leq \sup \|\phi_{\xi,l,p}\|_{H^m(\Omega)}\lesssim 1.$$

 For larger $s$ we need to obtain a sharper bound on $\epsilon_n(\Phi)$. We do this by considering the covering number
 \begin{equation}
  N_\Phi(\epsilon) = \min\{n:~\text{there is a covering of $\Phi$ by $n$ balls of diameter $\epsilon$}\},
 \end{equation}
 and noting that by definition $\epsilon_n(\Phi) = \inf\{\epsilon > 0: N_\Phi(\epsilon) \leq n\}$.

 Given $\epsilon > 0$, we cover the set $\Phi$ by a single ball of radius $\frac{\epsilon}{2}$ centered at the origin, and cover each of the remaining elements with additional balls. This implies that
 \begin{equation}
  N_\Phi(\epsilon) \leq 1 + \left|\left\{\phi_{\xi,l,p}: \|\phi_{\xi,l,p}\|_{H^m(\Omega)} > \frac{\epsilon}{2}\right\}\right|.
 \end{equation}
 We proceed to count the number of $\phi_{\xi,l,p}$ with large norm. This process is messy but relatively straightforward.

 By \eqref{eq_470} we must count the indices $\xi\in L^{-1}\mathbb{Z}^d,l\in \mathbb{Z}_{>0}$ and $s=1,...,n_{\xi,l}$ for which
 \begin{equation}
  \epsilon \lesssim 2^{-l(k-m+\frac{1}{2}-\delta)}(1+|\xi|)^{m-s+\frac{1}{2}}.
 \end{equation}
 We observe that this condition implies that we must choose $\xi$ so that $(1+|\xi|)^{m-s+\frac{1}{2}} \gtrsim \epsilon$ and $l$ so that
 \begin{equation}\label{eq_506}
  2^{l(k-m+\frac{1}{2}-\delta)} \lesssim \epsilon^{-1}(1+|\xi|)^{m-s+\frac{1}{2}}.
 \end{equation}
 In addition, for each of these values of $\xi$ and $l$, we get $n_{\xi,l}\lesssim 2^l(1+|\xi|)$ differt values of $p$. Combining these observations, we see that
 \begin{equation}
  \left|\left\{\phi_{\xi,l,p}: \|\phi_{\xi,l,p}\|_{H^m(\Omega)} > \frac{\epsilon}{2}\right\}\right| \lesssim \sum_{\substack{\xi\in L^{-1}\mathbb{Z}^d\\|\xi|\leq R}} (1+|\xi|) \sum_{l\in L(\epsilon,\xi)} 2^l,
 \end{equation}
 where $R \lesssim \epsilon^{\frac{1}{m-s+\frac{1}{2}}}$ (note that here we require $m-s+\frac{1}{2} < 0$) and $L(\epsilon,\xi)$ consists of indices $l$ which satisfy \eqref{eq_506}. Taking a logarithm, the set $L(\epsilon,\xi)$ can be characterized by
 \begin{equation}
  l\leq \left(k-m+\frac{1}{2}-\delta\right)^{-1}\left(-\log(\epsilon) + \left(m-s+\frac{1}{2}\right)\log(1+|\xi|)\right) + C
 \end{equation}
 for some constant $C$. Using this bound on $l$, combined with the fact that $\sum_{l=1}^k 2^l \lesssim 2^k$, we get
 \begin{equation}
  \sum_{l\in L(\epsilon,\xi)} 2^l \lesssim \epsilon^{\frac{-1}{k-m+\frac{1}{2}-\delta}}(1+|\xi|)^{\frac{m-s+\frac{1}{2}}{k-m+\frac{1}{2}-\delta}}.
 \end{equation}
 So we get
 \begin{equation}\label{eq_524}
  \left|\left\{\phi_{\xi,l,p}: \|\phi_{\xi,l,p}\|_{H^m(\Omega)} > \frac{\epsilon}{2}\right\}\right| \lesssim \epsilon^{\frac{-1}{k-m+\frac{1}{2}-\delta}} \sum_{\substack{\xi\in L^{-1}\mathbb{Z}^d\\|\xi|\leq R}} (1+|\xi|)^{1 + \frac{m-s+\frac{1}{2}}{k-m+\frac{1}{2}-\delta}}.
 \end{equation}
 For the final sum, we distinguish between two cases.

 First, if $m-s+\frac{1}{2} > -(d+1)\left(k-m+\frac{1}{2}\right)$, then we can choose a fixed $\delta = \delta(s,m,k,d) > 0$ small enough so that
 \begin{equation}
  1 + \frac{m-s+\frac{1}{2}}{k-m+\frac{1}{2}-\delta} > -d.
 \end{equation}
 In this case, by comparing the sum over the lattice $L^{-1}\mathbb{Z}^d$ to an integral, the sum in \eqref{eq_524} satisfies
 \begin{equation}
  \sum_{\substack{\xi\in L^{-1}\mathbb{Z}^d\\|\xi|\leq R}} (1+|\xi|)^{1 + \frac{m-s+\frac{1}{2}}{k-m+\frac{1}{2}-\delta}} \lesssim R^{d+1+\frac{m-s+\frac{1}{2}}{k-m+\frac{1}{2}-\delta}} \lesssim \epsilon^{\frac{d+1}{m-s+\frac{1}{2}} + \frac{1}{k-m+\frac{1}{2}-\delta}},
 \end{equation}
 since $R\lesssim \epsilon^{\frac{1}{m-s+\frac{1}{2}}}$. Combining this with \eqref{eq_524} we get
 \begin{equation}
  \left|\left\{\phi_{\xi,l,p}: \|\phi_{\xi,l,p}\|_{H^m(\Omega)} > \frac{\epsilon}{2}\right\}\right| \lesssim\epsilon^{\frac{d+1}{m-s+\frac{1}{2}}}.
 \end{equation}
 This implies that for small $\epsilon$, $N_\Phi(\epsilon)\lesssim \epsilon^{\frac{d+1}{m-s+\frac{1}{2}}}$ and so
 \begin{equation}
  \epsilon_n(\Phi) \lesssim n^{\frac{m-s+\frac{1}{2}}{d+1}}.
 \end{equation}
 Plugging this into \eqref{bound_equation}, we get
 \begin{equation}\label{eq_549}
  \|f - f_n\|_{H^m(\Omega)} \lesssim \delta(s,m,k,d)^{-1}\|f\|_{\mathcal{B}^s(\Omega)}n^{\frac{m-s+\frac{1}{2}}{d+1}}n^{-\frac{1}{2}}\lesssim \|f\|_{\mathcal{B}^s(\Omega)}n^{-\frac{1}{2}-\frac{s-m-\frac{1}{2}}{d+1}}.
 \end{equation}

 Next, if $m-s+\frac{1}{2} \leq -(d+1)\left(k-m+\frac{1}{2}\right)$, then for any $\delta > 0$ we get
 \begin{equation}
  1 + \frac{m-s+\frac{1}{2}}{k-m+\frac{1}{2}-\delta} < -d.
 \end{equation}
 In this case, the sum in \eqref{eq_524} is summable and we get
 \begin{equation}
  \sum_{\substack{\xi\in L^{-1}\mathbb{Z}^d\\|\xi|\leq R}} (1+|\xi|)^{1 + \frac{m-s+\frac{1}{2}}{k-m+\frac{1}{2}-\delta}} \lesssim 1
 \end{equation}
 if $m-s+\frac{1}{2} < -(d+1)\left(k-m+\frac{1}{2}\right)$, and in the special case where $m-s+\frac{1}{2} = -(d+1)\left(k-m+\frac{1}{2}\right)$, we get
\begin{equation}
  \sum_{\substack{\xi\in L^{-1}\mathbb{Z}^d\\|\xi|\leq R}} (1+|\xi|)^{1 + \frac{m-s+\frac{1}{2}}{k-m+\frac{1}{2}-\delta}} \lesssim \delta^{-1}.
 \end{equation}
 Combining this with \eqref{eq_524} we get
 \begin{equation}
  \left|\left\{\phi_{\xi,l,p}: \|\phi_{\xi,l,p}\|_{H^m(\Omega)} > \frac{\epsilon}{2}\right\}\right| \lesssim \epsilon^{\frac{-1}{k-m+\frac{1}{2}-\delta}},
 \end{equation}
 where we need an extra factor of $\delta^{-1}$ in the special case where $m-s+\frac{1}{2} = -(d+1)\left(k-m+\frac{1}{2}\right)$.
 This implies that up to a factor of $\delta^{-(k-m+\frac{1}{2}-\delta)}$ in this special case, we have
 \begin{equation}
  \epsilon_n(\Phi) \lesssim n^{-(k-m+\frac{1}{2}-\delta)}.
 \end{equation}
 Using \eqref{bound_equation}, we get
 \begin{equation}
  \|f - f_n\|_{H^m(\Omega)} \lesssim \delta^{-1}\|f\|_{\mathcal{B}^s(\Omega)}n^{-(k-m+\frac{1}{2}-\delta)}n^{-\frac{1}{2}},
 \end{equation}
 where the power of $\delta$ is replaced by $-1-(k-m+\frac{1}{2}-\delta)$ in the endpoint case. Finally, optimizing over $\delta$, we get
 \begin{equation}\label{eq_580}
  \|f - f_n\|_{H^m(\Omega)} \lesssim \|f\|_{\mathcal{B}^s(\Omega)}n^{-(k-m+1)}\log(n),
 \end{equation}
 where in the endpoint case the logarithm is taken to the power $1 + (k-m+\frac{1}{2})$.

 Combining the results of \eqref{eq_580} and \eqref{eq_549} with the previously discussed result at $s = m + \frac{1}{2}$, we get
 \begin{equation}
  \|f - f_n\|_{H^m(\Omega)} \lesssim \|f\|_{\mathcal{B}^s(\Omega)}n^{-t}\log(n)^q,
 \end{equation}
 where $t = \min\left(\frac{1}{2}+\frac{s-m-\frac{1}{2}}{d+1}, k-m+1\right)$ and $q$ is given by
 \begin{equation}
 q = \begin{cases}
            0 & \text{if}~t < k-m+1 \\
            1 & \text{if}~t < \frac{1}{2}+\frac{2(s-m)-1}{2(d+1)}\\
            1 + (k-m+\frac{1}{2}) & \text{otherwise}
           \end{cases}.
 \end{equation}
 This completes the proof since \eqref{psi-definition}, \eqref{eq_463}, and \eqref{card-b-splines-def} imply that $\phi_{\xi,l,p}\in \Sigma_{k+1}^k$.

\end{proof}

In the case where $f$ is highly smooth, i.e. $f\in \mathcal{B}^s(\Omega)$ with $s > (d+1)(k-m-\frac{1}{2})+m+\frac{1}{2}$, we obtain, up to a logarithmic factor, an approximation rate of $O(n^{-k-1+m})$ in $H^m(\Omega)$. We state this as a separate theorem.
\begin{theorem}\label{high-smoothness-approximation}
 Let $\Omega = [0,1]^d$, $k \in \mathbb{Z}_{\geq 0}$ and $m\geq 0$, with $m < k + \frac{1}{2}$. Suppose that $f\in \mathcal{B}^s(\Omega)$ for $s$ sufficiently large, specifically $$s > (d+1)\left(k-m+\frac{1}{2}\right) + m + \frac{1}{2}.$$ Then for $n\geq 2$,
 \begin{equation}\label{bound-equation}
  \inf_{f_n\in \Sigma^k_{n}}\|f - f_n\|_{H^m(\Omega)} \lesssim \|f\|_{\mathcal{B}^s}n^{m-(k+1)}\log(n).
 \end{equation}
\end{theorem}


% Copyright 2018 Melvin Eloy Irizarry-Gelpí
\chapter{Bi-Nilplex Numbers}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
An exo-2 real number has the form
\begin{equation}
    a_{0} + a_{1} W + a_{2} X + a_{3} WX
\end{equation}
These follow from a parabolic Cayley-Dickson construct on the exo-1 reals.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Arithmetic Operations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Multiplication}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conjugate Operations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Asterisk Conjugation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Quadrance}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Cloak Conjugation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Dagger Conjugation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Hodge Star}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Differential Operators}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...


\documentclass[../PHYS306Notes.tex]{subfiles}

\begin{document}
\section{Lecture 23}
\subsection{Lecture Notes - Hamiltonian Mechanics}
\subsubsection{Hamilton's Equations \& Properties} \}
A particle slides on a helical wire defined by $z = k\theta$, $r = R$. If we use $\theta$ as the generalized coordinate, the generalized momentum is $p = m(r^2 + k^2)\dot{\theta}$. What is the Hamiltonian of the system?
\begin{s}
    Using the fact that here the Hamiltonian is equal to the energy:
    \[\mathcal{H} = T + U = \frac{p^2}{2m} + mgk\theta\]
\end{s}
Last lecture, we derived Hamilton's equations of motion:
\[\boxed{\dpd{\mathcal{H}}{p_i} = \dot{q}_i, \quad \dpd{\mathcal{H}}{q_i} = - \dot{p}_i}\]
This was done by starting with the Hamiltonian (Legendre transform of $\mathcal{L}$), expanding out in the total differential of $\mathcal{H}$, then using the EL equation to solve for Hamilton's equation (see last day's notes for more detail). We notice that Hamilton's equations are two first order equations, rather than a single second order equation. In general, if we have $n$ degrees of freedom, the Lagrangian gives us $n$ 2nd order differential equations, while Hamilton gives us $2n$ 1st order differential equations.

\noindent Now suppose that the Hamiltonian is independent of $p_i$. What can we say about the system?
\begin{s}
$q_i$ is constant by Hamilton's equations.
\end{s}

Now, what do Hamilton's equations tell us about the derivatives $\dpd{\dot{q}_i}{q_i} + \dpd{\dot{p}_i}{p_i}$?
\begin{s}
Again using Hamilton's equation, these are equal to:
\[\dpd{\HH}{q_ip_i} - \dpd{\HH}{p_iq_i} = 0\]
By the equality of mixed partials.
\end{s}

\subsubsection{The Variational Principle, Revisited}
From Lagrangian mechanics, we have that the variation in the action is zero:
\[\delta S = \delta \int_{t_1}^{t_2}\mathcal{L}dt = \delta \int_{t_1}^{t_2}[\sum p_i\dot{q}_i - \mathcal{H}]dt = 0\]
Expanding this, we have:
\[\int_{t_1}^{t_2}\sum_i \left[-\left(\dot{p}_i + \dpd{\HH}{q_i}\right)\delta q_i + \left(\dot{q}_i - \dpd{\HH}{p_i}\right)\delta p_i\right] dt = 0\]
What does this imply about the terms in parentheses?
\begin{s}
Since $q$ and $p$ can be varied independently, both $\dot{p}_i + \dpd{\HH}{q_i}$ and $\dot{q}_i - \dpd{\HH}{p_i}$ must vanish independently; these are exactly Hamilton's equations of motion!
\end{s}

\subsubsection{Hamiltonian Time Dependence}
Let us now look at the time derivative of the Hamiltonian:
\[\dod{\mathcal{H}}{t} = \sum_i\left(\dpd{\mathcal{H}}{q_i}\dot{q}_i + \dpd{\HH}{p_i}\dot{p}_i\right)  + \dpd{\HH}{t}\]
Assuming the trajectory obeys Hamilton's equations, we have:
\[\dod{\mathcal{H}}{t} = \sum_i\left(-\dot{p}_i\dot{q}_i + \dot{q}_i\dot{p}_i\right) + \dpd{\HH}{t} = = \dpd{\HH}{t} = - \dpd{\LL}{t} \]
Even though $\HH$ is a function of $q, p, t$, the only explicit time dependence comes from the Hamiltonian itself! $\HH$ is constant if $\LL$ is independent of time.

\subsubsection{The Atwood Machine, Again}
\begin{center}
    \includegraphics[scale=0.5]{Lecture-23/l23-img1.png}
\end{center}
The Atwood machine has Hamiltonian:
\[\HH = \frac{p^2}{2(m_1 + m_2)} - (m_1 - m_2)gx - m_2gl\]
What are the equations of motion?
\begin{s}
By Hamilton's equations:
\[\dot{x} = \frac{p}{m_1 + m_2}\]
\[\dot{p} = (m_1 - m_2)g\]
\end{s}
How does the system move?
\begin{s}
From above, we can see that $x$ moves with constant gravitational acceleration with effective mass \[\frac{m_1 - m_2}{m_1 + m_2}\]
Which we can see from:
\[\ddot{x} = \frac{m_1 - m_2}{m_1 + m_2}g\]
We can also reason this from limits of $m_1 \ll m_2$, $m_1 \gg m_2$.
\end{s}

\subsubsection{Phase Space of the Harmonic Oscillator}
Phase space is the set of points $\set{q_i, p_i}$ i.e. possible combinations of (generalized) position/momenta. We can write the phase space vector as $\v{z} = (\v{q}, \v{p})$. For the Harmonic oscillator in one dimension (spring constant $k$, mass $m$ distance from equlibrium $x$), we have the Hamiltonian:
\[\HH = \frac{p_x^2}{2m} + \frac{k}{2}x^2\]
Hamilton's equations give:
\[\dot{p}_x = -\dpd{\HH}{x} = -kx\]
\[\dot{x} = \dpd{\HH}{p_x} = \frac{p_x}{m}\]
Of course, we may combine these to get:
\[\ddot{x} = \frac{p_x}{m} = -\frac{k}{m}x\]
We may write Hamilton's equations as a vector:
\[\m{\dot{x} \\ \dot{p}_x} = \m{p_x/m \\ -kx}\]
We know that this will have solutions:
\[x = x_0\cos(\sqrt{\frac{k}{m}}t - \delta)\]
\[p_x = m\dot{x} = -mx_0\sqrt{\frac{k}{m}}\sin(\sqrt{\frac{k}{m}}t - \delta)\]
Now, we observe:
\[\frac{x^2}{x_0^2} + \frac{p_x^2}{mx_0^2k} = \sin^2(x) + \cos^2(x) = 1\]
But this of course is just the equation for an ellipse, that tells us that the trajectory in phase space of the harmonic oscillator will be an ellipse! In particular, which of the two directions (if both) are possible?
\begin{center}
    \includegraphics[scale=0.8]{Lecture-23/l23-img2.png}
\end{center}
\begin{s}
Only B; consider that when we sit at the rightmost point in the ellipse, we get pulled back towards the origin, hence the magnitude of the momentum increases, in the negative direction. Hence only the second trajectory makes sense.
\end{s}
Now, consider a collection of harmonic oscillators which have the same energy but different relative phases. Which collection of phase points represents this system at a given instant in time?
\begin{center}
    \includegraphics[scale=0.7]{Lecture-23/l23-img3.png}
\end{center}
\begin{s}
For a given fixed energy, we stay on the ellipse, and the phase angle just tells you where you are on the ellipse. So, A.
\end{s}
Consider an area element in phase space. What physically must happen for a particle to move into the area across the left boundary?
\begin{center}
    \includegraphics[scale=1]{Lecture-23/l23-img4.png}
\end{center}
\begin{s}
The position $q_k$ increases but the momentum $p_k$ is constant.
\end{s}

\subsubsection{Particle in a Central Force Field}
The kinetic energy for a particle of mass $m$ in a central force field is given by:
\[T = \frac{m}{2}\left(\dot{r}^2 + r^2\dot{\phi}^2\right)\]
Then we have the generalized momenta:
\[p_r = \dpd{T}{\dot{r}} = m\dot{r} \implies \dot{r} = \frac{p_r}{m}\]
\[p_\phi = \dpd{T}{\dot{\phi}} = mr^2\dot{\phi} \implies \dot{\phi} = \frac{p_\phi}{mr^2}\]
Hence the Hamiltonian has the form:
\[\HH = T + U = \frac{1}{2m}\left(p_r^2 + \frac{p_\phi^2}{r^2}\right) + U(r)\]
Hence Hamilton's equations yield:
\[\dot{r} = \dpd{\HH}{p_r} = \frac{p_r}{m}, \quad \dot{p}_r = -\dpd{\HH}{r} = \frac{p_\phi^2}{mr^3} - \dod{U}{r}\]\
\[\dot{\phi} = \dpd{\HH}{p_\phi} = \frac{p_\phi}{mr^2}, \quad p_\phi = -\dpd{\HH}{\phi} = 0\]
\subsubsection{General Procedure for setting up Hamilton's equations}
\begin{enumerate}[1.]
\item Choose suitable generalized coordinates, $q_{1}, \cdots, q_{n}$.
\item Write down the kinetic and potential energies, $T$ and $U$, in terms of the $q$ 's and $\dot{q}$ 's.
\item Find the generalized momenta $p_{1}, \cdots, p_{n} .$ (We are now assuming our system is conservative, so $U$ is independent of $\dot{q}_{i}$ and we can use $p_{i}=\partial T / \partial \dot{q}_{i} .$ In general, one must use $p_{i}=\partial \mathcal{L} / \partial \dot{q}_{i}$.
\item Solve for the $\dot{q}$ 's in terms of the $p$ 's and $q$ 's.
\item Write down the Hamiltonian $\mathcal{H}$ as a function of the $p$ 's and $q$ 's. [Provided our coordinates are "natural" (relation between generalized coordinates and underlying Cartesians is independent of time), $\mathcal{H}$ is just the total energy $\mathcal{H}=T+U,$ but when in doubt, use $\mathcal{H}=\sum p_{i} \dot{q}_{i}-\mathcal{L} .$ See Problems 13.11
and $13.12 .]$.
\item Write down Hamilton's equations (13.25).
\end{enumerate}
We will illustrate the advantages of using Hamilton's equations rather than Lagrange next week. One advantage is that we get first order versus second order equations, which can be easier sometimes (we have more techniques). A deeper advantage is theoretical, which we will see. We will also see how to construct a quantum theory with this framework.
\end{document}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% UMB-CS110-2015S: Introduction to Computing
% Copyright 2015 Pejman Ghorbanzade <pejman@ghorbanzade.com>
% Creative Commons Attribution-ShareAlike 4.0 International License
% More info: https://github.com/ghorbanzade/UMB-CS110-2015S
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \topDirectory {.}
\def \texDirectory {\topDirectory/src/main/tex}

\documentclass[12pt,letterpaper,twoside]{article}
\usepackage{\texDirectory/template/style/directives}
\usepackage{\texDirectory/template/style/assignment}
\input{\texDirectory/template/config}

\begin{document}

\doc{title}{Solution to Quiz 1(b)}
\doc{date-pub}{Feb 19, 2015 at 01:00 PM}
\doc{date-due}{Feb 19, 2015 at 11:00 PM}
\doc{points}{4}

\prepare{header}

\section*{Question 1}

According to National Weather Serivce, the \textit{Wind Chill} can be computed as given in Equation \ref{eq1}, where $t$ is the temperature in Fahrenheit and $v$ is the wind speed in miles per hour.

\begin{equation}
w = 35.74 + 0.6215 t + (0.4275t-35.75)v^{0.16}
\label{eq1}
\end{equation}

Write a program \texttt{WindChill.java} that takes temperature in Celsius and using Equation \ref{eq1} gives the wind chill in Celsius.
Fahrenheit to Celsius conversion formula is given in Equation \ref{eq2}.

\begin{equation}
t_F = 1.8 \times t_C + 32
\label{eq2}
\end{equation}

\begin{figure}[H]\centering
	\includegraphics[width=8cm]{\texDirectory/template/images/windchill.png}
\end{figure}

\section*{Question 2}

Write a program \textit{Maximum.java} that takes three integer numbers as command-line arguments and prints their maximum, minimum and mean values.

\prepare{footer}

\end{document}


\documentclass[11pt]{article}

\usepackage{amsmath,amsthm}
\usepackage[headings]{fullpage}
\usepackage[utopia]{mathdesign}
\usepackage{color}

\pagestyle{myheadings}
\markboth{Norms}{Norms}

\input{../../fncextra}

\begin{document}

\begin{center}
  \bf Norm-an conquest
\end{center}

The absolute value $|x|$ represents the distance on the number line
between the point $x$ and the origin. We can do the same for a vector
of $n$ numbers, plotting an arrows whose tail is at the origin and
applying the Pythagorean theorem to conclude that $\bfx$ represents a
point that is a distance $(x_1^2 + \cdots + x_n^2)^{1/2}$ from the
origin. This is what we call the 2-norm, $\|\bfx\|_2$. It turns out
that if we abstract the notion of ``distance'' a little to its
essential properties, we can get other vector norms as well. Each norm has its own set of unit vectors (those having norm equal to 1).

For matrices, a definition based on the action of the
matrix as a linear transformation is quite handy for analyzing linear
algebra algorithms.  The definition starts with all the unit vectors
in whatever norm we like. Each of these
vectors $\bfv$ is mapped to the vector $\bfu=\mA\bfv$. The maximum of
$\|\bfu\|$ for all such $\bfv$ is the value of $\|\mA\|$. This
definition can be visualized easily only when both $\bfv$ and
$\bfu$ are low-dimensional.

\subsection*{Goals}

You will use experiments based on the definitions of norms to approximate the calculation of norms of a small matrix.

\subsection*{Preparation}

Read section 2.7. Recall that the equations $x=\cos(\theta)$, $y=\sin(\theta)$, $0\le \theta \le 2\pi$ parameterize the unit circle (set of all unit vectors) defined by the 2-norm in $\mathbf{R}^2$.

\subsection*{Procedure}

Download the script template and complete it to perform the following steps.

\begin{enumerate}
\item Define a vector \texttt{theta} of 200 equally spaced values from 0 to $2\pi$. Use it to define vectors \texttt{x} and \texttt{y} via $x_j = \cos(\theta_j)$, $y_j = \sin(\theta_j)$ (do this without any loops). Plot these points, which lie on the unit circle.

\item Let \texttt{A=magic(2)}. For each $j$, define the vector $\bfv=[x_j\:y_j]^T$ and let $\bfu=\mA\bfv$. On a new graph, plot all the $\bfu$ points, and make a vector storing $\|\bfu\|_2$ for all $j$.

\item Plot $\|\bfu\|_2$ as a function of $\theta$.

\item Using \texttt{format long} and \texttt{max}, calculate and show the maximum value of $\|\bfu\|_2$ over all $j$. This estimates $\|\mA\|_2$. Also compute the actual value \texttt{norm(A,2)}.

\item The script creates new vectors \texttt{x} and \texttt{y} that are unit vectors in the $\infty$-norm. Plot these points, giving a title and axis labels.

\item Repeat step 2, this time collecting $\|\bfu\|_\infty$ as a function of the point index $j$.

\item Make a plot as in step 3. This time, the $x$-axis will the index number $j$.

\item Estimate the norm $\|\mA\|_\infty$ and compute its exact value, as in step 4.
\end{enumerate}

\end{document}

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


%%%%%%%%%%%%%%%%%%%%%definitions%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\input{../../doc/related_pages/header.tex}
\input{../../doc/related_pages/newcommands.tex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%DOCUMENT%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\title{The toefl project}
\author{ M.~Wiesenberger and M.~Held}
\maketitle

\begin{abstract}
  This is a program for 2d isothermal blob simulations used in References~\cite{Wiesenberger2014,Kube2016,Wiesenberger2017a}.
\end{abstract}

\section{Equations}
Currently we implemented $5$ slightly different sets of equations. $n$ is the electron density, $N$ is the ion gyrocentre density and $\rho$
the vorticity density. $\phi$ is the electric potential. We
use Cartesian coordinates $x$, $y$.
\subsection{Models}

"local"
\begin{subequations}
\begin{align}
 -\nabla^2 \phi =  \Gamma_1 N -n, \quad
\psi = \Gamma_1 \phi \quad \Gamma_1 = ( 1- 0.5\tau\nabla^2)^{-1} \\
 \frac{\partial n}{\partial t}     =
    \{ n, \phi\}
  + \kappa \frac{\partial \phi}{\partial y}
  -\kappa \frac{\partial n}{\partial y}
  + \nu \nabla^2 n  \\
  \frac{\partial N}{\partial t} =
  \{ N, \psi\}
  + \kappa \frac{\partial \psi}{\partial y}
  + \tau \kappa\frac{\partial N}{\partial y} +\nu\nabla^2N
\end{align}
\end{subequations}

"global"
\begin{subequations}
\begin{align}
B(x)^{-1} = \kappa x +1-\kappa X\quad \Gamma_1 = ( 1- 0.5\tau\nabla^2)^{-1}\\
 -\nabla\cdot \left(\frac{N}{B^2} \nabla_\perp \phi\right) = \Gamma_1 N-n, \quad
 \text{Boussinesq:}\quad -\nabla_\perp^2 \phi = \frac{B^2}{N} (\Gamma_1 N -n) \\
\psi = \Gamma_1 \phi - \frac{1}{2} \frac{(\nabla\phi)^2}{B^2}\\
 \frac{\partial n}{\partial t}     =
    \frac{1}{B}\{ n, \phi\}
  + \kappa n\frac{\partial \phi}{\partial y}
  -\kappa \frac{\partial n}{\partial y}
  + \nu \nabla_\perp^2 n  \\
  \frac{\partial N}{\partial t} =
  \frac{1}{B}\{ N, \psi\}
  + \kappa N\frac{\partial \psi}{\partial y}
  + \tau \kappa\frac{\partial N}{\partial y} +\nu\nabla_\perp^2N
\end{align}
\end{subequations}

"gravity local"
\begin{subequations}
\begin{align}
 \nabla^2 \phi = \rho \\
 \frac{\partial n}{\partial t} = \{ n, \phi\} + \nu \nabla^2 n  \\
  \frac{\partial \rho}{\partial t} = \{ \rho, \phi\} - \eta \rho - \frac{\partial n}{\partial y} + \nu \nabla^2 \rho
\end{align}
\end{subequations}

"gravity global"
\begin{subequations}
\begin{align}
 \nabla \cdot(n \nabla \phi) = \rho \quad\text{ Boussinesq: }\quad \nabla^2 \phi = \rho/n \\
 \frac{\partial n}{\partial t} = \{ n, \phi\} +  \nu \nabla^2 n  \\
  \frac{\partial \rho}{\partial t} = \{ \rho, \phi\} + \{n, \frac{1}{2} \nabla\phi^2\} - \eta \rho - \frac{\partial n}{\partial y} +\nu\nabla^2\rho
\end{align}
\end{subequations}

"drift global"
\begin{subequations}
\begin{align}
B(x)^{-1} = \kappa x +1-\kappa X\\
 \nabla \cdot \left(\frac{n}{B^2} \nabla \phi\right) = \rho \quad
 \text{Boussinesq:}\quad \nabla^2\phi = \rho \frac{B^2}{n} \quad
\psi = \frac{1}{2} \frac{(\nabla\phi)^2}{B^2}\\
 \frac{\partial n}{\partial t}     =
    \frac{1}{B}\{ n, \phi\}
  + \kappa n\frac{\partial \phi}{\partial y}
  + \nu \nabla^2 n  \\
  \frac{\partial \rho}{\partial t} =
  \frac{1}{B}\{ \rho, \phi\}
  + \frac{1}{B}\{n, \psi\}
  + \kappa \rho\frac{\partial \phi}{\partial y}
  + \kappa n\frac{\partial \psi}{\partial y}
  - \kappa\frac{\partial n}{\partial y} +\nu\nabla^2\rho
\end{align}
\end{subequations}

\subsection{Initialization}
Initialization of $n$ is a Gaussian
\begin{align}
    n(x,y) = 1 + A\exp\left( -\frac{(x-X)^2 + (y-Y)^2}{2\sigma^2}\right)
    \label{}
\end{align}
where $X = p_x l_x$ and $Y=p_yl_y$ are the initial centre of mass position coordinates, $A$ is the amplitude and $\sigma$ the
radius of the blob.
We initialize
\begin{align}
    N = \Gamma_1^{-1} n \quad \phi = 0 \\
    \rho = \phi = 0
    \label{}
\end{align}
\subsection{Diagnostics}
\begin{align}
    M(t) = \int n-1 \\
    \Lambda_n = \nu \int \Delta n  \\
    ...
    \label{}
\end{align}
\section{Numerical methods}
discontinuous Galerkin on structured grid
\rowcolors{2}{gray!25}{white} %%% Use this line in front of longtable
\begin{longtable}{ll>{\RaggedRight}p{7cm}}
\toprule
\rowcolor{gray!50}\textbf{Term} &  \textbf{Method} & \textbf{Description}  \\ \midrule
coordinate system & Cartesian 2D & equidistant discretization of $[0,l_x] \times [0,l_y]$, equal number of Gaussian nodes in x and y \\
matrix inversions & conjugate gradient & Use previous two solutions to extrapolate initial guess and $1/\chi$ as preconditioner \\
\ExB advection & Arakawa & s.a. \cite{Einkemmer2014} \\
curvature terms & direct & flux conserving \\
time &  Karniadakis multistep & $3rd$ order explicit, diffusion $2nd$ order implicit \\
\bottomrule
\end{longtable}

\section{Compilation and useage}
There are two programs toeflR.cu and toefl\_hpc.cu . Compilation with
\begin{verbatim}
make <toeflR toefl_hpc toefl_mpi> device = <omp gpu>
\end{verbatim}
Run with
\begin{verbatim}
path/to/feltor/src/toefl/toeflR input.json
path/to/feltor/src/toefl/toefl_hpc input.json output.nc
echo np_x np_y | mpirun -n np_x*np_y path/to/feltor/src/toefl/toefl_mpi\
    input.json output.nc
\end{verbatim}
All programs write performance informations to std::cout.
The first is for shared memory systems (OpenMP/GPU) and opens a terminal window with life simulation results.
 The
second can be compiled for both shared and distributed memory systems and uses serial netcdf in both cases
to write results to a file.
For distributed
memory systems (MPI+OpenMP/GPU) the program expects the distribution of processes in the
x and y directions as command line input parameters.

\subsection{Input file structure}
Input file format: json

%%This is a booktabs table
\begin{longtable}{llll>{\RaggedRight}p{7cm}}
\toprule
\rowcolor{gray!50}\textbf{Name} &  \textbf{Type} & \textbf{Example} & \textbf{Default} & \textbf{Description}  \\ \midrule
n      & integer & 3 & - &\# Gaussian nodes in x and y \\
Nx     & integer &100& - &\# grid points in x \\
Ny     & integer &100& - &\# grid points in y \\
dt     & integer &3.0& - &time step in units of $c_s/\rho_s$ \\
n\_out  & integer &3  & - &\# Gaussian nodes in x and y in output \\
Nx\_out & integer &100& - &\# grid points in x in output fields \\
Ny\_out & integer &100& - &\# grid points in y in output fields \\
itstp  & integer &2  & - &   steps between outputs \\
maxout & integer &100& - &      \# outputs excluding first \\
eps\_pol   & float &1e-6    & - &  accuracy of polarisation solver \\
eps\_gamma & float &1e-7    & - & accuracy of $\Gamma_1$ (only in gyrofluid model) \\
eps\_time  & float &1e-10   & - & accuracy of implicit time-stepper \\
curvature  & float &0.00015& - & magnetic curvature $\kappa$ \\
tau        & float &1      & - & $\tau = T_i/T_e$ (only in gyrofluid models) \\
nu\_perp    & float &5e-3   & - & pependicular viscosity $\nu$ \\
amplitude  & float &1.0    & - & amplitude $A$ of the blob \\
sigma      & float &10     & - & blob radius $\sigma$ \\
posX       & float &0.3    & - & blob x-position in units of $l_x$, i.e. $X = p_x l_x$\\
posY       & float &0.5    & - & blob y-position in units of $l_y$, i.e. $Y = p_y l_y$ \\
lx         & float &200    & - & $l_x$  \\
ly         & float &200    & - & $l_y$  \\
friction   & float & 0     & 0 & friction coefficient $\eta$ in gravity model \\
bc\_x   & char & "DIR"      & - & boundary condition in x (one of PER, DIR, NEU, DIR\_NEU or NEU\_DIR) \\
bc\_y   & char & "PER"      & - & boundary condition in y (one of PER, DIR, NEU, DIR\_NEU or NEU\_DIR) \\
equations  & char & "global" & "global" &local, global, gravity\_local, gravity\_global, drift\_global \\
boussinesq & bool & false    & false &boussinesq approximation in global models true or false\\
\bottomrule
\end{longtable}

The default value is taken if the value name is not found in the input file. If there is no default and
the value is not found,
the program exits with an error message.

\subsection{Structure of output file}
Output file format: netcdf-4/hdf5
%
%Name | Type | Dimensionality | Description
%---|---|---|---|
\begin{longtable}{lll>{\RaggedRight}p{7cm}}
\toprule
\rowcolor{gray!50}\textbf{Name} &  \textbf{Type} & \textbf{Dimension} & \textbf{Description}  \\ \midrule
inputfile  &             text attribute & 1 & verbose input file as a string \\
energy\_time             & Dataset & 1 & timesteps at which 1d variables are written \\
time                     & Dataset & 1 & time at which fields are written \\
x                        & Dataset & 1 & x-coordinate  \\
y                        & Dataset & 1 & y-coordinate \\
electrons                & Dataset & 3 (time, y, x) & electon density $n$ \\
ions                     & Dataset & 3 (time, y, x) & ion density $N$ or vorticity density $\rho$  \\
potential                & Dataset & 3 (time, y, x) & electric potential $\phi$  \\
vorticity                & Dataset & 3 (time, y, x) & Laplacian of potential $\nabla^2\phi$  \\
dEdt                     & Dataset & 1 (energy\_time) & change of energy per time  \\
dissipation              & Dataset & 1 (energy\_time) & diffusion integrals  \\
energy                   & Dataset & 1 (energy\_time) & total energy integral  \\
mass                     & Dataset & 1 (energy\_time) & mass integral   \\
\bottomrule
\end{longtable}
\section{Diagnostics toeflRdiag.cu}
There only is a shared memory version available
\begin{verbatim}
cd path/to/feltor/diag
make toeflRdiag
path/to/feltor/diag/toeflRdiag input.nc output.nc
\end{verbatim}

Input file format: netcdf-4/hdf5
%
%Name | Type | Dimensionality | Description
%---|---|---|---|
\begin{longtable}{lll>{\RaggedRight}p{7cm}}
\toprule
\rowcolor{gray!50}\textbf{Name} &  \textbf{Type} & \textbf{Dimension} & \textbf{Description}  \\ \midrule
inputfile  &             text attribute & 1 & verbose input file as a string \\
electrons                & Dataset & 3 & electon density (time, y, x) \\
ions                     & Dataset & 3 & ion density (time, y, x) \\
potential                & Dataset & 3 & electric potential (time, y, x) \\
\bottomrule
\end{longtable}

Output file format: netcdf-4/hdf5
%
%Name | Type | Dimensionality | Description
%---|---|---|---|
\begin{longtable}{lll>{\RaggedRight}p{7cm}}
\toprule
\rowcolor{gray!50}\textbf{Name} &  \textbf{Type} & \textbf{Dimension} & \textbf{Description}  \\ \midrule
 inputfile & text attribute & 1 & copy of inputfile attribute of the input file (the json string of the simulation input file) \\
 time & Dataset & 1 & the time steps at which variables are written \\
 posX & Dataset & 1 (time) & centre of mass (COM) position x-coordinate \\
 posY & Dataset & 1 (time) &COM y-position \\
 velX & Dataset & 1 (time)& COM x-velocity \\
 velY & Dataset & 1 (time)& COM y-velocity \\
 accX & Dataset & 1 (time)& COM x-acceleration \\
 accY & Dataset & 1 (time)& COM y-acceleration \\
 velCOM & Dataset & 1 (time)&absolute value of the COM velocity \\
 posXmax& Dataset & 1 (time)&maximum amplitude x-position \\
 posYmax& Dataset & 1 (time)&maximum amplitude y-position \\
 velXmax& Dataset & 1 (time)&maximum amplitude x-velocity \\
 velYmax& Dataset & 1 (time)&maximum amplitude y-velocity \\
 maxamp & Dataset & 1 (time)&value of the maximum amplitude  \\
  compactness\_ne& Dataset & 1 (time) &compactness of the density field \\
 Ue& Dataset&  1 (time) &entropy electrons \\
 Ui &Dataset& 1 (time) & entropy ions \\
 Uphi& Dataset& 1 (time) &  exb energy \\
 mass& Dataset & 1 (time) & mass of the blob without background \\
\bottomrule
\end{longtable}

%..................................................................
\bibliography{../../doc/related_pages/references}
%..................................................................

\end{document}