%{\bf WEH: update this section with recent sensor placement publications.}
%Add in reference to our guidance document, the review paper, and others contained in guidance doc bibliography.

SPOT integrates solvers for sensor placement that have been developed by Sandia National Laboratories and the Environmental Protection Agency, along with a variety of academic collaborators~\cite{MurUbeJan06,MurBerHar06,CarGreHarKonLauLinMorPhi06,HarBerMurPhiRieWat07,BerHarPhiUbeWat06,BerFleHarPhiWat05}.
SPOT includes (1) general-\/purpose heuristic solvers that
consistently locate optimal solutions in minutes, (2) integer-\/ and
linear-\/programming heuristics that find solutions of provable quality,
(3) exact solvers that find globally optimal solutions, and (4) bounding
techniques that can evaluate solution optimality. These solvers optimize
a representation of the sensor placement problem that may be either
implicit or explicit. However, in either case the mathematical formulation for this problem can be described.

This section describes the mixed integer programming (MIP) formulations optimized by the SPOT solvers. This presentation assumes that the reader is familiar with MIP modeling. First, the standard SPOT formulation, eSP, is described which minimizes expected impact given a sensor budget. Subsequently, several other sensor placement formulations that SPOT solvers can optimize are presented. This discussion is limited to a description of the mathematical structure of these sensor placement problems. In many cases, SPOT has more than one optimizer for these formulations. These optimizers are described later in this manual. However, the goal of this section is to describe the mathematical structure of these formulations.

\section{The Standard SPOT Formulation}\label{formulations_formulationsCanonical}

The most widely studied sensor placement formulation for CWS design is to minimize the expected impact of an ensemble of contamination incidents given a sensor budget. This formulation has also become the standard formulation in SPOT, since it can be effectively used to select sensor placements in large water distribution networks.

A MIP formulation for expected-\/impact sensor placement is: \[ \label{eqn:SP} \begin{array}{llll} {\rm (eSP)} & \min & \sum_{a \in {\cal A}} \alpha_a \sum_{i \in {\cal L}_a} d_{ai} x_{ai} &\\ & {\rm s.t.} & \sum_{i\in {\cal L}_a} x_{ai} = 1 & \forall a \in {\cal A}\\ & & x_{ai} \le s_i & \forall a \in {\cal A}, i \in {\cal L}_a\\  & & \sum_{i \in L} c_i s_i \le p&\\ & & s_i \in \{0,1\} & \forall i \in L\\ & & 0 \leq x_{ai} \leq 1 & \forall a \in {\cal A}, i \in {\cal L}_a \end{array} \] This MIP minimizes the expected impact of a set of contamination incidents defined by ${\cal A}$. For each incident $a \in {\cal A}$, $\alpha_a$ is the weight of incident $a$, frequently a probability. This formulation integrates contamination simulation results, which are reported at a set of {\itshape locations\/} from the full set, denoted $L$, where a location refers to a network junction. For each incident $a$, ${\cal L}_a \subseteq L$ is the set of locations that can be contaminated by $a$. Thus, a perfect sensor at a location $i \in {\cal L}_a$ can detect contamination from incident $a$ at the time contamination first arrives at location $i$. Each incident is {\itshape witnessed\/} by the first sensor to see it. For each incident $a \in {\cal A}$ and location $i \in {\cal L}_a$, $d_{ai}$ defines the impact of the contamination incident $a$ if it is witnessed by location $i$. This impact measure assumes that as soon as a sensor witnesses contamination, then any further contamination impacts are mitigated (perhaps after a suitable delay that accounts for the response time of the water utility). The $s_i$ variables indicate where sensors are placed in the network; $c_i$ is the cost of placing a sensor at location $i$, and $p$ is the budget.

The $x_{ia}$ variables indicate whether incident $a$ is witnessed by a sensor at location $i$. A given set of sensors may not be able to witness all contamination incidents. To account for this, $L$ contains a {\itshape dummy\/} location, $q$. This dummy location is in all subsets ${\cal L}_a$. If the dummy location witnesses and incident, it generally means that no real sensor can detect that incident. The impact for this location is handled in two different ways: (1) it is the impact of the contamination incident after the entire contaminant transport simulation has finished, which estimates the impact that would occur without an online CWS, or (2) it has zero impact. The first approach treats detection by this dummy location as a penalty. The second approach simply ignores the detection by this dummy, though this only makes sense with an additional side-\/constraint on the maximum number of failed detections.  Without this extra side constraint, selecting the dummy to witness each event, essentially placing no sensors, would appear to give zero impact, or total protection.

The current implementation of eSP contains an additional set of constraints for the case where dummy impact is zero:
$$x_{aq} \leq 1-s_i \hspace*{.25in} \forall a \in {\cal A}, i \in {\cal L}_a \setminus \{q\}.$$  This constraint does not allow the selection of the zero-impact dummy for incidents that are truly witnessed by a real sensor.  Because this constraint only makes sense when coupled with a side constraint on the maximum number of failed detections, we will not explicitly include it in MIP formulations in this section.  However, the user should be aware of its existance because it affects the computation of sensor placement average impact.  Without this constraint, if a sensor placement is allowed to miss $r$ incidents, then the MIP will choose the (zero-impact) dummy for the $r$ highest impact events, whether the event is detected or not.  With this constraint, all true detections are counted.  Different sensor placements will have varying numbers of incidents contributing to the average impact.  Thus the optimal sensor placement, and the value of the optimal sensor placement, will be different when this constraint is there compared to when it is not.

The eSP formulation with the above extra constraint set is a slight generalization of the sensor placement model described by Berry et al. ~\cite{BerHarPhiUbeWat06}. Berry et al. treat the impact of the dummy as a penalty.  In that case the extra constraints are redundant. The impact of a dummy detection is no smaller than all other impacts for each incident, so the witness variable $x_{ai}$ for the dummy will only be selected if no sensors have been placed that can detect this incident with smaller impact.

Berry et al. note that eSP without the extra constraints is identical to the well-\/known $p$-\/median facility location problem \citep{MirFra90} when $c_i=1$. In the $p$-\/median problem, $p$ facilities (e.g., central warehouses) are to be located on $m$ potential sites such that the sum of distances $d_{ai}$ between each of $n$ customers (e.g., retail outlets) and the nearest facility $i$ is minimized. In comparing eSP and $p$-\/median problems, there is equivalence between (1) sensors and facilities, (2) contamination incidents and customers, and (3) contamination impacts and distances. While eSP allows placement of {\itshape at\/} {\itshape most\/} $p$ sensors, $p$-\/median formulations generally enforce placement of all $p$ facilities; in practice, the distinction is irrelevant unless $p$ approaches the number of possible locations.

\section{Robust SPOT Formulations}\label{formulations_formulationsRobust}

The eSP model can be viewed as optimizing one particular statistic of the distribution of impacts defined by the contaminant transport simulations. However, other statistics may provide more \char`\"{}robust\char`\"{} solutions, that are less sensitive to changes in this   distribution~\cite{WatHarMur06a}. Consider the following reformulation of eSP: \[ \label{eqn:rSP} \begin{array}{llll} {\rm (rSP)} & \min & Impact_{f}(\alpha,d,x) &\\ & {\rm s.t.} & \sum_{i\in {\cal L}_a} x_{ai} = 1 &\forall a \in {\cal A}\\ & & x_{ai} \le s_i & \forall a \in {\cal A}, i \in {\cal L}_a\\ & & \sum_{i \in L} c_i s_i \le p&\\ & & s_i \in \{0,1\} & \forall i \in L\\ & & 0 \leq x_{ai} \leq 1 & \forall a \in {\cal A}, i \in {\cal L}_a \end{array} \] The function $Impact_ {f}(\alpha,d,x)$ computes a statistic of the impact distribution. The following functions are supported in  SPOT (see Watson, Hart and Murray~\cite{WatHarMur06a} for further discussion of these statistics):
\begin{itemize}
\item {\bfseries Mean:} This is the statistic used in eSP.

\item {\bfseries VaR:} Value-\/at-\/Risk (VaR) is a percentile-\/based metric. Given a confidence level $\beta\in(0,1)$, the VaR is the value of the distribution at the $1-\beta$ percentile \cite{TopVlaZen02}. The value of VaR is less than the TCE value (see below).

Mathematically, suppose a random variable $W$ describes the distribution of possible impacts. Then \[ {\rm VaR}(W,\beta) = \min \{ w \mid \Pr[W \le w] \ge \beta \}. \] Note that the distribution $W$ changes with each sensor placement. Further, VaR can be computed using the $\alpha$, $d$ and $x$ values.

\item {\bfseries TCE:} The Tail-\/Conditioned Expectation (TCE) is a related metric which measures the conditional expectation of impact exceeding VaR at a given confidence level. Given a confidence level $1-\beta$, TCE is the expectation of the worst impacts with probability $\beta$. This value is between VaR and the worst-\/case value.

Mathematically, then \[ {\rm TCE}(\beta) = {\rm E}\left[ W \mid W \ge {\rm VaR}(\beta) \right]. \] The Conditional Value-\/at-\/Risk (CVaR) is a linearization of TCE investigated by Uryasev and Rockafellar \cite{rockafellar02cvar}. CVaR approximates TCE with a continuous, piecewise-\/linear function of $\beta$, which enables the use of CVaR in a MIP models for rSP.

\item {\bfseries Worst:} The worst impact value can be easily computed, since a finite number of contamination incidents are simulated. Further, rSP can be reworked to formulate a worst-\/case MIP formulation. However, this statistic is sensitive to changes in the number of contamination incidents that are modeled; adding additional contamination incidents may significantly impact this statistic.

\end{itemize}

\section{Min-\/Cost Formulations}\label{formulations_formulationsMinCost}

A standard variant of eSP and rSP is to minimize cost while constraining the impact to be below a specified threshold, $u$ . For example, the eSP MIP can be revised to formulate a MIP to minimize cost: \[ \begin{array}{llll} {\rm (ceSP)} & \min & \sum_{i \in L} c_i s_i & \\ & {\rm s.t.} & \sum_{i\in {\cal L}_a} x_{ai} = 1 &\forall a \in {\cal A}\\ & & x_{ai} \le s_i & \forall a \in {\cal A}, i \in {\cal L}_a\\  & & \sum_{a \in {\cal A}} \alpha_a \sum_{i \in {\cal L}_a} d_{ai} x_{ai} \leq u&\\ & & s_i \in \{0,1\} & \forall i \in L\\ & & 0 \leq x_{ai} \leq 1 & \forall a \in {\cal A}, i \in {\cal L}_a \end{array} \] Minimal cost variants of rSP can also be easily formulated.

\section{Formulations with Multiple Objectives}\label{formulations_formulationsMultiObj}

CWS design generally requires the evaluation and optimization of a variety of performance objectives. Some performance objectives cannot be simultaneously optimized, and thus a CWS design must be selected from a trade-\/off between these
objectives~\cite{WatGreHar04a}.

SPOT supports the analysis of these trade-\/offs with the specification of additional constraints on impact measures. For example, a user can minimize the expected extent of contamination (ec) while constraining the worst-\/case time to detection (td). SPOT allows for the specification of more than one impact constraint. However, the SPOT solvers cannot reliably optimize formulations with more than one impact constraint.

\section{The SPOT Formulation with Imperfect Sensors}\label{formulations_formulationsImperfect}

The previous sensor placement formulations make the implicit assumption that sensors work perfectly. That is, they never fail to detect a contaminant when it exists, and they never generate an erroneous detection when no contaminant exists. In practice, sensors are imperfect, and they generate these types of errors.

SPOT addresses this issue by supporting a formulation that models simple sensor failures~\cite{BerryCHLPW09}. Each sensor, $s_i$, has an associated probability of failure, $p_i$. With these probabilities, we can easily assess the probability that a contamination incident will be detected by a particular sensor. Thus, it is straightforward to compute the expected impact of a contamination incident.

This formulation does not explicitly allow for the specification of probabilities of false detections. These probabilities do not impact the performance of a CWS during a contamination incident. Instead, they impact the day-\/to-\/day maintenance and use of the CWS; erroneous detections create work for the CWS users, which is an ongoing cost. The overall likelihood of false detections is simply a function of the sensors that are selected. In cases where every sensor has the same likelihoods, this implies a simple constraint on the number of sensors.


%\chapter{Algebraic Concepts}
%\label{ch1}
%\thispagestyle{empty}
%\protected@edef\concepteq{%
%\[\conceptequiv\]
%}

\begin{wrapfigure}{r}{0.5\textwidth}
  \begin{center}
    \includegraphics[width=0.5\textwidth]{codingla/cover}
  \end{center}
  %\caption{Front Cover}
\end{wrapfigure}

\underline{\textcolor{BurntOrange}{\textbf{Excerpt from the Chapter \Large \textcolor{Sepia}{Algebraic Concepts}}}}

\vspace{5mm}

\hspace{4mm}\hlt{\textbf{Concept} $\mathcal{C}$ is a predicate describing a set of syntactic and semantic requirements on related types ($<T_i>$) together with a collection of similar procedures $\left(f : T^i \rightarrow T^j\right)$ stated in terms of the properties, attributes and type functions $\left(F : \mathcal{C}^i \rightarrow \mathcal{C}^j \right)$ defined on the types.}
\begin{gather*}
\therefore \mathcal{C}\left(<T_i>\right) \conceptequiv \wedge <\Psi_j>
\end{gather*}
where $\conceptequiv$ stands for \hlt{is defined by} and the $\Psi_j$ represent independent clauses defining the concept.

\begin{lstlisting}
template<class T>
    concept integral = is_integral_v<T>;
\end{lstlisting}

\hlt{If a type $T$ fulfills all the requirements of a concept $\mathcal{C}$, then $T$ \textbf{models} $\mathcal{C}$}, i.e. $T \models \CC$.

\begin{nscenter}
int8\_t and uint8\_t $\models$ \concept{integral}.
\end{nscenter}

\hlt{Concept $\mathcal{C}^i$ is a \textbf{refinement} of concept $\mathcal{C}^j$ if it subsumes the latter, i.e. if $\mathcal{C}^i$ is true for a set of types, then $\mathcal{C}^j$ is also true for the same set.}

In other words, $\mathcal{C}^i$ \hlt{refines} $\mathcal{C}^j$ ($\mathcal{C}^i \refines \mathcal{C}^j$) by addition of more requirements to $\mathcal{C}^j$, i.e. $\mathcal{C}^j$ \hlt{weakens} $\mathcal{C}^i$ ($\mathcal{C}^j \weakens \mathcal{C}^i$).

\begin{lstlisting}
template<class T>
    concept signed_integral = integral<T> && is_signed_v<T>;
\end{lstlisting}

\begin{nscenter}
\concept{signed\_integral} $\refines$ \concept{integral} \\
int8\_t $\models$ \concept{signed\_integral}
\end{nscenter}

\begin{lstlisting}
template<class T>
concept unsigned_integral = integral<T> && !signed_integral<T>;
\end{lstlisting}

\begin{nscenter}
\concept{unsigned\_integral} $\refines$ \concept{integral} \\
uint8\_t $\models$ \concept{unsigned\_integral}
\end{nscenter}

\begin{comment}

{\color{plotptcolor}
\vspace{1in}

\hrule
\vspace{1mm}
\hrule

\fancybreak{$\blacktriangle\blacktriangle\blacktriangle$}
\begin{hindi}
\centering \bfseries\large
ॐ
\end{hindi}
\fancybreak{$\blacktriangledown\blacktriangledown\blacktriangledown$}

\hrule
\vspace{1mm}
\hrule}
\end{comment}


% Created 2021-10-19 Tue 15:00
% Intended LaTeX compiler: pdflatex
\documentclass[presentation,aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{pifont}
\newcommand{\cmark}{\textcolor{green!80!black}{\ding{51}}}
\usepackage{amssymb}
\usepackage{pgfplotstable}
\DeclareMathOperator{\shift}{q}
\DeclareMathOperator{\diff}{p}
\usepackage{khpreamble, euscript, mathtools}
\DeclareMathOperator{\atantwo}{atan2}
\newcommand*{\ctrb}{\EuScript{C}}
\newcommand*{\obsv}{\EuScript{O}}
\usetheme{default}
\author{Kjartan Halvorsen}
\date{\today}
\title{State feedback with observer}
\hypersetup{
 pdfauthor={Kjartan Halvorsen},
 pdftitle={State feedback with observer},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.4.6)},
 pdflang={English}}
\begin{document}

\maketitle

\section{State feedback with observer}
\label{sec:org2f935f0}
\begin{frame}[label={sec:org44016c9}]{State feedback with reconstructed states}
\end{frame}

\begin{frame}[label={sec:orgbac2dad}]{State feedback with reconstructed states}
\begin{center}
\includegraphics[width=0.9\linewidth]{../../figures/fig-apollo}
\end{center}
\end{frame}

\begin{frame}[label={sec:org2d58208}]{State feedback}
Given
 \begin{equation}
 \begin{split}
  \dot{x} &= A x + B u\\
  y &= C x
 \end{split}
 \label{eq:ssmodel}
\end{equation}
and measurements (or estimates) of the state vector \(x\).

\alert{Linear state feedback} is the control law
\begin{equation*}
\begin{split}
 u &= f\big((x, u_c\big) = -l_1x_1 - l_2x_2 - \cdots - l_n x_n + l_0u_c\\
      &= -\textcolor{morange}{L}x + l_0u_c,
\end{split}
\end{equation*}
where \[ \textcolor{morange}{L} = \bbm l_1 & l_2 & \cdots & l_n \ebm. \]
Substituting the control law in the state space model \eqref{eq:ssmodel} gives
 \begin{equation}
 \begin{split}
  \dot{x} &= \left(A -B \textcolor{morange}{L} \right) x + l_0B r\\
  y(k) &= C x
 \end{split}
 \label{eq:closedloop}
\end{equation}
\end{frame}

\begin{frame}[label={sec:orgd1a7365}]{Observer design}
Given model
 \begin{equation*}
 \begin{split}
  \dot{x} &= A x + B u\\
  y &= C x
 \end{split}
 \label{eq:ssmodel}
\end{equation*}
and measurements of the output signal \(y\).

The observer is given by
\begin{equation*}
\begin{split}
\dot{\hat{x}} &= \underbrace{A \hat{x} + B u{}}_{\text{simulation}} + \underbrace{\textcolor{mred}{K}\big(y - C\hat{x}\big)}_{\text{correction}} = \left(A - \textcolor{mred}{K}C\right)\hat{x} +  B u{} + \textcolor{mred}{K}y
\end{split}
\end{equation*}
with poles given by the eigenvalues of the matrix \(A_o = A - \textcolor{mred}{K}C\)

\alert{Rule-of-thumb} Choose the poles of the observer (eigenvalues of \(A-\textcolor{mred}{K}C\)) at least twice as fast as the poles (eigenvalues) of \(A-B \textcolor{morange}{L}\).
\end{frame}

\begin{frame}[label={sec:org26932c4}]{Control by feedback from reconstructed states}
The design problem can be separated into two problems
\begin{enumerate}
\item Determine the gain vector \(\textcolor{orange!80!black}{L}\) and the gain \(\textcolor{mbluegreen}{l_0}\) of the control law
\[ u{} = -\textcolor{orange!80!black}{L} \hat{x} + \textcolor{mbluegreen}{l_0} r\]
so that the closed-loop system has good reference tracking.
\item Determine the gain vector \(\textcolor{mred}{K}\) of the observer
\begin{equation*}
\begin{split}
\dot{\hat{x}} &= A \hat{x} + B u{} + \textcolor{mred}{K} \big(y - C\hat{x}\big)
\end{split}
\end{equation*}
to get a good balance between disturbance rejection and noise attenuation.
\end{enumerate}
\end{frame}

\begin{frame}[label={sec:org7c5c7f8}]{Computing the observer gain}
A matrix \(M\) and its transpose \(M\transp\) have the same eigenvalues. Hence, the problem of determining the gain \(K\) to obtain desired eigenvalues of
\[A- \textcolor{mred}{K}C\] is equivalent to determining the gain \(\textcolor{mred}{K}\) in
\[(A-\textcolor{mred}{K}C)\transp = A\transp - C\transp \textcolor{mred}{K}\transp.\]
The last problem has the exact same form as the problem of determining \(\textcolor{morange}{L}\) to obtain desired eigenvalues of
\[A - B \textcolor{morange}{L}\]

So, the same matlab function can be used for both problems.
\end{frame}

\begin{frame}[label={sec:orgc1e9ad6},fragile]{Computing the state feedback and  observer gains}
 \begin{enumerate}
\item \alert{Ackerman's method}
\begin{verbatim}
L = acker(A, B, pd)
K = acker(A, C', po)'
\end{verbatim}
\item \alert{More numerically stable method}
\begin{verbatim}
L = place(A, B, pd)
K = place(A, C', po)'
\end{verbatim}
\end{enumerate}
\end{frame}

\section{Example - DC motor}
\label{sec:org5db664c}
\begin{frame}[label={sec:org3e671f9}]{Example - Position control of the DC motor}
\begin{center}
  \includegraphics[width=0.8\linewidth]{../../figures/block-DC}
\end{center}
\end{frame}

\begin{frame}[label={sec:org8593380}]{State-space model with physical states}
\begin{columns}
\begin{column}{0.4\columnwidth}
\begin{center}
  \includegraphics[width=\linewidth]{../../figures/block-DC}
\end{center}

State variables corresponding to physical signals:
\[ x = \begin{bmatrix} x_1\\x_2 \end{bmatrix}= \begin{bmatrix} \omega\\ \theta \end{bmatrix} \]
With dynamics
\begin{align*}
\tau \dot{\omega} &= -\omega + Ku\\
\dot{\theta} &= \omega
\end{align*}
\end{column}
\begin{column}{0.4\columnwidth}
\pause

\alert{Activity} Fill the matrix \(A\) and vectors \(B\) and \(C\).

\[ \dot{x} = \begin{bmatrix} \dot{x}_1\\\dot{x}_2\end{bmatrix} = \underbrace{\begin{bmatrix} \textcolor{white}{-\frac{1}{\tau}} & \textcolor{white}{0} \\\textcolor{white}{1} & \textcolor{white}{0} \end{bmatrix}}_{A} \begin{bmatrix} x_1\\x_2\end{bmatrix} + \underbrace{\begin{bmatrix} \textcolor{white}{\frac{k}{\tau}} \\ \textcolor{white}{0} \end{bmatrix}}_{B} u \]
\[ y = \theta = \underbrace{\begin{bmatrix} \textcolor{white}{0} & \textcolor{white}{1} \end{bmatrix}}_{C} \begin{bmatrix} x_1\\x_2\end{bmatrix} \]
\end{column}
\end{columns}
\end{frame}

\begin{frame}[label={sec:orgf01569b}]{State-space model with physical states}
\begin{columns}
\begin{column}{0.4\columnwidth}
\begin{center}
  \includegraphics[width=\linewidth]{../../figures/block-DC}
\end{center}

State variables corresponding to physical signals:
\[ x = \begin{bmatrix} x_1\\x_2 \end{bmatrix}= \begin{bmatrix} \omega\\ \theta \end{bmatrix} \]
With dynamics
\begin{align*}
\tau \dot{\omega} &= -\omega + ku\\
\dot{\theta} &= \omega
\end{align*}
\end{column}
\begin{column}{0.4\columnwidth}
\alert{Activity} Fill the matrix \(A\) and vectors \(B\) and \(C\).

\[ \dot{x} = \begin{bmatrix} \dot{x}_1\\\dot{x}_2\end{bmatrix} = \underbrace{\begin{bmatrix} \textcolor{black}{-\frac{1}{\tau}} & \textcolor{black}{0} \\\textcolor{black}{1} & \textcolor{black}{0} \end{bmatrix}}_{A} \begin{bmatrix} x_1\\x_2\end{bmatrix} + \underbrace{\begin{bmatrix} \textcolor{black}{\frac{k}{\tau}} \\ \textcolor{black}{0} \end{bmatrix}}_{B} u \]
\[ y = \theta = \underbrace{\begin{bmatrix} \textcolor{black}{0} & \textcolor{black}{1} \end{bmatrix}}_{C} \begin{bmatrix} x_1\\x_2\end{bmatrix} \]
\end{column}
\end{columns}
\end{frame}

\begin{frame}[label={sec:org4239a79}]{State-space model on controllable canonical form}
\begin{columns}
\begin{column}{0.4\columnwidth}
\begin{center}
  \includegraphics[width=\linewidth]{../../figures/block-DC}
\end{center}

Transfer function
\[G(s) = \frac{ \frac{k}{\tau}} {s( s + \frac{1}{\tau})}\]
\end{column}
\begin{column}{0.6\columnwidth}
The system with transfer function
\begin{equation*}
G(s)=\frac{b_1s^{n-1}+\dots+b_{n-1}s+b_n}{s^n+a_1s^{n-1}+\dots
  +a_{n-1}s+a_n}
\end{equation*}
can be represented on state-space form as
\begin{align*}
\dot{x}&=\bbm -a_1& -a_2& \cdots& -a_{n-1}& -a_n\\
1& 0& \cdots& 0& 0\\
0& 1& \cdots& 0& 0\\
\vdots& \vdots& \ddots& \vdots& \vdots\\
0& 0& \cdots& 1& 0\ebm x+
\bbm 1\\ 0\\ 0\\ \vdots\\ 0\ebm u\\
y&=\bbm b_1& b_2& \cdots& b_n\ebm x
\end{align*}

\pause

\alert{Activity} Determine the state-space model of the DC motor on controllable canonical form
\end{column}
\end{columns}
\end{frame}

\begin{frame}[label={sec:org6bee89b}]{State-space model on observable canonical form}
\begin{columns}
\begin{column}{0.4\columnwidth}
\begin{center}
  \includegraphics[width=\linewidth]{../../figures/block-DC}
\end{center}

Transfer function
\[G(s) = \frac{ \frac{k}{\tau}} { s(s + \frac{1}{\tau})}\]
\end{column}
\begin{column}{0.6\columnwidth}
The system with transfer function
\begin{equation*}
G(s)=\frac{b_1s^{n-1}+\dots+b_{n-1}s+b_n}{s^n+a_1s^{n-1}+\dots
  +a_{n-1}s+a_n}
\end{equation*}
can be represented on state-space form as
\begin{align*}
\dot{x}&=\bbm -a_1& 1& 0 &\cdots &  0\\
-a_2 & 0& 1 &  \cdots& 0\\
-a_3 & 0 & 0& \cdots & 0\\
\vdots& \vdots& \vdots & \ddots& \vdots\\
-a_n& 0& 0 & \cdots& 0\ebm x+
\bbm b_1\\ b_2\\ b_3\\ \vdots\\ b_n\ebm u\\
y&=\bbm 1& 0& \cdots& 0 \ebm x
\end{align*}

\pause

\alert{Activity} Determine the state-space model of the DC motor on observable canonical form
\end{column}
\end{columns}
\end{frame}

\begin{frame}[label={sec:org76cc716}]{State-feedback for model with physical states}
\begin{columns}
\begin{column}{0.4\columnwidth}
\[ \dot{x} = \begin{bmatrix} \dot{x}_1\\\dot{x}_2\end{bmatrix} = \underbrace{\begin{bmatrix} \textcolor{black}{-\frac{1}{\tau}} & \textcolor{black}{0} \\\textcolor{black}{1} & \textcolor{black}{0} \end{bmatrix}}_{A} \begin{bmatrix} x_1\\x_2\end{bmatrix} + \underbrace{\begin{bmatrix} \textcolor{black}{\frac{K}{\tau}} \\ \textcolor{black}{0} \end{bmatrix}}_{B} u \]

Feedback \(u = -\textcolor{morange}{L}x + \textcolor{mbluegreen}{l_0} r\) gives closed-loop system

\begin{align*}
  \dot{x} &= (A-B\textcolor{morange}{L})x + \textcolor{mbluegreen}{l_0}Br\\
  &= \begin{bmatrix} \textcolor{black}{-\frac{1}{\tau}} -\textcolor{morange}{l_1}\frac{k}{\tau} & - \textcolor{morange}{l_2}\frac{k}{\tau} \\\textcolor{black}{1} & \textcolor{black}{0} \end{bmatrix} x + \textcolor{mbluegreen}{l_0} B r
  \end{align*}
with characteristic polynomial
\[s^2 + (\textcolor{black}{\frac{1}{\tau}}  + \textcolor{morange}{l_1}\frac{k}{\tau})s +  \textcolor{morange}{l_2}\frac{k}{\tau} \]
\end{column}

\begin{column}{0.4\columnwidth}
\begin{center}
  \begin{tikzpicture}[scale=0.7]
  \pgfmathsetmacro{\wc}{2}
  \pgfmathsetmacro{\rp}{\wc*cos(45)}
    \draw[->] (-4,0) to (2,0) node[below] {Re};
    \draw[->] (0,-3) to (0,3) node[left] {Im};

    \draw[dashed, black!80] (0,\wc) arc[radius=\wc{}cm, start angle=90, end angle=270];

    \node[anchor=center, red!80!black] at (-\rp, \rp) {\Large $\times$ };
    \node[anchor=center, red!80!black] at (-\rp, -\rp) {\Large $\times$ };

    \draw[thin, <->] (0,0) -- node[above] {$\frac{1}{\tau_c}$} (-\rp, \rp);
    \end{tikzpicture}
\end{center}

Desired closed-loop characteristic polynomial

\begin{align*}
  (s-p_1)(s-p_2) &= s^2 + \frac{\sqrt{2}}{\tau_c}s + \frac{1}{\tau_c^2}
\end{align*}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[label={sec:org60f8f9e}]{State-feedback for model with physical states}
Characteristic polynomial obtained with state feedback
\[s^2 + (\textcolor{black}{\frac{1}{\tau}}  + \textcolor{morange}{l_1}\frac{k}{\tau})s +  \textcolor{morange}{l_2}\frac{k}{\tau} \]
Desired characteristic polynomial
\[  s^2 + \frac{\sqrt{2}}{\tau_c}s + \frac{1}{\tau_c^2}\]
\pause

\alert{Activity}
Determine the feedback gains!

\pause
\alert{Solution}
\pause
\begin{align*}
 \textcolor{morange}{l_1} &= \frac{\tau}{k}\big(\frac{\sqrt{2}}{\tau_c} - \frac{1}{\tau}\big) = \frac{\sqrt{2}\tau - \tau_c}{k\tau_c}\\
 \textcolor{morange}{l_2} &= \frac{\tau}{k\tau_c^2}
\end{align*}
\end{frame}

\begin{frame}[label={sec:org3f6e467}]{Observer for the model with physical states}
\small

\begin{columns}
\begin{column}{0.4\columnwidth}
The observer is given by
     \begin{equation*}
     \begin{split}
     \dot{\hat{x}} &= \underbrace{A \hat{x} + B u{}}_{\text{simulation}} + \underbrace{\textcolor{mred}{K}\big(y - C\hat{x}\big)}_{\text{correction}}\\
&= \left(A - \textcolor{mred}{K}C\right)\hat{x} +  B u{} + \textcolor{mred}{K}y\\
         &= \begin{bmatrix} \textcolor{black}{-\frac{1}{\tau}} & -\textcolor{mred}{k_1}  \\\textcolor{black}{1} & -\textcolor{mred}{k_2}  \end{bmatrix}\hat{x} +  B u{} + \textcolor{mred}{K}y
     \end{split}
     \end{equation*}
with poles given by the eigenvalues of the matrix \(A_o = A - \textcolor{mred}{K}C\),
which has characteristic polynomial
 \begin{equation*}
     \begin{split}
      \det \left( \begin{bmatrix} s & 0\\ 0 & s\end{bmatrix} - \begin{bmatrix} \textcolor{black}{-\frac{1}{\tau}} & - \textcolor{mred}{k_1}  \\\textcolor{black}{1} & -\textcolor{mred}{k_2}\end{bmatrix}\right)\\
= s^2 + (\frac{1}{\tau} + \textcolor{mred}{k_2})s +  (\textcolor{mred}{k_1}+\frac{\textcolor{mred}{k_2}}{\tau})
     \end{split}
     \end{equation*}
\end{column}

\begin{column}{0.4\columnwidth}
\pause

\begin{center}
  \begin{tikzpicture}[scale=0.7]
  \pgfmathsetmacro{\wc}{2}
  \pgfmathsetmacro{\rp}{\wc*cos(45)}
    \draw[->] (-4,0) to (2,0) node[below] {Re};
    \draw[->] (0,-3) to (0,3) node[left] {Im};

    \draw[dashed, black!80] (0,\wc) arc[radius=\wc{}cm, start angle=90, end angle=270];

    \node[anchor=center, red!80!black] at (-\rp, \rp) {\Large $\times$ };
    \node[anchor=center, red!80!black] at (-\rp, -\rp) {\Large $\times$ };

    \draw[thin, <->] (0,0) -- node[above] {$\frac{d}{\tau_c}$} (-\rp, \rp);
    \end{tikzpicture}
\end{center}

Choose \(d\) between 2 and 10 and  obtain desired closed-loop characteristic polynomial

\begin{align*}
  (s-p_{o,1})(s-p_{o,2}) &= s^2 + \frac{d\sqrt{2}}{\tau_c}s + \frac{d^2}{\tau_c^2}
\end{align*}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[label={sec:orgfc87ee3}]{Observer for the model with physical states}
Characteristic polynomial of the observer
\[s^2 + (\frac{1}{\tau} + \textcolor{mred}{k_2})s + (\textcolor{mred}{k_1}+\frac{\textcolor{mred}{k_2}}{\tau})\]
Desired characteristic polynomial
\[  s^2 + \frac{\sqrt{2}d}{\tau_c}s + \frac{d^2}{\tau_c^2}\]
\pause

\alert{Activity}
Determine the observer gains!

\pause
\alert{Solution}
\pause
\begin{align*}
 \textcolor{mred}{k_1} &= \frac{d^2}{\tau_c^2} - \frac{\sqrt{2}d}{\tau_c\tau} + \frac{1}{\tau^2}\\
 \textcolor{mred}{k_2} &= \frac{\sqrt{2}d}{\tau_c} - \frac{1}{\tau}
\end{align*}
\end{frame}
\end{document}


\documentclass{article}
\usepackage{amsmath}
\begin{document}
\title{FMM Implementation Details}
\author{Valentin N. Pavlov}
\maketitle
\section{General}

In this implementation, following \cite{dehnen}, we use the this definition of {\em surface spherical harmonics} that has non-standard normalization:
\begin{equation}
  Y^m_l = (-1)^m \sqrt{\frac{(l-m)!}{(l+m)!}} P^m_l e^{i m \phi}
\end{equation}

Again, following \cite{dehnen}, we use this non-standard normalization for the {\em regular} and {\em irregular solid harmonics} as the base for multipole and local expansions:

\begin{equation} \label{eq:2}
  \begin{split}
    R^m_l & = \frac{1}{\sqrt{(l-m)! (l+m)!}} r^l Y^m_l \\
    & = (-1)^m \frac{1}{(l+m)!} r^l P^m_l e^{i m \phi}
  \end{split}
\end{equation}

and

\begin{equation} \label{eq:3}
  \begin{split}
    I^m_l & = \sqrt{(l-m)! (l+m)!} \frac{1}{r^{l+1}} Y^m_l \\
    & = (-1)^m {(l-m)!} \frac{1}{r^{l+1}} P^m_l e^{i m \phi}
  \end{split}
\end{equation}

In all these $P^m_l$ are the associated Legendre polynomials, for which the following apply \cite{alp}:

\begin{equation} \label{eq:4}
  P^0_0 = 1
\end{equation}

\begin{equation} \label{eq:5}
  \begin{split}
    P^{m+1}_{m+1}(\cos{\theta}) & = -(2m+1) \sqrt{1-\cos^2{\theta}} P^m_m \\
    & = -(2m+1) \sin{\theta} P^m_m
  \end{split}
\end{equation}

\begin{equation} \label{eq:6}
  \begin{split}
    P^m_{m+1}(\cos{\theta}) & = (2m+1) \cos{\theta} P^m_m
  \end{split}
\end{equation}

\begin{equation} \label{eq:7}
  P^m_{l+1}(\cos{\theta}) = \frac{(2l+1)\cos{\theta}P^m_l - (l+m)P^m_{l-1}}{l-m+1}
\end{equation}

The last equation can be re-written as:

\begin{equation} \label{eq:8}
  P^m_{l+2}(\cos{\theta}) = \frac{(2l+3)\cos{\theta}P^m_{l+1} - (l+m+1)P^m_{l}}{l-m+2}
\end{equation}

\section{Iterative computation of $R^m_l$}

From (\ref{eq:2}):

\begin{equation}
  R^{m}_{m} = (-1)^{m} \frac{1}{(2m)!} r^m P^m_m e^{i m \phi}
\end{equation}

and

\begin{equation}
  R^{m+1}_{m+1} = (-1)^{m+1} \frac{1}{(2m+2)!} r^{m+1} P^{m+1}_{m+1} e^{i (m+1) \phi}
\end{equation}

Using (\ref{eq:5}) we have:

\begin{equation}
  \begin{split}
    R^{m+1}_{m+1} & = (-1)^{m+1} \frac{1}{(2m+2)!} r^{m+1} [-(2m+1) P^{m}_{m} \sin{\theta}] e^{i (m+1) \phi} \\
    & = (-1)^m \frac{(2m+1)}{(2m+2)(2m+1)(2m)!} r^m P^m_m e^{im\phi} r \sin{\theta} e^{i\phi} \\
    & = R^m_m \frac{1}{2m+2} r \sin{\theta} e^{i\phi}
  \end{split}
\end{equation}

For standard spherical coordinates we have:
\begin{equation}
\begin{split}
  x & = r \sin{\theta} \cos{\phi} \\
  y & = r \sin{\theta} \sin{\phi} \\
  z & = r \cos{\theta}
\end{split}
\end{equation}

so
\begin{equation}
  \begin{split}
    r \sin{\theta} e^{i\phi} & = r \sin{\theta} (\cos{\phi} + i \sin{\phi}) \\
    & = r \sin{\theta} ( \frac{x}{r\sin{\theta}} + i \frac{y}{r\sin{\theta}}) \\
    & = x+iy
  \end{split}
\end{equation}

and finally

\begin{equation} \label{eq:14}
  \boxed{R^{m+1}_{m+1} = \frac{x+iy}{2(m+1)} R^m_m}
\end{equation}

Additionally, from (\ref{eq:2}) and (\ref{eq:4}) it trivially follows that:

\begin{equation} \label{eq:15}
  \boxed{R^0_0 = 1}
\end{equation}

Together these allow us to calculate iteratively all $R^m_m$.

For $R^m_{m+1}$ similary we have:

\begin{equation}
  \begin{split}
    R^m_{m+1} & = (-1)^m \frac{1}{(2m+1)!} r^{m+1} [(2m+1) P^{m}_{m} \cos{\theta}] e^{i m \phi} \\
    & = (-1)^m \frac{(2m+1)}{(2m+1)(2m)!} r^m P^m_m e^{im\phi} r \cos{\theta} \\
    & = R^m_m r \cos{\theta}
  \end{split}
\end{equation}

The last part is just $z = r \cos{\theta}$, so:

\begin{equation} \label{eq:17}
  \boxed{R^m_{m+1} = z R^m_m}
\end{equation}

Next, we have from (\ref{eq:2}):

\begin{equation}
  \begin{split}
    R^m_{l+2} & = (-1)^m \frac{1}{(l+m+2)!} r^{l+2} P^m_{l+2} e^{i m \phi}
  \end{split}
\end{equation}

Pluggin in (\ref{eq:8}):

\begin{equation}
  \begin{split} \label{eq:19}
    R^m_{l+2} & = (-1)^m \frac{1}{(l+m+2)!} r^{l+2} \left[ \frac{(2l+3)\cos{\theta}P^m_{l+1} - (l+m+1)P^m_{l}}{l-m+2} \right] e^{i m \phi} \\
    R^m_{l+2} & = \left[ (-1)^m \frac{1}{(l+m+2)!} r^{l+2} \frac{(2l+3)\cos{\theta}P^m_{l+1}}{l-m+2} e^{i m \phi} \right] - \\
    & - \left[ (-1)^m \frac{1}{(l+m+2)!} r^{l+2} \frac{(l+m+1)P^m_l}{l-m+2} e^{i m \phi}\right]
  \end{split}
\end{equation}

The first term in (\ref{eq:19}) is:

\begin{equation}
  \begin{split}
    A & = (-1)^m \frac{1}{(l+m+2)!} r^{l+2} \frac{(2l+3)\cos{\theta}P^m_{l+1}}{l-m+2} e^{i m \phi} \\
    & = \frac{(2l+3)}{\left( \left(l+2\right) + m \right)\left( \left(l+2\right) - m \right)} (-1)^m \frac{1}{(l+m+1)!} r^{l+1} P^m_{l+1} e^{im\phi} z \\
    & = \frac{(2l+3) z R^m_{l+1} }{(l+2)^2 - m^2}
  \end{split}
\end{equation}

The second term in (\ref{eq:19}) is:

\begin{equation}
  \begin{split}
    B & = (-1)^m \frac{1}{(l+m+2)!} r^{l+2} \frac{(l+m+1)P^m_l}{l-m+2} e^{i m \phi} \\
    & = \frac{1}{\left( \left(l+2\right) + m \right)\left( \left(l+2\right) - m \right)} (-1)^m \frac{1}{(l+m)!} r^l P^m_l e^{im\phi} r^2\\
    & = \frac{ r^2 R^m_l }{(l+2)^2 - m^2}
  \end{split}
\end{equation}

Finally, we have:

\begin{equation}
R^m_{l+2} = \frac{1}{(l+2)^2-m^2} \left[ (2l+3) z R^m_{l+1} - r^2 R^m_l \right]
\end{equation}

We can also rewrite this as

\begin{equation} \label{eq:23}
\boxed{R^m_l = \frac{1}{l^2-m^2} \left[ (2l-1) z R^m_{l-1} - r^2 R^m_{l-2} \right]}
\end{equation}

which is the form used in the implementation.

Together the four equations (\ref{eq:14}), (\ref{eq:15}), (\ref{eq:17}) and (\ref{eq:23}) allow us to calculate all needed $R^m_m$ iteratively and efficiently.

\section{Iterative computation of $I^m_l$}

From (\ref{eq:3}):

\begin{equation}
  I^{m}_{m} = (-1)^{m} \frac{1}{r^{m+1}} P^m_m e^{i m \phi}
\end{equation}

and

\begin{equation}
  I^{m+1}_{m+1} = (-1)^{m+1} \frac{1}{r^{m+2}} P^{m+1}_{m+1} e^{i (m+1) \phi}
\end{equation}

Using (\ref{eq:5}) we have:

\begin{equation}
  \begin{split}
    I^{m+1}_{m+1} & = (-1)^{m+1} \frac{1}{r^{m+2}} \left[  -(2m+1) \sin{\theta} P^m_m \right] e^{i (m+1) \phi}  \\
    & = (-1)^m \frac{1}{r^{m+1}} P^m_m e^{i m \phi} (2m+1) \frac{1}{r} \sin{\theta} e^{i\phi} \\
    & = I^m_m (2m+1) \frac{x+iy}{r^2}
  \end{split}
\end{equation}

So

\begin{equation} \label{eq:27}
  \boxed{I^{m+1}_{m+1} = (2m+1) \frac{x+iy}{r^2} I^m_m}
\end{equation}

Additionally, from (\ref{eq:3}) and (\ref{eq:4}) it trivially follows that:

\begin{equation} \label{eq:28}
  \boxed{I^0_0 = \frac{1}{r}}
\end{equation}

Together these allow us to calculate iteratively all $I^m_m$.

For $I^m_{m+1}$ similary we have:

\begin{equation}
  \begin{split}
    I^m_{m+1} & = (-1)^m \frac{1}{r^{m+2}} P^m_{m+1} e^{i m \phi} \\
    & = (-1)^m \frac{1}{r^{m+2}} \left[   (2m+1) \cos{\theta} P^m_m \right] e^{i m \phi} \\
    & = (-1)^m \frac{1}{r^{m+1}} P^m_m e^{i m \phi} (2m+1) \cos{\theta} \frac{1}{r}  \\
  \end{split}
\end{equation}

So:

\begin{equation} \label{eq:30}
  \boxed{I^m_{m+1} = (2m+1) \frac{z}{r^2} I^m_m}
\end{equation}

Next, we have from (\ref{eq:3}):

\begin{equation}
  \begin{split}
    I^m_{l+2} & = (-1)^m (l+2-m)! \frac{1}{r^{l+3}} P^m_{l+2} e^{i m \phi}
  \end{split}
\end{equation}

Pluggin in (\ref{eq:8}):

\begin{equation}
  \begin{split} \label{eq:32}
    I^m_{l+2} & = (-1)^m (l+2-m)! \frac{1}{r^{l+3}} \left[ \frac{(2l+3)\cos{\theta}P^m_{l+1} - (l+m+1)P^m_{l}}{l-m+2} \right] e^{i m \phi} \\
    I^m_{l+2} & = \left[ (-1)^m (l+2-m)! \frac{1}{r^{l+3}} \frac{(2l+3)\cos{\theta}P^m_{l+1}}{l-m+2} e^{i m \phi} \right] - \\
    & - \left[ (-1)^m (l+2-m)! \frac{1}{r^{l+3}} \frac{(l+m+1)P^m_l}{l-m+2} e^{i m \phi}\right]
  \end{split}
\end{equation}

The first term in (\ref{eq:32}) is:

\begin{equation}
  \begin{split}
    C & = (-1)^m (l+2-m)! \frac{1}{r^{l+3}} \frac{(2l+3)\cos{\theta}P^m_{l+1}}{l-m+2} e^{i m \phi} \\
    & = (-1)^m (l+1-m)! \frac{1}{r^{l+2}} P^m_{l+1} e^{im\phi} (2l+3) \frac{1}{r} \cos{\theta} \\
    & = (2l+3) \frac{z}{r^2} I^m_{l+1}
  \end{split}
\end{equation}

The second term in (\ref{eq:32}) is:

\begin{equation}
  \begin{split}
    D & = (-1)^m (l+2-m)! \frac{1}{r^{l+3}} \frac{(l+1+m)P^m_l}{l+2-m} e^{i m \phi} \\
    & = (-1)^m (l-m)! \frac{1}{r^{l+1}} P^m_l e^{i m \phi} \left[(l+1)^2-m^2\right] \frac{1}{r^2}  \\
    & = \left[(l+1)^2-m^2\right] \frac{1}{r^2} I^m_l
  \end{split}
\end{equation}

Finally, we have:

\begin{equation}
I^m_{l+2} = \frac{1}{r^2} \left[ (2l+3) z I^m_{l+1} - \left[(l+1)^2-m^2\right] I^m_l \right]
\end{equation}

We can also rewrite this as

\begin{equation} \label{eq:36}
\boxed{I^m_l = \frac{1}{r^2} \left[ (2l-1) z I^m_{l-1} - \left[(l-1)^2-m^2\right] I^m_{l-2} \right]}
\end{equation}

which is the form used in the implementation.

Together the four equations (\ref{eq:27}), (\ref{eq:28}), (\ref{eq:30}) and (\ref{eq:36}) allow us to calculate all needed $I^m_m$ iteratively and efficiently.

\begin{thebibliography}{9}
\bibitem{dehnen} Dehnen, W. \textit{A fast multipole method for stellar dynamics.} Comput. Astrophys. 1, 1 (2014). \texttt{https://doi.org/10.1186/s40668-014-0001-7}
\bibitem{alp} \texttt{https://en.wikipedia.org/wiki/Associated\_Legendre\_polynomials}
\end{thebibliography}

\end{document}


\chapter{Other matching methods}

\section{Fisher--Paterson}

For text $T=\texttt{gcatatatgccggata}$ and pattern $P=\texttt{cata}$ perform Fisher--Patterson algorithm.

$T_a=(0,0,1,0,1,0,1,0,0,0,0,0,0,1,0,1)$, $P_a=(0,1,0,1)$\\
$T_c=(0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0)$, $P_c=(1,0,0,0)$\\
$T_g=(1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0)$, $P_g=(0,0,0,0)$\\
$T_t=(0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0)$, $P_t=(0,0,1,0)$\medskip\\
$T_a \times {P_a}^R = (0,0,1,0,2,0,2,0,1,0,0,0,0,1,0,2,0,1,0)$\\
$T_c \times {P_c}^R = (0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0)$\\
$T_g \times {P_g}^R = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)$\\
$T_t \times {P_t}^R = (0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0)$\medskip\\
$R = (0,0,1,0,4,0,3,0,2,0,0,0,1,2,0,3,0,1,0)$

Each position in $R$ represents a number of matched characters when $R$ is aligned with string $T$, $|R| = |T|+ |P| - 1$, so it contains also partial matches.

\section{Rank \& Select}

\clearpage
\section{Wavelet Tree}

\begin{figure}
\tikzstyle{level 1}=[level distance=1.5cm, sibling distance=8cm]
\tikzstyle{level 2}=[level distance=1.5cm, sibling distance=4cm]
\tikzstyle{level 3}=[level distance=1.5cm, sibling distance=4cm]
\begin{tikzpicture}[grow=down]
	\node[align=left] {
	 	$T=$ \texttt{abcdfabdefdabcaedfeaeddacbadefbe}\\
		\red$B=$ \texttt{00011001111000011110111000011101}
  }
	child {
		node[align=left] {
			$T_0=$ \texttt{abcababcaaacbab}\\
			\red$B_0=$ \texttt{001000010001000}
		}
		child {
			node[align=left] {
				$T_{00}=$ \texttt{abababaaabab}\\
				\red$B_{00}=$ \texttt{010101000101}
			}
			child {
        node{\texttt{}}
        edge from parent [->] node [midway,above] {\tiny \{a\}}
      }
			child {
        node{\texttt{}}
        edge from parent [->] node [midway,above] {\tiny \{b\}}
      }
      edge from parent [->] node [midway,above] {\tiny \{a, b\}}
		}
		child {
      node{\texttt{}}
      edge from parent [->] node [midway,above] {\tiny \{c\}}
    }
    edge from parent [->] node [midway,above] {\tiny \{a, b, c\}}
	}
	child {
		node[align=left] {
			$T_1=$ \texttt{dfdefdedfeedddefe}\\
			\red$B_1=$ \texttt{01001000100000010}
		}
		child {
			node[align=left]{
				$T_10=$ \texttt{ddededeedddee}\\
				\red$B_10=$ \texttt{0010101100011}
			}
			child {
        node{\texttt{}}
        edge from parent [->] node [midway,above] {\tiny \{d\}}
      }
			child {
        node{\texttt{}}
        edge from parent [->] node [midway,above] {\tiny \{e\}}
      }
      edge from parent [->] node [midway,above] {\tiny \{d,e\}}
		}
		child {
      node{\texttt{}}
      edge from parent [->] node [midway,above] {\tiny \{f\}}
    }
    edge from parent [->] node [midway,above] {\tiny \{d, e, f\}}
	};
\end{tikzpicture}
\caption{Wavelet tree for string $T$=abcdfabdefdabcaedfeaeddacbadefbe.}
\end{figure}

$\mathrm{rank}_T(\texttt{b}, 10) = \mathrm{rank}_{B_{00}}(1, \mathrm{rank}_{B_0}(0, \mathrm{rank}_B(0, 10)))$\\
$\mathrm{select}_T(\texttt{d}, 5) = \mathrm{select}_B(1, \mathrm{select}_{B_1}(0, \mathrm{select}_{B_{10}}(0, 5)))$

Support rank, select and symbol on posstion queris.

\section{Compressed Suffix Array}


\chapter{Funcoids as closed sets}

Idea \cite{nlab-topogeny} by \noun{Todd Trimble}.

\fxnote{\url{https://ncatlab.org/toddtrimble/published/topogeny}
and \url{https://math.stackexchange.com/q/2681502/4876}}

\fxnote{What about the infinite products?}

\begin{thm}
The set of staroids
$\subsets X_1\times\dots\times\subsets X_n\to 2$ is
order isomorphic to co-frame of closed subsets of topological
product $\beta X_1\times\dots\times\beta X_n$.
\end{thm}

\begin{proof}
$\subsets X_1\times\dots\times\subsets X_n\to 2$ can be order-embedded to
the frame of ideals
$\mathfrak{J}(\subsets X_1\times\dots\times\subsets X_n)$ what is
dual (check!) to the frame of ideals of the distributive lattice
$\subsets X_1\otimes\dots\otimes\subsets X_n$.
This by ?? is the coproduct $\sum_i \subsets X_i$ in the category
of boolean algebras.
By Stone duality it is isomorphic to the topology of it spectrum
$\beta X_1\times\dots\times\beta X_n$.
\end{proof}

Elements of $\beta X_1\times\dots\times\beta X_n$ are closed
subsets. So every $n$-staroid one-to-one corresponds to a closed
set of $\beta X_1\times\dots\times\beta X_n$.

Note that $\beta X_1\times\dots\times\beta X_n$ is a compact
Hausdorff space (as a product of compact Hausdorff spaces).

It seems that there is an easy way to describe the above order
embedding in both directions:
\begin{gather*}
f\mapsto
\setcond{(x_1,\dots,x_n)}{
x_1,\dots,x_n\in\atoms^\mathscr{F},
x_1\times^{\mathsf{FCD}}\dots\times^{\mathsf{FCD}}x_n\sqsubseteq f};\\
X\mapsto \bigsqcup
\setcond{p_1\times^{\mathsf{FCD}}\dots\times^{\mathsf{FCD}}p_n}{
p\in X}.
\end{gather*}

\fxnote{Try to prove that composition of funcoids is isomorphic to
composition of relations $\beta A\times\beta B$.}


\chapter{Blade Element Method}

\section{Coordinate Systems}

\subsection{Shaft-Rotating Axis System}

Origin of the Shaft-Rotating Axis System is coincident with the rotor hub center and rotates together with the rotor shaft. The z-axis it is coincident with the rotor shaft axis and points upwards, the x-axis points toward blade trailing edge and the y-axis completes a right-handed coordinate system.

Please notice that y-axis is positive toward blade tip for counter-clockwise rotors while it is negative toward blade tip for clockwise rotors.

\subsection{Blade-Span Axis System}

Origin of the Blade Axis System is coincident with the point of intersection of flapping and feathering hinge axes. The x-axis lies on XY plane of the Rotor Axis System and it is positive toward blade's trailing edge, z-axis is positive in upward direction and the y-axis completes a right-handed coordinate system.

Please notice that y-axis is positive toward blade tip for counter-clockwise rotors while it is negative toward blade tip for clockwise rotors.

\begin{figure}
  \centering
  \includegraphics[width=130mm]{eps/coordinate_system_SRAS.eps}
  \caption{Shaft-Rotating Axis System (left CCW, right CW)}
\end{figure}

\begin{figure}
  \centering
  \includegraphics[width=130mm]{eps/coordinate_system_BSAS.eps}
  \caption{Blade-Span Axis System (left CCW, right CW)}
\end{figure}

\begin{equation}
  \boldsymbol T \left( \Psi \right)
  =
  \left[
    \begin{matrix}
      -1 & 0 &  0 \\
       0 & 1 &  0 \\
       0 & 0 & -1 \\
    \end{matrix}
  \right]
  \left[
    \begin{matrix}
       \cos \Psi & \sin \Psi & 0 \\
      -\sin \Psi & \cos \Psi & 0 \\
               0 &         0 & 1 \\
    \end{matrix}
  \right]
  =
  \left[
    \begin{matrix}
      -\cos \Psi & -\sin \Psi &  0 \\
      -\sin \Psi &  \cos \Psi &  0 \\
               0 &          0 & -1 \\
    \end{matrix}
  \right]
\end{equation}


% !TEX root = ../main.tex
\section{Proximity Variational Inference}
\label{sec:pvi}
\input{ch-pvi/algo_local}
We now develop \gls{PVI}, a variational inference method that is robust to initialization and can consistently reach good local optima (\Cref{sec:method}).  \gls{PVI} alters the notion of proximity. We further restrict the iterates of the variational parameters by deforming the Euclidean ball implicit in classical gradient ascent. This is done by choosing proximity statistics that are not the identity function, and distance functions that are different than the square difference. These design choices help guide the variational parameters away from poor local optima (\Cref{sec:proximity_examples}).  One drawback of the proximity perspective is that it requires an inner optimization at each step of the outer optimization. We use a Taylor expansion to avoid this computational burden (\Cref{sec:proximity_taylor}).

\subsection{Proximity Constraints for Variational Inference}
\label{sec:method}
\gls{PVI} enriches the proximity constraint in gradient ascent of the \gls{ELBO}.  We want to develop constraints on the iterates $\mblambda_t$ to counter the pathologies of standard variational inference.

Let $f(\cdot)$ be a \emph{proximity statistic}, and let $d$ be a differentiable
distance function that measures distance between proximity statistic iterates. A \emph{proximity constraint} is the combination of a distance function $d$ applied to a proximity statistic $f$. (Recall that in classical gradient ascent, the Euclidean proximity constraint uses the identity as the proximity statistic and the square difference as the distance.) Let $k$ be the scalar magnitude of the proximity constraint. We define the proximity update equation for the variational parameters $\mblambda_{t+1}$ to be
\begin{align}
  \begin{split}
    U(\mblambda_{t+1}) = &\cL(\mblambda_t)
    + \nabla \cL(\mblambda_t)^\top (\mblambda_{t+1}-\mblambda_t)
    %\\ %&
    -
    \frac{1}{2\rho}
    (\mblambda_{t+1}-\mblambda_t)^\top (\mblambda_{t+1}-\mblambda_t) %\\&
    - k \cdot d(f(\tmblambda), f(\mblambda_{t+1})),
  \end{split}
  \label{eq:f-constrained}
\end{align}
where $\tmblambda$ is the variational parameter to which we are measuring closeness. In gradient ascent, this is the previous parameter $\tmblambda = \mblambda_t$, but our construction can enforce proximity to more than just the previous parameters. For example, we can set $\tmblambda$ to be an exponential moving average\footnote{The exponential moving average of a variable $\mblambda$ is denoted $\tmblambda$ and is updated according to $\tmblambda \leftarrow \alpha\tmblambda + (1-\alpha)\mblambda$, where $\alpha$ is a decay close to one.}---this adds robustness to one-update optimization missteps.

The next parameters are found by maximizing \Cref{eq:f-constrained}.  This enforces that the variational parameters between updates will remain close in the proximity statistic $f(\mblambda)$.  For example, $f(\mblambda)$ might be the entropy of the variational approximation; this can avoid zeroing out some of its support.  This procedure is detailed in \Cref{algo:local}. The magnitude $k$ of the constraint is a hyperparameter. The inner optimization loop optimizes the update equation $U$ at each step.
\input{ch-pvi/algo_global}

\subsection{Proximity Statistics for Variational Inference}
\label{sec:proximity_examples}
We describe four proximity statistics $f(\mblambda)$ appropriate for variational inference.  Together with a distance function, these proximity statistics yield proximity constraints. (We study them in \Cref{sec:pvi-experiments}.)

\parhead{Entropy Proximity Statistic.} Consider a constraint built from the entropy proximity statistic, $f(\mblambda) = \mathrm{H}(q(\mbz; \mblambda))$. Informally, the entropy measures the amount of randomness present in a distribution.  High entropy distributions look more uniform across their support; low entropy distributions are peaky.

Using the entropy in \Cref{eq:f-constrained} constrains all updates to have entropy close to their previous update. When the variational distributions are initialized with large entropy, this statistic balances the ``zero-forcing'' issue that is intrinsic to variational inference~\citep{mackay2003information}.  \Cref{fig:bernoulli_arrows} demonstrates how \gls{PVI} with an entropy constraint can correct this pathology.

\parhead{KL Proximity Statistic.} We can rewrite the \gls{ELBO} to
include the \gls{KL} between the approximate posterior and the prior \citep{kingma2014autoencoding},
\begin{align*}
  \cL(\mblambda) =
  \E [ \log p(\mb{x} \mid \mb{z})] - \mathrm{KL}(q(\mbz \mid \mbx; \mblambda) || p(\mbz) ).
\end{align*}
Flexible models tend to minimize the \gls{KL} divergence too quickly and get stuck in poor optima~\citep{DBLP:conf/conll/BowmanVVDJB16}. The choice of \gls{KL} as a proximity statistic prevents the \gls{KL} from being optimized too quickly relative to the likelihood.

\parhead{Mean/Variance Proximity Statistic.} A common theme in the problems with variational inference is that the bulk of the probability mass can quickly move to a point where that dimension will no longer be explored~\citep{Burda2016}. One way to address this is to restrict the mean and variance of the variational approximation to change slowly during optimization. This constraint only allows higher order moments of the variational approximation to change rapidly. The mean $\mu=\E_{q(\mbz; \mblambda)}[\mbz]$ and variance $\textrm{Var}(\mbz) = \E_{q(\mbz; \mblambda)}[(\mbz - \mu)^2]$ are the statistics $f(\mblambda)$ we constrain.

\parhead{Orthogonal Proximity Statistic.} In Bayesian deep learning models such as the variational autoencoder~\citep{kingma2014autoencoding,rezende2014stochastic} it is common to parametrize the variational distribution with a neural network. Orthogonal weight matrices make optimization easier in neural networks by allowing gradients to propagate further~\citep{saxe2013exact}. We can exploit this fact to design an orthogonal proximity statistic for the weight matrices $W$ of neural networks: $f(W) = WW^\top$. With an orthogonal initialization for the weights, this statistic enables efficient optimization.

We gave four examples of proximity statistics that, together with a distance function, yield proximity constraints. We emphasize that any function of the variational parameters $f(\mblambda)$ can be designed to ameliorate issues with variational inference. We discuss how to select a proximity statistic in \Cref {sec:discussion}.

\subsection{Taylor-expanding the Proximity Constraint for Speed}
\label{sec:proximity_taylor}
\gls{PVI} in \Cref{algo:local} requires optimizing the update equation, \Cref{eq:f-constrained}, at each iteration. This rarely has a closed-form solution and requires a separate optimization procedure that is computationally expensive.

An alternative is to use a first-order Taylor expansion of the proximity constraint. Let $\nabla d$ be the gradient with respect to the second argument of the distance function, and $f(\tmblambda)$ be the first argument to the distance. We compute the expansion around $\mblambda_t$ (the variational parameters at step $t$),
\begin{align*}
  U(\mblambda_{t+1}) = &\cL(\mblambda_t) + \nabla \cL(\mblambda_t)^\top(\mblambda_{t+1}-\mblambda_t) \\
                       &- \frac{1}{2\rho} (\mblambda_{t+1}-\mblambda_t)^\top (\mblambda_{t+1}-\mblambda_t)\\
                       & - k \cdot (d(f(\tmblambda), f(\mblambda_{t}))  \\
                       &+ \nabla d (f(\tmblambda), f(\mblambda_t)) \nabla f(\mblambda_t)^\top (\mblambda_{t+1}-\mblambda_t)).
\end{align*}
This Taylor expansion enjoys a closed-form solution for the variational parameters $\mblambda_{t+1}$,
\begin{align}
  \mblambda_{t+1} = \mblambda_t + \rho(\nabla \cL(\mblambda_t) - k \cdot (\nabla d (f(\tmblambda), f(\mblambda_t)) \nabla f(\mblambda_t)).
  \label{eq:fast-update}
\end{align}
Note that setting $\tmblambda$ to the current parameter $\mblambda_t$ removes the proximity constraint. Distance functions are minimized at zero so their derivative is zero at that point.

Fast \gls{PVI} is detailed in \Cref{algo:global}. Unlike \gls{PVI} in \Cref{algo:local}, the update in \Cref{eq:fast-update} does not require an inner optimization. Fast \gls{PVI} is tested in \Cref{sec:case-study}. The complexity of fast \gls{PVI} is similar to standard \gls{VI} because fast \gls{PVI} optimizes the \gls{ELBO} subject to the distance constraint in $f$. (The added complexity comes from computing the derivative of $f$; no inner optimization loop is required.)

Finally, note that fast \gls{PVI} implies a global objective which varies over time.  It is
\begin{align*}
% \begin{split}
  \cL_{\textrm{proximity}}(\mblambda_{t+1}) = &\E_q [ \log p(\mbx, \mbz)] - \E_q [ \log q(\mblambda_{t+ 1})] %\\&
  - k \cdot d(f(\tmblambda), f(\mblambda_{t+1})).
% \end{split}
\end{align*}
Because $d$ is a distance, this remains a lower bound on the evidence, but where new variational approximations remain close in $f$ to previous iterations' distributions.


\section{Introduction}
%The introduction of the then still unknown study of group theory is one of the greatest achievement of E. Galois. Instead of studying solutions explicitly, he studied the $k$-automorphism groups acting on the roots.\\
The general Galois theory was started, of course, by E. Galois himself. Its modern interpretation in field extension theory is, informally, instead of studying sets of solutions (i.e. the roots) for some polynomial equation over a given field one shall study the symmetry group acting on the roots.\\
%\indent Naturally, in field extension theory and algebraic geometry Galois theory is a prominent subfield - nonetheless in number theory. However, the actual power of this theory is that its application does not stop there.\\
%\indent The question we are going to study is can we extend Galois's approach to a new setting and what that setting would look like.%Speaking roughly in a categorical manner, Galois theory describes a functor assigning to each object $X$ in the category of sets an object in the category of groups, group schemes or formal group schemes such that the original object is a torsor of the group object, its so-called Galois group (or principle homogeneous space or torsors, see appendix, pg. \pageref{appendix}, for a brief introduction to category theory). Importantly, the group object is intrinsically connected to the structure of $X$.% Appropriately extending our notation we will arrive at Galois theory of artinian $D$-module algebras.
\subsection{Aim of Thesis}
\indent The question, we are going to study, is can we generalize Galois's approach and for which algebraic structures can we do that. The answer to this question is addressed in the paper 'Introduction to Galois theory for simple artinian $D$-module algebras' by F. Heiderich \cite{Heid13} which we are going to present and exemplify within the framework of differential Galois theory in characteristic zero. This requires a large body of algebraic structures and a little help from category theory.\\
\indent Firstly, we are going to introduce the theory of (unital, associative) algebras $(A,\mu,\eta)$ over some given ring and a distinct type of algebra extensions, the so called Ore-extensions. Next, we discuss briefly Lie algebras and their enveloping algebras since they will be used in the discussion of our examples. Furthermore, we need the theory of (counital, coassociative) coalgebras $(C, \Delta, \eps)$ over some given ring, which are categorically dual to an algebra. Moreover, we are going to merge these theories into the theory of bialgebras. A bialgebra $(D, \mu, \eta, \Delta, \eps)$ is both, an algebra and a coalgebra, such that the coproduct $\Delta$ and counit $\eps$ are homomorphisms of algebras and product $\mu$ and unit $\eta$ are homomorphisms of coalgebras. Completing our brief visit to general algebra, we will introduce $D$-module algebras, denoted by $(A,\Psi_A)$, which are $D$-modules such that the representation homomorphism $\Psi_A : D \longrightarrow \trm{End}(A)$ commutes with the algebra structure on $A$. Finally, we are going to present the theory of Hopf-algebras $(H, \mu, \eta, \Delta, \eps, S)$, which is a bialgebra with a bialgebra anti-homomorphism - its antipode $S : H \longrightarrow H^{\trm{copop}}$, where $H^{\trm{copop}}$ is the opposite, co-opposite bialgebra. This will comprise the whole section 2\medskip\\
\indent Equipped with these theories and enhanced with the introductory theory of differential modules and rings, we will introduce an important example of a bialgebra and its module algebra: the ring of differential operators $(k[\partial], \mu, \eta)$ over a given differential ring $(k, \partial)$, and the ring of differential polynomials $(k\{u\}, \Psi_{k\{u\}})$, which both date back to Ritt and Kolchin (see \cite{Ritt} and \cite{Kol}). We are going to prove that the ring of differential operators is an Ore-extension of the differential ring $k$ and the ring of differential polynomials $k\{u\}$ is a $k[\partial]$-module algebra. Augmented with the theory of linear differential equations over algebraically closed fields of characteristic zero - called Picard-Vessiot theory, we are going to study two examples of homogeneous linear differential field extensions over $\currfield$ and show that their Galois group is a linear algebraic group over the field of constants. We will be discussing the abovementioned in section 3.\\
\indent This will lay the foundation of the generalized Galois theory of $D$-module algebras for a given bialgebra $D$, where $D \simeq D^1 \# k.G$, i.e. the smashed product of a group algebra and a pointed irreducible cocommutative cofree (= Birkhoff-Witt type) bialgebra for a given group $G$ and a Lie algebra $\mathfrak{g}$. In the case we will discuss $G$ equals the trivial group and $D^1$ the ring of differential operators $k[\partial]$. This, in turn, will clarify for which algebraic structures can we define a Galois-object. In a categorical manner, for any bialgebra $D$ we get a functor
$$\trm{Gal} : \trm{CAlgMod}_D \longrightarrow \trm{Grp},\ \trm{GrpSch}\ \trm{or}\ \trm{GrpLaw}$$
assigning to each $D$-module algebra $A$ a group, (formal) group scheme or group law. The application to general differential equations of fields of characteristic zero heavily depends on the definition of the universal Taylor homomorphism
$$\iota: (R, \partial) \longrightarrow (R[[t]],\partial), a \longmapsto \sum_i \frac{\partial^i(a)}{i!} t^i$$
as defined in \cite{Ume96}. This can be thought of as a generalized power series ansatz, as discussed in introductory Analysis. Heiderich subsequently defines a functor $\trm{Ume}$, dedicated to Umemura, assigning to each commutative differential algebra over the field of solutions its Galois group as follows: given a differential extension $K/k$ with transcendence degree $n$ such that $[K : k(x_1,\ldots,x_n)]_{\trm{sep}} < \infty$ and any commutative associative algebra $A$ over $K$, the elements of the Galois group are all differential algebra automorphisms $\varphi$ % \in \trm{Aut} (\mathcal{K} \\otimes_K A[[w]] \longrightarrow K[[t]] \otimes_K A[[w]]$
 acting on the topological completion of $\mathcal{K} \otimes A[[w]]$ with respect to the $\left<w\right>$-adic topology, denoted by $\mathcal{K} \hat{\otimes}_K A[[w]]$, that makes
$$\xymatrix{
\mathcal{K} \hat{\otimes}_K A[[w]] \ar[r]^\varphi \ar[rd]_{id_{\mathcal{K}} \otimes \pi[[w]]~~~~} & \mathcal{K} \hat{\otimes}_K A[[w]]\ar[d]^{id_{\mathcal{K}} \otimes \pi[[w]]}\\
&\mathcal{K} \hat{\otimes}_K A/N(A)[[w]]\\
}$$
commutative and acting on $\kappa \hat{\otimes}_K A[[w]]$ as identity. Here, $N(A)$ is the nilradical in $A$, $\pi : A \longrightarrow A/N(A)$ the canonical projection and $\pi[[w]]$ its extension to the ring of formal power series, $\kappa := K\{\iota(k)\}_{\partial_x}$ and $\mathcal{K} := K\{\iota(K)\}_{\partial_x}$ differential subalgebras of $K[[t]]$, closed under the $K$-derivations $\partial_{x_i}(x_j) = \delta_{ij}$.  This is a special version of a Lie-Ritt functor of the type:
$$\Gamma_{n,R} : \trm{CAlg} \longrightarrow \trm{Grp}, A \longmapsto \left\{\phi = (\phi_i)_{i=1}^n\in A[[w]]^n : \phi_i \equiv w_i \mod N(A)[[w]]\right\},$$
e.g. group of infinitesimal coordinate transformation congruent to identity module nilradical, introduced by Umemura in \cite{Ume96}. In the context of Picard-Vessiot theory, Heiderich shows that this functor is a formal group scheme such that for a PV field $K$ there exists a finite \'{e}tal field extension $K'$ such that for every commutative module algebra $A$ over $K'$
$$\bao{c}
\ker\left[\trm{Gal}(K/k)(A) \longrightarrow \trm{Gal}(K/k)(A/N(A))\right] \simeq \trm{Ume}(K/k)(A),\ \trm{and}\\ \trm{Ume}(K/k)(K'[\eps]) \simeq \trm{Lie}(K/k) \otimes K',\\\ea$$
where $K'[\eps] \simeq K'[X]/\left<X^2\right>$. Lastly, we are presenting the findings of Heiderich, that the Hopf-algebra $H := (R \otimes R)^{\Psi_R}$ encodes the PV-ring $R$ and its spectrum is the affine group scheme $\trm{Gal}(R/k)$ whose $A$ points are isomorphic to $\trm{Aut}_D(k \otimes A)$ with module algebra homomorphism $\rho \otimes \rho_0 \in \trm{Hom}(k \otimes A, \trm{Hom}(D,k \otimes A))$ with
$$\rho \otimes \rho_0 = \rho \otimes \rho_D = \left[a \otimes a' \longmapsto \Psi(\_\otimes a) \ast a' \eps_D := \left[d \longmapsto \sum_{(d)} \Psi(d_{(1)} \otimes a) \otimes \eps_D(d_{(2)}) a'\right]\right]$$
leaving $k \otimes A$ fixed and apply this to one of our examples discussed in the previous section. The bialgebra $D$ in this case is simply $\currfield[\partial]$ - i.e. the ring of differential operators over $\currfield$. This summarizes the fourth section.\\
% and apply the theory to some (more or less classical) examples. He also choses a bialgebraic approach. The term '$D$ measures to $k$' as in Takeuchi et al. is now termed '$k$ is a $D$-module algebra', for some bialgebra $D$ over ring/field of constants $C_k =: k^\Psi$. The homomorphism $\Psi : D \otimes A \longrightarrow A$ satisfies certain compatibility conditions wrt. the algebra structure $(A, \mu, \eta)$ of any unital associative $k$-algebra $A$ and some bialgebra $D$. The application to general differential equations of fields of characteristic zero heavily depends on the definition of the universal Taylor homomorphism
%$$\iota: (R, \partial) \longrightarrow (R[[t]],\partial), a \longmapsto \sum_i \frac{\partial^i(a)}{i!} t^i$$
%as defined in \cite{Ume96}. He subsequently defines a functor $\trm{Ume}$, dedicated to Umemura, assigning to each commutative differential algebra over the field of solutions its Galois group.\\
\indent The beauty of this theory lies in its generality - it covers classical linear and non-linear differential equations over fields of characteristic zero, iterative derivations for positive characteristic as well as so called difference equations in arbitrary characteristic. Furthermore, the prerequisit of algebraic closedness of the field of constants, as in the classical Picard Vessiot theory, is not required. In brief, Galois theory of simple artinian module algebras has applications in representation theory of groups and solution theory of differential equations.% The clue is to treat our solution algebras as module algebras over the ring of differential operators. Although beyond the scope of this thesis, there is an intriguing connection between both fields, differential and difference equations.
% Expressed in the language of modern algebra, we are going to describe the unifying theory to study $D$-module algebras and certain subalgebras - stable under $D$-action and their respective automorphism groups.
%\subsubsection{Outline of Thesis}
%This paper contains three parts loosely following the evolution of the theory. The first part contains a broad introduction to the main concepts used in this paper (though, some parts are placed in the appendix for brevity). These include Ore extensions, Lie-, co-, bi- and Hopf-algebras. Ore extensions generalize classic commutative element adjunctions: for some $R$-algebra $A$ and certain endomorphisms $\alpha, \delta \in \trm{End}_R(A)$, such that $A[\delta]$ has a unique $R$-bialgebra structure (to specify, $\delta$ is a $(\alpha,id_A)$-skew primitive element with coproduct $\alpha \otimes \delta + \delta\otimes id_A$). Coalgebras are $R$-modules that have an $R$-algebra as dual whilst bialgebras are $R$-co/algebras with a distinct compatibility condition (i.e. coproduct and counit are algebra homomorphisms, product and unit are coalgebra homomorphisms).\\
%\indent The second part includes the definition of the ring of differential operators over some differential ring of characteristic zero and its ring of differential polynomials. We are going to show, that the first is indeed a Hopf-algebra as well as an Ore-extension, the latter a module algebra for the first. Furthermore, we introduce the prominent PV-theory and conclude with two linear examples over $\ov{\qz}$.\\
%\indent The third part introduces the Umemura-functor and the general Lie-Ritt functors, as well as iterative derivations. This is augmented with infinite Galois group defined over any differential/ iterative differential/difference algebra. We show how Heiderich connects classic PV theory with the general approach and conclude with extension of the second example from the previous chapter.%(co-) module algebras over co-, bi- and Hopf-algebras as means for Galois theory. Some important theorems are included and finally, exemplifying the theory explicitly.
%\subsection{Aim of this Paper}
\subsection{Background}
We are going to briefly address why we are needing these constructs. In \cite{vdPS01} it is said that differential modules over some differential ring do not have tensor products, in general. That is why we need the coalgebra structure - as it encodes the action of differential operators on the tensor products and therefore the action of differential operators on products of the module algebra. Furthermore, Umemura explains that a generalized approach to differential equations in characteristic zero is far from obvious (\cite{Ume96b}, problem 1 and 2). Given a differential polynomial, we can construct a linear partial differential equation equivalent to our polynomial. However, it is not clear what the base field/ring looks like and if the object containing all symmetries acting on the solutions is in the category of groups.
\subsection{Short Historic Review}
The develpoment of this theory was everything but straight forward. The problems involved were manifold - e.g. is the action of the Galois group in- or equivariant. Furthermore, how to study differential equations in positive characteristic.
%Galois theory in the context of field theory is simply the study of field extensions and the actions of all automorphisms over the ground field leaving it fixed.
%As just mentioned, the Galois theory was introduced by E. Galois to study field extensions via the action of the $k$-automorphisms on roots of separable polynomial equations over some field $k$ leaving $k$ fixed. This led to the famous theorems as the correspondence theorem of normal subgroups and the normal separable extensions over $k$, or the solvability theorem - stating, the Galois group is solvable iff its polyomial solvable by radicals in its Galois extension.
%To establish a general Galois theory required an extensive study of concepts developed rather recently. We summarize the historic steps that let to the theory we will present shortly.
\subsubsection{19th Century to mid-20th century}
The first studies in the differential case were done by S. Lie in the mid-19th century which resulted in the well known theory of Lie groups and their algebras. This is a group with a set of derivations, compatible with the group left action, forming a Lie algebra.\\
\indent The first steps for a general Galois theory for linear differential equations over fields of characteristic zero were done by Picard and Vessiot in the late 19th century to early-mid 20th century. Hence, the naming in the linear case:
\bd
\item[Picard-Vessiot ring] a differential ring extension $(R,\partial)/(k/\partial)$ of a differential field $(k,\partial)$ is called a Picard-Vessiot ring (PV-ring) for a scalar differential equation $L \in k[\partial]$, if both the subring of constants agree $R^\partial = k^\partial$ and the ring extension is simple as a differential ring.
\item[Picard-Vessiot field] is the quotient field of the PV ring.
\ed
The Galois group, or more precisely - differential Galois group, is isomorphic to some linear algebraic subgroup, transforming a set of solutions into a new set of solutions, over their field of constants $k^\partial$. In \cite{vdPS01}, it is shown there is a correspondence between scalar differential equtions and matrix differential equtions. A correspondence theoreme equivalent to the main theoreme of Galois theory in field extensions reads as:
\bd
\item[Galois Correspondence] For a given (matrix/scalar) differential equation over some differential field with algebraically closed field of constants and characterisc zero, there is a one-to-one correspondence between the closed algebraic subgroups of the differential Galois group and the intermediate PV-subfields
%Let $A \in \trm{Gl}_n(k)$ define some linear differential equation over the differential field $(k,\partial)$. There is a one-to-one correspondence between the closed algebraic subgroups $H_i$ of $G \leq \trm{Gl}_n(C_k)$ and the PV-subfields $M_i$ of $K = S_{\left<0\right>}^{-1}(R)$:
%$$\trm{DGal}(K/M_i) = H_i,\ \trm{Fix}^{H_i} = M_i = \trm{Stab}_{H_i}(K),$$
%with $\partial_K$ the extension of $\partial$ on $K \supset M_i \supset k$ and $R$ the PV-ring
(see \cite{vdPS01}, pg. 25).
\ed
Although being well established, this theory only applies to linear differential fields containing either the field of complex numbers or the algebraic closure of the field of rational numbers (i.e. characteristic zero).
\subsubsection{Mid-20th Century to today}
Next, there was Ritt how coined the term 'differential algebra' and ring of differential polynomials. Simply put, the ring of differential polynomials over some differential field/ring is a non-noetherian ring with unique differential relations. This allowed a more general approach in terms of its quotient rings wrt. differential ideals \cite{Ritt}. This was enhanced by Kolchin who described certain classes of non-linear differential field extensions for characteristic zero, the so-called strongly normal differential extensions. Furthermore, he was the first to state that algebraic geometry is simply a differential equation without any derivatives occurring - hence, just a subfield of differential algebra \cite{Kol}.\\
\indent However, it took until the late 20th century to introduce a differential Galois theory for positive characteristic. The problem arose from the fact that any differential extension enlarges the subring of constants for classical derivations over fields of positive characteristic. %To exemplify, $\left(k(t),\partial = \frac{d}{dt}\right)$ differential field with $\trm{char}(k) = p$ - if $\partial$ denotes the restrictions to the fields in question and $C_X$ denotes the field of constants for $X$, we get:
%$$(k(t),\partial) \supsetneq (C_{k(t)},\partial) = (C_k(t^p),\partial) \supsetneq (C_k, \partial),\ \trm{where}\ C_X = \{a \in X : \partial(a) = 0\},\ X = k, k(t)$$
%as a proper subfield with all its elements being constants.
This problem was circumvented by the introduction of iterative differential equations in positive characteristic (see \cite{HassSchm} for iterative derivations, \cite{Matz} for iterative differential equations and their Galois theory).\\
\indent Takeuchi introducted a generalizing concept, the so called $C$-ferential fields $k$, where $C$ is a coalgebra with a unique homomorphism $\psi : C \otimes k \longrightarrow k$, said to measure $C$ to $k$. We remark that Takeuchi introduced the term of Birkhoff-Witt type coalgebras which simply means cofree. This made possible a Galois theory for iterative differential equation unifying PV theory in characteristic zero and in positive prime characteristic \cite{Take}. In context of the theory of coalgebras, $k$ is a $C$-comodule algebra (i.e. a comodule such that multiplication and unit map are coalgebra homomorphisms).\\
\indent Amano \cite{AM} as well as Amano and Masuoka \cite{Amo} came up with a Hopf-algebraic approach, where $C$, as in Takeuchi, was a cocommutative pointed irreducible Hopf-algebra of Birkhoff-Witt type (see section ... for an explanation). They showed that for any simple differential ring extension $R$ the Hopf-algebra $H = R \otimes_k R^{\Psi_R \otimes \Psi_R}$ is a principle homogeneous space of $\trm{Gal}(R/k)$ and there is a correspondence between Hopf-ideals in $H$ and differential subfields $k \subset M \subset K = Q(R)$. They show that instead of linear algebraic groups, group schemes are more suitable.


\subsection{Sliding Window Technique} \label{sliding_window_technique}

Given a continuous time series stream $Q$, the sliding window technique examines the $w$ most recent data points and moves $s$ steps along the time axis as new measurements arrive, where $w$ and $s$ are referred to as window and step size. This technique has the advantage that it does not need to store the never-ending stream of data, but it also implies that measurements can only be considered for further data analysis as long as they are located within the current window.

In most applications, each window is passed to a data processing unit, which performs some kind of time series classification, clustering, or anomaly detection. For example in online gesture recognition \cite{lesti2017filter}, one can employ a nearest neighbor classifier, which compares each window to a training set of preliminary learned time series instances. In case that the current window $Q[t-w,t]$ is similar to one of the known gestures, where similar means that the time series distance falls below a certain threshold, a corresponding action can be triggered. A popular distance measure for gestures \cite{liu2009uwave} and other warped time series is described in the following subsection.


\chapter{Data on the Sphere}
\label{ch_intro}

\section{Introduction}

In a number of areas of scientific activity, data is gathered which naturally maps to the sphere. For instance, remote sensing of the
Earth's surface and atmosphere, e.g. with POLDER\footnote{http://polder.cnes.fr}, generates spherical data maps which are
crucial for global and local geophysical studies such as understanding climate change, geodynamics or monitoring human-environment
interactions. More examples can be found in medical imaging or computer graphics. In astronomy and astrophysics, recent and upcoming
ground based and satellite borne experiments such as WMAP\footnote{http://map.gsfc.nasa.gov} or Planck-Surveyor\footnote{http://astro.estec.esa.nl/Planck}
for the observation of the Cosmic Microwave Background radiation field over the whole celestial sphere,  produce full-sky
maps in a wide range of wavelengths. These maps are necessarily digitized and hence distributed as a finite set of pixel values on some
grid. The properties of this grid will affect the subsequent analysis of the data, and a good choice will make standard computations,
such as the spherical harmonics transform, much faster and accurate. Considerable work has been dedicated to the development of
pixelization schemes on the sphere. In particular, Healpix \citep{pixel:healpix} is a sampling scheme which has some attractive geometrical
features profitably used in this spherical data analysis software package. \\

Processing spherical data maps requires specific tools or somehow adapting traditional methods used on flat images to the spherical
topology, such as multiscale transforms for image processing. Among these, Wavelets and related representations are by now successfully
used in all areas of signal and image processing. Their recent inclusion in JPEG 2000 -- the new still-picture compression standard --
is an illustration of this lasting and significant impact. Wavelets are also very popular tools in astronomy \citep{starck:book02} which
have led to very impressive results in denoising and detection applications. For instance, both the Chandra and the XMM data centers
use wavelets for the detection of extended sources in X-ray images. For denoising and deconvolution, wavelets have also demonstrated
how powerful they are for discriminating signal from noise \citep{starck:sta02_2}. In cosmology, wavelets have been used in many studies
such as for analyzing the spatial distribution of galaxies \citep{astro:slezak93,astro:escalera95,starck:sta05_3,starck:martinez05},
determining the topology of the universe \citep{astro:rocha04}, detecting non-Gaussianity in the CMB maps \citep{gauss:aghanim99,gauss:barreiro01_1,wave:vielva04,starck:sta03_1},
reconstructing the primordial power spectrum \citep{astro:pia03}, measuring the galaxy power spectrum \citep{astro:fang00} or reconstructing
weak lensing mass maps \citep{wlens:starck06}. It has also been shown that noise is a problem of major concern for N-body simulations of
structure formation in the early Universe and that using wavelets for removing noise from N-body simulations is equivalent to simulations
with two orders of magnitude more particles \citep{rest:romeo03,rest:romeo04}.

This technical report includes an overview of multiscale transforms on the sphere and introduces their uses in several algorithms
for signal processing on the sphere. In this chapter, the Section~\ref{mrs_pixel} overviews the problem of pixelization on the sphere
and introduces the two solutions used by \mrs package: the HEALPix pixelization scheme~\ref{healpix} and Gauss-Legendre Sky Pixelization (GLESP)~\ref{Glesp}.
The Section~\ref{alm} introduces the spherical harmonics transform which could be considered as an extension of Fourier's transform to the sphere.
Section~\ref{intro_multi_sph} is a short introduction to multiscale methods on the sphere and to their applications. These methods are fully
presented in Chapter~\ref{ch_mms} and algorithm on the sphere bases on them are given in Chapter~\ref{ch_restore} for data restoration,
in Chapter~\ref{ch_sca_datarest} for sparse component analysis and in Chapter~\ref{ch_mrs_ica} for blind source separation.
The Chapter~\ref{ch_fluctu} is dedicated to statistics on the sphere which includes the detection of non-gaussianities.
%In Section~\ref{sect_wts}, we present an isotropic wavelet transform on the sphere which has similar properties as the isotropic undecimated wavelet transform and therefore should
%be very useful for data denoising and deconvolution. This algorithm is directly derived from the FFT-based wavelet transform proposed in \citep{starck:sta94_3} for aperture synthesis image restoration, and is relatively close to the \citep{freeden98} method, except that it features the same straightforward reconstruction as does the starlet transform algorithm (i.e.\ the sum of the scales reproduces the original data). This wavelet transform can also be easily extended to a pyramidal wavelet transform, allowing us to reduce the redundancy, a possibility which may be very important for larger data sets.
%In Section~\ref{sect_cur}, we show how this new pyramidal transform can be used to derive a curvelet transform on the sphere.
Sections~\ref{section:bedros} and \ref{section:cmb} present how these new tools can help us to analyze data in two
real applications, in physics and in cosmology. Finally, a guided numerical experiments together with a toolbox
written in IDL and dedicated to multiscale transforms on the sphere (MR/S) are described in Chapter~\ref{ch_mrs_idl}.

\section{Pixelization}
\label{mrs_pixel}

Various pixelization schemes for data on the sphere exist in the literature. These include the Equidistant Coordinate Partition (ECP),
the Icosahedron method \citep{tegmark:icos1}, the Quad Cube \citep{white92}, IGLOO \citep{igloo}, HEALPix \citep{pixel:healpix},
Hierarchical Triangular Mesh (HTM) \citep{kunszt01} or Gauss-Legendre Sky Pixelization (GLESP) \citep{pixel:glesp}. Important properties to decide
which one is the best for a given application include the number of pixels and their size, fast computation of the spherical harmonics transform,
equal surface area for all pixels, pixel shape regularity, separability of variables with respect to latitude and longitude,
availability of efficient software libraries including parallel implementation, etc. Each of these properties has advantages and drawbacks.
In this section, we present the HEALPix and the GLESP representation which have several useful properties.

%\newpage
\subsection{HEALPix}
\index{HEALPix}
\label{healpix}

\begin{figure}[htb]
\centering
\includegraphics[width=8cm]{pixelhealpix.pdf}
\caption{The HEALPix sampling grid for four different resolutions.}
\label{pixelhealpix}
\end{figure}

The HEALPix representation (Hierarchical Equal Area isoLatitude Pixelization of a sphere) \citep{pixel:healpix}\footnote{http://healpix.jpl.nasa.gov.}
is a curvilinear hierarchical partition of the sphere into quadrilateral pixels of exactly equal area but with varying shape. The base resolution divides
the sphere into 12 quadrilateral faces of equal area placed on three rings around the poles and equator. Each face is subsequently divided into
$N_{\mathrm{side}}^{2}$ pixels following a quadrilateral multiscale  tree structure (see Fig.~\ref{pixelhealpix}). The pixel centers are located
on iso-latitude rings, and pixels from the same ring are equispaced in azimuth. This is critical for computational speed of all operations involving
the evaluation of the spherical harmonics coefficients, including standard operations such as convolution, power spectrum estimation, and so on.
HEALPix is a standard pixelization scheme in astronomy.

%=================================================================================================================================

\subsection{Gauss-Legendre Sky Pixelization (GLESP)}
\index{GLESP}
\label{Glesp}
\begin{figure}
\centering
\hbox{
\includegraphics[width = 7.8cm]{healpix_192pix.png}
\includegraphics[width = 7.8cm]{glesp_220pix.png}
}
\caption[Comparison between Healpix and Glesp pixelization schemes.]{Comparison of pixelization schemes for a low resolution map (880 arcmin) with Healpix pixelization (on the left) and Glesp pixelization (on the right).}
\label{cmp_lowres}
\end{figure}

The principle of GLESP \citep{pixel:glesp} is to select pixels centers on points whose latitude is on the zeros of the associated Legendre's polynomial. In order to fix the longitude,
two solutions have been built.
The first one seeks for pixel with surfaces approximately equal. The equator is split
in $2*l+1$ pixels and other pixels bands are split in order to have pixel surfaces as closed as possible to those of the
equatorial band.
The second one chooses pixels with an equally spaced longitude. Pixels don't have the same surface,
but the accuracy on spherical harmonics calculation is better.

Figure \ref{cmp_lowres} shows the shape and localization of pixels with both Healpix and GLESP scheme for a  low resolution map.
The difference in the shape of the pixels is clearly shown. There are 16 rings and 192 pixels for the Healpix scheme, and 13 rings and 220 pixels for the GLESP one.

%=================================================================================================================================

\section{Spherical Harmonics}
\label{alm}
\index{spherical harmonics}

In the following,  the $\hat{ }$ notation will be used to denote the spherical harmonics coefficients of a function.
Any function $f(\theta,\vartheta) \in L_2(S^2)$ on the sphere $S^2$ in $\RR^3$ can be decomposed into spherical harmonics:
\begin{eqnarray}
\label{decomp_alm}
f(\theta,\vartheta)=\sum_{l=0}^{+\infty}\sum_{m=-l}^{l} \hat{f}_{lm}Y_{lm}(\theta,\vartheta) ,
\end{eqnarray}
where  $Y_{lm}$ are the spherical harmonics defined by:
\begin{eqnarray}
\label{def_ylm}
Y_{lm}(\theta,\vartheta)=\sqrt{\frac{2l+1}{4\pi}\frac{(l- \abs{m} )!}{(l+ \abs{m} )!}} P_{lm}(\cos\vartheta)e^{im\theta},
\end{eqnarray}

$P_{lm}$ are the  associated Legendre functions (or polynomials) defined by the following differential equation:
\begin{eqnarray}
\label{def_poly_legendre}
\frac{d}{dt} \left[     (1-t^2)   \frac{d}{dt} P_{lm}  \right]   + \Big( l(l+1) - \frac{m^2}{1-t^2}\Big) P_{lm} = 0  .
\end{eqnarray}

These functions are related to the Legendre polynomials $P_{l}$ by
\begin{eqnarray}
P_{lm}(t)  = (-1)^m (1-t^2)^{m/2}\frac{d^m}{dt^m}P_l(t) ,
\label{def_poly_leg}
\end{eqnarray}
where  $P_l$  is:
\begin{eqnarray}
P_{l}(t)  =\frac{1}{2^l l!}  \frac{d^l}{dt^l} (t^2-1)^l .
\label{def_pl}
\end{eqnarray}

Furthermore, an important property of the Legendre polynomials is that they are orthogonal:
\begin{eqnarray}
\label{ortho_harm_sph}
\sum_{l\in\mathbb{N}} \sum_{|m|\leqslant l} Y^*_{lm}({\boldsymbol \omega}') \ Y_{lm}({\boldsymbol \omega}) = \delta({\boldsymbol \omega}' - {\boldsymbol \omega}) .
\end{eqnarray}
with ${\boldsymbol \omega} = (\theta,\vartheta)$ et ${\boldsymbol \omega}' = (\theta',\vartheta')$

\section{Multiscale methods on the sphere}
\label{intro_multi_sph}

\subsection{Wavelets on the sphere}
\index{wavelet}

Many wavelet transforms on the sphere have been proposed in the past years. Using the lifting scheme \citep{wave:sweldens95a} developed
an orthogonal Haar wavelet transform on any surface, which can be directly applied on the sphere. Its interest is however relatively
limited because of the poor properties of the Haar function and the problems inherent to orthogonal transforms.
More interestingly, many papers have presented new continuous wavelet transforms \citep{wave:antoine99,wave:tenerio99,wave:cayon01,wave:holschneider96}.
These works have been extended to directional wavelet transforms \citep{wave:antoine01,wave:hobson04}. All these continuous wavelet
decompositions are useful for data analysis, but cannot be used for restoration purposes because of the lack of an inverse transform.
\citep{freeden97} and \citep{freeden98} proposed the first redundant wavelet transform, based on the spherical harmonics transform,
which presents an inverse transform. \citep{starck:sta05_2} proposed an invertible isotropic undecimated wavelet transform (UWT)
on the sphere, also based on spherical harmonics, which has the same property as the isotropic undecimated wavelet  transform, i.e.\ the sum of the wavelet scales
reproduces the original image. A similar wavelet construction \citep{marinucci08,fay08a,fay08} used the so-called needlet filters.
\citep{wiaux08} also proposed an algorithm which permits to reconstruct an image from its steerable wavelet transform. Since reconstruction algorithms
are available, these new tools can be used for many applications such as denoising, deconvolution, component separation
\citep{starck:yassir05,bobin-gmca-cmb,delabrouille08} or inpainting \citep{inpainting:abrial06,starck:abrial08}.
\index{needlet}

The \mrs package offers an implementation of an isotropic wavelet transform on the sphere. Its properties are similar to those of the \og{}\`a trous \fg{}
algorithm and therefore should be very useful for data denoising and deconvolution. This algorithm, described in chapter~\ref{ch_mms}, is directly derived
from the FFT-based wavelet transform proposed in \citep{starck:sta94_3} for aperture synthesis image restoration. It is relatively close to the Freeden and
Maier \citep{freeden98} method, except that the reconstruction process is as straightforward as in the \og{}\`a trous \fg{} algorithm (i.e. the sum of the scales
reproduces the original data). This wavelet transform can also be easily extended to a pyramidal wavelet transform, which may be very important for
larger data sets such such as from the Planck experiment.

\subsection{Ridgelets and Curvelets on the sphere}
 \index{ridgelet}
 \index{curvelet}
In this area, further insight will come from the analysis of full-sky data mapped to the sphere thus requiring the development of a curvelet
transform on the sphere. The \mrs package offers an implementation of ridgelet and curvelet transforms for spherical maps. Those implementations
are derived as extensions of the digital ridgelet and curvelet transforms described in \citep{starck:sta01_3}. The implemented undecimated isotropic
wavelet transform on the sphere and the specific geometry of the Healpix sampling grid are important components of the present implementation of
curvelets on the sphere. \\

Further motivation for developing these multiscale methods on the sphere follows from the results obtained in different data processing applications.
As described in chapter~\ref{ch_restore}, the \mrs package provides the necessary tools to experiment with these  spherical multiscale transforms in
denoising applications, for instance using the Combined Filtering Method, which allows us to filter data on the sphere using both the Wavelet and the
Curvelet transforms. The analysis of multichannel data mapped to the sphere, a problem encountered for instance in the processing of WMAP and Planck
observations, is another issue that is shown to benefit from the developed multiscale representations on the sphere. This is reported in chapter~\ref{ch_mrs_ica}
which is dedicated to describing some methods in multichannel data analysis extended to spherical maps which are implemented in the \mrs package.