\chapter{Lecture 27 Jul 06th 2018}%
\label{chp:lecture_27_jul_06th_2018}
% chapter lecture_27_jul_06th_2018

\section{Polynomial Ring}%
\label{sec:polynomial_ring}
% section polynomial_ring

\subsection{Polynomials}%
\label{sub:polynomials}
% subsection polynomials

\begin{defn}[Polynomials]
\label{defn:polynomials}
  Let $R$ be a ring and $x$ a variable. Let
  \begin{equation*}
    R[x] = \left\{ f(x) = \sum_{i=0}^{m} a_i x^i : m \in \mathbb{N} \cup \{0\}, \, a_i \in R, 0 \leq i \leq m \right\}.
  \end{equation*}
  Each element in $R[x]$ is called a \hldefn{polynomial} in $x$ over $R$. If $a_m \neq 0$, we say that $f(x)$ has \hldefn{degree} $m$, denoted by $\deg f = m$, and we say that $a_m$ is the \hldefn{leading coefficient} of $f(x)$.

  If $\deg f = 0$, then $f(x) = a_0 \in R$. In this case, we call $f(x)$ a \hldefn{constant polynomial}. Note if
  \begin{equation*}
    f(x) = 0 \iff a_0 = a_1 = ... = a_m = 0,
  \end{equation*}
  we define $\deg 0 = - \infty$, and $f(x)$ is called a \hldefn{zero polynomial}.
\end{defn}

For
\begin{gather*}
  f(x) = a_0 + a_1 x + \hdots + a_m x^m \\
  g(x) = b_0 + b_1 x + \hdots + b_n x^n
\end{gather*}
in $R[x]$. If $m \leq n$, we can define $a_i = 0$ for $m + 1 \leq i \leq n$. Then the addition and multiplication on $R[x]$ can be defined as
\begin{align*}
  f(x) + g(x) &= (a_0 + b_0) + (a_1 + b_1) x + \hdots + (a_n + b_n) x^n \\
  f(x) g(x) &= (a_0 + a_1 x + \hdots + a_m x^m) (b_0 + b_1 x + \hdots + b_n x^n) \\
            &= a_0 b_0 + (a_1 b_0 + a_1 b_0) x + (a_2 b_0 + a_1 b_1 + a_0 b_2) x^2 + \hdots \\
            &\quad + (a_m b_m) x^{m + n} \\
            &= c_0 + c_1 x + \hdots + c_{m + n} x^{m + n}
\end{align*}
where $c_i = a_0 b_i + a_1 b_{i - 1} + \hdots + a_{i - 1} b_1 + a_i b_0$.

\begin{propo}[Ring is a Subring of Its Polynomial Ring]
\label{propo:ring_is_a_subring_of_its_polynomial_ring}
  Let $R$ be a ring and $x$ a variable.
  \begin{enumerate}
    \item $R[x]$ is a ring
    \item $R$ is a subring of $R[x]$
    \item If $Z = Z(R)$ denote the center of $R$, then the center of $R[x]$ is $Z[x]$. In particular, $x$ is in the center of $R[x]$.
  \end{enumerate}
\end{propo}

\begin{proof}
  \begin{enumerate}
    \item \textbf{Checking all 9 properties}: Let
          \begin{gather*}
            f(x) = a_0 + a_1 x + \hdots + a_m x^m \\
            g(x) = b_0 + b_1 x + \hdots + b_n x^n \\
            h(x) = d_0 + d_1 x + \hdots + d_k x^k
          \end{gather*}
          be in $R[x]$.
      \begin{itemize}
        \item (\textbf{Closed under addition and multiplication})
          Suppose, WLOG, that $m \leq n$. Let $a_i = 0$ for $m + 1 \leq i \leq n$. Then
          \begin{equation*}
            f(x) + g(x) = (a_0 + b_0) + (a_1 + b_1) x + \hdots + (a_n + b_n) x^n
          \end{equation*}
          and we observe that $a_i + b_i \in R$ for $0 \leq i \leq n$ since $R$ is a ring. And so $f(x) + g(x) \in R[x]$. Also, we have
          \begin{align*}
            f(x) g(x) = c_0 + c_1 x + \hdots + c_{m + n} x^{m + n}
          \end{align*}
          where $c_i = a_0 b_i + a_1 b_{i - 1} + \hdots + a_{i - 1} b_1 + a_i b_0 \in R$ for $1 \leq i \leq m + n$. And so $f(x) g(x) \in R[x]$.
        \item (\textbf{Commutativity of Addition}) Suppose, WLOG, that $m \leq n$. Let $a_i = 0$ for $m + 1 \leq i \leq n$. Then
          \begin{align*}
            f(x) + g(x) &= (a_0 + b_0) + (a_1 + b_1) x + \hdots + (a_n + b_n) x^n \\
                        &= (b_0 + a_0) + (b_1 + a_1) x + \hdots + (b_n + a_n) x^n \\
                        &= g(x) + f(x)
          \end{align*}
        \item (\textbf{Zero and Unity}) It is clear that the zero and unity of $R$ are the zero and unity of $R[x]$ respectively, since only
          \begin{equation*}
            f(x) + 0 = f(x) = 0 + f(x)
          \end{equation*}
          and
          \begin{equation*}
            1 f(x) = f(x) = f(x) \cdot 1.
          \end{equation*}
        \item (\textbf{Associativity}) Suppose, WLOG, that $m \leq n \leq k$. Let $a_i = b_j = 0$ for $m + 1 \leq i \leq k$ and $n + 1 \leq j \leq k$. Then
          \begin{align*}
            &f(x) + [ g(x) + h(x) ]\\
            &= f(x) + [ (b_0 + d_0) + (b_1 + d_1) x + \hdots + (b_k d_k) x^k ] \\
            &= (a_0 + b_0 + d_0) + (a_1 + b_1 + d_1) x + \hdots + (a_k + b_k + d_k) x^k \\
            &= [(a_0 + b_0) + (a_1 + b_1) x + \hdots + (a_k + b_k) x^k] + d(x) \\
            &= [ f(x) + g(x) ] + h(x)
          \end{align*}
          and if we use the summation notation for $f(x), g(x)$ and $h(x)$, we have
          \begin{align*}
            f(x) [ g(x) d(x) ] &= f(x) \left[ \left( \sum_{j=0}^{n} b_j x^j \right)\left( \sum_{l=0}^{k} d_l x^l \right) \right] \\
                               &= \left[ \sum_{i=0}^{m} a_i x^i \right] \left[ \sum_{j=0}^{n} \sum_{l=0}^{k} b_j d_l x^{j + l} \right] \\
                               &= \sum_{i=0}^{m} \sum_{j=0}^{n} \sum_{l=0}^{k} a_i b_j d_l x^{i + j + k} \\
                               &= \left[ \sum_{i=0}^{m} \sum_{j=0}^{n} a_i b_j x^{i + j} \right] \left[ \sum_{l=0}^{k} d_l x^l \right] \\
                               &= \left[ \left( \sum_{i=0}^{m} a_i x^i \right) \left( \sum_{j=0}^{n} b_j x^j \right) \right] h(x) \\
                               &= [ f(x) g(x) ] h(x)
          \end{align*}
        \item (\textbf{Inverse}) Since $R$ is a ring, and in particular an additive ring, for each $a_i \in R$, $0 \leq i \leq m$, we have that $\exists (-a_i) \in R$ such that $a_i + (-a_i) = 0$. Particularly, we have that
          \begin{equation*}
            - f(x) = ( - a_0 ) + ( - a_1 ) x + ( - a_2 ) x^2 + \hdots + ( - a_m ) x^m
          \end{equation*}
          is the inverse of $f(x) \in R[x]$.
        \item (\textbf{Distributivity}) Again, using the summation notation, since $R$ is a ring, we have
          \begin{align*}
            &f(x) [ g(x) + h(x) ] \\
            &= \left[ \sum_{i=0}^{m} a_i x^i \right] \left[ \sum_{j=0}^{n} b_j x^j + \sum_{l=0}^{k} d_l x^l \right] \\
            &= \left[ \sum_{i=0}^{m} a_i x^i \right] \left[ \sum_{j=0}^{k} (b_j + d_j) x^j \right] \\
            &= \sum_{i=0}^{m} \sum_{j=0}^{k} a_i (b_j + d_j) x^{i + j} = \sum_{i=0}^{m} \sum_{j=0}^{k} (a_i b_j + a_i d_j) x^{i + j} \\
            &= \sum_{i=0}^{m} \sum_{j=0}^{k} a_i b_j x^{i + j} + \sum_{i=0}^{m} \sum_{j=0}^{k} a_i d_j x^{i + j} \\
            &= \sum_{i=0}^{m} \sum_{j=0}^{n} a_i b_j x^{i + j} + \sum_{i=0}^{m} \sum_{j=0}^{k} a_i d_j x^{i + j} \\
            &= f(x) g(x) + f(x) d(x).
          \end{align*}
          Proof for the other side is similar.
        \end{itemize}
        With that, we have that $R[x]$ is a ring.

      \item We already have that $R$ is a ring, and so it suffices to prove that $R \subseteq R[x]$. This is, however, rather simple, since $\forall r \in R$, we have that $r$ is a constant polynomial, and so $r \in R[x]$, and therefore $R \subseteq R[x]$.

      \item Let
        \begin{gather*}
          f(x) = a_0 + a_1 x + a_2 x^2 + \hdots + a_m x^m \in Z[x] \\
          g(x) = b_0 + b_1 x + b_2 x^2 + \hdots + b_n x^n \in R[x].
        \end{gather*}
        We have that
        \begin{equation*}
          f(x) g(x) = \sum_{i=0}^{m} \sum_{j=0}^{n} a_i b_j x^{i + j}.
        \end{equation*}
        Since $a_i \in Z$ for $0 \leq i \leq n$, we have
        \begin{equation*}
          f(x) g(x) = \sum_{i=0}^{m} \sum_{j=0}^{n} b_j a_i x^{i + j} = \sum_{j=0}^{n} \sum_{i=0}^{m} b_j a_i x^{j + i} = g(x) f(x)
        \end{equation*}
        for any $g(x) \in R[x]$. And so $Z[x] = Z(R[x])$.

        For $\supseteq$, $f(x) \in Z(R[x]) \implies \forall b \in R \subseteq R[x]$ we have $f(x) b = bf(x)$. It follows that
        \begin{equation*}
          \forall 0 \leq i \leq n \quad a_i b = b a_i
        \end{equation*}
        and so $a_i \in Z(R)$, which implies that $Z(R[x]) \subseteq Z[x]$. Therefore, $Z(R[x]) = Z[x]$.
  \end{enumerate}\qed
\end{proof}

\begin{warning}
  Althought $f(x) \in R[x]$ can be used to define a function from $R \to R$, the polynomial is not the same as the function it defines. For example, if $R = \mathbb{Z}_2$, then $\mathbb{Z}_2[x]$ is an infinite set, but there are only $4$ different functions from $\mathbb{Z}_2 \to \mathbb{Z}_2$
\end{warning}

\begin{propo}[Polynomial Ring is an Integral Domain]
\label{propo:polynomial_ring_is_an_integral_domain}
  Let $R$ be an integral domain. Then
  \begin{enumerate}
    \item $R[x]$ is an integral domain.
    \item If $f(x) \neq 0$ and $g(x) \neq 0$ in $R[x]$, then\sidenote{In order to preserve this for when we have the case of $\deg 0$, we have to define $\deg 0 = - \infty$. Otherwise, say if we define $\deg 0 = -1$, then if $\deg f = -1$, then $\deg (fg) = \deg f + \deg g$ would imply that $\deg g = -2$, which is undefined.}
      \begin{equation*}
        \deg (fg) = \deg f + \deg g
      \end{equation*}
    \item The units in $R[x]$ are $R^*$, the units in $R$.
  \end{enumerate}
\end{propo}

\begin{proof}
  We shall prove $(1)$ and $(2)$ together.
  \begin{enumerate}
    \item[1 \& 2.] Suppose $f(x) \neq 0 \neq g(x) \in R[x]$, say
      \begin{gather*}
        f(x) = a_0 + a_1 x + \hdots + a_m x^m \quad a_m \neq 0 \\
        g(x) = b_0 + b_1 x + \hdots + b_n x^n \quad b_n \neq 0.
      \end{gather*}
      Then
      \begin{equation*}
        f(x) g(x) = a_m b_n x^{m + n} + \hdots a_0 b_0.
      \end{equation*}
      Now since $R$ is an integral domain, we have that $a_m b_n \neq 0$ and so $f(x) g(x) \neq 0$. Thus $R[x]$ is an integral domain. Moreover, we see that
      \begin{equation*}
        \deg (fg) = m + n = \deg f + \deg g.
      \end{equation*}

      \setcounter{enumi}{2}
    \item Suppose that $u(x) \in R[x]$ is a unit of $R[x]$ with inverse $u^{-1}(x)$ which we shall write as $v(x)$. Since $u(x) v(x) = 1$, by $(2)$, we have that
      \begin{equation}\label{eq:polynomial_ring_is_an_integral_domain_eq1}
        \deg u + \deg v = \deg 1 = 0.
      \end{equation}
      Now by $(1)$, $R[x]$ is an integral domain, and so since $u(x) v(x) = 1$, we have that $u(x) \neq 0 \neq v(x)$. Therefore, $\deg u, \deg v \geq 0$, which implies that we must have $\deg u = 0 = \deg v$ from \cref{eq:polynomial_ring_is_an_integral_domain_eq1}. Therefore, units in $R[x]$ are from $R^*$.
  \end{enumerate}\qed
\end{proof}

\begin{note}
  Recall that $\mathbb{Z}_n$ is an integral domain if and only if $n = p$ a prime. If $n \neq p$, then, e.g., for $\mathbb{Z}_4[x]$, we have
  \begin{equation*}
    2x\cdot 2x = 4x^2 = 0
  \end{equation*}
  and so
  \begin{equation*}
    \deg (2x) + \deg (2x) \neq \deg (4x^2) = \deg (2x \cdot 2x).
  \end{equation*}
\end{note}

% subsection polynomials (end)

\subsection{Factorization of Polynomials}%
\label{sub:factorization_of_polynomials}
% subsection factorization_of_polynomials

\begin{defn}[Division of Polynomials]\index{Division of Polynomials}
\label{defn:division_of_polynomials}
  Let $R$ be a commutative ring and $f(x), g(x) \in R[x]$. We say that $f(x)$ divides $g(x)$, denoted as $f(x) \, | \, g(x)$ if $\exists q(x) \in R[x]$ such that
  \begin{equation*}
    g(x) = q(x) f(x)
  \end{equation*}
\end{defn}

\begin{defn}[Monic Polynomial]\index{Monic Polynomial}
\label{defn:monic_polynomial}
  Let $R$ be a commutative ring and $f(x) \in R[x]$. $f(x)$ is monic if its leading coefficient is $1$.
\end{defn}

We shall prove the following proposition next class.

\begin{propononum}
  Let $R$ be an integral domain, and $f(x), \, g(x) \in R[x]$ be monic polynomials. If $f(x) \, | \, g(x)$ and $g(x) \, | \, f(x)$, then $f(x) = g(x)$.
\end{propononum}

% subsection factorization_of_polynomials (end)

% section polynomial_ring (end)

% chapter lecture_27_jul_06th_2018 (end)


\section{The Knapsack Problem}

%%%%%%%%%%%%%%%%%%%%
\begin{frame}{The change-making problem}
  \begin{exampleblock}{The change-making problem (Problem 7.12)}
    \begin{itemize}
      \item Coins values: $x_{1} \dots x_{n}$
      \item Amount: $v$
      \item Is it possible to make change for $v$?
    \end{itemize}
  \end{exampleblock}
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}{The change-making problem}
  \begin{exampleblock}{The change-making problem (Problem 7.12(2), Problem 7.1 (Subset sum))}
	\begin{enumerate}[(1)]
	  \setcounter{enumi}{1}
	  \item Without repetition ($0/1$)
	\end{enumerate}
  \end{exampleblock}

  \pause
  \begin{description}
	\item[Subproblem:] $C[i, w]$: Make change for $w$ using only values of $x_{1} \dots x_{i}$?
	\item[Goal:] $C[n,v]$
	  \pause
	\item[Make choice:] Using value $x_{i}$ or not?
	\item[Recurrence:]
	  \[
		C[i,w] = C[i-1, w] \lor (C[i-1, w-x_{i}] \textcolor{blue}{\land w \ge x_{i}})
	  \]
	  \pause
	\item[Init:]
	  \begin{align*}
		C[i,0] &= \text{true}  \\
		C[0,w] &= \text{false}, \text{if } w > 0 \\
		C[0,0] &= \text{true}
	  \end{align*}
	\item[Time:] $O(nv)$
  \end{description}
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}{The change-making problem}
  \begin{exampleblock}{The change-making problem (Problem 7.12(1))}
	\begin{enumerate}[(1)]
	  \item Unbounded repetition ($\infty$)
	\end{enumerate}
  \end{exampleblock}

  \pause
  \begin{description}
	\item[Subproblem:] $C[i, w]$: Make change for $w$ using only values of $x_{1} \dots x_{i}$?
	\item[Goal:] $C[n,v]$
	  \pause
	\item[Make choice:] Using value $x_{i}$ or not?
	\item[Recurrence:]
	  \[
		C[i,w] = C[i-1, w] \lor (C[\textcolor{red}{i}, w-x_{i}] \land w \ge x_{i})
	  \]
	  \pause
	\item[Init:]
	  \begin{align*}
		C[i,0] &= \text{true}, \forall i = 0 \dots n  \\
		C[0,w] &= \text{false}, \text{if } w > 0
	  \end{align*}
	\item[Time:] $O(nv)$
  \end{description}
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}{The change-making problem}
  \begin{exampleblock}{The change-making problem (Problem 7.12(1))}
	\begin{enumerate}[(1)]
	  \item Unbounded repetition ($\infty$)
	\end{enumerate}
  \end{exampleblock}

  \pause
  \begin{description}
	\item[Subproblem:] $C[w]$: Possible to make change for $w$?
	\item[Goal:] $C[v]$
	  \pause
	\item[Make choice:] What is the first coin to use?
	\item[Recurrence:]
	  \[
		C[w] = \bigvee_{\textcolor{red}{i: \; x_i \le w}} C[w-x_i]
	  \]
	  \pause
	\item[Init:] $C[0] = \text{true}$
	\item[Time:] $O(nv)$
  \end{description}
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}{The change-making problem}
  \begin{exampleblock}{The change-making problem (Problem 7.12(1))}
	\begin{enumerate}[(1)]
	  \item Unbounded repetition ($\infty$)
	\end{enumerate}
  \end{exampleblock}

  \[
	C[i,w] \text{\emph{ vs. }} C[w]
  \]

  \[
	C[i,w] = C[i-1, w] \lor (C[i, w-x_{i}] \land w \ge x_{i})
  \]

  \[
	C[w] = \bigvee_{i: \; x_i \le w} C[w-x_i]
  \]
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}{The change-making problem}
  \begin{exampleblock}{The change-making problem (Problem 7.12(3))}
	\begin{enumerate}[(1)]
	  \setcounter{enumi}{2}
	  \item Unbounded repetition with $\le k$ coins
	\end{enumerate}
  \end{exampleblock}

  \pause
  \begin{description}
	\item[Subproblem:] $C[i,w,l]$: Possible to make change for $w$ with $\le l$ coins of values of $x_{1} \dots x_{i}$?
	\item[Goal:] $C[n,v,k]$
	  \pause
	\item[Make choice:] Using value $x_{i}$ or not?
	\item[Recurrence:]
	  \[
		C[i,w,l] = C[i-1,w,l] \lor \left( C[\textcolor{red}{i}, w-x_{i}, \textcolor{red}{l-1}] \land w \ge x_{i} \right)
	  \]
	  \pause
	\item[Init:]
	  \begin{align*}
		C[0,0,l] &= \text{true}, \quad C[0,w,l] = \text{false}, \text{if } w > 0 \\
		C[i,0,l] &= \text{true}, \quad C[i,w,0] = \text{false}, \text{if } w > 0
	  \end{align*}
  \end{description}
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}{The change-making problem}
  \begin{exampleblock}{The change-making problem (Problem 7.12(3))}
	\begin{enumerate}[(1)]
	  \setcounter{enumi}{2}
	  \item Unbounded repetition with $\le k$ coins
	\end{enumerate}
  \end{exampleblock}

  \pause
  \begin{description}
	\item[Subproblem:] $C[w,l]$: Possible to make change for $w$ with $\le l$ coins?
	\item[Goal:] $C[v,k]$
	  \pause
	\item[Make choice:] What is the first coin to use?
	\item[Recurrence:]
	  \[
		C[w,l] = \bigvee_{i: \; x_i \le w} C[w-x_i, l-1]
	  \]
	  \pause
	\item[Init:]
	  \begin{align*}
		C[0,l] &= \text{true}, \\
		C[w,0] &= \text{false}, \text{if } w > 0
	  \end{align*}
  \end{description}
\end{frame}
%%%%%%%%%%%%%%%%%%%%


\section{Model of implicit particle-in-cell}
We developed the implicit particle-in-cell (PIC) code, based on the scheme suggested by Lapenta et al.~\cite{Lapenta2006} and improved for the relativistic case by Noguchi et al.\cite{Noguchi2007}. This scheme is described in details in these papers and below we present only a short description. The common assumption for all particle-in-cell codes is the consideration of the plasma as a superposition of a large number of finite elements, called super-particles. Distribution function can be represented as the sum of members for all super-particles:
\begin{equation}
F \left( \textbf{x},\textbf{p},t \right) =\sum _{p=1}^{N_{s}}S \left( x-x_{{p}} \right)
S \left( y-y_{{p}} \right) S \left( z-z_{{p}} \right) \delta \left( \textbf{p}-\textbf{p}_{{p}} \right),
\end{equation}
where $\textbf{x}$ and $\textbf{p}$ are coordinates and the momentum of a particle , respectively, $S$ is a shape-function, and $\delta$ is the Dirac's delta-function. The shape-function is chosen in form of b spline. Also we introduce interpolation function $W$ which represents the part of a particle which is contained in the grid cell:
\begin{equation}
W \left(x_{{c}} - x_{{p}} \right)= \int\limits_{-\infty}^{+\infty}S(x-x_{{p}})\phi(x)dx,
\end{equation}
where $c$ and $p$ are indexes of the cell and the particle, respectively, and $\phi$ equals 1 inside the cell and 0 outside. Using this function we can determine electric and magnetic field for each particle as
\begin{equation}
\begin{aligned}
&\textbf{E}_{p} = \sum_{c}\textbf{E}_c W \left(x_{{c}} - x_{{p}} \right),
\\
&\textbf{B}_{p} = \sum_{c}\textbf{B}_c W \left(x_{{c}} - x_{{p}} \right).
\end{aligned}
\end{equation}

Then we use particle fields to solve equations of motion for particles:
\begin{equation}
\begin{aligned}
&{\frac {d\textbf{x}_p}{dt}}=\textbf{v}_p,
\\
&{\frac {d\textbf{p}_p}{dt}}=q_p \left(\textbf{E}_{p}+\frac{\textbf{v}_p\times\textbf{B}_{p}}{c}\right),
\end{aligned}
\end{equation}
where $q_p$ is the particle charge and $\textbf{p}_p$ is the momentum.

At the same time, using interpolation functions we can determine macroscopic plasma parameters, such as the electric flux and the electric density :
\begin{equation}
\begin{aligned}\label{rhoj}
&\rho_c=\sum_p q_p W \left(x_{{c}} - x_{{p}} \right),
\\
&\textbf{J}_c=\sum_p q_p \textbf{v}_p W \left(x_{{c}} - x_{{p}} \right).
\end{aligned}
\end{equation}

The difficulty comes from the fact that particles coordinates and fields are coupled and we can not separate the equations of motion and Maxwell equations. The first possible solution is the explicit method: equations of fields use particle velocities on the previous time step and vice versa. Explicit approach is rather simple, but it has strong restrictions on stability. The other possible method is the implicit approach which is more complicated, but at the same time more stable. The main idea of it is to predict particle velocity at the next time step, using the field at the next time step and then use velocity in the implicit scheme for the field.

In the implicit approach we should introduce intermediate values $F^{n+\theta}=\theta F^{n+1} + \left(1-\theta\right) F^n$, where $F^n$ is the value at the n-th time step and $F^{n+\theta}$ the value at the intermediate time step. $\theta$ is the parameter of the scheme and should be greater or equal to $\frac{1}{2}$ for stability. Using this denotations we write time discretisation of the Maxwell equations as:
\begin{equation}
\begin{aligned}\label{maxwell}
&\nabla\times\textbf{E}^{n+\theta}+\frac{\textbf{B}^{n+1}-\textbf{B}^n}{c\Delta t}=0,
\\
&\nabla\times\textbf{B}^{n+\theta}-\frac{\textbf{E}^{n+1}-\textbf{E}^n}{c\Delta t}=\frac{4\pi}{c}\textbf{J}^{n+\theta},
\\
&\Delta\cdot\textbf{E}^{n+\theta}=4\pi\rho^{n+\theta},
\\
&\Delta\cdot\textbf{B}^n=0.
\end{aligned}
\end{equation}

Time discretization of equations of particle motion reads as
\begin{equation}\label{particlemoving}
\begin{aligned}
&\textbf{x}_p^{n+1}=\overline{\textbf{v}}_p\Delta t,
\\
&\textbf{p}_p^{n+1}=\textbf{p}_p^{n}+q_p\Delta t
\left(\textbf{E}_p^{n+\theta}\left(\textbf{x}_p^{n+\theta}\right)+\frac{\overline{\textbf{v}}_p\times\textbf{B}_p^n\left(\textbf{x}_p^{n+\theta}\right)}{c}\right),
\end{aligned}
\end{equation}
where $\overline{\textbf{v}}_p$ is the average velocity. It should be noted that the electric field is evaluated at the moment $n+\theta$, while the magnetic field at the moment $n$. If $\theta = \frac{1}{2}$ the scheme has the second order accuracy in $\Delta t$.  Finally we can express average velocity explicitly using $\textbf{v}_p^{n}$ and $\textbf{E}_p^{n+\theta}$:
\begin{equation}\label{averagev}
\overline{\textbf{v}}_p = \widehat{\textbf{v}}_p+\frac{q_p\Delta t}{2m_p\Gamma_p}\alpha_p^{n}\textbf{E}_p^{n+\theta}\left(\textbf{x}_p^{n+\theta}\right),
\end{equation}
where we use following notations:
\begin{equation}
\widehat{\textbf{v}}_p=\alpha_p^{n}\gamma_p^n\textbf{v}_p^n,
\end{equation}
\begin{equation}
\alpha_p^n=\frac{1}{\Gamma_p\left(1+\left(\frac{q_p\Delta t\textbf{B}_p^n}{2m_p\Gamma_p}\right)^2\right)}\left(I-\frac{q_p\Delta t}{2m_p\Gamma_p}I\times\textbf{B}_p^n+\left(\frac{q_p\Delta t}{2m_p\Gamma_p}\right)^2\textbf{B}_p^n\textbf{B}_p^n\right),
\end{equation}
\begin{equation}
\Gamma_p=\frac{q_p\Delta t\textbf{B}_p^n}{2m_p}\textbf{E}_p^n\cdot\textbf{v}_p^n+\gamma_p^n,
\end{equation}
where $I$ is the identity tensor and $\gamma_p^n$ is the gamma-factor of the particle at the moment $n$. Using expression(\ref{averagev}) for the average velocity we can expand in series expressions for the electric flux and density (\ref{rhoj}) by term $\textbf{x}_p^n-\textbf{x}_p^{n+\theta}$ and substitute them into the Maxwell equations (\ref{maxwell}). After solving algebraic equations, combining all terms and excluding magnetic field we finally obtain the implicit second-order elliptic equation for $\textbf{E}^{n+\theta}$:
\begin{eqnarray}\label{electricfield}
\left(c\theta\Delta t\right)^2 \left(-\nabla^2\textbf{E}^{n+\theta}-\nabla\nabla\cdot\left(\mu^n\cdot\textbf{E}^{n+\theta}\right)\right)+\epsilon^n\textbf{E}^{n+\theta}=
\nonumber\\
\textbf{E}^{n}-c\theta\Delta t\left(\frac{4\pi\widehat{\textbf{J}}}{c}-\frac{\Delta t}{2}\nabla\cdot\widehat{\Pi}-\nabla\times\textbf{B}^n\right)
-\left(c\theta\Delta t\right)^2 4\pi \nabla\widehat{\rho},
\end{eqnarray}
where we used following notations:
\begin{equation}
 \epsilon^n=I+\mu^n ,
\end{equation}
\begin{equation}
\mu^n=-\sum_p\frac{2\pi q_p^2\theta\Delta t^2}{m_p}\alpha_p^n W\left(x-x_p^n\right),
\end{equation}
\begin{equation}
\widehat{\Pi}=\sum_p q_p\widehat{\textbf{v}}_p\widehat{\textbf{v}}_p W\left(x-x_p^n\right),
\end{equation}
\begin{equation}
\widehat{\textbf{J}}=\sum_p q_p \widehat{\textbf{v}}_p W\left(x-x_p^n\right),
\end{equation}
\begin{equation}
\widehat{\rho}=\rho^n - \theta \Delta t \nabla\cdot\left(\widehat{\textbf{J}} -\frac{\Delta t}{2}\nabla\cdot\widehat{\Pi} \right).
\end{equation}

The spacial discretization of the equation of the electric field (\ref{electricfield}) is performed with a finite-volume scheme and  then the system of linear equations is solved using general minimal residual algorithm. After that we can explicitly evaluate magnetic field using the first Maxwell equation (\ref{maxwell}) and finally, when fields computed, we can solve equations of motion (\ref{particlemoving}) using iterative non-linear solver.

Our code is fully three dimensional and parallelized with MPI technology, which is adapted for distributed computing and can be executed on a wide class of computers.


%auto-ignore
\providecommand{\MainFolder}{..}
\documentclass[\MainFolder/Text.tex]{subfiles}
\begin{document}
\section{Summary of IBL-infinity theory for cyclic DGA}\label{BV:Summary}
Let $(V,\Pair,m_1,m_2)$ be a cyclic $\DGA$ of degree $n$ of finite type.
We have:
\begin{itemize}
    \item Cyclic cochains $\CycC(V) = \CDBCyc V[2-n]$,
    \item Canonical dIBL-algebra $\OPQ_{110}$, $\OPQ_{210}$, $\OPQ_{120}$ on $\CycC(V)$ denoted by $\dIBL(\CycC(V))$,
    \item Canonical Maurer-Cartan element $\MC = (\MC_{10})$,
    \item Twisted dIBL-algebra $\OPQ_{110}^\MC$, $\OPQ_{210}$, $\OPQ_{120}$ on $\CycC(V)$ denoted by $\dIBL^\MC(\CycC(V))$.
\end{itemize}
Recall from Appendix~\ref{Section:AppEqDefPrCoPr} that, up to signs and permutation of variables, $\OPQ_{210}$ is the cyclization ${}^+$ of the Gerstenhaber bracket $[\cdot,\cdot]$ and that it holds $\BVOp_{\CycMRM} = \ProdCyc\circ\OPQ_{120}$, where~$\BVOp_{\CycMRM}$ is an extension of the Schwarz's $\BV$-operator on polynomial functions on $V$ to $\CycC(V)$ and~$\ProdCyc$ is the cyclic shuffle coproduct.

Let $(V',\Pair',m_1',m_2')$ be another cyclic $\DGA$ of degree $n$ of finite type, and let
\begin{equation}\label{Eq:DefRetr}
\begin{tikzcd}[column sep=large]
(V,m_1)\arrow[loop left]{l}{\Htp}\arrow[shift left]{r}{\pi}&\arrow[shift left]{l}{\iota} (V',m_1')
\end{tikzcd}
\end{equation}
be a deformation retraction.
We have the following:
\begin{itemize}
    \item $\IBLInfty$-morphism $\HTP: \dIBL(\CycC(V))\rightarrow \dIBL(\CycC(V'))$ with components $\HTP_{klg}: \hat{\Ext}_k \CycC(V) \rightarrow \hat{\Ext}_l \CycC(V')$ such that
 $$ \HTP_{110}=\iota^*: (\CycC(V),\hat{\OPQ}_{110})\longrightarrow(\CycC(V'),\hat{\OPQ}'_{110}) $$
 is a quasi-isomorphism.
 The number $\HTP_{klg}(\Susp^k \psi_1\otimes\dotsb\otimes\psi_k)(\Susp^{l}\omega_1\otimes\dotsb\otimes\omega_l)$
for $\psi_1$,~$\dotsc$, $\psi_k \in \CDBCyc V$ and $\omega_1 = \omega_{11}\dotsb\omega_{1 s_1}$,~$\dotsc$, $\omega_l = \omega_{l1}\dotsb\omega_{ls_l}\in \BCyc V'$, where $\Susp$ is the formal symbol of degree $n-3$, is computed via summation over ribbon graphs with interior vertices decorated with $\psi_1$, $\dotsc$, $\psi_k$, interior edges decorated with the propagator --- the Schwartz kernel $\Prpg$ of $\Htp$ --- and exterior vertices decorated with~$\omega_{ij}$ at the $i$-th boundary component and with $j$ respecting the orientation.
We will refer to such graphs shortly as \emph{Feynman graphs.}
    \item Pushforward Maurer-Cartan element $\PMC \coloneqq\HTP_* \MC$ with components $\PMC_{lg} \in \hat{\Ext}_l\CycC(V)$.
    The number $\PMC_{lg}(\Susp^l\omega_1\otimes \dotsc \otimes \omega_l)$ is computed via summation over Feynman graphs as above with trivalent internal vertices $\MC_{10}$.
    \item Twisted $\IBLInfty$-morphism $\HTP^\MC: \dIBL^\MC(\CycC(V)) \rightarrow \dIBL^\PMC(\CycC(V'))$ with components $\HTP^\MC_{klg}: \hat{\Ext}_k \CycC(V) \rightarrow \hat{\Ext}_l \CycC(V')$ such that
 $$\begin{multlined}[t]\HTP_{110}^\MC: (\CycC(V),\hat{\OPQ}_{110}^\MC)\longrightarrow(\CycC(V'),{\hat{\OPQ}'^\PMC}_{110}) \\ =\iota^* + \HTP_{210}\circ_1 \MC_{10} + \frac{1}{2!} \HTP_{310} \circ_{1,1}(\MC_{10}, \MC_{10}) + \dotsb\end{multlined} $$
is a quasi-isomorphism.
The number $\HTP_{klg}(\Susp^k \psi_1\otimes\dotsb\otimes\psi_k)(\Susp^{l}\omega_1\otimes\dotsb\otimes\omega_l)$ is computed via summation over Feynmann graphs with interior vertices $\psi_1$, $\dotsc$, $\psi_k$ and $\MC_{10}$.
\end{itemize}
Recall that an $\IBLInfty$-quasi-isomorphism is automatically an $\IBLInfty$-homotopy equivalence; this has been proven in \cite[Theorem~1.2]{Cieliebak2015} via obstruction theory.
Obstruction theory also gives the existence of a minimal model of any $\IBLInfty$-algebra, which is the content of~\cite[Theorem~1.3]{Cieliebak2015}.
What is not proven yet but what we suspect is true is the following:
\begin{enumerate}[label=(\arabic*)]
 \item For a different choice of the deformation retraction \eqref{Eq:DefRetr}, the corresponding $\IBLInfty$-morphisms $\HTP$ and $\HTP'$ are $\IBLInfty$-homotopic.
 \item If $\iota$ is in addition a morphism of Poincar\'e $\DGA$'s (perhaps simply-connected), then $\dIBL^\MC(\CycC(V))$ and $\dIBL^{\MC'}(\CycC(V'))$ are $\IBLInfty$-homotopy equivalent (perhaps even the Maurer-Cartan elements $\MC'$ and $\HTP_{*}\MC$ are gauge equivalent).
%Therefore, in~\eqref{Eq:DefRetr}, if, e.g., $V'$ is a subalgebra and $\iota$ is an inclusion, then $\dIBL^\MC(\CycC(V))$ and $\dIBL^{\MC'}(\CycC(V'))$ are $\IBLInfty$-homotopic.
\end{enumerate}
\end{document}


\lab{Newton's Method}{Newton's Method}
\label{lab:NewtonsMethod}
\objective{Newton's method, the classical method for finding the zeros of a function, is one of the most important algorithms of all time.
In this lab, we implement Newton's method in arbitrary dimensions and use it to solve a few interesting problems.
We also explore in some detail the convergence (or lack of convergence) of the method under various circumstances.}

\section*{Iterative Methods} % ================================================

An \emph{iterative method} is an algorithm that must be applied repeatedly to obtain a result.
The general idea behind any iterative method is to make an initial guess at the solution to a problem, apply a few easy computations to better approximate the solution, use that approximation as the new initial guess, and repeat until done.
More precisely, let $F$ be some function used to approximate the solution to a problem.
Starting with an initial guess of $x_0$, compute
\begin{equation}x_{k+1} = F(x_k)\label{eq:iter-summary}\end{equation}
for successive values of $k$ to generate a sequence $(x_k)_{k=0}^\infty$ that hopefully converges to the true solution.
If the terms of the sequence are vectors, they are denoted by $\x_k$.

In the best case, the iteration converges to the true solution $x$, written $\lim_{k\rightarrow\infty} x_k = x$ or $x_k\rightarrow x$.
In the worst case, the iteration continues forever without approaching the solution.
In practice, iterative methods require carefully chosen \emph{stopping criteria} to guarantee that the algorithm terminates at some point.
The general approach is to continue iterating until the difference between two consecutive approximations is sufficiently small, and to iterate no more than a specific number of times.
That is, choose a very small $\epsilon > 0$ and an integer $N\in\mathbb{N}$, and update the approximation using (\ref{eq:iter-summary}) until either
\begin{equation} % Stopping Criteria.
|x_k - x_{k-1}| < \epsilon
\qquad \text{or} \qquad
k > N.
\end{equation}

The choices for $\epsilon$ and $N$ are significant: a ``large'' $\epsilon$ (such as $10^{-6}$) produces a less accurate result than a ``small'' $\epsilon$ (such $10^{-16}$), but demands less computations; a small $N$ (10) also potentially lowers accuracy, but detects and halts nonconvergent iterations sooner than a large $N$ (10,000).
In code, $\epsilon$ and $N$ are often named \li{tol} and \li{maxiter}, respectively (or similar).

While there are many ways to structure the code for an iterative method, probably the cleanest way is to combine a \li{for} loop with a \li{break} statement.
As a very simple example, let $F(x) = \frac{x}{2}$.
This method converges to $x = 0$ independent of starting point.

\begin{lstlisting}
>>> F = lambda x: x / 2
>>> x0, tol, maxiter = 10, 1e-9, 8
>>> for k in range(maxiter):           # Iterate at most N times.
...     print(x0, end='  ')
...     x1 = F(x0)                      # Compute the next iteration.
...     if abs(x1 - x0) < tol:          # Check for convergence.
...         break                       # Upon convergence, stop iterating.
...     x0 = x1                         # Otherwise, continue iterating.
...
<<10  5.0  2.5  1.25  0.625  0.3125  0.15625  0.078125>>
\end{lstlisting}

In this example, the algorithm terminates after $N=8$ iterations (the maximum number of allowed iterations) because the tolerance condition $|x_k - x_{k-1}| < 10^{-9}$ is not met fast enough.
If $N$ had been larger (say $40$), the iteration would have quit early due to the tolerance condition.

\section*{Newton's Method in One Dimension} % =================================

\emph{Newton's method} is an iterative method for finding the zeros of a function.
That is, if $f:\mathbb{R}\rightarrow\mathbb{R}$, the method attempts to find a $\bar{x}$ such that $f(\bar{x}) = 0$.
Beginning with an initial guess $x_0$, calculate successive approximations for $\bar{x}$ with the recursive sequence
\begin{equation}
x_{k+1} = x_k - \frac{f(x_k)}{f'(x_k)}.
\label{eq:newton-1d-def}
\end{equation}

The sequence converges to the zero $\bar{x}$ of $f$ if three conditions hold:
\begin{enumerate}
\item $f$ and $f'$ exist and are continuous,
\item $f'(\bar{x})\neq0$, and
\item $x_0$ is ``sufficiently close'' to $\bar{x}$.
\end{enumerate}
In applications, the first two conditions usually hold.
If $\bar{x}$ and $x_0$ are not ``sufficiently close,'' Newton's method may converge very slowly, or it may not converge at all.
However, when all three conditions hold, Newton's method converges quadratically, meaning that the maximum error is squared at every iteration.
This is very quick convergence, making Newton's method as powerful as it is simple.

\begin{figure}[h] % Iterations of Newton's method.
\centering
\includegraphics[width=.7\textwidth]{figures/newton_iters.pdf}
\caption{
Newton's method approximates the zero of a function (blue) by choosing as the next approximation the $x$-intercept of the tangent line (red) that goes through the point $(x_k, f(x_k))$.
In this example, $f(x) = e^x - 2$, which has a zero at $\bar{x} = \log(2)$.
Setting $x_0 = 2$ and using (\ref{eq:newton-1d-def}) to iterate, we have $x_1 = x_0 - \frac{f(x_0)}{f'(x_0)} = 2 - \frac{e^2 - 2}{e^2} \approx 1.2707$.
Similarly, $x_2 \approx 0.8320$, $x_3 \approx .7024$, and $x_4 \approx 0.6932$.
After only a few iterations, the zero $\log(2)\approx 0.6931$ is already computed to several digits of accuracy.}
\label{fig:newton}
\end{figure}

\begin{problem}
\label{prob:newton-basic}
Write a function that accepts a function $f$, an initial guess $x_0$, the derivative $f'$, a stopping tolerance defaulting to $10^{-5}$, and a maximum number of iterations defaulting to $15$.
Use Newton's method as described in (\ref{eq:newton-1d-def}) to compute a zero $\bar{x}$ of $f$.
Terminate the algorithm when $|x_k - x_{k-1}|$ is less than the stopping tolerance or after iterating the maximum number of allowed times.
Return the last computed approximation to $\bar{x}$, a boolean value indicating whether or not the algorithm converged, and the number of iterations completed.

Test your function against functions like $f(x) = e^x - 2$ (see Figure \ref{fig:newton}) or $f(x) = x^4 - 3$.
Check that the computed zero $\bar{x}$ satisfies $f(\bar{x}) \approx 0$.
Also consider comparing your function to \li{scipy.optimize.newton()}, which accepts similar arguments.
\end{problem}

\begin{info}
Newton's method can be used to find zeros of functions that are hard to solve for analytically.
For example, the function $f(x) = \frac{\sin(x)}{x}-x$ is not continuous on any interval containing 0, but it can be made continuous by defining $f(0)=1$.
Newton's method can then be used to compute the zeros of this function.
\end{info}

\begin{problem} % Application to interest rates.
\label{prob:newton-interest}
Suppose that an amount of $P_1$ dollars is put into an account at the beginning of years $1, 2,..., N_1$ and that the account accumulates interest at a fractional rate $r$ (so $r = .05$ corresponds to $5\%$ interest).
In addition, at the beginning of years $N_1 + 1, N_1 + 2, ..., N_1 + N_2$, an amount of $P_2$ dollars is withdrawn from the account and that the account balance is exactly zero after the withdrawal at year $N_1 + N_2$.
Then the variables satisfy
\[
P_1[(1+r)^{N_1} - 1] = P_2[1-(1+r)^{-N_2}].
\]

Write a function that, given $N_1$, $N_2$, $P_1$, and $P_2$, uses Newton's method to determine $r$.
For the initial guess, use $r_0 = 0.1$.
\\(Hint: Construct $f(r)$ such that when $f(r)=0$, the equation is satisfied.
Also compute $f'(r)$.)

To test your function, if $N_1 =30, N_2 =20, P_1 =2000$, and $P_2 =8000$, then $r\approx 0.03878$.
(From Atkinson, page 118). % TODO: better citation.
\end{problem}

\subsection*{Backtracking} % --------------------------------------------------

Newton's method may not converge for a variety of reasons.
One potential problem occurs when the step from $x_k$ to $x_{k+1}$ is so large that the zero is stepped over completely.
\emph{Backtracking} is a strategy that combats the problem of overstepping by moving only a fraction of the full step from $x_k$ to $x_{k+1}$.
This suggests a slight modification to (\ref{eq:newton-1d-def}),
\begin{equation}
x_{k+1} = x_k - \alpha\frac{f(x_k)}{f'(x_k)},\qquad\alpha\in(0,1].
\label{eq:newton-backtracking-1d}
\end{equation}
Note that setting $\alpha = 1$ results in the exact same method defined in (\ref{eq:newton-1d-def}), but for $\alpha \in (0,1)$, only a fraction of the step is taken at each iteration.

\begin{problem} % Implement backtracking.
Modify your function from Problem \ref{prob:newton-basic} so that it accepts a parameter $\alpha$ that defaults to $1$.
Incorporate (\ref{eq:newton-backtracking-1d}) to allow for backtracking.

To test your modified function, consider $f(x)=x^{1/3}$.
The command \li{x**(1/3.)} fails when \li{x} is negative, so the function can be defined with NumPy as follows.
\begin{lstlisting}
import numpy as np
f = lambda x: np.sign(x) * np.power(np.<<abs>>(x), 1./3)
\end{lstlisting}
With $x_0=.01$ and $\alpha=1$, the iteration should \textbf{not} converge.
However, setting $\alpha=.4$, the iteration should converge to a zero that is close to $0$.
\label{prob:newton-1d-backtracking}
\end{problem}

The backtracking constant $\alpha$ is significant, as it can result in faster convergence or convergence to a different zero (see Figure \ref{fig:newton-backtracking-multi-result}).
However, it is not immediately obvious how to choose an optimal value for $\alpha$.

\begin{figure}[H]
\centering
\includegraphics[width=.7\textwidth]{figures/backtracking.pdf}
\caption{Starting at the same initial value but using different backtracking constants can result in convergence to two different solutions.
The blue line converges to $\tilde{\x} = (0,-1)$ with $\alpha = 1$ in 5 iterations of Newton's method while the orange line converges to $\hat{\x} = (3.75,.25)$ with $\alpha = 0.4$ in $15$ iterations.
Note that the points in this example are $2$-dimensional, which is discussed in the next section.}
\label{fig:newton-backtracking-multi-result}
\end{figure}

\begin{problem} % Searching for a good backtracking constant.
\label{prob:newton-backtracking-search}
Write a function that accepts the same arguments as your function from Problem \ref{prob:newton-1d-backtracking} except for $\alpha$.
Use Newton's method to find a zero of $f$ using various values of $\alpha$ in the interval $(0,1]$.
Plot the values of $\alpha$ against the number of iterations performed by Newton's method.
Return a value for $\alpha$ that results in the lowest number of iterations.

A good test case for this problem is the function $f(x) = x^{1/3}$ discussed in Problem \ref{prob:newton-1d-backtracking}.
In this case, your plot should show that the optimal value for $\alpha$ is actually closer to $.3$ than to $.4$.
% resemble the following figure.
% \begin{figure}[H]
% \includegraphics[width=.7\textwidth]{figures/alpha_iters.pdf}
% \end{figure}
\end{problem}

\section*{Newton's Method in Higher Dimensions} % =============================

Newton's method can be generalized to work on functions with a multivariate domain and range.
Let $f:\mathbb{R}^n\rightarrow\mathbb{R}^n$ be given by $f(\x)=[f_1(\x)\ f_2(\x)\ \ldots\ f_k(\x)]\trp$, with $f_i:\mathbb{R}^n\to\mathbb{R}$ for each $i$.
The derivative $Df:\mathbb{R}^n\rightarrow\mathbb{R}^{n\times n}$ is the $n\times n$ Jacobian matrix of $f$.
\[
Df =
\left[\begin{array}{ccc}
\frac{\partial f_1}{\partial x_1} & \cdots & \frac{\partial f_1}{\partial x_k} \\
\vdots & \ddots & \vdots \\
\frac{\partial f_n}{\partial x_1} & \cdots & \frac{\partial f_n}{\partial x_k} \\
\end{array}\right]
\]

In this setting, Newton's method seeks a vector $\bar{\x}$ such that $f(\bar{\x}) = \0$, the vector of $n$ zeros.
With backtracking incorporated, (\ref{eq:newton-backtracking-1d}) becomes
\begin{equation}
\x_{k+1} = \x_k - \alpha{Df(\x_k)}^{-1}{f(\x_k)}.
\label{eq:newton-nd}
\end{equation}
Note that if $n = 1$, (\ref{eq:newton-nd}) is exactly (\ref{eq:newton-backtracking-1d}) because in that case, $Df(x)^{-1} = 1/f'(x)$.

This vector version of Newton's method terminates when the maximum number of iterations is reached or the difference between successive approximations is less than a predetermined tolerance $\epsilon$ with respect to a vector norm, that is, $||\x_k - \x_{k-1}|| < \epsilon$.

\begin{problem} % Newton's method in n dimensions.
Modify your function from Problems \ref{prob:newton-basic} and \ref{prob:newton-1d-backtracking} so that it can compute a zero of a function $f:\mathbb{R}^n\rightarrow\mathbb{R}^n$ for any $n\in\mathbb{N}$.
Take the following tips into consideration.
\begin{itemize}
\item If $n > 1$, $f$ should be a function that accepts a 1-D NumPy array with $n$ entries and returns another NumPy array with $n$ entries.
Similarly, $Df$ should be a function that accepts a 1-D array with $n$ entries and returns a $n\times n$ array.
In other words, $f$ and $Df$ are callable functions, but $f(\x)$ is a vector and $Df(\x)$ is a matrix.

\item \li{np.isscalar()} may be useful for determining whether or not $n > 1$.

\item Instead of computing $Df(\x_k)^{-1}$ directly at each step, solve the system $Df(\x_k)\y_k = f(\x_k)$ and set $\x_{k+1} = \x_k - \alpha\y_k$.
In other words, use \li{la.solve()} instead of \li{la.inv()}.
% Always avoid taking matrix inverses when possible.

\item The stopping criterion now requires using a norm function instead of \li{abs()}.
\end{itemize}

After your modifications, carefully verify that your function still works in the case that $n=1$, and that your functions from Problems \ref{prob:newton-interest} and \ref{prob:newton-backtracking-search} also still work correctly.
In addition, your function from Problem \ref{prob:newton-backtracking-search} should also work for any $n \in \mathbb{N}$.
\label{prob:newton-nd-implementation}
\end{problem}

\begin{problem}
Bioremediation involves the use of bacteria to consume toxic wastes.
At a steady state, the bacterial density $x$ and the nutrient concentration $y$ satisfy the system of nonlinear equations
\begin{align*}
\gamma xy - x(1 + y) &= 0 \\
-xy + (\delta - y)(1 + y) &= 0,
\end{align*}
where $\gamma$ and $\delta$ are parameters that depend on various physical features of the system.%
\footnote{This problem is adapted from exercise 5.19 of \cite{heath2002scientific} and the notes of Homer Walker).}

For this problem, assume the typical values $\gamma = 5$ and $\delta = 1$, for which the system has solutions at $(x, y) = (0, 1), (0, -1)$, and $(3.75, .25)$.
Write a function that finds an initial point $\x_0 = (x_0,y_0)$ such that Newton's method converges to either $(0, 1)$ or $(0, -1)$ with $\alpha = 1$, and to $(3.75, .25)$ with $\alpha = 0.55$.
As soon as a valid $\x_0$ is found, return it (stop searching).
\\(Hint: search within the rectangle $[-\frac{1}{4},0]\times[0,\frac{1}{4}]$.)
\end{problem}

\subsection*{Basins of Attraction} % ------------------------------------------

When a function $f$ has many zeros, the zero that Newton's method converges to depends on the initial guess $x_0$.
For example, the function $f(x)=x^2-1$ has zeros at $-1$ and $1$.
If $x_0<0$, then Newton's method converges to $-1$; if $x_0 > 0$ then it converges to $1$ (see Figure \ref{fig:basins-quadratic}).
The regions $(-\infty, 0)$ and $(0, \infty)$ are called the \emph{basins of attraction} of $f$.
Starting in one basin of attraction leads to finding one zero, while starting in another basin yields a different zero.

When $f$ is a polynomial of degree greater than 2, the basins of attraction are much more interesting.
For example, the basis of attraction for $f(x) = x^3-x$ are shown in Figure \ref{fig:basins-cubic}.
The basin for the zero at the origin is connected, but the other two basins are disconnected and share a kind of symmetry.

\begin{figure}[H] % 1-D basins of attraction.
\centering
\begin{subfigure}{.48\textwidth}
    \centering
    \includegraphics[width=\textwidth]{figures/basins_quadratic.pdf}
    \caption{Basins of attraction for $f(x) = x^2 -1$.}
    % With $\alpha=1$, blue values for $x_0$ converge to -1 and orange values converge to 1.}
    \label{fig:basins-quadratic}
\end{subfigure}
\quad
\begin{subfigure}{.48\textwidth}
    \centering
    \includegraphics[width=\textwidth]{figures/basins_cubic.pdf}
    \caption{Basins of attraction for $f(x) = x^3 -x$.}
        % With $\alpha=1$, blue values converge to $-1$, orange converge to 0, and green converge to 1.}
    \label{fig:basins-cubic}
\end{subfigure}
\caption{Basins of attraction with $\alpha=1$.
Since choosing a different value for $\alpha$ can change which zero Newton's method converges to, the basins of attraction may change for other values of $\alpha$.}
\end{figure}

It can be shown that Newton's method converges in any Banach space with only slightly stronger hypotheses than those discussed previously. % \footnote{See Chapter 7 of Volume 1 for details.}
In particular, Newton's method can be performed over the complex plane $\mathbb{C}$ to find imaginary zeros of functions.
Plotting the basins of attraction over $\mathbb{C}$ yields some interesting results.

The zeros of $f(x) = x^3 - 1$ are $1$, and $-\frac{1}{2} \pm \frac{\sqrt{3}}{2}i$.
To plot the basins of attraction for $f(x) = x^3-1$ on the square complex domain $X = \{a+bi \mid a \in [-\frac{3}{2},\frac{3}{2}], b \in [-\frac{3}{2},\frac{3}{2}]\}$,
create an initial grid of complex points in this domain using \li{np.meshgrid()}.
% Create the real and imaginary parts of the points separately, and then use \li{np.meshgrid()} to turn them into a single grid of complex numbers.

\begin{lstlisting}
>>> x_real = np.linspace(-1.5, 1.5, 500)    # Real parts.
>>> x_imag = np.linspace(-1.5, 1.5, 500)    # Imaginary parts.
>>> X_real, X_imag = np.meshgrid(x_real, x_imag)
>>> X_0 = X_real + 1j*X_imag                # Combine real and imaginary parts.
\end{lstlisting}

The grid $X_0$ is a $500\times500$ array of complex values to use as initial points for Newton's method.
Array broadcasting makes it easy to compute an iteration of Newton's method at every grid point.

\begin{lstlisting}
>>> f = lambda x: x**3 - 1
>>> Df = lambda x: 3*x**2
>>> X_1 = X_0 - f(X_0)/Df(X_0)
\end{lstlisting}

After enough iterations, the $(i,j)$th element of the grid $X_k$ corresponds to the zero of $f$ that results from using the $(i,j)$th element of $X_0$ as the initial point.
For example, with $f(x) = x^3 - 1$, each entry of $X_k$ should be close to $1$, $-\frac{1}{2} + \frac{\sqrt{3}}{2}i$, or $-\frac{1}{2} - \frac{\sqrt{3}}{2}i$.
Each entry of $X_k$ can then be assigned a value indicating which zero it corresponds to.
Some results of this process are displayed below.

\begin{figure}[H]
\centering
\begin{subfigure}{.49\textwidth}
    \centering
    \includegraphics[width=\textwidth]{figures/fractal_hw.png}
    \caption{Basins of attraction for $f(x) = x^3-1$.}
    \label{fig:fractal_hw}
\end{subfigure}
\begin{subfigure}{.49\textwidth}
    \centering
    \includegraphics[width=\textwidth]{figures/fractal_ex.png}
    \caption{Basins of attraction for $f(x) = x^3-x$.}
    \label{fig:fractal_ex}
\end{subfigure}
\caption{}
\label{fig:newton-basins}
\end{figure}

\begin{info} % Newton fractals
Notice that in some portions of Figure \ref{fig:fractal_hw}, whenever red and blue try to come together, a patch of green appears in between.
This behavior repeats on an infinitely small scale, producing a fractal.
Because it arises from Newton's method, this kind of fractal is called a \emph{Newton fractal}.

Newton fractals show that the long-term behavior of Newton's method is \textbf{extremely} sensitive to the initial guess $x_0$.
Changing $x_0$ by a small amount can change the output of Newton's method in a seemingly random way.
This phenomenon is called \emph{chaos} in mathematics.
\end{info}

\begin{problem} % Plot the basins of attraction.
Write a function that accepts a function $f:\mathbb{C}\rightarrow\mathbb{C}$, its derivative $f':\mathbb{C}\rightarrow\mathbb{C}$, an array \li{zeros} of the zeros of $f$, bounds $[r_{\text{min}},r_{\text{max}},i_{\text{min}},i_{\text{max}}]$ for the domain of the plot, an integer \li{res} that determines the resolution of the plot, and number of iterations \li{iters} to run the iteration.
Compute and plot the basins of attraction of $f$ in the complex plane over the specified domain in the following steps.
\begin{enumerate}
\item Construct a \li{res}$\times$\li{res} grid $X_0$ over the domain $\{a+bi \mid a \in [r_{\text{min}},r_{\text{max}}], b \in [i_{\text{min}},i_{\text{max}}]\}$.

\item Run Newton's method (without backtracking) on $X_0$ \li{iters} times, obtaining the \li{res}$\times$\li{res} array $x_{k}$.
To avoid the additional computation of checking for convergence at each step, do not use your function from Problem \ref{prob:newton-nd-implementation}.

\item $X_k$ cannot be directly visualized directly because its values are complex.
Solve this issue by creating another \li{res}$\times$\li{res} array $Y$.
To compute the $(i,j)$th entry $Y_{i,j}$, determine which zero of $f$ is closest to the $(i,j)$th entry of $X_k$.
Set $Y_{i,j}$ to the index of this zero in the array \li{zeros}.
If there are $R$ distinct zeros, each $Y_{i,j}$ should be one of $0,1,\ldots,R-1$.
\\(Hint: \li{np.argmin()} may be useful.)

\item Use \li{plt.pcolormesh()} to visualize the basins.
Recall that this function accepts three array arguments: the $x$-coordinates (in this case, the real components of the initial grid), the $y$-coordinates (the imaginary components of the grid), and an array indicating color values ($Y$).
Set \li{cmap="brg"} to get the same color scheme as in Figure \ref{fig:newton-basins}.
\end{enumerate}

Test your function using $f(x) = x^3-1$ and $f(x)=x^3-x$.
The resulting plots should resemble Figures \ref{fig:fractal_hw} and \ref{fig:fractal_ex}, respectively (perhaps with the colors permuted).
\end{problem}

\begin{comment} % No Additional Material for now.

\newpage

\section*{Additional Material} % ==============================================

\subsection*{Newton's Method for Optimization} % ------------------------------

\subsection*{Other Algorithms Based on Newton's Method} % ---------------------

% \subsection*{Fractals} % ----------------------------------------------------

% % Totally irrelevant.
% Another well-studied fractal in the complex plane is the Mandelbrot set.
% It is defined as the points $c \in \mathbb{C}$ for which the sequence
% \[z_k = z_{k-1}^2 + c\]
% is bounded.

\subsection*{Visualizing Complex Functions} % ---------------------------------

Plot the result of \li{np.angle()} on $X_k$ as an alternative to the index assignment.

\end{comment}


\chapter{Conclusions and Outlook}
\label{ch:conclusion}

This thesis focuses on the plasma dynamics at the tokamak periphery.
%
Despite its importance for the success of the magnetic confinement fusion program, the development of a model for the tokamak periphery has been hindered by the fact that this region is characterized by fluctuation levels of order unity, by the presence of both closed and open magnetic flux surfaces, and by a wide range of temperatures and densities that result in a wide range of collisionalities.
%
These challenges, as shown in the present thesis, can be overcome by the use of moment expansion methods with a suitable set of basis functions that allows a convenient expression of the integro-differential Coulomb collision operator.

In \cref{ch:dk}, a moment-hierarchy model is developed from a first-principles based, full-F, drift-kinetic model, suitable to describe the plasma dynamics in the SOL region of tokamak devices at arbitrary collisionality.
%
Taking advantage of the separation between the turbulent and gyromotion scales, a gyroaveraged Lagrangian and its corresponding equations of motion are obtained.
%
The gyroaveraged distribution function is then expanded into a Hermite-Laguerre basis, and the coefficients of the expansion are related to the lowest-order gyrofluid moments.
%
The fluid moment expansion of the Coulomb operator in terms of irreducible Hermite polynomials is reviewed, and its respective particle moments are written in terms of coefficients of the Hermite-Laguerre expansion, relating both expansions.
%
This allows us to express analytically the moments of the collision operator in terms of guiding-center moments.
%
A moment-hierarchy that describes the evolution of the guiding-center moments is derived, together with a Poisson's equation accurate up to second order.
%
The resulting set of equations is then used to derive a fluid model in the high collisionality limit.
%
The results of this chapter are published in \citet{Jorge2017}.

In \cref{ch:gk}, a full-F gyrokinetic moment-hierarchy able to evolve the turbulent plasma dynamics in both the tokamak edge and SOL regions is derived.
%
Taking advantage of the spatial scale separation between turbulent fluctuations and magnetic field gradients, and the low-frequency of the fluctuations compared to the ion gyrofrequency, a single-particle Lagrangian is obtained using two successive noncanonical coordinate transformations in order to take into account fluctuations present at the $k_\perp \rho_s$ scale.
%
Such transformations are derived using Lie transform perturbation theory.
%
The resulting gyrokinetic equation is then projected onto a Hermite-Laguerre polynomial basis, allowing us to express the gyroaverage of plasma quantities in a closed analytical form.
%
The electrostatic fields are evolved using a gyrokinetic formulation of Maxwell's equations, expressed in terms of coefficients of the moment-hierarchy expansion coefficients.

\cref{ch:op} complements the gyrokinetic moment-hierarchy model of \cref{ch:gk} by deriving a moment-hierarchy formulation of the full-F gyrokinetic Coulomb collision operator, valid in both the electrostatic and in the electromagnetic regime.
%
The Coulomb collision operator at arbitrary $k_\perp \rho_i$ is ported to a phase-space coordinate system suitable to describe magnetized plasmas, i.e., to guiding-center and gyrocenter coordinate systems, and projected onto a Hermite-Laguerre basis.
%
This allows us to describe the plasma dynamics and turbulence in the tokamak periphery at arbitrary collisionalities and fills a gap in the literature by providing full Coulomb moments for full-F gyrofluid models.

%In \cref{ch:4ddk},

In \cref{ch:epw}, following \citet{Jorge2018a}, the effect of full Coulomb collisions on electron-plasma waves is studied by taking into account both electron-electron and electron-ion collisions.
%
The proposed framework is particularly efficient, as the number of polynomials needed in order to obtain convergence is low enough to allow multiple scans to be performed, particularly a comparison between several collision operators at arbitrary collisionalities.
%
While the use of electron-ion collisions {alone} leads to a damping rate slightly smaller than the one evaluated with the full Coulomb operator, the damping rate using a Lenard-Bernstein or a Dougherty collision operator yields deviations up to 50\% larger with respect to the Coulomb one.
%
An eigenmode analysis reveals major differences between the spectrum of full Coulomb and simplified collision operators.
%
In addition, the eigenspectrum shows the presence of purely damped modes that correspond to the entropy mode.
%
We demonstrate that the entropy mode needs a full Coulomb collision operator for its proper description, deriving an analytical dispersion relation for the entropy mode that accurately reproduces the numerical results.

Finally, in \cref{ch:dwi}, the linear properties of the drift-wave instability are described at arbitrary collisionalities for the first time.
%
The analysis shows that the corrections introduced by the full Coulomb collision operator with respect to simplified collision operators, presently used in state-of-the-art codes, are qualitatively and quantitatively significant at the relevant collisionality regime of operation of future nuclear fusion devices such as ITER.
%
Indeed, the drift-wave growth rate is seen to deviate by factors of order unity from fluid and kinetic models based on simplified collision operators.
%
The results of \cref{ch:dwi} are published in \citet{Jorge2018}.

With the present work, a crucial step towards a predictive model of tokamak turbulence has been accomplished.
%
Although the ordering used in this work when deriving the gyrokinetic moment-hierarchy equation is, in principle, applicable to describe the plasma dynamics in the whole machine, we focus on the tokamak periphery region as collisions are expected to limit the number of terms in the expansion needed, making moment-expansion simulations more efficient than standard numerical methods.
%
As a first step of the numerical implementation of the proposed models, we have considered its linear version.
%
However, plasma dynamics at the tokamak periphery is essentially turbulent, therefore requiring the development of nonlinear simulations.
%
In this setting, future extensions of the present work should include the development of sheath boundary conditions for moment-hierarchy non-linear simulations.
%
Finally, in order to properly address the treatment of peeling-ballooning modes and the drift-Alfvén coupling in the edge region, an extension of the model derived here to include electromagnetic perturbations will be addressed in a future publication \citep{Frei2019}.


\documentclass[12pt]{article}

\begin{document}

\section*{Chapter 1}

	\subsection*{Part 1: Introduction}

	(skip)

	\subsection*{Part 2: Sets and Subsets}

	\begin{enumerate}
		\item Determine whether each of the following statements is true or false:
		\begin{enumerate}
			\item For each set $ A, A \in 2^A $ \\
				True. $ A \in \left\{ A \right\} $ by definition
			\item For each set $ A, A \subset 2^A $ \\
				False \\
				ex: $ A = \left\{ 1 \right\} $\\
				$ 2^A = \left\{ \left\{ 1 \right\} \right\} $ \\
				$ A \subset 2^A \leftrightarrow 1 \in \left\{ 1 \right\} \wedge 1 \in
			\item For each set $ A, {A} \subset 2^A $
			\item For each set $ A, \emptyset \subset 2^A $
			\item For each set $ A, \emptyset \in 2^A $
			\item There are no members of the set $ \left\{ \emptyset \right\} $
			\item Let A and B be sets. If $\displaystyle A \subset B$, then $ 2^A \subset 2^B $
			\item There are two distinct objects that belong to the set $ \left\{ \emptyset \left\{ \emptyset \right\} \right\} $
		\end{enumerate}
		\item Let A, B, C be sets. Prove if $ A \subset B $ and $ B \subset C $, then $ A \subset C $
		\item Let $ A_1,...,A_n $ be sets. Prove that if $ A_1 \subset A_2, A_2 \subset A_3, ..., A_{n-1} \subset A_n, A_n \subset A_1 $ then $ A_1 = A_2 = ... = A_n $
	\end{enumerate}

\end{document}


\subsection{Two dimensional uniform dataset with holes}
\label{sec:2d-holes}

In order to test for the adaptability of the randomized SOM to different topologies, we created a two dimensional uniform dataset with holes of various size and at random positions (see figure \ref{fig:2D-holes:results}B). Such holes are known to pose difficulties to the regular SOM since neurons whose codewords are over a hole (or in the immediate vicinity) are attracted by neurons outside the holes from all sides. Those neurons hence become dead units that never win the competition. In the RSOM, this problem exists but is less severe thanks to the absence of regularity in the underlying neural topology and the loose constraints (we use 2 neighbors to build the topology). This can be observed in \ref{fig:2D-holes:results}B) where the number of dead units is rather small and some holes are totally devoid of any neurons. Furthermore, when a sample that does not belong to the original distribution is presented, it can be observed that the answer of the map is maximal for a few neurons only (see figure \ref{fig:2D-holes:results}G)).

%The second experiment is designed to investigate how the SOM algorithms cope with two-dimensional uniformly distributed data points with holes ($x_1, x_2 \sim \mathcal{U}(0, 1)$). Therefore, in this case the input to the maps is two-dimensional Euclidean points on a plane, where we put some holes at random places on the plane (see Figure~\ref{Fig:persistence_exp2b} {\bfseries \sffamily B}, blue discs). We train again both the VSOM and the Kohonen maps over $25000$ samples for $25000$ epochs and each map consists of $1024$ neurons. For the VSOM we define the topology of the map using a blue noise distribution (see Figure~\ref{Fig:experiment2b} {\bfseries \sffamily A}) and for the Kohonen we use the standard rectangular Euclidean grid. After convergence both algorithms generate proper topographic maps covering the  input space. Figure~\ref{Fig:experiment2b} {\bfseries \sffamily B} shows the mapping of VSOM learning algorithm (white discs and black segments) along with the input space (blue discs). We observe that not too many neurons cover the holes.

This observation is also supported by our topological analysis shown in figure \ref{fig:2D-holes:analysis}. Figures
\ref{fig:2D-holes:analysis}A, B, and C show the persistent barcodes where we can see the lifespan of each (birth, death)
pair (for more details about how we compute these diagrams see Section~\ref{sec:tda}). We observe that both the SOM and
the RSOM capture both the $H0$- and $H1$-homology of the input space, however the RSOM seems to have more persistent
topological features for the $H1$-homology (orange lines). This means that the RSOM can capture more accurately the
holes which are present in the input space. Roughly speaking we have about eight holes (see figure~\ref{fig:2D-holes:results}B) and we count about eight persistent features (the longest line segments
in the barcode diagrams) for RSOM in \ref{fig:2D-holes:analysis}C. On the other hand, the important persistent features
for the SOM are about five. In a similar way the persistent diagrams in figures~\ref{fig:2D-holes:analysis}C, D, and E
show that both RSOM and SOM capture in a similar way both the $H0$- and $H1$-homology features, although the
RSOM (panel F) captures more holes as the isolated orange points away from the diagonal line indicate. This
is because the pairs that are further away from the diagonal are the most important meaning that they represent
topological features that are the most persistent during the filtration process.
Furthermore, we measure the Bottleneck distance between the persistence diagrams of input space and those of
SOM and RSOM. The SOM's persistence diagram for $H0$ is closer to the input space (SOM: $0.000829$, RSOM: $0.001$),
while the RSOM's persistence diagram is closer to input's one for the $H1$ (SOM: $0.00478$, RSOM: $0.0037$).
Finally, we ought to point out that the scale between panels A (D) and B, C (E, F) are not the same since the
self-organization process has compressed information during mapping the input space to neural one.

% On the upper part of this figure, we can see that the 1-homology (or H1, blue segments, blue dots) are more elongated for RSOM (last column) when compared to the regular SOM (central column). These segments correspond to the lifespan of H1 features when the $\alpha$ radius is increased and we can observe that the RSOM is closer to the actual distribution (left column) when compared to SOM. More precisely, we observe that the number of holes in figure~\ref{fig:2D-holes:results} is eight. Furthermore, we notice that the number of persistent blue segments (first raw of figure~\ref{fig:2D-holes:analysis}) in persistent barcodes of figure~\ref{fig:2D-holes:analysis} is about eight for the input space and about the same for the RSOM. The regular SOM expresses less persistent blue segments. The length of the blue or red segments in the barcodes indicate the lifespan  of the filtration under the variation of radius $\alpha$. The more a segment survives the more important that topological feature is. Therefore, we can claim that the RSOM has about six persistent (significant) blue segments meaning that there are eight \emph{holes} in the corresponding neural space. On the contrary, regular SOM has less persistent segments of 1-homology (blue lines) implying that it covers more regularly the input space. Similar results are shown in the second raw of figure~\ref{fig:2D-holes:analysis}, where the persistent diagrams display the pairs (birth, death). Every time the radius $\alpha$ increases new pairs are born or die as we have already described in Section~\ref{sec:topo}.

% However, 0-homology (H0, red segments) of RSOM and SOM behavior is very similar but also quite different from the actual distribution.

% \npr{ Here, an explanation of what are the red lines would be necessary. Also, concerning H0, I'm not sure how to explain the difference with SOM, RSOM and the actual distribution and what does that mean.}

%Differences in $H0$ are attributed to the different neural space topology the two algorithms, the Kohonen and the VSOM, use. VSOM's neurons are placed not on an rectangular Euclidean grid as Kohonen's do, but instead on a random (following a blue noise distribution) Euclidean grid.

% \npr{ Where is the referenced figure below? Where is the explanation concerning birht death rate on the analysis figure ?}

% In Figures~\ref{Fig:experiment2b} {\bfseries \sffamily C}-{\bfseries \sffamily H} we show the receptive fields of six randomly chosen units from the VSOM  map. We see that different stimuli are captured by different units implying that the topographic map of VSOM map is well-formed.

\begin{figure}
  \includegraphics[width=\columnwidth]{experiment-2D-holes.pdf}
  \vspace{2mm}
  \includegraphics[width=\columnwidth]{figures/colormap.pdf}
  %
  \caption{%
  %
  {\bfseries \sffamily Two dimensional uniform dataset with holes (results)}
  %
  Randomized SOM made of $1024$ neurons with a $2$-nearest neighbors induced topology. Model has been trained for $25,000$ epochs on two-dimensional points drawn from a uniform distribution on the unit square with holes of various sizes and random positions. \textbf{A} Map topology in neural space. \textbf{B} Map topology in data space. \textbf{C to H} Normalized distance map for six random samples. The \textbf{G} point has been purposely set outside the point distribution. Normalization has been performed for each sample in order to enhance contrast but this prevents comparison between maps.
  %
  }
  \label{fig:2D-holes:results}
\end{figure}

\begin{figure}
  \centering
  \includegraphics[width=\columnwidth]{experiment-2D-holes-analysis.pdf}
  %
  \caption{{\bfseries \sffamily Two dimensional uniform dataset with holes (analysis)}
  Persistent Barcodes of \textbf{A} input space, \textbf{B} SOM, and \textbf{RSOM}.
  The blue and orange line segments represent the $H0$- and $H1$-homology, respectively. This means
  that blue color represents connected segments within the space and orange color reflects the holes
  within the space. The longer the line segment the more important the corresponding topological
  feature. \textbf{D} illustrates the persistent diagram for the input space. \textbf{E} and \textbf{F}
  depict the persistent diagrams for SOM and RSOM, respectively. Again blue dots indicate $H0$-homology
  features and orange dots represent $H1$-homological features.}
  \label{fig:2D-holes:analysis}
\end{figure}


\chapter{Appendix}

\begin{algorithm}[H]
	\caption{Branch-and-Bound algorithm for a minimization problem}
	\label{alg:lit:bab}
	\begin{algorithmic}[1]
		\Statex
		\State $Incumbent=\infty$
		\State Initialize the tree with root node, $n_0$, and solve the relaxed LP
		% \Let{$BestBound$}{LP solution}
		\Let{$Nodes$}{$\{n_0\}$} \Comment{\emph{The set of nodes to be fathomed}}
		\Statex
		\While{$Nodes\neq \emptyset$}
			\State Select a node $n\in Nodes$
			\State Choose a relaxed variable, $x_i$, in the LP solution
			\State Branch on $x_i$, splitting its domain into two subsets, creating nodes $n_a$, $n_b$
			\State Solve the two relaxed LPs of each node.
			\For{$n_{new} \in \{n_a, n_b\}$}
				\If{$LPsol$ is integer}
					\If{$LPsol < Incumbent$}
						\Let{$Incumbent$}{$LPsol$} \Comment{\emph{Found new best solution}}
					\ElsIf{$LPsol \geq Incumbent$}
						\Let{$Nodes$}{$Nodes\cup\{n_{new}\}$}
					\EndIf
				\ElsIf{$LPsol$ is not integer}
					\If{$LPsol \leq BestBound$}
						\Let{$Nodes$}{$Nodes\cup\{n_{new}\}$}
					\ElsIf{$LPsol > BestBound$}
						\Let{$Nodes$}{$Nodes\setminus\big(n_{new}\cup Children(n_{new})\big)$} \Comment{\emph{Pruning}}
						\State Continue to next node
					\EndIf
				\EndIf
				\If{$LPsol < BestBound$}
					\Let{$BestBound$}{$LPsol$}
				\EndIf
				% \State Current node is fathomed
			\EndFor
		\EndWhile
		\Statex
		\State \Return $Incumbent$
	\end{algorithmic}
\end{algorithm}

\begin{lstlisting}[caption={Full MiniZinc model for CP sub-problems},label={lst:appen:CPmodel},language=minizinc]
% Constraint Programming model for a station's sub-problem
include "cumulative.mzn";
include "disjunctive.mzn";
include "redefinitions.mzn";
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
% INSTANCE INITIALISATION
int: nTasks;
int: nPrecs;
int: maxLoad;  % maximum makespan
set of int: TASK;
set of int: PREC = 1..nPrecs;
set of int: TIME = 0..maxLoad;
array[TASK] of int: dur; % duration
array[TASK] of set of TASK: suc; % set of successors
array[TASK,TASK] of int: forwSU; % forward setup times
array[TASK,TASK] of int: backSU; % backward setup times
array[TASK] of set of TASK: followForw; % allowed followers in forward load
array[TASK] of set of TASK: followBack; % allowed followers in backward load
array[TASK] of set of TASK: precedeForw; % allowed preceders in forward load
array[TASK] of set of TASK: precedeBack; % allowed preceders in backward load
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
% DECISION VARIABLES
array[TASK] of var TIME: s; % start time
array[TASK,TASK] of var TIME: spair; % start time pairings
array[TASK,TASK] of var bool: y; % forward direction following
array[TASK,TASK] of var bool: z; % backward direction following
var TIME: load;  % load
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
% CONSTRAINTS
% Only one follower in either station load direction
constraint
	forall (
		i in TASK
	)(
		  sum( j in followForw[i] )( y[i,j] )
		+ sum( j in followBack[i] )( z[i,j] )
		== 1
	);
% Only one preceder in either station load direction
constraint
	forall (
		j in TASK
	)(
		  sum( i in precedeForw[j] )( y[i,j] )
		+ sum( i in precedeBack[j] )( z[i,j] )
		== 1
	);
% Exactly one backward setup
constraint
	sum(
		i in TASK, j in followBack[i]
	)(
		z[i,j]
	) == 1
	;
% Precedence constraints
constraint
	forall (
		i in TASK, j in suc[i]
	)(
		s[i] + dur[i] + forwSU[i,j]*y[i,j] <= s[j]
	);
% Forward station load respects setup times
constraint
	forall (
		i in TASK, j in followForw[i]
	)(
		y[i,j] <-> ( s[i] + dur[i] + forwSU[i,j] == s[j] )
	);
% Backward station load respects station load
constraint
	forall (
		i in TASK
	)(
		  s[i] + dur[i]
		+ sum(
			j in followBack[i]
		  )(
		  	backSU[i,j]*z[i,j]
		  )
		<= load
	);
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
% REDUNDANT CONSTRAINTS
% Cumulative Global
constraint
	cumulative(
		[ spair[i,j] 			| i in TASK, j in TASK ],
		[ dur[i] + forwSU[i,j] 	| i in TASK, j in TASK ],
		[ y[i,j]				| i in TASK, j in TASK ],
		1
	);
constraint
	forall(
		i in TASK, j in TASK
	)(
		s[i] == spair[i,j]
	);
% Fix some ordering variables to zero
constraint
	forall (
		i in TASK, j in TASK
	where
		not( j in followForw[i] )
	)(
		y[i,j] == 0
	);
constraint
	forall (
		i in TASK, j in TASK
	where
		not( j in followBack[i] )
	)(
		z[i,j] == 0
	);
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
% OBJECTIVE
ann: my_search;
% Solve
solve :: my_search
minimize load;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
% OUTPUT
output
if full_output == 0 then
  ["load = " ++ show(load) ++ "\n"]
elseif full_output == 1 then
  ["load = " ++ show(load) ++ "\n"] ++
  ["start = " ++ show(s) ++ "\n"]
else
  [""]
endif;
\end{lstlisting}

\begin{table}[tpb]
	\centering
	\caption{Breakdown of all 1076 adapted SBF2 instances}
	\vspace{2mm}
	\begin{tabular}{llrrrrr}
		\toprule
		Class & Creator & \#Inst. & $n$ & $m$ & $|E|$ & $OS$ \\
		\midrule\midrule
		1 &  & 108 & 7-21 & 2-8 & 6-27 & \\
		 & {\tt mertens}  & 6 & 7 & 2-6 & 6 & 52.40\\
		  & {\tt bowman8}  & 1 & 8 & 5 & 8 & 75.00\\
		  & {\tt jaeschke} & 5 & 9 & 3-8 & 11 & 83.33\\
		  & {\tt jackson}  & 6 & 11 & 3-8 & 13 & 58.18\\
		  & {\tt mansoor}  & 3 & 11 & 2-4 & 11 & 60.00\\
		  & {\tt mitchell} & 6 & 21 & 3-8 & 27 & 70.95\\\midrule
		2 &  & 112 & 25-30 & 3-14 & 32-40 & \\
		  & {\tt roszieg} & 6 & 25 & 4-10 & 32 & 71.67\\
		  & {\tt heskia}   & 6 & 28 & 3-8 & 40 & 22.49\\
		  & {\tt buxey}    & 7 & 29 & 7-13 & 36 & 50.74\\
		  & {\tt sawyer30} & 9 & 30 & 5-14 & 32 & 44.83\\\midrule
		3 &  & 176 & 32-58 & 3-31 & 38-82 & \\
		  & {\tt lutz1}   & 6 & 32 & 6-11 & 38 & 83.47\\
		  & {\tt gunther}  & 7 & 35 & 7-14 & 43 & 59.50\\
		  & {\tt kilbrid}  & 10 & 45 & 3-10 & 62 & 44.60\\
		  & {\tt hahn}     & 5 & 53 & 4-8 & 82 & 83.82\\
		  & {\tt warnecke} & 16 & 58 & 14-31 & 70 & 59.10\\\midrule
		4 &  & 224 & 70-83 & 7-63 & 86-112 &  \\
		 & {\tt tonge} & 16 & 70 & 7-23 & 86 & 59.04 \\
		  & {\tt wee-mag} & 24 & 75 & 31-63 & 87 & 22.70 \\
		  & {\tt arc83} & 16 & 83 & 8-21 & 112 & 59.10 \\\midrule
		5 &  & 144 & 89-94 & 12-49 & 116-181 &  \\
		  & {\tt lutz2} & 11 & 89 & 24-49 & 116 & 77.60 \\
		  & {\tt lutz3} & 12 & 89 & 12-23 & 116 & 77.60 \\
		  & {\tt mukherje} & 13 & 94 & 13-25 & 181 & 44.80 \\\midrule
		6 &  & 208 & 111-148 & 7-51 & 175-176 &  \\
		  & {\tt arc111} & 17 & 111 & 9-27 & 176 & 40.40 \\
		  & {\tt barthold} & 8 & 148 & 7-14 & 175 & 25.80 \\
		  & {\tt barthol2} & 27 & 148 & 25-51 & 175 & 25.80 \\\midrule
		7 &  & 104 & 297-297 & 25-50 & 423-423 &  \\
		  & {\tt scholl} & 26 & 297 & 25-50 & 423 & 58.20 \\\midrule
		\multicolumn{2}{l}{Overall} & 1076 & 7-297 & 2-31 & 6-82 & \\
		\bottomrule
	\end{tabular}
	\label{tab:appen:dataSBF2}
\end{table}

\begin{table}[tpb]
	\tiny
	\caption{Full results of FSBF-2 with (\ref{eq:mip:valIneq1}) on classes 1,2 and 3}
	\centering
	\vspace{2mm}
	\begin{tabular}{cclrrrrrr}
		\toprule
		Class & Alpha & Creator & \#Nodes & \%Gap & \#No solution & \#Optimal & \%Optimal & Runtime(s) \\\midrule\midrule
		1 & 1.00 & {\tt mertens}	& 117 & 0.00 & 0 & 6/6 & 100.00 & 0.46 \\
		&		& {\tt bowman8}	& 0 & 0.00 & 0 & 1/1 & 100.00 & 0.40 \\
		&		& {\tt jaeschke}	& 249 & 0.00 & 0 & 5/5 & 100.00 & 0.60 \\
		&		& {\tt jackson}	& 3,798 & 0.00 & 0 & 6/6 & 100.00 & 6.31 \\
		&		& {\tt mansoor}	& 5,237 & 0.00 & 0 & 3/3 & 100.00 & 3.95 \\
		&		& {\tt mitchell}	& 234,143 & 0.79 & 0 & 5/6 & 83.33 & 682.81 \\
		& 0.75	& {\tt mertens}	& 80 & 0.00 & 0 & 6/6 & 100.00 & 0.30 \\
		&		& {\tt bowman8}	& 0 & 0.00 & 0 & 1/1 & 100.00 & 0.25 \\
		&		& {\tt jaeschke}	& 106 & 0.00 & 0 & 5/5 & 100.00 & 0.40 \\
		&		& {\tt jackson}	& 4,456 & 0.00 & 0 & 6/6 & 100.00 & 8.91 \\
		&		& {\tt mansoor}	& 4,010 & 0.00 & 0 & 3/3 & 100.00 & 2.52 \\
		&		& {\tt mitchell}	& 188,922 & 1.02 & 0 & 4/6 & 66.67 & 799.00 \\
		& 0.50	& {\tt mertens}	& 80 & 0.00 & 0 & 6/6 & 100.00 & 0.32 \\
		&		& {\tt bowman8}	& 0 & 0.00 & 0 & 1/1 & 100.00 & 0.10 \\
		&		& {\tt jaeschke}	& 143 & 0.00 & 0 & 5/5 & 100.00 & 0.47 \\
		&		& {\tt jackson}	& 4,456 & 0.00 & 0 & 6/6 & 100.00 & 8.81 \\
		&		& {\tt mansoor}	& 3,902 & 0.00 & 0 & 3/3 & 100.00 & 2.70 \\
		&		& {\tt mitchell}	& 166,621 & 1.02 & 0 & 4/6 & 66.67 & 737.33 \\
		& 0.25	& {\tt mertens}	& 80 & 0.00 & 0 & 6/6 & 100.00 & 0.37 \\
		&		& {\tt bowman8}	& 0 & 0.00 & 0 & 1/1 & 100.00 & 0.06 \\
		&		& {\tt jaeschke}	& 107 & 0.00 & 0 & 5/5 & 100.00 & 0.42 \\
		&		& {\tt jackson}	& 4,456 & 0.00 & 0 & 6/6 & 100.00 & 8.76 \\
		&		& {\tt mansoor}	& 1,394 & 0.00 & 0 & 3/3 & 100.00 & 1.21 \\
		&		& {\tt mitchell}	& 166,876 & 1.02 & 0 & 4/6 & 66.67 & 738.00 \\[1mm]
		\multicolumn{2}{l}{Overall} & & 43,437 & 0.16 & 0 & 101/108 & 93.52 & 166.57 \\\midrule
		2 & 1.00 & {\tt roszieg}	& 269,369 & 12.92 & 0 & 0/6 & 0.00 & 1800.47 \\
		&		& {\tt heskia}	& 401,337 & 12.40 & 0 & 0/6 & 0.00 & 1800.89 \\
		&		& {\tt buxey}	& 55,003 & 28.79 & 0 & 0/7 & 0.00 & 1800.70 \\
		&		& {\tt sawyer30}	& 30,589 & 28.26 & 0 & 0/9 & 0.00 & 1800.84 \\
		& 0.75	& {\tt roszieg}	& 211,653 & 8.15 & 0 & 0/6 & 0.00 & 1800.44 \\
		&		& {\tt heskia}	& 375,894 & 8.60 & 0 & 0/6 & 0.00 & 1800.88 \\
		&		& {\tt buxey}	& 26,939 & 25.80 & 0 & 0/7 & 0.00 & 1800.70 \\
		&		& {\tt sawyer30}	& 23,766 & 25.86 & 0 & 0/9 & 0.00 & 1800.86 \\
		& 0.50	& {\tt roszieg}	& 364,062 & 5.29 & 0 & 0/6 & 0.00 & 1800.41 \\
		&		& {\tt heskia}	& 354,638 & 6.84 & 0 & 0/6 & 0.00 & 1800.68 \\
		&		& {\tt buxey}	& 38,177 & 16.03 & 0 & 0/7 & 0.00 & 1800.57 \\
		&		& {\tt sawyer30}	& 34,790 & 16.35 & 0 & 0/9 & 0.00 & 1800.67 \\
		& 0.25	& {\tt roszieg}	& 364,552 & 5.29 & 0 & 0/6 & 0.00 & 1800.41 \\
		&		& {\tt heskia}	& 330,465 & 3.81 & 0 & 0/6 & 0.00 & 1800.71 \\
		&		& {\tt buxey}	& 85,544 & 8.13 & 0 & 0/7 & 0.00 & 1800.64 \\
		&		& {\tt sawyer30}	& 71,434 & 7.64 & 0 & 0/9 & 0.00 & 1800.59 \\[1mm]
		\multicolumn{2}{l}{Overall} & & 168,899 & 13.76 & 0 & 0/112 & 0.00 & 1800.66 \\\midrule
		3 & 1.00 & {\tt lutz1}	& 52,738 & 10.98 & 0 & 1/6 & 16.67 & 1733.60 \\
		&		& {\tt gunther}	& 37,277 & 31.30 & 0 & 0/7 & 0.00 & 1800.91 \\
		&		& {\tt kilbrid}	& 45,651 & 24.87 & 1 & 0/10 & 0.00 & 1801.75 \\
		&		& {\tt hahn}	& 74,365 & 14.70 & 0 & 0/5 & 0.00 & 1801.53 \\
		&		& {\tt warnecke}	& 4,813 & 58.44 & 0 & 0/16 & 0.00 & 1802.23 \\
		& 0.75	& {\tt lutz1}	& 49,364 & 10.60 & 0 & 0/6 & 0.00 & 1800.53 \\
		&		& {\tt gunther}	& 39,351 & 22.45 & 0 & 0/7 & 0.00 & 1800.90 \\
		&		& {\tt kilbrid}	& 85,124 & 18.87 & 2 & 0/10 & 0.00 & 1801.61 \\
		&		& {\tt hahn}	& 112,021 & 7.18 & 0 & 0/5 & 0.00 & 1801.44 \\
		&		& {\tt warnecke}	& 4,580 & 48.45 & 1 & 0/16 & 0.00 & 1802.40 \\
		& 0.50	& {\tt lutz1}	& 115,017 & 2.81 & 0 & 2/6 & 33.33 & 1706.07 \\
		&		& {\tt gunther}	& 26,716 & 18.32 & 0 & 0/7 & 0.00 & 1800.84 \\
		&		& {\tt kilbrid}	& 49,411 & 17.51 & 1 & 0/10 & 0.00 & 1801.55 \\
		&		& {\tt hahn}	& 108,078 & 7.62 & 0 & 0/5 & 0.00 & 1801.18 \\
		&		& {\tt warnecke}	& 7,121 & 41.94 & 1 & 0/16 & 0.00 & 1802.23 \\
		& 0.25	& {\tt lutz1}	& 63,440 & 1.76 & 0 & 4/6 & 66.67 & 733.06 \\
		&		& {\tt gunther}	& 31,915 & 11.11 & 0 & 0/7 & 0.00 & 1800.79 \\
		&		& {\tt kilbrid}	& 100,912 & 5.77 & 3 & 0/10 & 0.00 & 1801.41 \\
		&		& {\tt hahn}	& 161,258 & 4.92 & 0 & 0/5 & 0.00 & 1801.18 \\
		&		& {\tt warnecke}	& 7,657 & 31.58 & 0 & 0/16 & 0.00 & 1802.41 \\[1mm]
		\multicolumn{2}{l}{Overall} & & 46,060 & 19.56 & 9 & 7/176 & 3.98 & 1759.67 \\
		\bottomrule
	\end{tabular}
	\label{tab:appen:mipfsbf}
\end{table}

\begin{table}[tpb]
	\tiny
	\caption{Full results of SCBF-2 with (\ref{eq:mip:valIneq1}) on classes 1,2 and 3}
	\centering
	\vspace{2mm}
	\begin{tabular}{cclrrrrrr}
		\toprule
		Class & Alpha & Creator & \#Nodes & \%Gap & \#No solution & \#Optimal & \%Optimal & Runtime(s) \\\midrule\midrule
		1 & 1.00 & {\tt mertens}	& 623 & 0.00 & 0 & 6/6 & 100.00 & 0.31 \\
		&		& {\tt bowman8}	& 568 & 0.00 & 0 & 1/1 & 100.00 & 0.36 \\
		&		& {\tt jaeschke}	& 739 & 0.00 & 0 & 5/5 & 100.00 & 0.43 \\
		&		& {\tt jackson}	& 11,149 & 0.00 & 0 & 6/6 & 100.00 & 9.00 \\
		&		& {\tt mansoor}	& 10,954 & 0.00 & 0 & 3/3 & 100.00 & 5.38 \\
		&		& {\tt mitchell}	& 1,123,442 & 11.10 & 0 & 0/6 & 0.00 & 1800.25 \\
		& 0.75	& {\tt mertens}	& 500 & 0.00 & 0 & 6/6 & 100.00 & 0.30 \\
		&		& {\tt bowman8}	& 142 & 0.00 & 0 & 1/1 & 100.00 & 0.21 \\
		&		& {\tt jaeschke}	& 596 & 0.00 & 0 & 5/5 & 100.00 & 0.28 \\
		&		& {\tt jackson}	& 18,033 & 0.00 & 0 & 6/6 & 100.00 & 11.11 \\
		&		& {\tt mansoor}	& 9,303 & 0.00 & 0 & 3/3 & 100.00 & 5.04 \\
		&		& {\tt mitchell}	& 957,732 & 11.81 & 0 & 0/6 & 0.00 & 1800.24 \\
		& 0.50	& {\tt mertens}	& 500 & 0.00 & 0 & 6/6 & 100.00 & 0.27 \\
		&		& {\tt bowman8}	& 34 & 0.00 & 0 & 1/1 & 100.00 & 0.10 \\
		&		& {\tt jaeschke}	& 665 & 0.00 & 0 & 5/5 & 100.00 & 0.26 \\
		&		& {\tt jackson}	& 18,033 & 0.00 & 0 & 6/6 & 100.00 & 10.85 \\
		&		& {\tt mansoor}	& 11,228 & 0.00 & 0 & 3/3 & 100.00 & 6.38 \\
		&		& {\tt mitchell}	& 1,116,662 & 12.23 & 0 & 0/6 & 0.00 & 1800.23 \\
		& 0.25	& {\tt mertens}	& 500 & 0.00 & 0 & 6/6 & 100.00 & 0.29 \\
		&		& {\tt bowman8}	& 49 & 0.00 & 0 & 1/1 & 100.00 & 0.10 \\
		&		& {\tt jaeschke}	& 545 & 0.00 & 0 & 5/5 & 100.00 & 0.28 \\
		&		& {\tt jackson}	& 18,033 & 0.00 & 0 & 6/6 & 100.00 & 10.73 \\
		&		& {\tt mansoor}	& 12,718 & 0.00 & 0 & 3/3 & 100.00 & 7.20 \\
		&		& {\tt mitchell}	& 1,117,030 & 12.23 & 0 & 0/6 & 0.00 & 1800.24 \\[1mm]
		\multicolumn{2}{l}{Overall} & & 244,811 & 1.97 & 0 & 84/108 & 77.78 & 403.17 \\\midrule
		2 & 1.00 & {\tt roszieg}	& 991,067 & 20.31 & 0 & 0/6 & 0.00 & 1800.30 \\
		&		& {\tt heskia}	& 726,379 & 11.69 & 2 & 0/6 & 0.00 & 1800.60 \\
		&		& {\tt buxey}	& 685,017 & 16.08 & 4 & 0/7 & 0.00 & 1800.50 \\
		&		& {\tt sawyer30}	& 530,560 & 27.54 & 4 & 0/9 & 0.00 & 1800.57 \\
		& 0.75	& {\tt roszieg}	& 734,178 & 18.44 & 0 & 0/6 & 0.00 & 1800.24 \\
		&		& {\tt heskia}	& 756,204 & 17.72 & 2 & 0/6 & 0.00 & 1800.56 \\
		&		& {\tt buxey}	& 558,135 & 24.44 & 3 & 0/7 & 0.00 & 1800.59 \\
		&		& {\tt sawyer30}	& 497,528 & 29.45 & 4 & 0/9 & 0.00 & 1800.49 \\
		& 0.50	& {\tt roszieg}	& 1,195,487 & 16.73 & 0 & 0/6 & 0.00 & 1800.31 \\
		&		& {\tt heskia}	& 711,764 & 13.75 & 2 & 0/6 & 0.00 & 1800.52 \\
		&		& {\tt buxey}	& 609,114 & 22.60 & 2 & 0/7 & 0.00 & 1800.50 \\
		&		& {\tt sawyer30}	& 556,436 & 19.70 & 4 & 0/9 & 0.00 & 1800.53 \\
		& 0.25	& {\tt roszieg}	& 1,193,838 & 16.73 & 0 & 0/6 & 0.00 & 1800.28 \\
		&		& {\tt heskia}	& 652,072 & 11.64 & 2 & 0/6 & 0.00 & 1800.49 \\
		&		& {\tt buxey}	& 580,369 & 23.58 & 0 & 0/7 & 0.00 & 1800.48 \\
		&		& {\tt sawyer30}	& 614,005 & 25.58 & 2 & 0/9 & 0.00 & 1800.47 \\[1mm]
		\multicolumn{2}{l}{Overall} & & 701,617 & 19.75 & 31 & 0/112 & 0.00 & 1800.47 \\\midrule
		3 & 1.00 & {\tt lutz1}	& 716,824 & 18.94 & 0 & 0/6 & 0.00 & 1800.37 \\
		&		& {\tt gunther}	& 482,696 & 10.68 & 5 & 0/7 & 0.00 & 1800.65 \\
		&		& {\tt kilbrid}	& 318,856 & -- & 10 & 0/10 & 0.00 & 1801.17 \\
		&		& {\tt hahn}	& 450,264 & 21.67 & 0 & 0/5 & 0.00 & 1800.85 \\
		&		& {\tt warnecke}	& 170,586 & -- & 16 & 0/16 & 0.00 & 1801.47 \\
		& 0.75	& {\tt lutz1}	& 644,760 & 16.40 & 0 & 0/6 & 0.00 & 1800.38 \\
		&		& {\tt gunther}	& 525,585 & 21.13 & 4 & 0/7 & 0.00 & 1800.62 \\
		&		& {\tt kilbrid}	& 320,037 & -- & 10 & 0/10 & 0.00 & 1801.08 \\
		&		& {\tt hahn}	& 414,795 & 27.77 & 0 & 0/5 & 0.00 & 1800.86 \\
		&		& {\tt warnecke}	& 167,942 & -- & 16 & 0/16 & 0.00 & 1801.36 \\
		& 0.50	& {\tt lutz1}	& 473,510 & 15.23 & 0 & 0/6 & 0.00 & 1800.42 \\
		&		& {\tt gunther}	& 463,846 & 28.02 & 2 & 0/7 & 0.00 & 1800.60 \\
		&		& {\tt kilbrid}	& 323,799 & -- & 10 & 0/10 & 0.00 & 1800.96 \\
		&		& {\tt hahn}	& 363,883 & 18.67 & 0 & 0/5 & 0.00 & 1800.92 \\
		&		& {\tt warnecke}	& 135,786 & -- & 16 & 0/16 & 0.00 & 1801.48 \\
		& 0.25	& {\tt lutz1}	& 475,795 & 16.00 & 0 & 0/6 & 0.00 & 1800.33 \\
		&		& {\tt gunther}	& 427,559 & 23.37 & 2 & 0/7 & 0.00 & 1800.50 \\
		&		& {\tt kilbrid}	& 356,573 & -- & 10 & 0/10 & 0.00 & 1800.97 \\
		&		& {\tt hahn}	& 310,303 & 26.20 & 0 & 0/5 & 0.00 & 1800.70 \\
		&		& {\tt warnecke}	& 111,564 & -- & 16 & 0/16 & 0.00 & 1801.41 \\[1mm]
		\multicolumn{2}{l}{Overall} & & 326,284 & 12.20 & 117 & 0/176 & 0.00 & 1801.00 \\
		\bottomrule
	\end{tabular}
	\label{tab:appen:mipSCBF}
\end{table}