\chapter{Linear Multistep Methods}

\begin{intro}
  In the previous methods we obtained the value after the next time
  step always by using \emph{one} initial value at the beginning of
  the current time interval, possibly with the
  help of intermediate steps. These methods often are accused to have
  a higher computation time than methods which use several previous
  points, the argument being that function values at these points have
  been computed already. Such methods using values of several time steps in
  the past are called multistep methods. They are constructed such
  that using more steps yields a method of higher order.

  We will begin this chapter by introducing some of the
  formulas. Afterwards, we will study their stability and convergence
  properties.
\end{intro}

\begin{example}[Adams-Moulton formulas]
  \label{ex:lmm:2}
  \index{Adams-Moulton methods} Basically, there are two construction
  principles for the multistep methods: Quadrature and numerical
  differentiation.  We postpone the latter to example~\ref{ex:lmm:3}
  and deal with the former for now.  As first example we choose the
  class of Adams-Moulton methods for which the integral from point
  $t_{k-1}$ to point $t_{k}$ is approximated by a quadrature of the
  points $t_{k-\lmms}$ to $t_k$, hence
  \begin{gather}
    \label{eq:lmm:16}
    y_k = y_{k-1} + \sum_{r=0}^\lmms f_{k-r} \int_{t_{k-1}}^{t_k}
    L_r(t) \dt,
  \end{gather}
  where $f_j$ denotes the function value $f(t_j, y_j)$ and $L_r(t)$
  the Lagrange interpolation polynomial to point $t_r$ with respect to
  the points $t_{k-\lmms},\dots,t_k$.  This is shown in
  Figure~\ref{fig:lmm:adams-moulton}.
  \begin{figure}[tbp]
    \begin{center}
      \includegraphics[width=.9\textwidth]{fig/adams-moulton.tikz}
    \end{center}
    \caption{The quadrature of Adams-Moulton formulas: the
      integration interval is marked by the wavy line in the end. The support
			points of the quadrature are stated under the line.}
    \label{fig:lmm:adams-moulton}
  \end{figure}
  Since the integral involves the point being computed itself, these
  methods are implicit. The first of these are
  \input{definitions/adams-moulton}
\end{example}

\begin{example}[Adams-Bashforth formulas]
  \label{ex:lmm:1}
  \index{Adams-Bashforth methods} With the same principle we obtain
  explicit methods by omitting the point in time $t_k$ in the
  definition of the interpolation polynomial. See
  Figure~\ref{fig:lmm:adams-bashforth}.
  \begin{figure}[tbp]
    \begin{center}
      \includegraphics[width=.9\textwidth]{fig/adams-bashforth.tikz}
    \end{center}
    \caption{The quadrature of Adams-Bashforth formulas: the
      integration interval is marked by the wavy line in the end. The support
			points of the quadrature are stated under the line.}
    \label{fig:lmm:adams-bashforth}
  \end{figure}
  This yields quadrature formulas of the form
  \begin{gather}
    \label{eq:lmm:17}
    y_k = y_{k-1} + \sum_{r=1}^\lmms f_{k-r} \int_{t_{k-1}}^{t_k}
    L_r(t) \dt.
  \end{gather}
  Again, we list the first few:
  \input{definitions/adams-bashforth}
\end{example}

\begin{example}
  \label{ex:lmm:3}
  \index{BDF methods} Backward differencing formulas (BDF) are as well
  based on Lagrange interpolation at the points $t_{k-\lmms}$ to
  $t_k$. In contrast to Adams formulas they do not use quadrature for
  the right hand side, but rather the derivative of the interpolation
  polynomial in the point $t_k$.  Using Lagrange interpolation
  polynomials $L_i(t)$, we let
  \begin{gather*}
    y(t) = \sum_{r=0}^\lmms y_{n-r} L_{n-r}(t),
  \end{gather*}
  where $y_n$ is still to determine. Now we assume that $y$ solves the ODE
  in point $t_n$, hence
  \begin{gather*}
    y'(t_n) = f(t_n, y_n) = \sum_{r=0}^\lmms y_{n-r} L'_{n-r}(t_n).
  \end{gather*}
  This yields the following schemes:
  \input{definitions/bdf}
  For an example on how to derive these schemes see the appendix.
\end{example}

\begin{remark}
  We know from introduction to numerical analysis, that the numerical
  differentiation and the extrapolation, the evaluation of
  interpolation polynomials outside of the interval which is spanned
  through the interpolation points, are not stable.  Therefore, we
  expect stability problems for the Adams-Bashforth and BDF
  methods. Moreover, we remember that Lagrange interpolation with
  equidistant support points is unstable for a high-degree
  polynomials. Therefore, we also expect that all methods above
  perform well only with moderate order.
\end{remark}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Definition and consistency of LMM}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\input{definitions/lmm}

\begin{remark}
  \index{step size!constant} The LMM was defined for constant step size
  $h$.  In principle it is possible to implement the method with a
  variable step size but we restrict ourselves to the constant case.
  Notes to the step size control can be found later on in this chapter.
\end{remark}

\begin{remark}
  One-step methods were always denoted by describing how to compute
  $y_1$ from $y_0$. Here, the notation becomes more complicated, but
  sometimes we consider only $y_s$ computed from $y_0,\dots,y_{s-1}$
  implying the same rules for $y_k$ computed from
  $y_{k-\lmms},\dots,y_{k-1}$.
\end{remark}
\input{definitions/lmm-errors}

\begin{lemma}
  Consider the differential equation
  \begin{gather*}
    y' = f(t,y) \qquad y(t_0) = y_0
  \end{gather*}
  where f is given continuously differentiable and $y(t)$ is the exact solution.
  For the local error we obtain

  \begin{gather}
    y(t_k)-y_k = \left( \alpha_0 \identity - h\beta_0 \frac{\partial f}{\partial y}(t_k,\eta) \right)^{-1} (L_h u)(t_k).
  \end{gather}

  Here $\eta$ is a value between $y(t_k)$ and $y_k$ if $f$ is a scalar
	function.
  If $f$ is multidimensional, the matrix
	$\frac{\partial f}{\partial y}(t_k,\eta)$ is the Jacobi matrix,
	which rows are evaluated at possible places between
	$y(t_k)$ and $y_k$.
\end{lemma}

\begin{proof}
  Considering the local error we can assume exact initial values
  and therefore we can transform ~\ref{eq:lmm:4} to:
  \begin{gather*}
    \alpha_\lmms y_k + \sum\limits_{r=1}^\lmms \alpha_{\lmms-r} y(t_{k-r})
    = h \left( \beta_\lmms f_k + \sum\limits_{r=1}^\lmms \beta_{\lmms-r} f_{k-r} \right)
  \end{gather*}
  We transform further:
  \begin{multline*}
    \sum\limits_{r=0}^{\lmms} \left( \alpha_r y(t_{k-r})
      - h \beta_r f(t_{k-r},y(t_{k-r})) \right)
    \\
    - \alpha_0 y(t_k) + h \beta_0 f(t_k, y(t_k)) + \alpha_0 y_k
    - h \beta_0 f(t_k,y_k) = 0.
  \end{multline*}
	We now insert ~\ref{eq:lmm:9} which results in
  \begin{gather*}
    (L_h y)(t_k) = \alpha_0 \left( y(t_k) - y_k \right) - h \beta_0 \left( f(t_k,y(t_k)) - f(t_k,y_k) \right)
    \\
    \left( y(t_k) - y_k \right) \left( \alpha_0 \identity - h \beta_0 \frac{f(t_k,y(t_k)) - f(t_k,y_k)}{y(t_k) - y_k} \right)
  \end{gather*}
  By application of the mean value theorem and
  subsequent transformation we obtain the statement of the theorem.
\end{proof}

      % \cite[Lemma 2.2, p. 369]{HairerNorsettWanner93}

\input{definitions/lmm-consistency}
\input{theorems/lmm-bramble-hilbert}

\begin{proof}
  We start with the Taylor expansion of a solution $u$ of the ODE and
  the corresponding right hand side $f$ for $t_k$, where we insert,
  unlike usual, $f=u'$:
  \begin{alignat*}2
    u(t) &= \sum_{i=0}^p \frac{u^{(i)}(t_k)}{i!}(t-t_k)^i +
    \frac{u^{(p+1)}(\xi)}{(p+1)!}(t-t_k)^{p+1} &=:& \phi(t) + r_u(t)
    \\
    f\bigl(t,u(t)\bigr) &= \sum_{i=1}^p \frac{u^{(i)}(t_k)}{(i-1)!}(t-t_k)^{i-1} +
    \frac{u^{(p+1)}(\xi)}{p!}(t-t_k)^{p} &=:& \phi'(t) + r_f(t),
  \end{alignat*}
  with the Taylor polynomial $\phi(t)$ of degree $p$ and remainder
  $r_u(t)$ and $r_f(t)$. Out of this we calculate:
  \begin{align*}
    L_h u(t_k) =& \sum_{r=0}^\lmms \alpha_{\lmms-r} \phi(t_{k-r}) - h
    \sum_{r=0}^\lmms \beta_{\lmms-r} \phi'(t_{k-r})
    \\
    &+ \sum_{r=0}^\lmms \alpha_{\lmms-r} r_u(t_{k-r}) - h
    \sum_{r=0}^\lmms \beta_{\lmms-r} r_f(t_{k-r}).
  \end{align*}
  Since $t_{k-r}-t_k = r h$, the first row equals a polynomial
  $\psi(h)$ in $h$ of degree $p$. For the second row we insert the
	reminder estimate $r_u(t) = \mathcal O((t-t_k)^{p+1}) = h
  r_f(t)$ and get:
  \begin{gather}
    \label{eq:lmm:15}
    L_h u(t_k) = L_h \phi(t_k) + \mathcal O(h^{p+1}) = \psi(h) + \mathcal O(h^{p+1}).
  \end{gather}
  According to the definition of the truncation error, this term has to be of
	order $p+1$, such that the method is of order $p$. However it is $\psi$
  of degree $p$. This can only hold true if $L_h\phi=\psi\equiv
  0$. On the other hand $\tau_h(t_k)$ automatically is of order
  $p$. Since $u$ is the solution of an arbitrary right hand side, this
	condition has to be satisfied for all kind of Taylor polynomials $\phi$
	of degree $p$.
\end{proof}

\begin{Theorem}{lmm-consistency}
  \index{step size!constant}
  A LMM with constant step size is consistent of order
  $p$ if and only if
    \begin{gather}
      \label{eq:lmm:12}
      \begin{split}
      \sum_{r=0}^\lmms \alpha_{r} &= 0, \\
      \sum_{r=0}^\lmms \bigl(\alpha_{r}r^q - q \beta_{r}
      r^{q-1}\bigr) &= 0,
      \qquad q = 1,\dots,p
      \end{split}
    \end{gather}
\end{Theorem}

\begin{proof}
  According to lemma~\ref{Lemma:lmm-bramble-hilbert} it is sufficient
  to show that ~\eqref{eq:lmm:12} is equivalent to $L_h \phi_q=0$ for
  polynomials of degree $q\le p$. Due to linearity of the method it
  however is sufficient to show this for a basis of the polynomial
  space of degree $p$.  For that we choose the monomial basis of the
  form
  \begin{gather*}
  \pi_q(t) =
  \left(\frac{t-t_{k-\lmms}}h\right)^q,\qquad q=0,\dots,p.
  \end{gather*}
  For those it holds: $\pi_q(t_{k-r}) = (\lmms-r)^q$. Now we see that
  the first condition is $L_h\pi_0 = 0$ (here is
  $\pi_0'\equiv0$) and the second condition is $L_h\pi_q = 0$.
\end{proof}

\begin{todo}
  Beispiel einer konsistenten LMM, die nicht konvergiert.
\end{todo}

\begin{remark}
  As shown in a homework problem, a consistent LMM is not necessary
  convergent. To understand this behavior and develop criteria for
  convergence we need to diverge into the theory of difference
  equations.
\end{remark}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Properties of difference equations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{intro}
  The stability of LMM can be understood by employing the fairly old
  theory of difference equations. In order to keep the presentation
  simple in this section, we use a different notation for numbering
  indices in the equations. Nevertheless, the coefficients of the
  characteristic polynomial are the same as for LMM.
\end{intro}

\input{definitions/difference-equation}

\begin{Lemma}{lmm:1}
  The solutions of the equation~\eqref{eq:lmm:3} with $y_n\in \R$ or
  $y_n\in \C$ form a vector space of dimension $\lmms$.
\end{Lemma}

\begin{proof}
  Since the equation~\eqref{eq:lmm:3} is linear and homogeneous, it is
  obvious that if two sequences of solutions $\{y^{(1)}\}$ and
  $\{y^{(2)}\}$ satisfy the equation, sums of multiples of them
  satisfy it too.

  As soon as the initial values $y_0$ to $y_{\lmms-1}$ are chosen, all
  other sequence members are uniquely defined.  Moreover it holds
  \begin{gather*}
    y_0=y_1=\dots=y_{\lmms-1}=0
    \quad\Longrightarrow\quad
    y_n = 0, \;n \ge 0.
  \end{gather*}
  Therefore it is sufficient to consider the first $\lmms$ values.  If
  they are linear independent, then the overall sequences are and vice
  versa. Thus, the initial values form a $\lmms$
  dimensional vector space.
\end{proof}

\input{theorems/difference-equation-solutions}

\begin{proof}
  Inserting the solution $y_n = \xi^n$ into the difference equation
  results in
  \begin{gather*}
    \sum_{r=0}^\lmms \alpha_{r} \xi^{n+r} = \xi^{n}
    \sum_{r=0}^\lmms \alpha_{r} \xi^{r}
    = \xi^{n} \chi(\xi) = 0.
  \end{gather*}
\end{proof}

\input{theorems/difference-equation-basis}

\begin{proof}
  First we observe that the sum of the multiplicities of the roots
  results in the degree of the polynomial:
  \begin{gather*}
    \lmms = \sum_{i=1}^\iota \nu_i.
  \end{gather*}
  Moreover we know because of Lemma~\ref{Lemma:lmm:1}, that $\lmms$ is
  the dimension of the solution space. We show that the sequences
  $\{y^{(i,k)}_n\}$ are linear independent. This is clear for
  sequences of different index $i$. It is also clear for different roots,
  because for $n\to\infty$ the exponential function nullifies the
  influence of the polynomials.

  It remains to show that the sequences $\{y^{(i,k)}_n\}$ in fact are
  solutions of the difference equations.  For $k=0$ we have proven
  this already in lemma~\ref{Lemma:difference-equation-solutions}.  We proof the fact here for
  $k=2$ and for a double zero $\xi_i$; the principle for higher order
  roots should be clear then.  Equation~\eqref{eq:lmm:3} applied to
  the sequence $\{n \xi_i^n\}$ results in
  \begin{align*}
    \sum_{r=0}^{\lmms} \alpha_r (n+r) \xi_i^{n+r}
    &= n \xi_i^n \sum_{r=0}^{\lmms} \alpha_r \xi_i^{r}
    + \xi_i^{n+1} \sum_{r=1}^{\lmms} \alpha_r r \xi_i^{r-1}
    \\
    &= n \xi_i^n \rho(\xi_i) + \xi_i^{n+1} \rho'(\xi_i) = 0.
  \end{align*}
  Here the term with $\alpha_0$ vanishes, because it is multiplied
  with $r=0$. $\rho(\xi_i) = \rho'(\xi_i) = 0$ because $\xi_i$ is a
  multiple root.
\end{proof}

\input{theorems/root-test}

\begin{proof}
  According to theorem~\ref{Theorem:difference-equation-basis} we can write all solutions
  as linear combinations of the sequences $y^{(i,k)}$ in
  equation~\eqref{eq:lmm:6}. Therefore,
  \begin{enumerate}
  \item all solutions to $|\xi_i|<1$ for $n\to\infty$ converge to zero
  \item all solutions to $|\xi_i|>1$ for $n\to\infty$ divergence to infinity
  \item all solutions to $|\xi_i|=1$ for $n\to\infty$ stay bounded
	if and only if $\xi_i$ is simple.
  \end{enumerate}
  This proves the statement of the theorem.
\end{proof}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Stability and convergence}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{remark}
  In contrast to one-step methods the convergence of multistep methods
  follows not directly from the consistency of the method, if the
  right hand side of the differential equation satisfies the Lipschitz
  condition~\eqref{eq:IVP:1}.  Analog to the A-stability we will
  discuss this by means of a simple model problem and we will deduce
  stability conditions.
\end{remark}

\begin{remark}
  In the following we investigate the solution to a fixed point in time
  $t$ with a shrinking step size $h$. Therefore we choose $n$
  steps of step size $h = t/n$ and let $n$ go towards infinity.
\end{remark}

\input{definitions/lmm-stability}
\input{theorems/lmm-stability}

\begin{proof}
  The application of the LMM to the equation~\eqref{eq:lmm:1} results
  in the difference equation
  \begin{gather*}
    \sum_{r=0}^{\lmms} \alpha_{\lmms-r} y_{n-r} = 0.
  \end{gather*}
  Now we have to proof that the solutions for fixed $t = h n$ stay
  bounded if $h\to 0$. But we also see that the upper equation does
  not contain $h$. Therefore we have to examine, if the solutions
  $y_n$ stay bounded for $n\to \infty$.  By resorting the summation we
  obtain a difference equation of the form~\eqref{eq:lmm:3}. Due to
  corollary~\ref{Corollary:root-test} it follows the statement of the theorem.
\end{proof}

\begin{Corollary}{adams-stability}
  Adams-Bashforth and Adams-Moulton methods are stable.
\end{Corollary}

\begin{proof}
  For all of these methods the first generating polynomial is $\rho(x)
  = x^\lmms-x^{\lmms-1}$. It has the simple root $\xi_1 = 1$ and the
  $\lmms-1$-fold root 0.
\end{proof}

\begin{Theorem}{BDF-stability}
  The BDF methods are stable for $\lmms \le 6$ and not
  stable for $\lmms \ge 7$.
\end{Theorem}

\input{definitions/lmm-convergence}
\input{theorems/lmm-one-step}

\begin{proof}
  From the general form of LMM we
  obtain
  \begin{gather*}
    \frac1{\alpha_s} \sum_{r=0}^\lmms \alpha_{\lmms-r} y_{k-r}
    = \frac{h}{\alpha_s} \sum_{r=0}^{\lmms-1} \beta_{\lmms-r} f_{k-r}
    + \beta_s f_k.
  \end{gather*}
  We rewrite this to
  \begin{gather*}
    y_k = -\sum_{r=1}^{\lmms} \alpha'_{\lmms-r} y_{k-r} +
    h\psi_h(t_{k-1}, Y_{k-1}),
  \end{gather*}
  where we implicitly enter this formula as value for $y_k$ in the
  computation of $f_k$. It remains to realize that this is the first
  set of $d$ equations in~\eqref{eq:lmm-one-step:1}, and that the
  remaining ones are just shifting $y_i$ to $y_{i+1}$.
\end{proof}

\input{theorems/lmm-one-consistency}

\begin{proof}
  The first component of $Y_k - \widehat Y_k$ is the local error of
  step $k$, which is of order $h^{p+1}$ by the assumption. The other
  components vanish by the definition of the method.
\end{proof}

\input{theorems/lmm-one-stability}

\begin{proof}
  We notice that $\widehat\rho(x) = \sum \alpha'_{s-r} x^r$ is the
  characteristic polynomial of the matrix $A$ and thus its eigenvalues
  are the roots of $\widehat\rho(x)$, which has the same roots as the
  generating polynomial $\rho(x)$. By the root test, we know that
  simple roots, which correspond to irreducible blocks of dimension
  one have maximal modulus one. Furthermore, every Jordan block of
  dimension greater than one corresponds to a multiple root, which by
  assumption has modulus strictly less than one. It is easy to see
  that such a block admits a modified canonical form
  \begin{gather*}
    J_i =
    \begin{pmatrix}
      \lambda_i & 1- \abs{\lambda_i}\\
        & \lambda_i &\ddots\\
          &&\ddots & 1- \abs{\lambda_i}\\
            &&&\lambda_i
    \end{pmatrix}.
  \end{gather*}
  Thus, the canonical form $J = T^{-1}AT$ has norm $\norm{J}_{\infty}
  \le 1$. If we define the norm
  \begin{gather*}
    \norm{x} = \norm{(T^{-1}\otimes \identity)x}_\infty,
  \end{gather*}
  we obtain the result by
  \begin{multline*}
    \norm{(A\otimes \identity)x}
    = \norm{(T^{-1}\otimes \identity)(A\otimes \identity)x}_\infty
    = \norm{(J\otimes \identity)(T^{-1}\otimes \identity)x}_\infty
    \\
    \le \norm{(T^{-1}\otimes \identity)x}_\infty
    = \norm{x}.
  \end{multline*}
\end{proof}

\input{theorems/lmm-convergence}

\begin{proof}
  We reduce the proof to convergence of a one-step method with
  \begin{gather}
    \label{eq:lmm:18}
    Y_k = G(Y_{k-1}) =  (A\otimes \identity) Y_{k-1} + h \verfahren_h(t_{k-1}, Y_{k-1}).
  \end{gather}
  Let $Y_{k-1}$ and $Z_{k-1}$ be two initial values for the interval $I_k$.
  By the previous lemma, we have in the norm defined there, for
  sufficiently small $h$, and assuming a Lipschitz constant $L_h$ for
  $\verfahren_h$ :
  \begin{gather}
    \label{eq:lmm:19}
    \norm{G(Y_{k-1})-G(Z_{k-1})} \le (1+h L_h) \norm{Y_{k-1}-Z_{k-1}}.
  \end{gather}
  Thus, the local error $\eta_k = U_k - \widehat Y_k$ at step $k$, which by
  Lemma~\ref{Lemma:lmm-one-consistency} is bounded by $M h^{p+1}$, accumulates
  until step $n$ at most to $h^{p+1}(1_h L_h)^{n-k}$.

  We have:
  \begin{align*}
    \norm{U_1 - Y_1} &\le (1+h L_h)\norm{U_0-y_0} + M h^{p+1} \\
    \norm{U_2 - Y_2} &\le (1+h L_h)^2\norm{U_0-y_0} +  M h^{p+1} \bigl(1+ (1+h L_h)\bigr)\\
    \norm{U_3 - Y_3} &\le (1+h L_h)^3\norm{U_0-y_0} +  M h^{p+1} \Bigl(\bigl(1+ (1+h L_h)+ (1+h L_h)^2\bigr)\Bigr)\\
    \norm{U_n-Y_n} &\le e^{n h L_h}\norm{U_0-Y_0} +
    \frac{M h^p}{L_h}\bigl(e^{n h L_h} - 1\bigr).
  \end{align*}
\end{proof}

\subsection{Starting procedures}

\begin{intro}
In contrast to one-step methods, where the numerical solution is obtained
solely from the differential equation and the initial value, multistep
methods require more than one start value. An LMM with $s$ steps requires $s$
known start values $y_{k-s}, \dots, y_{k-1}$. Mostly, they are not provided
by the IVP itself. Thus, general LMM decompose into two parts:
\begin{itemize}
\item a \emph{starting phase} where the start values are computed in a
suitable way and
\item a \emph{run phase} where the LMM is executed.
\end{itemize}
It is crucial that the method of the starting phase provides a suitable order
corresponding to the LMM of the run phase, recall Definition
\ref{Definition:lmm-convergence}. Moreover, it should have analog properties to
the LMM, like explicit/implicit or applicability to stiff problems.
% We now consider different starting procedures for an implicit LMM with
% convergence order $p$. According to Definition \ref{Definition:lmm-convergence}
% the starting values are required to have the same convergence order.
Possible choices for the starting phase include multistep methods with variable
order and one-step methods.
\end{intro}

\begin{example}[Self starter]
A 2-step BDF method requires $y_0$ and $y_1$ to be known. $y_0$ is given by the
initial value while $y_1$ is unknown so far. To guarantee that the method has
order 2, $y_1$ needs to be locally of order 2 at least
\begin{align}\label{eq:lmm_1BDFstarter}
|u(t_1)-y_1| \leq c_0 h^2.
\end{align}
This is ensured, for example, by one step of the 1-step BDF method.

However, starting an LMM with $s>2$ steps by a first-order method and then
successively increasing the order until $s$ is reached does not provide the
desired global order. That is due to the fact that the first step limits
the overall convergence order to 2, compare \eqref{eq:lmm_1BDFstarter}.
Nevertheless, self starters are often used in practice.
\end{example}
% In this case local
% error estimates are used to bound the errors of the starting values and all
% approximations of the run phase by reducing the step sizes,
% %. Moreover, also in
% %the run phase the step sizes are controlled using local error estimates,
% see the
% discussion on step size control in Section \ref{section:step_size_control}.

\begin{example}[Runge-Kutta starter]
\label{Example:RKstarter}
One can use Runge-Kutta methods to start LMM. Since only a fixed
number of starting steps are performed, the local order of the
Runge-Kutta approximation is crucial.  For an implicit LMM with
convergence order $p$ and stepsize $h$ one could use an RK method with
consistency order $p-1$ with the same stepsize $h$.

Consider a 3-step BDF method. Thus, beside $y_0$, we need start values
$y_1, y_2$ with errors less than $c_0 h^3$. They can be computed by RK methods
of consistency order $2$, for example by two steps of the 1-stage Gau\ss \
collocation method with step size $h$ since it has consistency order $2s=2$,
see theorem \ref{Theorem:gauss-consistency}.
\end{example}

\begin{example}[Continuous Runge-Kutta starter]
  Another option is to use continuous Runge-Kutta methods and to
  evaluate the continuous approximation to obtain the required
  starting values.

  In constrast to Example \ref{Example:RKstarter} one could also use
  the continuous polynomial approximation of Gau\ss \ collocation to
  start a 3-step BDF method. One step with step size $2h$ of a 2-stage
  Gau\ss \ collocation method would give a polynomial of degree $2$
  which is then evaluated in $t_1=t_0+h$ and $t_2=t_1+h$ to obtain
  $y_1, y_2$. According to Theorem
  \ref{Theorem:collocation-continuous} $y_1, y_2$ have the appropriate
  order.
\end{example}

\begin{remark}
  In practice not the order of a procedure is crucial but rather the
  fact that the errors of all approximations (the start values and all
  approximations of the run phase) are bounded by the user-given
  tolerance, compare Section \ref{section:step_size_control}. Thus,
  the step sizes of all steps are controlled using local error
  estimates. Hence, self starting procedures usually start with very
  small step sizes and increase them successively. Due to their higher
  orders RK starters usually are allowed to use moderate step sizes in
  the beginning. Generally, LMM are applied with variable step sizes
  and orders in practice (see e.g. Exercise 7.2).
\end{remark}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{LMM and stiff problems}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{Definition*}{lmm-stability-region}{A-stability of LMM}
  \index{stability region!of a LMM}
  The linear model difference equation
  \begin{gather}
    \label{eq:lmm:7}
    \sum_{r=0}^{\lmms} \bigl(\alpha_{\lmms-r} - z \beta_{\lmms-r}) y_{n-r} = 0.
  \end{gather}
  is obtained by applying an LMM to the model equation
  $u' = \lambda u$ and inserting $z=h\lambda$.

  The \define{stability region} of an LMM is the set of points $z\in \C$,
  for which all solution sequences $\{y_n\}$ of the equation~\eqref{eq:lmm:7}
  stay bounded for $n\to\infty$. An LMM is called \define{A-stable}, if the
  stability region contains the left half-plane of $\C$.
\end{Definition*}

\begin{Definition}{lmm-stability-polynomial}
  The stability polynomial of an LMM is obtained by inserting
  $y_n = x^n$ into the linear model difference equation to obtain
  \begin{gather}
    \label{eq:lmm:8}
    r_z(x) = \sum_{r=0}^{\lmms} \bigl(\alpha_{\lmms-r} - z \beta_{\lmms-r})
    x^{\lmms-r}.
  \end{gather}
\end{Definition}

\begin{remark}
  Instead of the simple amplification function $r(z)$ of the one-step
  methods, we get here a function of two variables.  The point $z$ for
  which we want to show stability and the artificial variable $x$ from
  the analysis of the method.
\end{remark}

\begin{Lemma}{lmm-stability}
  Let $\{\xi_1(z),\dots,\xi_\lmms(z)\}$ be the set of roots of the
  stability polynomial $r_z(x)$ as functions of $z$.
  A point $z\in \C$ is in the stability region of a LMM, if these
  roots satisfy the root test in corollary~\ref{Corollary:root-test}.
\end{Lemma}

\begin{proof}
  The proof is analog to theorem~\ref{Theorem:lmm-stability}.
\end{proof}

\begin{Theorem*}{dahlquist2}{2nd Dahlquist barrier}
  \defindex{Dahlquist barrier (second)} There is no A-stable LMM of
  order $p>2$. Among the A-stable LMM of order 2, the trapezoidal rule
  (Crank-Nicolson) has the smallest error constant.
\end{Theorem*}

\subsection{Relaxed A-stability}

\begin{intro}
  Motivated by the fact that there are no higher order A-stable LMM
  and by highly dissipative problems, people have introduced relaxed
  concepts of A-stability.
\end{intro}

\input{definitions/aa-stability}

\begin{remark}
  The introduction of the A(0)-stability is motivated by linear
  systems of the form $u'=-Au$ with symmetric, positive definite
  matrix $A$. In fact one requires there only stability on the real
  axis because all eigenvalues are real. Thus, any positive angle
  $\alpha$ is sufficient.

  Similarly A($\alpha$)-stable LMM are suitable for linear problems in
  which high frequently vibration ($\Im\lambda$ large) decay fast
  ($-\Re\lambda$ large).

  In all cases one observes corresponding properties of the Jacobian
  matrix $\partial_u f$ for the application of nonlinear problems.
\end{remark}

\begin{example}
  The stability regions of the stable BDF methods are in
  Figure~\ref{fig:bdf-stability}. The corresponding values for
  A($\alpha$)-stability and stiff stability are in Table
\ref{tab:bdf-stability}.
\end{example}
\begin{figure}[tp]
  \centering
  \includegraphics[width=.45\textwidth]{fig/stability-bdf.png}
  \hfill
  \includegraphics[width=.45\textwidth]{fig/stability-bdf-zoom.png}
  \caption{Boundaries of stability regions of BDF1 to BDF6. Unstable
    region right of the origin. Zoom on the right}
  \label{fig:bdf-stability}
\end{figure}
\begin{table}[tp]
  \centering
  \begin{tabular}{c|cccccc}
    $k$ & 1 & 2 & 3 & 4 & 5 & 6 \\\hline
    $\alpha$ & 90$^\circ$ & 90$^\circ$& 86.03$^\circ$
                    & 73.35$^\circ$& 51.84$^\circ$
                            & 17.84$^\circ$ \\
    $D$ & 0 & 0 & 0.083& 0.667& 2.327& 6.075
  \end{tabular}
  \caption{Values for A($\alpha$)- and stiff stability for BDF methods
    of order $k$.}
  \label{tab:bdf-stability}
\end{table}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Predictor-corrector schemes}

\begin{Definition*}{predictor-corrector}{Predictor-corrector methods}
  Assume a pair of time stepping schemes, one explicit, one implicit,
  \begin{align*}
    \hat y_{k} &= \hat \verfahren_p(y_{k-1}) \\
    y_k &= \verfahren_c(y_{k-1},y_{k}),
  \end{align*}
  we can use $\hat y_k$ as initial value for the Newton iteration for
  $y_k$. In an extreme case, we let
  \begin{gather*}
    y_k = \verfahren_c(y_{k-1},\hat y_{k}),
  \end{gather*}
  without any further iteration.
\end{Definition*}

\begin{remark}
  Predictor-corrector methods were developed strongly around
  Adams-Moulton and Adams-Bashforth methods, since the implicit ones
  have much smaller error constants. Given that these methods offer no
  considerable advantages compared to Runge-Kutta methods, but
  stability properties and implementation are weak points, We omit
  their discussion.

  A simple predictor for BDF methods can be obtained, since they are
  based on an interpolating polynomial. Thus, we simply extrapolate
  this polynomial to the next point in time.
\end{remark}

\begin{example}
  While the predictor-corrector idea sounds reasonable, we have to be
  careful with stiff problems, the original reason for using implicit
  methods. Take again our favorite IVP
  \begin{gather*}
    u' = \lambda u,
    \qquad u(0) = 1.
  \end{gather*}
  We apply the BDF(1) scheme, namely the implicit Euler method, with
  step size 1. According to its stability
  function~\eqref{eq:impl:stabil:impleuler}, we obtain
  \begin{gather*}
    y_1 = \frac1{1-\lambda}.
  \end{gather*}
  Hence, the interpolating polynomial is
  \begin{gather*}
    y(t) = (1-t) + \frac1{1-\lambda} t = 1 + \frac{\lambda}{1-\lambda}t.
  \end{gather*}
  For the mildly stiff problem $\lambda = -3$, we obtain
  \begin{gather*}
    y_1 = 0.25, \qquad y_2 = 0.0625,
    \qquad \hat y_2 = y(2) = -0.5.
  \end{gather*}
  Thus, the extrapolated value is already a much worse initial value
  for a Newton iteration than using the value from the previous time
  step.

  While this example was particularly chosen to exhibit such failure,
  it does show that extrapolation of stiff problems has its
  pitfalls. Here, we end up with a time step restriction which is
  comparable to the stability condition of the explicit method.
\end{example}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "notes"
%%% End:


\documentclass[a4paper,11pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{float}
\usepackage[utf8]{inputenc}

\title{MaS Assignment I\\
\large The Chirikov Map}
\author{Klaas Kliffen s2369494}
\date{\today}

\begin{document}

\maketitle

\section{Introduction}

The Chirikov map is an area preserving chaotic map. It is displayed in a square with 2$\pi$ as the length of the sides.

The Chirikov map is defined by the set of functions:
\begin{align}
p_{n+1} &= p_n + K \text{ sin}[2\pi x_n] / (2*\pi)\\
x_{n+1} &= x_n + p_{n+1}
\end{align}
These are taken modulo 1, to produce the following functions:
\begin{align}
p_{n+1} &= \{p_n + K \text{ sin}[2\pi x_n] / (2*\pi)\} \text{ mod} 1\\
x_{n+1} &= \{x_n + p_{n+1}\} \text{ mod} 1
\end{align}

Taking the modulo causes the Chirikov map to be displayed in a square with 1 as the length of the sides.
The functions take the parameter $K$ as a parameter. The initial conditions are defined by values of $p$ and $x$ each in $[0,1]$.

\subsection*{Initialisation}
The system is initialised by $\{x_0,p_0\} \in [0,1] \times [0,1]$

\subsection*{a) 'Orbits' in the $x$-$p$ plane for fixed $K$}
The first part of the assignment assumes a fixed value of $K = 1$ and varies the initial conditions. The aim of this part will be to distinguish between different kinds of 'orbits'.

\subsection*{b) Behaviour for different values of $K$}
The second part will use the orbits from the first part and will use a varying value for $K$.
The aim of this part will be to explore the changing orbits for an increasing value of $K$

\section{Methods}
This section globally describes the adapted functions used in this assignment.

\subsection*{a) 'Orbits' in the $x$-$p$ plane for fixed $K$}
To generate the values describing the orbit, a step function is created to accept 2 coordinates and calculates the next coordinates from the equations 3 and 4.
This function can be used to explore the different kind of orbits given the initial values.\\
For each initial value, the first thousand iterations are run. To determine the order in which points are visited, another number of iterations may be given. These will be noted in the result section.\\

\subsection*{b) Behaviour for different values of $K$}
To plot multiple orbits for a given $K$, the step function is called multiple times, each with different pseudo-random initial values. The calculated values are then stored in two arrays to be plotted.\\
For each value of K, 50 orbits are calculated with pseudo random initial conditions, each with 1000 iterations.

\section{Results}
\subsection{a) 'Orbits' in the $x$-$p$ plane for fixed $K$}
There are three types of orbits that can be found. These will be addressed each in its own section.
\subsubsection{Points}
Barely visible are two single points in figure \ref{pointorbit} at $(0,0.5)$ and $(0.5,0.5)$. From figure \ref{pointval} it is clear that $p$ stays constant, with $x$ switching between the two points. The value of $p$ is constant, because in formula (3) the sinus component is constant with $x$ varying between two values: 0 and 0.5, both yielding a zero value for the sinus. Since $p$ is constant at 0.5, from formula (4), it is clear that x with initial condition 0.5, can only be 0 and 0.5 in an alternating order. Therefor, only 20 iterations are shown in figure \ref{pointval}.
\begin{figure}[H]
\centering
\includegraphics[width=.9\textwidth]{img/orbitpoint.png}
\caption{Orbit plot of two points}
\label{pointorbit}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=.9\textwidth]{img/valuepoint.png}
\caption{The values for $p$ and $x$ in the first 20 iterations}
\label{pointval}
\end{figure}

\subsubsection{Curves}
\begin{figure}[H]
\centering
\includegraphics[width=.9\textwidth]{img/orbitcurve.png}
\caption{Orbit plot of four curves}
\label{curveorbit}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=.9\textwidth]{img/valuecurve.png}
\caption{The values for $p$ and $x$ in the first 250 iterations }
\label{curveval}
\end{figure}

\newpage

Figure \ref{curveorbit} represent curves. These curves are closed and symmetrical.The values of $p$ are in two ranges: a higher range, yielding the top curve and a lower range, yielding the lower curve. The value of $x$ varies in one range. In figure \ref{curveval} it can be seen that $x$ varies between two peaks. The curves are visited in a fixed order as figure \ref{curveval} shows for the first 250 iterations. The top curve is visited first with a few iterations. After that, the bottom curve is visited with with a similar amount of iterations.

\subsubsection{Areas}
In figure \ref{areaorbit} two dotted areas can be seen. One on the top layer and one on the bottom. These areas seem to be symmetrical around the centre point of the image. These areas seem to be filled with chaotic values. In figure \ref{areaval} the values for $p$ seem to be on the lower half of the image, but after about 300 iterations, these values seem to spike to the upper half of the image. The values for $x$ seem to be chaotic and spread about all of the $[0,1]$ range.

\begin{figure}[H]
\centering
\includegraphics[width=.9\textwidth]{img/orbitarea.png}
\caption{Orbit plot of two areas}
\label{areaorbit}
\end{figure}

\newpage
\begin{figure}[H]
\centering
\includegraphics[width=.9\textwidth]{img/valuearea.png}
\caption{The values for $p$ and $x$ in the first 500 iterations}
\label{areaval}
\end{figure}

\subsection{b) Behaviour for different values of $K$}

The figures 7 to 22 are taken at different values for $K$ in an increasing order.

\subsubsection{Increasing value of $K$}

\begin{figure}[H]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k0.png}
\caption{Orbits for $K = 0$}
\end{minipage}\hfill
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k01.png}
\caption{Orbits for $K = 0.1$}
\end{minipage}
\end{figure}

For value $K=0$ the orbits are plotted in figure 7. These are all horizontal lines. Since the sinus component form formula (3) is completely neglected, this value is constant. The value for $x$ however, could be anywhere in the range of [0,1]. This yields horizontal lines.

\begin{figure}[H]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k025.png}
\caption{Orbits for $K = 0.25$}
\end{minipage}\hfill
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k05.png}
\caption{Orbits for $K = 0.5$}
\end{minipage}
\end{figure}

\begin{figure}[H]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k075.png}
\caption{Orbits for $K = 0.75$}
\end{minipage}\hfill
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k095.png}
\caption{Orbits for $K = 0.95$}
\end{minipage}
\end{figure}

\begin{figure}[H]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/kc.png}
\caption{Orbits for $K_c = 0.97164$}
\end{minipage}\hfill
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k098.png}
\caption{Orbits for $K = 0.98$}
\end{minipage}
\end{figure}

\begin{figure}[H]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k1.png}
\caption{Orbits for $K = 1.0$}
\end{minipage}\hfill
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k125.png}
\caption{Orbits for $K = 1.25$}
\end{minipage}
\end{figure}

\begin{figure}[H]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k15.png}
\caption{Orbits for $K = 1.5$}
\end{minipage}\hfill
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k175.png}
\caption{Orbits for $K = 1.75$}
\end{minipage}
\end{figure}

\begin{figure}[H]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k2.png}
\caption{Orbits for $K = 2.0$}
\end{minipage}\hfill
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k225.png}
\caption{Orbits for $K = 2.25$}
\end{minipage}
\end{figure}

\begin{figure}[H]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k25.png}
\caption{Orbits for $K = 2.5$}
\end{minipage}\hfill
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{img/k3.png}
\caption{Orbits for $K = 3.0$}
\end{minipage}
\end{figure}

In figures 8 to 12 ($K$ values in the range of [0.1,0.95]) it can be seen that the straight lines at $K = 0$ slowly curve into two curves at the horizontal centre of the image. In between are similar structures of curves visible.

Above  $K = 0.75$ areas of chaotic dots appear and take up most of the image after $K = 2$, destroying the curves in the centre of the image.
After values of 3.0 for $K$ most of the area of the image is taken up by the chaotic region.\\

Around $K = 1.25$ six smaller curves can be seen on the edges of the two large curves on the top and the bottom of the image. These become bigger and move outwards away from the centre of the large curve. When $K$ reaches a value of 2.0, these satellite curves are dissolved into the chaotic region of the image. This behaviour seems similar to the period doubling of the logistic map. For values of $K$ between 2.25 and 3.0, another instance of these smaller curves can be seen.

\subsubsection{KAM orbits}
KAM orbits are orbits spanning the entire range of [0,1]. These only exist below a certain threshold value for $K$ called $K_c$. The value 0.971635 as described by Greene\cite{kval} is used as the value for $K_c$. Figures 12 to 15 show plots of orbits for values of $K$ between 0.95 and 1.0. Although figures 14 and 15 show orbits spanning the entire range of $[0,1]$, when zooming in, it becomes clear these do not follow a closed curve and are more of a chain of curves.

\section{Conclusion and discussion}

\subsection{a) 'Orbits' in the $x$-$p$ plane for fixed $K$}
From the different initial conditions three types of 'orbits' can be determined: Points, curves and areas. Each of these types has a certain order in which points are visited. For point orbits, these are clearly defined. For curves both values will vary in between ranges. For areas, the $x$ value will vary over the complete interval of $[0,1]$ and $p$ will vary only over smaller ranges.

\subsection{b) Behaviour for different values of $K$}
For an increasing value of $K$ the amount of chaotic regions will increase. For values up to $K = 0.9$ the regions will be very small to non existent. After that the regions will grow. For values of $K$ in between $[1.0,1.75]$ and $[2.0,3.0]$ there will be a process similar to period doubling with smaller curves moving outward of the large centre curve. After $K = 3.0$ the image will only consist of the centre two curves and a chaotic region.\\
Exploring the limit of KAM orbits around the value of $K_c = 0.971635$ did not lead to observable results. Possibly to issues with the resolution of the plot and the amount of points per orbit plotted.

\subsection{Discussion}
The resolution on the images is limited. It is hard to prove from figures alone that a line could cross the entire horizontal scale of an image and not be distorted by a chaotic region. Depending on the resolution and the amount of points generated for each orbit, the image yield a better view of KAM orbits.

\begin{thebibliography}{1337}
\bibitem{kval}
Greene, John M.\\
\emph{A method for determining a stochastic transition}\\
Journal of Mathematical Physics, 20, 1183-1201 (1979)\\ DOI:http://dx.doi.org/10.1063/1.524170

\end{thebibliography}
\end{document}


\chapter{Collisions}\label{ch:collisions}
Many musical instruments rely on collisions in some shape or form. Examples are the collision between a hammer and a piano string, a guitar pick and the string, and even the collision between the lips of a trumpet player.

This work uses collision models that rely on penalising methods. The colliding objects -- although possibly perfectly rigid -- are supposed to interpenetrate, and collision is interpreted as a \textit{penalty}. The eventual force acting on the colliding objects is then dependent on the level of penetration. For deformable objects, such as the hammer felt tip of a piano, the penalty is dependent on the level of deformation. These collision models were first used in a musical context by e.g. \cite{Chatziioannou2013, Bilbao2014}.

The discretisations proposed in \cite{Chatziioannou2013, Bilbao2014} rely on implicit nonlinear schemes which require an iterative method, such as the Newton-Raphson method presented in Section \ref{sec:newtonRaphson}, to obtain their solution.
The exact number of iterations required per time step, especially in interactive applications, is usually unknown. This could be detrimental to real-time applications, as the number of iterations, and consequently the extra number of computations, could be very large in a particular situation. Furthermore, and perhaps more importantly, existence and uniqueness of the solution might not be available.

In \cite{Ducceschi2021} (co-authored by the PhD student [\hyperref[ch:listOfPublications]{O3}]), Ducceschi et al. propose a method based on quadratisation of the collision potential energy, that circumvents the need of an iterative method to solve nonlinear collisions. Energy quadratisation for explicit schemes first appeared in the context of Port-Hamiltonian systems and was due to Lopes et al. in \cite{Lopes2015}. The introduction of an additional state variable, which is what Ducceschi's work is based on, was introduced in \cite{Yang2017, Jiang2019}. Papers \citeP[D] and \citeP[E] follow an earlier iteration of the non-iterative collision algorithm from \cite{Ducceschi2019, Bilbao2019} which exhibited spurious oscillations that Ducceschi et al. resolve in \cite{Ducceschi2021}. Paper \citeP[H] uses the corrected collision model for the collision between the lips exciting the trombone. The corrected model will be used in this work and presented in this chapter.

This chapter first provides a definition for the collision potential as well as its quadratisation, used as the basis for the explicit method. Then, the method will be applied to a simple mass-barrier collision and finally, to a mass-spring -- string collision which can be used to model a finger-fretted string.

\subsubsection{Collision potential}
Collisions can be modelled using a nonlinear \textit{collision potential}, which can be defined as
\begin{equation}\label{eq:potential}
    \phi(\eta) = \frac{K_\ctxt}{\alpha_\ctxt+1}[\eta]_+^{\alpha_\ctxt+1},
\end{equation}
with collision stiffness $K_\ctxt \geq 0$ (in N/m$^{\alpha_\ctxt}$) and dimensionless nonlinear collision coefficient $\alpha_\ctxt \geq 1$. Here $\eta = \eta(t)$ describes the relative displacement between the two colliding bodies (in m). The $[\cdot ]_+$ operator, defined as
\begin{equation}\label{eq:etaPlus}
    [\cdot]_+ = \frac{\cdot + |\cdot|}{2},
\end{equation}
describes the `positive part of' and when applied to $\eta$ in Eq. \eqref{eq:potential} causes the potential $\phi$ to only be non-zero when the two colliding bodies are in contact.
% See Figure \ref{fig:eta}.
% %
% \begin{figure}[h]
% \centerline{\includegraphics[width=0.6\columnwidth]{figures/interactions/eta.eps}}
% \caption{\label{fig:eta}{A plot of $[\eta]_+$.}}
% \end{figure}

The derivative of Eq. \eqref{eq:potential} with respect to $\eta$ is defined as
\begin{equation}\label{eq:derivPotential}
    \phi'(\eta) = K_\ctxt[\eta]_+^{\alpha_\ctxt}
\end{equation}
and can then be used in the PDE at hand.

The issue with this form of the collision potential, is that an iterative method, such as Newton-Raphson presented in Section \ref{sec:newtonRaphson}, needs to be used in order to solve the system \cite{Ducceschi2021}.

\subsubsection{Quadratic form}
In \cite{Ducceschi2021}, the authors propose to rewrite the potential in Eq. \eqref{eq:derivPotential} in a quadratic form. Using the chain rule and  $\psi = \psi(\eta)$, Eq. \eqref{eq:derivPotential} can be rewritten as
\begin{equation}\label{eq:quadraticPotential}
    \phi'(\eta) = \psi\psi' \quad \text{where} \quad \psi = \sqrt{2\phi} \quad \text{and} \quad \psi' = \frac{\dot{\psi}}{\dot{\eta}}\ ,
\end{equation}
where a dot denotes a single derivative with respect to time.

This form of the potential can be discretised to a FD scheme that can be solved explicitly. This process will be shown below, using an example of the simple mass -- rigid barrier collision.

\section{The mass -- rigid barrier collision}\label{sec:massRigidBarrier}
As a test case, a mass colliding with a rigid barrier is presented here, which is arguably the simplest case of a collision. Consider a mass at location $u = u(t)$ (in m) colliding with a barrier at location $b$ (in m).

If the barrier is placed above the mass, the force it exerts on the mass will be negative and its system would be described as
\begin{equation}\label{eq:massBarrierPre}
    M\ddot u = -\psi\psi',
\end{equation}
with mass $M$ (in kg) and $\psi = \psi(\eta)$ and $\psi'$ are as defined in Eq. \eqref{eq:quadraticPotential} with $\eta = \eta(t) = u(t) - b$.

Looking towards the discretisation the mass-barrier collision, one could use the definitions in Eq. \eqref{eq:quadraticPotential} to rewrite Eq. \eqref{eq:massBarrierPre} to the following system of equations
\begin{subequations}\label{eq:massBarrier}
    \begin{align}
        M\ddot u &= -\psi g,\label{eq:massBarrierPDE1}\\
        \dot\psi &= g \dot\eta,\label{eq:massBarrierPDE2}\\
        \eta(t) &= u(t) - b,\label{eq:massBarrierPDE3}
    \end{align}
\end{subequations}
where $g = \psi'$.

\subsubsection{Relative location of objects}
When working with multiple interacting objcts, it is important to consider whether an object is located `above' or `below' the other,
%
% Notice that
% it is important to keep in mind the relative location of the colliding objects, i.e., whether one object is `above' or `below' an other.
i.e., which (generally) has a more positive or negative displacement than the other. A mass with a displacement of $0.01$ m will thus be `above' a barrier with a displacement of $-0.05$ m. Along these lines, a positive force acting on an element will accelerate it upwards and a negative force will accelerate it downwards.

The relative location of the two colliding objects will affect two things in system \eqref{eq:massBarrier}:

Firstly, the location of the object determines the direction of the collision force, i.e., the sign of the right-hand side in system \eqref{eq:massBarrier}. In this case, the barrier is placed above the mass, and will exert a downwards (negative) force on the mass during collision. If the barrier was placed below the mass, the opposite would have applied.

Secondly, the definition of $\eta$ in \eqref{eq:massBarrierPDE3} is affected by the relative location of the objects. The collision potential in Eq. \eqref{eq:potential} is only non-zero when $\eta$ is positive. If the barrier is placed above the mass, $u(t)-b$ will be positive on collision. It is thus important to remember that $\eta$ should be defined as the element above subtracted from the element below.

\subsection{Discrete time}
Before discretising system \eqref{eq:massBarrier} in full, the discrete approximation to the collision potential will be elaborated on.
Following \cite{Ducceschi2021}, $\psi$ is placed on an interleaved temporal grid (see Section \ref{sec:firstOrderDiscrete}) using
\begin{equation}\label{eq:psiHalfDef}
    \psi^{n-1/2} = \mu_{t-}\psi^n,
\end{equation}
where the interleaved temporal grid is used here as it results in energy conservation in discrete time (see Section \ref{sec:energyAnalysisMassBarrier}). Approximations to $\psi$ and $g$ in Eq. \eqref{eq:massBarrier} can then be made as
\begin{equation}
    \psi \approxeq \mtp \psi^{n-1/2}
\end{equation}
and
\begin{equation}\label{eq:approxPsi}
    g \approxeq g^n = \frac{\delta_{t+}\psi^{n-1/2}}{\delta_{t\cdot}\eta^n} ,
\end{equation}
respectively. Notice that applying a first-order difference operator to a grid function on an interleaved grid is second-order accurate.\footnote{$\ \dtp \psi^{n-1/2}\ \overset{\text{Eq. \eqref{eq:approxPsi}}}{=}\ \dtp \mtm \psi^n\ \overset{\text{Eq. \eqref{eq:identity2}}}{=}\  \dtd \psi^n$ which is second-order accurate (see Section \ref{sec:FDoperators}).}
The result of the approximation in Eq. \eqref{eq:approxPsi} allows $\psi$ to be treated as an independent time series:
\begin{equation}
    \dtp \psi^{n-1/2} = g^n \dtd \eta^n.
\end{equation}
With the above approximations in place, system \eqref{eq:massBarrier} can be discretised and yields the following system of equations:
\begin{subequations}\label{eq:massBarrierSystem}
    \begin{align}
        M\dtt \un &= -\left(\mtp\psi^{n-1/2}\right)g^n,\label{eq:massBarrierSystem1}\\
        \dtp \psi^{n-1/2} &= g^n \dtd \eta^n,\label{eq:massBarrierSystem2}\\
        \eta^n &= \un - b.\label{eq:massBarrierSystem3}
    \end{align}
\end{subequations}

\subsubsection{An explicit definition for $g^n$}
To be able to calculate $\psi^{n+1/2}$ and $u^{n+1}$ in system \eqref{eq:massBarrierSystem} explicitly, a definition for $g^n$ only based on known values must be found. As $g^n \approxeq \psi'$ as per Eq. \eqref{eq:approxPsi}, the derivative can be computed analytically according to
\begin{equation}
    g^n = \psi'\bigg\rvert_{\eta=\eta^n} \quad \overset{\text{Eq. \eqref{eq:quadraticPotential}}}{=}\quad  \frac{\phi'}{\sqrt{2\phi}}\bigg\rvert_{\eta=\eta^n}.
\end{equation}
Recalling \eqref{eq:derivPotential} and \eqref{eq:potential}, this can conveniently be rewritten to
\begin{equation}\label{eq:gn}
    g^n = \frac{K_\ctxt[\eta^n]_+^{\alpha_\ctxt}}{\sqrt{\frac{2K_\ctxt}{\alpha_\ctxt+1}[\eta^n]_+^{\alpha_\ctxt+1}}}=K_\ctxt\sqrt{\frac{\alpha_\ctxt+1}{2K_\ctxt}}[\eta^n]_+^{\alpha_\ctxt}[\eta^n]_+^{\frac{-(\alpha_\ctxt+1)}{2}}=\sqrt{\frac{K_\ctxt(\alpha_\ctxt+1)}{2}}[\eta^n]_+^{\frac{\alpha_\ctxt-1}{2}}\,.
\end{equation}
For implementation purposes, one can expand the $[\cdot]_+$ operator as the following (equivalent) condition:
\begin{subnumcases}{ \label{eq:gDefOld} g^n =}
    \sqrt{\frac{K_\text{c}(\alpha_\text{c}+1)}{2}}\cdot(\eta^n)^{\frac{\alpha_\text{c}-1}{2}},
    & if $\eta^n \geq 0$ \label{eq:collCorr1Old}\\
    0, & $\text{if } \eta^n < 0$\label{eq:collCorr2Old}
\end{subnumcases}
This implementation is the one presented in \cite{Ducceschi2019}, but exhibited spurious oscillations and `sticking' behaviour. This is due to the possibility of negative forces for positive penetrations due to the discontinuity in the definition for $g^n$ at $\eta^n = 0$.

In \cite{Ducceschi2021}, the definition for $g^n$ in \eqref{eq:gDefOld} is extended, starting out by using an implicit equation for $g^n$ by directly discretising Eq. \eqref{eq:approxPsi}
\begin{equation}\label{eq:gImp}
    g_\text{imp}^n = 2\frac{\psi^{n+1/2} - \psi^{n-1/2}}{\eta^{n+1} - \eta^{n-1}}\ .
\end{equation}
If there is, however, no collision at $n+1/2$, $\psi^{n+1/2} = 0$ and Eq. \eqref{eq:gImp} reduces to
\begin{equation*}
    g_\text{imp}^n = -2\frac{\psi^{n-1/2}}{\eta^{n+1} - \eta^{n-1}}\ .
\end{equation*}
Furthermore, due to the fact that there is no collision, $\eta^{n+1}$ can be calculated according to $\eta^{n+1} = \eta^\star = u^\star - b$, where $u^\star$ is the value of $u^{n+1}$ calculated using the scheme in Eq. \eqref{eq:massBarrierSystem1} without the collision force. Expanding Eq. \eqref{eq:massBarrierSystem1} without the collision force yields
\begin{equation*}
    \frac{M}{k^2}\left(u^\star - 2\un + u^{n-1}\right) = 0 \quad \Longrightarrow \quad u^\star = 2u^n - u^{n-1}.
\end{equation*}
Thus, if there is no collision, $g^n_\text{imp}$ can now be explicitly calculated from known values and be used in the definition for $g^n$ in Eq. \eqref{eq:gDefOld} according to \cite{Ducceschi2021}
\begin{subnumcases}{ \label{eq:gDef} g^n =}
    \kappa\sqrt{\frac{K_\text{c}(\alpha_\text{c}+1)}{2}}\cdot(\eta^n)^{\frac{\alpha_\text{c}-1}{2}},
    & if $\eta^n \geq 0,$ \label{eq:collCorr1}\\
    -2 \frac{\psi^{n-1/2}}{\eta^\star-\eta^{n-1}}, & if $\eta^n < 0\ \text{ and } \ \eta^{\star} \neq \eta^{n-1},$\label{eq:collCorr2}\\
    0, & $\text{if } \eta^n < 0\ \text{ and } \ \eta^{\star} = \eta^{n-1}.\qquad$\label{eq:collCorr3}
\end{subnumcases}
%
Here, $\kappa = 1$ if $\psi^{n-1/2} \geq 0$, otherwise $\kappa = -1$ and aims to resolve the `sticking' behaviour by forcing an outwardly-directed force at all times. As was done in paper \citeP[H], condition \eqref{eq:collCorr3} has been added to the definition of $g^n$ from \cite{Ducceschi2021} to prevent a division by 0 in Eq. \eqref{eq:collCorr2}.

This definition for $g^n$ does not exhibit the spurious oscillations that the old definition in Eq. \eqref{eq:gDefOld} did, and can still be explicitly calculated from known values of the system.

\subsection{Solving the system}\label{sec:solvingMassBarrier}
To implement the system in Eq. \eqref{eq:massBarrierSystem}, its definitions need to be slightly rewritten. Using identity \eqref{eq:identity3}, $\mtp \psi^{n-1/2}$ can be rewritten to
\begin{equation*}
    \mu_{t+}\psi^{n-1/2} = \frac{k}{2}\delta_{t+}\psi^{n-1/2} + \psi^{n-1/2}.
\end{equation*}
Then, substituting \eqref{eq:massBarrierSystem2} into this, yields
\begin{equation}\nonumber
    \mu_{t+}\psi^{n-1/2} = \frac{k}{2}g^n\delta_{t\cdot}\eta^n + \psi^{n-1/2},
\end{equation}
and inserting this into \eqref{eq:massBarrierSystem1}, yields
\begin{equation}\label{eq:substitutionFDS}
    M\delta_{tt}u^n = -\left(\frac{k}{2}g^n\delta_{t\cdot}\eta^n + \psi^{n-1/2}\right)g^n\ .
\end{equation}
As the position of barrier $b$ is static, the following is true:
\begin{equation}\label{eq:derEtaEqDerU}
    \frac{d\eta}{dt} = \frac{d}{dt}\Big(u - b\Big)\quad \Longrightarrow \quad \delta_{t\cdot}\eta^n = \delta_{t\cdot}u^n,
\end{equation}
i.e., the time derivative of $\eta$ equals the time derivative of $u$.\footnote{Note that if the barrier was placed underneath the mass, making \eqref{eq:massBarrierSystem3} $\eta^n = b-u^n$, this would result in $\delta_{t_\cdot}\eta^n = -\delta_{t\cdot}u^n$.} Eq. \eqref{eq:substitutionFDS} can now be solved explicitly as $u^{n+1}$ is the only unknown in the system
\begin{equation}
    \bigg(\frac{M}{k^2} + \frac{(g^n)^2}{4}\bigg)u^{n+1} = \frac{M}{k^2}(2u^n-u^{n-1})+\frac{(g^n)^2}{4}u^{n-1}-\psi^{n-1/2}g^n\ ,
\end{equation}
and can be solved by a simple division.

Finally, $u^{n+1}$ can be used to calculate $\eta^{n+1}$ by evaluating \eqref{eq:massBarrierSystem3} at $n+1$:
\begin{equation}\label{eq:etaNPlus1}
    \eta^{n+1} = u^{n+1}-b,
\end{equation}
which is used to calculate $\psi^{n+1/2}$ by expanding and rewriting \eqref{eq:massBarrierSystem2} to
\begin{equation}\label{eq:psiNPlusHalf}
    \psi^{n+1/2} = \psi^{n-1/2} + \frac{\eta^{n+1} - \eta^{n-1}}{2}\ .
\end{equation}

Figure \ref{fig:massBarrierCollision} shows the mass -- rigid barrier collision over time for two values of $K_\text{c}$. The mass is initialised with an initial (upwards) velocity using $u^0 = -1$ m and $u^1 = -0.95$ m. The figure shows that the penetration of the mass with the barrier causes a downwards force on the mass. As expected, this force is higher for a larger value of $K_\ctxt$ and causes the mass to accelerate downwards more quickly.

\def\figSpacing{0.01\textwidth}
\def\figWidth{0.49\textwidth}
\begin{figure}[h]
    \centering
    \subfloat[$K_\ctxt = 10^7$. \label{fig:massBarrierLow}]{\includegraphics[width=\figWidth]{figures/interactions/massBarrierLow.eps}}\hspace{\figSpacing}
    \subfloat[$K_\ctxt = 10^9$.\label{fig:massBarrierHigh}]{\includegraphics[width=\figWidth]{figures/interactions/massBarrierHigh.eps}}
    \caption{The mass -- rigid barrier collision over time with $\alpha_\text{c} = 1.3$ for different values of $K_\text{c}$. \label{fig:massBarrierCollision}}
\end{figure}

\subsection{Energy analysis}\label{sec:energyAnalysisMassBarrier}
To prove that the collision term does not add any additional energy into the system (retaining passivity) and that it does not add additional constraints on the stability of the system, the energy analysis techniques presented in Section \ref{sec:energyAnalysis} can be used. Notice that for brevity, the steps presented in Section \ref{sec:energyAnalysis} will not explicitly be followed.

Multiplying Eq. \eqref{eq:massBarrierSystem1} by $(\dtd \un)$ yields
\begin{equation*}
    \dtp \h_\mtxt  = -\left(\mtp\psi^{n-1/2}\right)g^n (\dtd \un)
\end{equation*}
where the energy of the mass is defined as (see Eq. \eqref{eq:energyBalanceMassSpring})
\begin{equation}
    \h_\mtxt = \frac{M}{2}(\dtm\un)^2.
\end{equation}
Expanding $g^n$ yields
\begin{align*}
    \dtp \h_\mtxt  &= -\left(\mtp\psi^{n-1/2}\right)\frac{\dtp \psi^{n-1/2}}{\dtd \eta^n}(\dtd \un)\\
    \xLeftrightarrow{\mystrut\ \text{Eq. \eqref{eq:derEtaEqDerU}}} \qquad & = -\left(\mtp\psi^{n-1/2}\right)\dtp \psi^{n-1/2},
\end{align*}
which, using identity \eqref{eq:prodIdentity3}, can be rewritten to
\begin{equation}
    \dtp(\h_\mtxt + \h_\ctxt) = 0,
\end{equation}
with collision energy
\begin{equation}\label{eq:collisionEnergy}
    \h_\ctxt = \frac{(\psi^{n-1/2})^2}{2}.
\end{equation}
Recall that in order for a scheme to be passive, its energy must be non-negative, and the fact that $\psi$ is squared proves passivity for system \eqref{eq:massBarrierSystem}.

Figure \ref{fig:massBarrierEnergy} shows the energetic output of the mass -- rigid barrier collision corresponding to Figure \ref{fig:massBarrierLow}. The left panel shows that the kinetic energy of the mass is transferred into the energy of the collision, after which it is converted into kinetic energy of the mass again.

\begin{figure}[h]
    \centering
    \begin{tikzpicture}[->,node distance=3cm,
        thick,main node/.style={circle,draw}]

        \node[] (image) at (0,0) {
        \includegraphics[width=\textwidth]{figures/interactions/massBarrierEnergy.eps}
        };

        \node[] (he) at (0.2,0.5) {\small $\mathfrak{h}_\text{e}$};

        \node[] (h) at (-5.8, 1) {\small $\mathfrak{h}$};
        \node[] (t) at (-5.8, 0.5) {\small $\color{blue}\mathfrak{h}_\text{m}$};
        \node[] (v) at (-5.8, 0) {\small $\color{red}\mathfrak{h}_\ctxt$};

      \end{tikzpicture}
      \caption{The energy of the mass (blue), the collision (green) and the total energy (black) of the mass -- rigid barrier collision. The energy corresponds to the behaviour in Figure \ref{fig:massBarrierLow}. The right panel shows the normalised energy (according to Eq. \eqref{eq:normalisedEnergy}) shows that the deviation of the energy is within machine precision. \label{fig:massBarrierEnergy}}
\end{figure}

\section{Mass-spring -- string collision}\label{sec:massString}
The mass-spring -- string collision is slightly trickier than the mass -- rigid barrier collision, as there are two moving components rather than one. This system is chosen as an example as it has the interesting use-case of fretting a string to change the pitch, modelling the fretting finger as a mass.

Consider a lossless stiff string of length $L$, its transverse displacement described by $u = u(x,t)$ (in m) and defined for $t\geq 0$ and $x\in \D$ with domain $\D = [0, L]$. The mass with displacement $w = w(t)$ (in m) and $t\geq 0$ will model the fretting finger. The PDE for the stiff string and its parameter definitions can be found in Eq. \eqref{eq:stiffStringPDENoLosses} and for the mass-spring system in Eq. \eqref{eq:massSpringPDE}. Placing the string above the mass, the following system emerges:
\begin{subequations}\label{eq:massStringPDE}
\begin{align}
    \rho A \ptt u & =T\pxx u - EI\pxxxx u + \delta(x-x_\text{m}) \psi g \label{eq:massStringPDE1}\\
    M \ddot w &=-Kw - \psi g\label{eq:massStringPDE2}\\
    \dot\psi &= g \dot\eta,\label{eq:massStringPDE3}\\
    \eta(t) &= w(t) - u(x_\text{m}, t),\label{eq:massStringPDE4}
\end{align}
\end{subequations}
where spatial Dirac delta function $\delta(x-x_\text{m})$ localises the mass (finger) along the string at location $x_\text{m} \in \D$ (see Eq. \eqref{eq:spatialDirac}). Furthermore, $\psi = \psi(\eta)$ and $g=\psi'$ are as defined in Eq. \eqref{eq:quadraticPotential}.

Discretising system \eqref{eq:massStringPDE}, with the collision discretised according to the process explained in Section \ref{sec:massRigidBarrier}, yields
\begin{subequations}
    \begin{align}
        \rho A \delta_{tt}u^n_l & =T\delta_{xx}u^n_l - EI\delta_{xxxx}u_l^n + J_l(x_\text{m}) \big(\mu_{t+}\psi^{n-1/2}\big)g^n, \label{eq:massString1}\\
        M \delta_{tt}w^n &=-Kw^n - \big(\mu_{t+}\psi^{n-1/2}\big)g^n,\label{eq:massString2}\\
        \delta_{t+}\psi^{n-1/2} &= g^n\delta_{t\cdot}\eta^n,\label{eq:massString3}\\
        \eta^n &= w^n - I_l(x_\text{m})\uln,\label{eq:massString4}
    \end{align}
\end{subequations}
where $l\in d$ with discrete domain $d=\{0, \hdots, N\}$ and number of grid points along the string $N+1$. Furthermore, spreading and interpolation operators $I_l(x_\text{m}) = I_{l, o}(x_\text{m})$ and $J_l(x_\text{m}) = J_{l, o}(x_\text{m})$ are as defined in Section \ref{sec:interpolationSpreading}. The order $o$ is left unspecified. Following the same process as in Section \ref{sec:solvingMassBarrier}, Eqs. \eqref{eq:massString1} and \eqref{eq:massString2} can be rewritten to
\begin{subequations}\label{eq:massStringComb}
    \begin{align}
        \rho A \delta_{tt}u^n_l & =T\delta_{xx}u^n_l - EI\delta_{xxxx}u_l^n + J_l(x_\text{m}) \left(\frac{k}{2}g^n\delta_{t\cdot}\eta^n + \psi^{n-1/2}\right)g^n,\label{eq:massStringComb1}\\
        M \delta_{tt}w^n &=-Kw^n - \left(\frac{k}{2}g^n\delta_{t\cdot}\eta^n + \psi^{n-1/2}\right)g^n,\label{eq:massStringComb2}
    \end{align}
\end{subequations}
which can be used as a starting point for solving the system.

\subsection{Solving the system}
As the colliding objects are both moving, Eq. \eqref{eq:derEtaEqDerU} is not valid anymore and another strategy needs to be used.
To start, one must isolate the string at the collision location $x_\text{m}$ by taking an inner product of Eq. \eqref{eq:massStringComb1} with $J_l(x_\text{m})$ over discrete domain $d$. Using identity \eqref{eq:identityIJ} and dividing all terms by $\rho A$ yields
\begin{align*}
    \delta_{tt}I_l(x_\text{m})u^n_l =c^2I_l(x_\text{m})\delta_{xx}u^n_l &- \kappa^2I_l(x_\text{m})\delta_{xxxx}u_l^n \\
    &\quad + \frac{\lVert J_l(x_\text{m})\rVert^2_d}{\rho A} \left(\frac{k}{2}g^n\delta_{t\cdot}\eta^n + \psi^{n-1/2}\right)g^n.
\end{align*}
with $c = \sqrt{T/\rho A}$ and $\kappa = \sqrt{EI/\rho A}$. Expanding the temporal FD operators yields
\begin{equation}\label{eq:stringMassunp1}
    I_l(x_\text{m})u_l^{n+1} = u^\star+ \underbrace{\frac{\lVert J_l(x_\text{m})\rVert^2_d k^2}{\rho A}}_{\mathfrak{J}_l} \left(\frac{(g^n)^2}{4}\left(\eta^{n+1}-\eta^{n-1}\right) + \psi^{n-1/2}g^n\right),
\end{equation}
where
\begin{equation*}
    u^\star = I_l(x_\text{m})(2u_l^n -u_l^{n-1}) + c^2k^2I_l(x_\text{m})\delta_{xx}\uln- \kappa^2k^2I_l(x_\text{m})\delta_{xxxx}\uln
\end{equation*}
is the result of the update equation of the string at $x_\text{m}$ without the collision term. Then, Eq. \eqref{eq:massString4} evaluated at $n+1$, which is $\eta^{n+1} = w^{n+1} - I(x_\text{m})u_l^{n+1}$, can be substituted into Eq. \eqref{eq:stringMassunp1}, which results in
\begin{equation}\label{eq:expandedMassString1}
    \begin{aligned}
    \left(1 + \mathfrak{J}_l\frac{(g^n)^2}{4}\right)I_l(x_\text{m})u_l^{n+1} - \mathfrak{J}_l&\frac{(g^n)^2}{4} w^{n+1}= u^\star\\
    & + \mathfrak{J}_l \left(-\frac{(g^n)^2}{4}\eta^{n-1} + \psi^{n-1/2}g^n\right).
    \end{aligned}
\end{equation}
Performing this same process on the FD scheme of the mass in Eq. \eqref{eq:massStringComb2} yields
\begin{equation}\label{eq:expandedMassString2}
    \begin{aligned}
    -\frac{(g^n)^2 k^2}{4M} I_l(x_\text{m})u_l^{n+1} + &\left(1 + \frac{(g^n)^2 k^2}{4M}\right)w^{n+1} = w^\star\\
    & - \frac{k^2}{M} \left(-\frac{(g^n)^2}{4}\eta^{n-1} + \psi^{n-1/2}g^n\right),
    \end{aligned}
\end{equation}
where
\begin{equation*}
    w^\star = 2w^n - w^{n-1} - \frac{Kk^2}{M}w^n
\end{equation*}
is (again) the result of the update equation of the mass without the collision term.
Equations \eqref{eq:expandedMassString1} and \eqref{eq:expandedMassString2} can be treated as a system of linear equations (see Section \ref{sec:linearEquations}) with unknowns $I_l(x_\text{m})u^{n+1}$ and $w^{n+1}$. Writing the aforementioned equations in matrix form yields
\begin{align}
    \begin{bmatrix}
            I_l(x_\text{m})u^{n+1}_l\\
            w^{n+1}
        \end{bmatrix}
        =
        \mathbf{A}^{-1}\mathbf{v}
    \end{align}
    where
    \begin{equation}
    \begin{gathered}
    \mathbf{A} =
        \begin{bmatrix}
            \left(1 + \mathfrak{J}_l\frac{(g^n)^2}{4}\right) & -\mathfrak{J}_l\frac{(g^n)^2}{4}\\
            -\frac{(g^n)^2 k^2}{4M} &\left(1 + \frac{(g^n)^2 k^2}{4M}\right)
        \end{bmatrix}
        \quad \text{and}\\
        \mathbf{v} =
        \begin{bmatrix}
            u^\star + \mathfrak{J}_l \left(-\frac{(g^n)^2}{4}\eta^{n-1} + \psi^{n-1/2}g^n\right)\\
            w^\star- \frac{k^2}{M} \left(-\frac{(g^n)^2}{4}\eta^{n-1} + \psi^{n-1/2}g^n\right)
        \end{bmatrix}.
        \nonumber
    \end{gathered}
\end{equation}
From this, $\eta^{n+1}$ can be calculated, and can consequently be applied to the string and mass in system \eqref{eq:massStringComb}.

Figure \ref{fig:massStringCollision} shows an implementation of the mass spring collision. The mass is initialised with an upwards initial velocity, where $w^0 = -0.2, w^1 = -0.1$, and collides with the string almost instantly after the start of the simulation. As the first panel shows, the collision model allows for interpenetration of the objects. Immediately after, the collision force accelerates the string upwards and the mass downwards.

\begin{figure}[h]
    \centering
    \includegraphics[width=\textwidth]{figures/interactions/stringMassCollision.eps}
    \caption{The collision of the mass (blue) and the string (red). The collision model allows for interpenetration of the objects as shown in the left panel. \label{fig:massStringCollision}}
\end{figure}

\subsection{Energy analysis}
This section follows Section \ref{sec:energyAnalysis} without explicitly following the steps for brevity.

One can obtain the energy of the stiff string FD scheme in Eq. \eqref{eq:massString1} by taking the inner product of scheme by $(\dtd \uln)$ over discrete domain $d$ to obtain
\begin{equation}\label{eq:rOCEnergyString}
    \dtp \h_\text{s} = \left\langle (\dtd \uln), J_l(x_\text{m})\left(\mtp \psi^{n-1/2}\right)g^n\right\rangle_d
\end{equation}
where the energy of the string is (see Eq. \eqref{eq:energyBalanceStiffString})
\begin{equation*}
    \begin{gathered}
        \h_\text{s} = \t_\text{s} + \v_\text{s}, \qwiq \t_\text{s} = \frac{\rho A}{2}\lVert\dtm \uln\rVert^2_d,\quad \text{and} \\
        \v_\text{s} = \frac{T}{2}\langle\dxp\uln, e_{t-}\dxp\uln\rangle_{\underline{d}} + \frac{EI}{2}\langle\dxx\uln, e_{t-}\dxx\uln\rangle_{\overline{\underline{d}}}\ .
    \end{gathered}
\end{equation*}
Energy analysis for the mass in Eq. \eqref{eq:massString2} can be done by multiplying the scheme by $(\dtd w^n)$ to get
\begin{equation}\label{eq:rOCEnergyMass}
    \dtp \h_\text{m} = -(\dtd w^n)\left(\mtp \psi^{n-1/2}\right)g^n,
\end{equation}
where (see Eq. \eqref{eq:energyBalanceMassSpring})
\begin{equation*}
    \h_\text{m} = \t_\text{m} + \v_\text{m}, \qwiq \t_\text{m} = \frac{M}{2}(\dtm w^n)^2, \qaq \v_\text{m} = \frac{K}{2}w^n e_{t-}w^n.
\end{equation*}
The total energy in the system is the addition of Eqs. \eqref{eq:rOCEnergyString} and \eqref{eq:rOCEnergyMass}, which, using identity \eqref{eq:identityIJ} for the former, can be written as:
\begin{align*}
    \dtp(\h_\text{s} + \h_\text{m}) &= \Big(I_l(x_\text{m})(\dtd \uln) - (\dtd w^n)\Big)\left(\mtp \psi^{n-1/2}\right)g^n,\\
    &= \underbrace{\dtd\left(I_l(x_\text{m})\uln - w^n\right)}_{-\dtd \eta^n}\left(\mtp \psi^{n-1/2}\right)g^n.
\end{align*}
Then, expanding $g^n$ according to Eq. \eqref{eq:approxPsi} yields
\begin{align*}
    \dtp(\h_\text{s} + \h_\text{m}) &= - \dtd\eta^n\left(\mtp \psi^{n-1/2}\right)\frac{\delta_{t+}\psi^{n-1/2}}{\delta_{t\cdot}\eta^n}\\
    &= -\left(\mtp \psi^{n-1/2}\right)\delta_{t+}\psi^{n-1/2}
\end{align*}
which, using identity \eqref{eq:prodIdentity3}, can be rewritten as
\begin{equation}
    \dtp(\h_\text{s} + \h_\text{m} + \h_\text{c}) = 0,
\end{equation}
with collision energy
\begin{equation*}
    \h_\text{c} = \frac{(\psi^{n-1/2})^2}{2}.
\end{equation*}
Again, the fact that $\psi$ is squared here, means that $\h_\text{c}$ is non-negative, and proves passivity of the system.

Figure \ref{fig:massStringCollisionEnergy} shows the energy of the mass-spring collision corresponding to the behaviour shown in Figure \ref{fig:massStringCollision}. One can observe that energy of the mass is transferred to the string almost immediately after the start of the simulation. Furthermore, the figure shows that the mass and the string collide again at $n\approx 110$. The interpenetration of the two colliding objects can be observed from the small peaks in the value for $\h_\ctxt$ at these times.

\begin{figure}[h]
    \centering
    \begin{tikzpicture}[->,node distance=3cm,
        thick,main node/.style={circle,draw}]

        \node[] (image) at (0,0) {
        \includegraphics[width=\textwidth]{figures/interactions/stringMassCollisionEnergy.eps}
        };

        \node[] (he) at (0.2,0.5) {\small $\mathfrak{h}_\text{e}$};

        \node[] (h) at (-5.8, 1) {\small $\mathfrak{h}$};
        \node[] (t) at (-5.8, 0.5) {\small $\color{blue}\mathfrak{h}_\text{m}$};
        \node[] (v) at (-5.8, 0) {\small $\color{red}\mathfrak{h}_\stxt$};
        \node[] (c) at (-5.8, -0.5) {\small $\color[HTML]{00DB00}\mathfrak{h}_\ctxt$};

      \end{tikzpicture}
      \caption{The energy of the mass (blue), the string (red), the collision (green) and the total energy (black) of the mass-string collision. The energy corresponds to the system in Figure \ref{fig:massStringCollision}. The right panel shows the normalised energy (according to Eq. \eqref{eq:normalisedEnergy}) shows that the deviation of the energy is within machine precision. \label{fig:massStringCollisionEnergy}}
\end{figure}
\section{Two-sided collision: A connection}\label{sec:twoSidedCollision}

% As an alternative to the method connections shown in Chapter \ref{ch:connections} showed ways to connect various resonators using techniques presented in \cite{theBible}. An alternative method to establish these connections can be devised using the methods presented in this chapter.
%

Using the methods presented in this chapter, one could devise a two-sided collision and alter the collision potential in Eq. \eqref{eq:potential} to \cite{Bilbao2019}
\begin{equation}\label{eq:twoSidedPotential}
    \phi(\eta) = \frac{K}{\alpha_\ctxt+1}|\eta|^{\alpha_\ctxt+1},
\end{equation}
and taking its derivative with respect to $\eta$ yields
\begin{equation}
    \phi'(\eta) = \sgn(\eta)K|\eta|^{\alpha_\ctxt}.
\end{equation}
One can observe that, as opposed to the (one-sided) potential presented in Eq. \eqref{eq:potential}, the collision force will be non-zero, for both a positive and negative $\eta$. This two-sided collision can be used as a connection -- as an alternative to connections presented in Chapter \ref{ch:connections} -- and has been used in papers \citeP[D] and \citeP[E] in combination with Eq. \eqref{eq:potential} to model the mechanics of the tromba marina. See Chapter \ref{ch:tromba} for more details.


\chapter{Derivations}\label{app:derivations}
\def\Psilp{\Psi_{l+1}^n}
\def\Psilm{\Psi_{l-1}^n}
\def\Psinp{\Psi_l^{n+1}}
\def\Psinm{\Psi_l^{n-1}}

\section{Webster's update equation (Eq. \eqref{eq:webstersUpdateEq})}\label{app:webstersUpdateEq}
This section derives the update equation for Webster's equation in Eq. \eqref{eq:webstersUpdateEq}:
\begin{align*}
    &\begin{aligned}
    \frac{\Sbar}{k^2}(\Psi_l^{n+1} - 2\Psiln+\Psi_l^{n-1}) &= c^2\bigg((\dxm \Sp)(\mxm \dxp \Psiln)\\
    & + (\mxm \Sp)(\dxm \dxp \Psiln)\bigg),\\
    \Psinp - 2\Psiln+\Psinm &= \frac{c^2k^2}{\Sbar}\bigg(\frac{1}{h}(\Sp - \Sm)\frac{1}{2h}\overbrace{(\Psilp -\Psilm)}^{\mxp\dxm\Psiln = \delta_{x\cdot}\Psiln}\nonumber\\
    &+\frac{1}{2}(\Sp + \Sm)\frac{1}{h^2}(\Psilp-2\Psiln+\Psilm)\bigg),
    \end{aligned}\\[-0.5em]
    &\begin{aligned}
        \Psinp &= 2\Psiln -\Psinm +\overbrace{\frac{\lambda^2}{2\Sbar}}^{\lambda = \frac{ck}{h}}\Big(\Sp\Psilp - \Sp\Psilm\\
        &\qquad\qquad - \Sm\Psilp + \Sm\Psilm+ \Sp\Psilp + \Sp\Psilm \\
        &\qquad\qquad + \Sm\Psilp + \Sm\Psilm - 2 (\Sp + \Sm)\Psiln\Big)\nonumber,\\
        \Psinp &= 2\Psiln-\Psinm+ \frac{\lambda^2}{2\Sbar}\Big(2\Sp\Psilp + 2\Sm\Psilm - 4\Sbar\Psiln\Big)\nonumber,\\
        \Psinp &= 2\Psiln-\Psinm+ \frac{\lambda^2\Sp}{\Sbar}\Psilp + \frac{\lambda^2\Sm}{\Sbar}\Psilm - 2\lambda^2\Psiln\nonumber,\\
        \Psinp &= 2(1-\lambda^2)\Psiln-\Psinm+ \frac{\lambda^2\Sp}{\Sbar}\Psilp + \frac{\lambda^2\Sm}{\Sbar}\Psilm.
    \end{aligned}
\end{align*}

\section{Boundary terms Webster's equation (Eq. \eqref{eq:centStrictDissip})}\label{app:boundaryWebster}
This section derives process of obtaining the values for $\el$ and $\er$ such that the boundary terms in Webster's equation are strictly dissipative.

Starting with the second term in the energy balance in Eq. \eqref{eq:powerBalanceWebster}:
\begin{equation}
    - c^2\langle\dtd\Psiln, \dxm\big(\Sp(\dxp\Psiln)\big)\rangle_d^{\el,\er}.
\end{equation}
Using identity \eqref{eq:weightedIdentityMinus}
\begin{equation*}
    \begin{aligned}
    \langle f_l^n, \dxm g_l^n \rangle_d^{\el,\er}  = -&\langle \dxp f_l^n, g_l^n \rangle_{\underline{d}}+ f_N^ng_{N-1}^n - f_0^ng_0^n \\
    &+ \frac{\epsilon_\text{r}}{2}f_N^n(g_N^n-g_{N-1}^n)+ \frac{\epsilon_\text{l}}{2}f_0^n(g_0^n - g_{-1}^n),
    \end{aligned}
\end{equation*}
this can be rewritten to (with $f=\dtd\Psi$ and $g = S_{l+1/2}(\dxp\Psi)$)
\begin{equation*}
        -c^2\langle \dtd\Psiln,\dxm \big(\Sp(\dxp\Psiln)\big) \rangle_{d}^{\epsilon_\text{l},\epsilon_\text{r}} = c^2\langle \dtd\dxp \Psiln, \big(\Sp(\dxp\Psiln)\big)\rangle_{\underline{d}} - \b.
\end{equation*}
where
\begin{equation}
    \b = \b_\text{r} - \b_\text{l}
\end{equation}
with
\begin{equation*}
    \mathfrak{b}_\text{r} =  \begin{aligned}[t]
        &c^2 (\dtd\Psi_N^n)\Big(S_{N-1/2}\overbrace{(\dxp\Psi_{N-1}^n)}^{(\dxm\Psi_{N}^n)}\Big)\\
        &+ \frac{\epsilon_\text{r}}{2}(\dtd\Psi_{N}^n)\Big(S_{N+1/2}(\dxp\Psi_N^n)- S_{N-1/2}\underbrace{(\dxp \Psi_{N-1}^n)}_{(\dxm\Psi_{N}^n)}\Big)
    \end{aligned}
\end{equation*}
and
\begin{equation*}
    \mathfrak{b}_\text{l} = \begin{aligned}[t]
        &c^2(\dtd\Psi_0^n)\Big(S_{1/2}(\dxp\Psi_0^n)\Big)\\
        & -\frac{\epsilon_\text{l}}{2}(\dtd\Psi_0^n)\Big(S_{1/2}(\dxp\Psi_0^n)-S_{-1/2}\underbrace{(\dxp\Psi_{-1}^n)}_{(\dxm\Psi_0^n)}\Big)
    \end{aligned}
\end{equation*}
which can be rewritten to
\begin{align}
    \b_\text{r} &= c^2(\dtd\Psi_N^n)\left(\frac{\epsilon_\text{r}}{2}S_{N+1/2}(\dxp \Psi_N^n) + \left(1-\frac{\epsilon_\text{r}}{2}\right)S_{N-1/2}(\dxm\Psi_N^n)\right),\\
    \b_\text{l} &= c^2(\dtd\Psi_0^n)\left(\frac{\epsilon_\text{l}}{2}S_{-1/2}(\dxm\Psi_0^n)+\left(1-\frac{\epsilon_\text{l}}{2}\right)S_{1/2}(\dxp \Psi_0^n))\right).
\end{align}
% \\
% &= \\
% &\qquad - c^2(\dtd\Psi_0^n)\left(\frac{\epsilon_\text{l}}{2}S_{-1/2}(\dxm\Psi_0^n)+\left(1-\frac{\epsilon_\text{l}}{2}\right)S_{1/2}(\dxp \Psi_0^n))\right)

Then, for the centred radiating boundary condition in Eq. \eqref{eq:centRadBound} to be strictly dissipative, i.e., $\dxd \Psiln = 0 \ \Rightarrow \ \b_\text{r} = 0$ the special choice for $\epsilon_\text{r} = S_{N-1/2} / \mu_{xx}S_N$ needs to be made:
\begin{equation}
    \begin{aligned}
        \mathfrak{b}_\text{r} &= c^2 (\dtd\Psi_N^n)\!\left(\frac{S_{N-1/2}}{2\mu_{xx}S_N}S_{N+1/2}(\dxp\Psi_N^n)+\left(1\!-\!\frac{S_{N-1/2}}{2\mu_{xx}S_N}\right)\!S_{N-1/2}(\dxm\Psi_N^n)\!\right),\\
        &= c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(\frac{S_{N+1/2}}{2\mu_{xx}S_N}(\dxp\Psi_N^n)+\left(1-\frac{S_{N-1/2}}{2\mu_{xx}S_N}\right)(\dxm\Psi_N^n)\right),\\
        &=c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(1-\frac{S_{N-1/2}}{2\mu_{xx}S_N}\right)\left(\frac{\frac{S_{N+1/2}(\dxp\Psi_N^n)}{2\mu_{xx}S_N}}{\left(1-\frac{S_{N-1/2}}{2\mu_{xx}S_N}\right)}+\dxm\Psi_N^n\right),\\
        &=c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(1-\frac{\epsilon_\text{r}}{2}\right)\left(\frac{\frac{S_{N+1/2}(\dxp\Psi_N^n)}{2\mu_{xx}S_N}}{\left(\frac{2\mu_{xx}S_N - S_{N-1/2}}{2\mu_{xx}S_N}\right)}+\dxm\Psi_N^n\right),\\
        &=c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(1-\frac{\epsilon_\text{r}}{2}\right)\left(\frac{S_{N+1/2}(\dxp\Psi_N^n)}{2\mu_{xx}S_N - S_{N-1/2}}+\dxm\Psi_N^n\right),\\
        &=c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(1-\frac{\epsilon_\text{r}}{2}\right)\left(\frac{S_{N+1/2}(\dxp\Psi_N^n)}{S_{N+1/2} + S_{N-1/2} - S_{N-1/2}}+\dxm\Psi_N^n\right),\\
        &=c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(1-\frac{\epsilon_\text{r}}{2}\right)\left(\dxp\Psi_N^n+\dxm\Psi_N^n\right),\\
        &=c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(1-\frac{\epsilon_\text{r}}{2}\right)\left(\frac{1}{h}\left(\Psi_{N+1}^n - \Psi_N^n + \Psi_N^n - \Psi_{N-1}^n\right)\right),\\
&= c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(1-\frac{\epsilon_\text{r}}{2}\right)2(\delta_{x\cdot}\Psi_N^n),\\
&= c^2 (\dtd\Psi_N^n)S_{N-1/2}\left(2-\epsilon_\text{r}\right)(\delta_{x\cdot}\Psi_N^n).
    \end{aligned}
\end{equation}
The same can be done for $\mathfrak{b}_\text{l}$ with $\epsilon_\text{l} = S_{1/2}/\mu_{xx}S_0$ to get
\begin{equation}
    \mathfrak{b}_\text{l} = c^2(\dtd\Psi_0^n)S_{1/2}\left(2-\epsilon_\text{l}\right)(\delta_{x\cdot}\Psi_0^n).
\end{equation}

\section{Derivatives for Newton-Raphson for the elasto-plastic friction model (Eq. \eqref{eq:NRit})}\label{app:elastoDeriv}
Recalling the functions needed for to compute the Newton-Raphson iteration for the elasto-plastic bow model in Section \ref{sec:elastoPlastic}, being Eq. \eqref{eq:elastog1}
\begin{equation*}
    g_1(v^n,z^n) = \left(\frac{2}{k} + 2\sz\right)v^n + \lVert J_l(x_\Btxt^n)\rVert_d^2\frac{f(v^n,z^n)}{\rho A}+ b^n= 0,
\end{equation*}
and Eq. \eqref{eq:elastog2}:
\begin{equation*}
    g_2(v^n, z^n) = r^n - a^n = 0,
\end{equation*}
the derivatives needed to solve the Newton-Raphson iteration in Eq. \eqref{eq:NRit}
\begin{equation*}
    \begin{bmatrix}
        v^n\\
        z^n
        \end{bmatrix}_{i+1}
        =
        \begin{bmatrix}
        v^n\\
        z^n
        \end{bmatrix}_i
        -
        \begin{bmatrix}
        \frac{\partial g_1}{\partial v} & \frac{\partial g_1}{\partial z}\\
        \frac{\partial g_2}{\partial v} & \frac{\partial g_2}{\partial z}\\
        \end{bmatrix}^{-1}
        \begin{bmatrix}
        g_1\\
        g_2
        \end{bmatrix}\,
        .
\end{equation*}
can be shown to be
\begin{align*}
    \frac{\partial g_1}{\partial v} &= \frac{2}{k} + 2\sigma_0 + \frac{s_1\lVert J_l(x_\Btxt^n)\rVert_d^2}{\rho A}\frac{\partial r}{\partial v}+\frac{s_2\lVert J_l(x_\Btxt^n)\rVert_d^2}{\rho A},\\
    \frac{\partial g_1}{\partial z} &= \frac{s_0\lVert J_l(x_\Btxt^n)\rVert_d^2}{\rho A} + \frac{s_1\lVert J_l(x_\Btxt^n)\rVert_d^2}{\rho A}\frac{\partial r}{\partial z},\\
    \frac{\partial g_2}{\partial v} &= \frac{\partial r}{\partial v}
    \\\frac{\partial g_2}{\partial z}&= \frac{\partial r}{\partial z} -\frac{2}{k}.
\end{align*}
Recalling from Eq. \eqref{eq:r} that
\begin{equation*}
    r^n = r(v^n,z^n) = v^n\bigg[1-\alpha(v^n,z^n)\frac{z^n}{z_\text{ss}(v^n)}\bigg]
\end{equation*}
its derivatives can be computed as
\begin{align*}
    \frac{\partial r}{\partial v} &= 1-z^n\Bigg(\frac{(\alpha^n+\frac{\partial \alpha^n}{\partial v}v^n)z_\text{ss}^n - \frac{\partial z_\text{ss}^n}{\partial v}\alpha^n v^n}{(z_\text{ss}^n)^2}\Bigg),\\
    \frac{\partial r}{\partial z} &= -\frac{v^n}{z_\text{ss}^n}\bigg(\frac{\partial \alpha^n}{\partial z}z^n + \alpha^n\bigg),
    \end{align*}
with
\begin{align*}
    \frac{\partial\alpha^n}{\partial v} &=\sgn(z_\text{ss}^n)\frac{\partial z_\text{ss}^n}{\partial v}\frac{z_\text{ba} - |z^n|}{(|z_\text{ss}^n| - z_\text{ba})^2}\frac{\pi}{2}\cos\big(\sgn(z^n)\Phi\big),\\
    \frac{\partial\alpha^n}{\partial z}&=\frac{\sgn(z^n)\pi\cos\big(\sgn(z^n)\Phi\big)}{2(|z_\text{ss}^n|-z_\text{ba})},\\
    \frac{\partial z_\text{ss}^n}{\partial v} &= -\frac{2|v^n|}{v_\text{S}^2 s_0}(f_\text{S}-f_\text{C})e^{-(v^n/v_\text{S})^2}.
\end{align*}


\section{Important Shapes in 2D \& 3D}
\noindent
In 2D space $(\R^2)$, the most common and simple shapes you will encounter are lines and circles.
\begin{itemize}
	\item Lines have a form like $x=1$ or $y=2x+1$.
	\item Circles have a form like $\left(x-1\right)^2 + \left(y-2\right)^2 = 9$.
\end{itemize}

\noindent
In 3D space $(R^3)$, these 2D shapes have higher dimensional versions: planes, cylinders, and spheres.
\begin{itemize}
	\item{Planes have forms like $x = 1$, $y = 2x+1$, and $z = 2x+3y+5$.\\
		\small{Note the similarity to the equation for lines. One can think of a plane as a line extruded in a direction.}}
	\item{Cylinders have forms like $\left(x-4\right)^2 + \left(y-5\right)^2 = 36$.\\
		\small{Note the similarity to the equation for circles. One can think of a cylinder as a circle extruded away from it's face.}}
	\item{Spheres have forms like $\left(x-7\right)^2 + \left(y-8\right)^2 + \left(z-9\right)^2 = 100$.\\
		\small{Note the similarity to the equations for circles. One can think of a sphere as a circle rotated and extruded about its center.}}
\end{itemize}


%auto-ignore
\providecommand{\MainFolder}{..}
\documentclass[\MainFolder/Text.tex]{subfiles}

\begin{document}
\section{Standard Hodge propagator for Euclidean space}\label{Sec:HeatRN}
\allowdisplaybreaks

We will use Propositions~\ref{Prop:StdCodifInt} and~\ref{Prop:HeatKerFormulas} to prove in two ways that $\StdPrpg$ for $\R^n$ extends smoothly to the blow-up. We will start with the following well known formulas.
\begin{Proposition}[Green form and heat kernel for $\R^n$]\label{Prop:GreenKernelRn}
The Green form for $\R^n$, which can be equivalently characterized as the unique solution $\GKer\in \DR^n(\R^n\times\R^n\backslash\Diag)$ of
\begin{equation}\label{Eq:GrRn}
\Laplace_y \GKer(x,y) = \delta(x-y)(\Diff{x}^1-\Diff{y}^1)\dotsb(\Diff{x}^n-\Diff{y}^n),
\end{equation}
where $\delta(x-y)$ is the Dirac delta function, satisfies
$$ \GKer(x,y) = \begin{cases}
\displaystyle\frac{1}{(n-2) \Vol(\Sph{n-1})} \frac{1}{\Abs{x-y}^{n-2}}(\Diff{x}^1 - \Diff{y}^1) \dotsb (\Diff{x}^n - \Diff{y}^n) & \text{for }n\ge 3, \\[1em]
-\dfrac{1}{2\pi}\ln \Abs{x-y}(\Diff{x}^1 - \Diff{y}^1)(\Diff{x}^2 - \Diff{y}^2)& \text{for }n=2.
\end{cases} $$
The heat kernel for $\R^n$, i.e., the solution of $\Laplace_y \QKer_t(x,y) = -\frac{\partial}{\partial t}\QKer_t(x,y)$,  is given by
\begin{equation}\label{Eq:EuclidHeatKer}
\QKer_t(x,y) = (4\pi t)^{-\frac{n}{2}}\exp\Bigl(-\frac{\Abs{x-y}^2}{4t}\Bigr) (\Diff{x}^1 - \Diff{y}^1)\ldots (\Diff{x}^n-\Diff{y}^n).
\end{equation}
\end{Proposition}
\begin{proof}
See \cite{BGV}.
\end{proof}

\begin{Proposition}[Standard Hodge propagator for $\R^n$]\label{Prop:StdHodgePropRn}
The standard Hodge propagator for $\R^n$ with $n\ge 2$ satisfies
$$\StdPrpg(x,y) = \frac{(-1)^{n+1}}{\Vol(\Sph{n-1})} \sum_{i=1}^n (-1)^{i-1} \frac{x^i-y^i}{\Abs{x-y}^n}(\Diff{x}^1 - \Diff{y}^1)\dotsb\reallywidehat{(\Diff{x}^i - \Diff{y}^i)}\dotsb(\Diff{x}^n-\Diff{y}^n) $$
and extends smoothly to $\Bl_\Diag(\R^n\times \R^n)$.
\end{Proposition}
\begin{proof}[Proof using the Green form]
Consider the formulas from Proposition~\ref{Prop:GreenKernelRn}. Recall the formula for the codifferential
\begin{equation}\label{Eq:CodiffRn}
\CoDd f(x)\Diff{x}^I = - \sum_{i\in I} \varepsilon(i,I) \frac{\partial f(x)}{\partial x^i} \Diff{x}^{I\backslash\{i\}}.
\end{equation}
For $n\ge 3$, we compute
\begin{align*}
&(\Id\otimes\CoDd_y)\GKer(x,y) \\
&\quad=\frac{1}{(n-2)\Vol(\Sph{n-1})} \sum_I (-1)^{n\Abs{I}} (\Id \otimes \CoDd_y)\Bigl(\frac{1}{\Abs{x-y}^{n-2}}(\Star\Diff{x}^I)\wedge\Diff{y}^I\Bigr) \\
&\quad=\frac{1}{\Vol(\Sph{n-1})} \sum_{I} (-1)^{n\Abs{I} + \Abs{I} + n+1} \sum_{i\in I}\frac{x^i-y^i}{\Abs{x-y}^n}\varepsilon(i,I)(\Star\Diff{x}^{I})\wedge\Diff{y}^{I\backslash\{i\}}\\
&\quad=\frac{1}{\Vol(\Sph{n-1})} \sum_{I} (-1)^{n\Abs{I} + \Abs{I} + n+1} \sum_{i\in I}\frac{x^i-y^i}{\Abs{x-y}^n}\varepsilon(i,I)\varepsilon(I,I^c) \Diff{x}^{I^c}\wedge\Diff{y}^{I\backslash\{i\}}\\
&\quad=\begin{multlined}[t]\frac{1}{\Vol(\Sph{n-1})} \sum_{i=1}^n \frac{x^i-y^i}{\Abs{x-y}^n} \sum_{\substack{J\subset \{1,\dotsc,\hat{i},\dotsc,n\}}}(-1)^{n\Abs{J} + \Abs{J}}\varepsilon(i,J)\varepsilon(J\cup\{i\},J^c\backslash\{i\})\\ \Diff{x}^{J^c\backslash\{i\}} \wedge \Diff{y}^{J}\end{multlined}\\
&\quad=\frac{1}{\Vol(\Sph{n-1})} \sum_{i=1}^n (-1)^{i-1} \frac{x^i-y^i}{\Abs{x-y}^n}(\Diff{x}^1 - \Diff{y}^1)\dotsb\reallywidehat{(\Diff{x}^i - \Diff{y}^i)}\dotsb(\Diff{x}^n-\Diff{y}^n).
\end{align*}
In the last step, we used that
$$ \varepsilon(i,J)\varepsilon(J\cup\{i\},J^c\backslash\{i\}) = (-1)^{i-1}\varepsilon(J,J^c\backslash\{i\}) $$
and
\begin{align*}
&\Diff{x}^{J^c\backslash\{i\}} \wedge \Diff{y}^{J}\\
& = (-1)^{\Abs{J}} \varepsilon(J^c\backslash\{i\},J)[(\Diff{x}^1-\Diff{y}^1)\dotsb\reallywidehat{(\Diff{x}^i-\Diff{y}^i)}\dotsb (\Diff{x}^n-\Diff{y}^n)]_{J^{c}\backslash\{i\}, J}\\
& = (-1)^{n \Abs{J} + \Abs{J}}[(\Diff{x}^1-\Diff{y}^1)\dotsb\reallywidehat{(\Diff{x}^i-\Diff{y}^i)}\dotsb (\Diff{x}^n-\Diff{y}^n)]_{J^{c}\backslash\{i\}, J},
\end{align*}
where $[\cdot]_{I_1,I_2}$ denotes the part of the product which picks the first variable at positions $I_1$ and the second at positions $I_2$. The computation for $n=2$ gives the same result, and the formula for $\StdPrpg$ is justified by Proposition~\ref{Prop:StdCodifInt}.
%\begin{align*}
%(\Diff{x}^1 - \Diff{y}^1) \dotsb (\Diff{x}^n - \Diff{y}^n) &=\sum_{k=0}^n(-1)^{n-k} \sum_{\substack{I\subset \{1,\dotsc,n\}\\\Abs{I}=k}} \varepsilon(I I^c \mapsto[n])\Diff{x}^{I} \wedge \Diff{y}^{I^c} \\
%&=\sum_{k=0}^n(-1)^{n-k}\sum_{\substack{I \subset \{1,\dotsb,n\}\\\Abs{I}=k}} \Diff{x}^I \wedge (\Star \Diff{y}^I)
%\end{align*}

We will now study whether $\StdPrpg$ extends smoothly to the blow-up. Consider the polar coordinates in one variable
\begin{align*}
\phi: [0,\infty) \times \Sph{n} \times \R^n  &\longrightarrow \R^n \times \R^n \\
(r,\omega,u) &\longmapsto (u+r\omega, u).
\end{align*}
There is a unique smooth map $\tilde{\phi}$ which fits in the blow-up diagram
$$\begin{tikzcd}
 & \Bl_\Diag(\R^n\times \R^n)\arrow{d}{\pi}\\{}
 [0,\infty)\times\Sph{n}\times\R^n\arrow{r}{\phi}\arrow{ru}{\tilde{\phi}}& \R^n\times \R^n,
\end{tikzcd}$$
and it is a diffeomorphism of manifolds with boundary. We denote by
$$ \phi_0 \coloneqq \Restr{\phi}{(0,\infty) \times \Sph{n}\times\R^n} : (0,\infty)\times\Sph{n}\times\R^n\longrightarrow \R^n \times \R^n\backslash\Diag $$
the restriction of $\phi$ to the interior. The commutative diagram
$$\begin{tikzcd}{}
[0,\infty)\times\Sph{n}\times\R^n\arrow{r}{\tilde{\phi}}& \Bl_\Diag(\R^n\times\R^n) \\
(0,\infty)\times\Sph{n}\times\R^n\arrow{r}{\phi_0}\arrow[hook]{u} & \R^n\times\R^n\backslash\Diag \arrow[hook]{u}{\tilde{\iota}}
\end{tikzcd}$$
shows that we can equivalently study whether the form
$$ \StdPrpgPol\coloneqq \phi_0^* \StdPrpg $$
admits a smooth extension $\widetilde{\StdPrpgPol}$ to $[0,\infty)\times\Sph{n-1}\times\R^n$. We have
\begin{align*}
\StdPrpgPol(r,\omega,u) &= \phi_0^*\bigl(\CoDd_y \GKer)(r,\omega,u) \\
& = \begin{multlined}[t]
\frac{(-1)^{n+1}}{r^{n-1}\Vol(\Sph{n-1})}\sum_{i=1}^n (-1)^{i-1} \omega^i (r\Diff{\omega}^1 + \omega^1 \Diff{r}) \dotsb \reallywidehat{(r\Diff{\omega}^i + \omega^i \Diff{r})} \dotsb \\ (r\Diff{\omega}^n + \omega^n \Diff{r})
\end{multlined}\\
 & = \begin{aligned}[t]
 \frac{(-1)^{n+1}}{r^{n-1}\Vol(\Sph{n-1})} \Bigl(r^{n-1}&\sum_{1\le i \le n}(-1)^{i-1}\omega^i\Diff{\omega}^1\dotsb\widehat{\Diff{\omega}^i}\dotsb\Diff{\omega}^n    \\
  - r^{n-2}&\sum_{1\le i < j \le n}(-1)^{i+j} \omega^i \omega^j \Diff{r}\Diff{\omega}^1 \dotsb \widehat{\Diff{\omega}^i} \dotsb \widehat{\Diff{\omega}^j} \dotsb\Diff{\omega}^n \\
  + r^{n-2}&\sum_{1 \le j < i \le n}(-1)^{i+j} \omega^j\omega^i \Diff{r} \Diff{\omega}^1 \dotsb \widehat{\Diff{\omega}^j} \dotsb \widehat{\Diff{\omega}^i} \dotsb\Diff{\omega}^n\Bigr)
  \end{aligned} \\
 & = (-1)^{n+1}\frac{\Vol_{\Sph{n-1}}(\omega)}{\Vol(\Sph{n-1})},
\end{align*}
where the last two sums canceled. The result extends smoothly beyond $r=0$ because it does not depend on $r$ at all.
\end{proof}
\begin{proof}[Proof using the heat kernel]
Consider the polar coordinates with respect to the diagonal
$$ \begin{aligned}
   \varphi: [0,\infty)\times \Sph{n-1} \times \R^n &\longrightarrow \R^n \times \R^n \backslash \Diag \\
 (r,\omega,u) &\longmapsto (x,y) = (u+r\omega, u-r\omega).
   \end{aligned} $$
There is a unique smooth map $\tilde{\varphi}$ which fits in the blow-up diagram
$$\begin{tikzcd}
 & \Bl_\Diag(\R^n\times \R^n)\arrow{d}{\pi}\\{}
 [0,\infty)\times\Sph{n}\times\R^n\arrow{r}{\varphi}\arrow{ru}{\tilde{\varphi}}& \R^n\times \R^n,
\end{tikzcd}$$
and it is a diffeomorphism of manifolds with boundary. The heat kernel \eqref{Eq:EuclidHeatKer} transforms under $\varphi$ as
\begin{align*}
\QKerPol_t(r,\omega,u) &\coloneqq (\varphi^* \QKer_t)(r,\omega,u) \\
 & = (4 \pi t)^{-\frac{n}{2}} \exp(-\frac{r^2}{t}) 2^n r^{n-1} \Diff{r} \Vol(\omega) \\
 &= (\pi t)^{-\frac{n}{2}} \exp(-\frac{r^2}{t}) r^{n-1} \Diff{r} \Vol(\omega).
\end{align*}
It follows from Proposition~\ref{Prop:HeatKerFormulas} that for $(r,\omega,u)\in (0,\infty) \times \Sph{n-1}\times \R^n$ we have
\begin{equation}\label{Eq:StdPrpgPol}
\StdPrpgPol(r,\omega,u) = (-1)^{n+1}\frac{1}{2}\lim_{t\to 0} \int_t^\infty \CoDdPol \QKerPol_\tau(r,\omega,u) \Diff{\tau},
\end{equation}
where $\CoDdPol$ is the codifferential on $\R^n\times \R^n$ computed with respect to the pullback of the product Riemannian metric. If $g: \R^n \otimes \R^n\rightarrow \R$ is an inner product, then the pullback Riemannian metric satisfies
\begin{equation}\label{Eq:PullbackMetric}
g^{\mathrm{pol}}\coloneqq \varphi^*(g\oplus g)(r,\omega,u) = 2\begin{pmatrix}
g(\omega,\omega) & 0 & 0 \\
0 & r^2 g & 0 \\
0 & 0 & g
\end{pmatrix};
\end{equation}
it is degenerate at the boundary $r=0$. Next, it is easy to check that the conformal transformation $g\mapsto\lambda g$ on vectors induces the conformal transformation $g\mapsto\frac{1}{\lambda^k}g$ on $k$-forms. Thus, if $\Norm{\cdot}^\mathrm{pol}$ denotes the point-wise norm with respect to $g^{\mathrm{pol}}$ for the standard Euclidean metric, then
$$ \Norm{\Diff{r}}^{\mathrm{pol}} = 2^{-\frac{1}{2}},\quad\Norm{\Vol(u)}^{\mathrm{pol}} = 2^{-\frac{n}{2}},\quad\Norm{\Vol(\omega)}^{\mathrm{pol}} = 2^{-\frac{n-1}{2}} r^{-(n-1)}, $$
and hence
$$ \VolPol(r,\omega,u) = 2^{n}r^{n-1}\Diff{r}\Vol(\omega)\Vol(u). $$
In order to get the Hodge star $\StarPol$, we compute
\begin{align*}
\Diff{r}\Vol(\omega)\wedge \StarPol \bigl(\Diff{r}\Vol(\omega)\bigr) & \overset{!}{=} {\Norm{\Diff{r}\Vol(\omega)}^{\mathrm{pol}}}^2 \Vol^{\mathrm{pol}}(r,\omega,u) \\
&=r^{-(n-1)} \Diff{r}\Vol(\omega)\Vol(u), \\
\Diff{r}\Vol(u) \wedge \StarPol(\Diff{r}\Vol(u)) &\overset{!}{=} {\Norm{\Diff{r} \Vol(u)}^{\mathrm{pol}}}^2\Vol^{\mathrm{pol}}(r,\omega,u) \\
&=\frac{1}{2} r^{n-1} \Diff{r} \Vol(\omega) \Vol(u).
\end{align*}
Using the product structure \eqref{Eq:PullbackMetric}, it follows that
\begin{align*}
\StarPol\bigl(\Diff{r}\Vol(\omega)\bigr)&=r^{-(n-1)} \Vol(u)\quad\text{and}\\
\StarPol(\Diff{r}\Vol(u))&= \frac{1}{2} r^{n-1} \Vol(\omega).
\end{align*}
Recalling the definition of the codifferential $\CoDd \alpha = (-1)^{n(k-1)+1} \Star\Dd\Star \alpha$, we compute
\begin{align*}
(\StarPol \Dd \StarPol)\bigl(\QKerPol_t(r,\omega,u)\bigr) &=  \StarPol \Dd \Bigl( (\pi t)^{-\frac{n}{2}} \exp(-\frac{r^2}{t}) \Vol(u) \Bigr)  \\
& = \StarPol\Bigl(\frac{-2r}{t}(\pi t)^{-\frac{n}{2}}\exp(-\frac{r^2}{t}) \Diff{r} \Vol(u)\Bigr)\\
&= -\frac{1}{t}(\pi t)^{-\frac{n}{2}} \exp(-\frac{r^2}{t}) r^n \Vol(\omega),
\end{align*}
and because the product dimension is even, we obtain
$$ \CoDdPol \QKerPol_t(r,\omega,u) = \frac{1}{t}(\pi t)^{-\frac{n}{2}} \exp(-\frac{r^2}{t}) r^n \Vol(\omega). $$
In order to integrate this according to \eqref{Eq:StdPrpgPol}, we will make use of the $\Gamma$-function $\Gamma(z) = \int_0^\infty x^{z-1} e^{-x} \Diff{x}$. Then, we have
\begin{align*}
(-1)^{n+1}\StdPrpgPol(r,\omega,u)&=\frac{1}{2}\lim_{t\to 0} \int_t^\infty \CoDdPol \QKerPol_\tau(r,\omega,u)\Diff{\tau}\\
&=\frac{1}{2}\pi^{-\frac{n}{2}}r^n \Bigl(\lim_{t\to 0}\int_{t}^\infty \tau^{-\frac{n}{2} - 1} \exp(-\frac{r^2}{\tau})\Diff{\tau}\Bigr)\Vol(\omega)\\
&=\frac{1}{2}\pi^{-\frac{n}{2}}r^n \Bigl(\lim_{t\to 0}\int_{\frac{r^2}{t}}^0 \Bigl(\frac{r^2}{z}\Bigr)^{-\frac{n}{2} - 1}\exp(-z)\bigl(-z^{-2}r^2\Diff{z}\bigr)\Bigr)\Vol(\omega)\\
&= \frac{1}{2}\pi^{-\frac{n}{2}}\Bigl(\lim_{t\to 0} \int_0^{\frac{r^2}{t}} z^{\frac{n}{2}-1} \exp(-z) \Diff{z}\Bigr)\Vol(\omega) \\
&= \frac{\Gamma(\frac{n}{2})}{2\pi^{\frac{n}{2}}}\Vol(\omega) \\
& = \frac{\Vol(\omega)}{\Vol(\Sph{n-1})},
\end{align*}
which recovers the formula in the other proof of Proposition~\ref{Prop:StdHodgePropRn}.
\end{proof}

\begin{Example}[The case $n=1$]\label{Ex:SDFSDF}
It is easy to check directly that
$$ \Prpg(x,y) \coloneqq \theta(x-y), $$
where $\theta$ is the Heavyside step function, is the Schwartz form of a Hodge homotopy $\Htp$. Indeed, for any smooth $f: \R\rightarrow\R$ with compact support, we have
$$ \Htp(f \Diff{x})(y) = \int_x \Prpg(x,y)f(x)\Diff{x} = \int_{y}^{\infty} f(x)\Diff{x}, $$
and hence $\Dd\circ\Htp = -\Id$. It is also easy to check that the following is the Laplace Green form:
$$ \GKer(x,y) = - \frac{1}{2}\Abs{x-y}(\Diff{x}-\Diff{y}). $$
Indeed, using $\Sgn(x) = 2\theta(x) - 1$, we get
$$ \frac{\partial^2}{\partial y^2} \frac{1}{2}\Abs{x-y} = \frac{\partial}{\partial y}\frac{1}{2}\Sgn(y-x) = \delta(y-x) = \delta(x-y), $$
which shows \eqref{Eq:GrRn}. We carefully compute
\begin{align*}
(\Id\otimes \CoDd_y)\GKer(x,y) & = \CoDd_y \Bigl(\frac{1}{2}\Abs{x-y}\Diff{y}\Bigr) \\
& = -\frac{1}{2} \frac{\partial}{\partial y}\Abs{x-y} \\
& = -\frac{1}{2}(2\theta(y-x)-1) \\
& = - \theta(y-x) + \frac{1}{2} \\
& = \theta(x-y) - \frac{1}{2}
\end{align*}
and apply Proposition~\ref{Prop:StdCodifInt} to get
$$ \StdPrpg(x,y) = \theta(x-y) - \frac{1}{2}. $$
In particular, we see that the sign agrees with the direct computation of the Hodge propagator above. Smoothness on the blow-up is for $n=1$ equivalent to smoothness on the closures of connected components of $\R\times\R\backslash\Diag$; this is readily satisfied.
\end{Example}

\begin{Question}
	Is it possible to use the asymptotic heat kernel expansion and formula~\eqref{Eq:PrpgUsingHeatKernel} or the asymptotic Green kernel expansion and formula \eqref{Eq:FormForPUsingG} to infer from the case of $\R^n$ with the standard Euclidean metric $g_0$ that $\StdPrpg$ extends smoothly to the blow-up for flat manifolds, i.e., locally isometric to $(\R^n,g_0)$?
\end{Question}

%NOTICE THAT ALREADY $\GKer$ EXTENDS SMOOTHLY TO THE BLOW-UP. BUT ACCORDING TO EXAMPLE BLAH BLAH WE CAN NOT USE IT TO PROVE IT BECAUSE OF THE POLARZIED OPERATORS. MAYBE YES BECAUSE OF ITS SIMPLE FORM?
\end{document}