% OUTLINE:
% * Introduction: a bright comet is coming!
% * Observations: COBS, criteria.
% * Light curve analysis: model, model fitting.
% * Discussion & caveats:
%   - compare surface brightness to stars

\documentclass[RNAAS]{aastex63}

%% Define new commands here
\newcommand\latex{La\TeX}
\graphicspath{{./}{figures/}}
\begin{document}

\title{A Probabilistic Brightness Prediction for Comet C/2019 Y4 (ATLAS)}

\correspondingauthor{Geert Barentsen}
\email{hello@geert.io}

\author[0000-0002-3306-3484]{Geert Barentsen}
\affiliation{Bay Area Environmental Research Institute, P.O. Box 25, Moffett Field, CA 94035, USA}

\keywords{Long period comets}

\section{Introduction} \label{sec:intro}

Several media outlets recently reported that comet C/2019 Y4 may soon provide a spectacular \textit{Great Comet} display.
The object was originally discovered on 2019 Dec 28 at magnitude $V\approx19.5$ \citep{CBET4712}. The comet's brightness increased rapidly thereafter, reaching $V\approx8$ by late March (Fig.~\ref{fig:1}).
The comet is expected to reach peak brightness near its perihelion date on 2020 May 31.
In this research note, we estimate the comet's brightness evolution in a probabilistic way by combining citizen science observations with prior information from previous comets.

\begin{figure}[h!]
\begin{center}
\includegraphics[scale=0.85,angle=0]{2019y4-prediction.pdf}
\caption{Light curve of comet C/2019 Y4. Plusses and crosses show visual and CCD observations from the COBS database. The mean model fit is shown as a thick dashed line. Thin black lines show random MCMC draws to visualize the model uncertainty. The grey hatched area indicates when the comet will be within 20 degrees from the Sun as seen from Earth.\label{fig:1}}
\end{center}
\end{figure}

\section{Observations}

The
\textit{\href{https://cobs.si}{Comet Observation Database}} \citep[COBS;][]{2018JBAA..128..279Z} contains nearly 250,000 brightness estimates of 1285 comets dating back to 1884. The data are predominantly contributed by citizen scientists.
At the time of writing, the database contained 354 observations of C/2019 Y4 contributed by 52 volunteers across 18 countries.
Fig.~\ref{fig:1} shows the subset of 296 good-quality observations that met the selection criteria\footnote{We use observations reported with the COBS method codes S, B, M, I, E, Z, V, or O. Observations flagged as ``poor'' or ``upper limit'' are excluded.} for our analysis.

\section{Light curve analysis}

The canonical method to model the total magnitude $m$ of a comet (integrated across the coma) as a function of the body's geocentric and heliocentric distances ($\Delta$ and $r$) is a power-law formula in the form
\begin{equation}
m = H + 5 \log{\Delta} + 2.5\,n\,\log{r},
\end{equation}
where $H$ is the absolute magnitude, and $n$ is the \textit{activity index} which is a proxy for the rate of dust production as a function of heliocentric distance. The typical value for $n$ is 4 \citep[][]{2001A&G....42a..11G}, but values exceeding $n>8$ have been reported for segments of light curves associated with enhanced activity \citep[e.g.][]{1990acm..proc..327H}.

We use \texttt{\href{https://docs.pymc.io}{PyMC3}} \citep{pymc} to fit the power law model to the observations in a probabilistic way.
We model the residuals using a zero-centered Cauchy distribution with scale parameter $\beta$.
We adopt empirical Gaussian priors $\beta \sim \mathcal{N}(\mu=0.47,\,\sigma=0.02)\,$,
$n \sim \mathcal{N}(3.5,\,1.4)\,$,
and
$H \sim \mathcal{N}(6.7,\,2.0)\,$.
We derived these priors by fitting the same model to the 12 brightest long-period comets available in the COBS database.
Finally, we sample the model posterior using the default Markov Chain Monte Carlo algorithm provided by \texttt{PyMC3}.  We verified that changing the priors does not significantly alter the posterior.

\section{Results}

The model light curve corresponding to the mean posterior parameters is shown as a dashed line in Fig.~\ref{fig:1}.
We find a mean value of $n=4.5\pm0.5$ for the activity index, and $H=5.9\pm0.3$ for the absolute magnitude. This corresponds to a peak brightness $m=-1\pm1$ on 2020 May 31.

\section{Discussion}

Given the current observations and the canonical light curve model, C/2019 Y4 is on track to become the brightest comet since C/2011 W3 (Lovejoy).
We caution the reader for three important caveats however:
\begin{enumerate}
\item The comet will be located very close to the Sun in the sky on 2020 May 31 ($13^o$ elongation). This will severely hinder the comet's visibility.
The observing conditions will be more favorable on or before 2020 May 20 ($24^o$ elongation), but the comet is expected to be much fainter on that date ($m=+1\pm1$).
\item We find that the early observations of the comet prior to mid-March do not fit the canonical model well, suggesting that the activity has decreased over time.
This indicates that the comet's surface may have been covered by a thin layer of volatile materials which have now been depleted. If we exclude the outlier observations recorded prior to 2020 March 15 from the model fit, the expected peak brightness drops significantly to $m=+5\pm1$.
\item Finally, we caution that comets are notoriously difficult to predict.
For example, we cannot exclude the possibility that C/2019 Y4 may break into fragments and brighten dramatically, or conversely, the object may lose its volatiles and fade away more quickly than expected.
\end{enumerate}

%The coma brightness is likely to be spread out across several arcminutes however, likely making the comet look fainter to the eye than a star of a similar brightness.

%In summary, given the current observations and a canonical light curve model, we do not currently expect comet C/2019 Y4 to appear as a \textit{Great Comet}.

The code used in this analysis is available as generic Python package called \texttt{cometcurve} available at \url{github.com/barentsen/cometcurve}. The reader can use this tool to keep track of the comet's evolution.

%The parameter $n$ is able to fit the light curves of many comets in a statistical sense. It is insufficient to capture intricate details in the light curves of comets, which are known to show variability (e.g. cite).

\acknowledgments

The COBS database is the product of the volunteer observers and database maintainers.
The data is available under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
% obs = cc.read_cobs(comet="2019Y4", allowed_methods='all')
% ", ".join(obs.observer_name.value_counts().keys())
Specifically, this analysis depends on observations contributed by
Thomas Lehmann, Artyom Novichonok, Denis Buczynski, Steffen Fritsche, Christian Harder, Carl Hergenrother, Piotr Guzik, Maik Meyer, Maciej Kwinta, Nick James, Alex Scholten, Jerzy Bohusz, Johan Warell, David Swan, Mike Collins, Maciej Reszelski, Gerhard Scheerle, Jacek Powichrowski, Martin Masek, Tomasz Sciezor, Gideon van Buitenen, Sandor Szabo, Timo Karhula, Robin Hegenbarth, Nirmal Paul, Marek Biely, Harri Kiiskinen, Piotr Nowak, Andreas Kammerer, Kevin Hills, Volker Kasten, Marcin Filipek, Walter Kutschera, Pavol Dubovsky, Juan Jose Gonzalez Suarez, Jakub Cerny, Pedro Pérez Corujo, Peter De Schrijver, Kristof Friedrich, Teerasak Thaluang, Uwe Pilz, Adam Tuznik, Jose Pablo Navarro Pina, Mikolaj Sabat, Salvador Aguirre, Vladimir Bespalov, Miroslav Lostak, Seiichi Yoshida, Mariusz Swietnicki, Carlos Labordena, Michael Linnolt, and Tibor Csorgei.

\begin{thebibliography}{}

\bibitem[Green et al.(2001)]{2001A&G....42a..11G} Green, D.~W.~E., Marsden, B.~G., \& Morris, C.~S.\ 2001, Astronomy and Geophysics, 42, 1.11

\bibitem[Green(2019)]{CBET4712} Green, D.~W.~E.\ 2019, Central Bureau Electronic Telegrams 4712

\bibitem[Hughes(1990)]{1990acm..proc..327H} Hughes, D.~W.\ 1990, Asteroids, Comets, Meteors III, 327

\bibitem[Salvatier et al.(2016)]{pymc}
Salvatier, J., Wiecki, T.~V., Fonnesbeck, C.\ 2016, PeerJ Computer Science, 2, e55

\bibitem[Tonry et al.(2018)]{2018PASP..130f4505T} Tonry, J.~L., Denneau, L., Heinze, A.~N., et al.\ 2018, \pasp, 130, 064505

\bibitem[Zakrajsek \& Mikuz(2018)]{2018JBAA..128..279Z} Zakrajsek, J., \& Mikuz, H.\ 2018, Journal of the British Astronomical Association, 128, 279

\end{thebibliography}

\end{document}


% !TEX root = ../zeth-protocol-specification.tex

\chapter{Instantiation of the cryptographic primitives}\label{chap:instantiation}

In this chapter, we start by instantiating the cryptographic building blocks used in previous sections to describe the \zeth~\dapscheme~design. Finally, we proceed by providing security proofs justifying that our instantiation complies with the security requirements listed in previous sections.

Note that, in several cases, it is necessary to specify details in terms of concrete properties of the curve \Curve~and associated scalar field $\FFx{\rCURVE}$. In these cases, we focus on two curves of interest: \BNCurve~and \BLSCurve. We note, however, that other suitable curves could be used.

\BNCurve~\cite{bn-prime} has several properties that make it implementation-friendly. Elements of both the base field and scalar field can be represented in \ethWordLen~bits (the native word size of the \evm), allowing efficient encoding and manipulation of such elements. Moreover, a subset of operations on \BNCurve are supported by the \evm~through precompiled contracts. These precompiled contracts enable verification of signatures (\cref{instantiation:otsig}) and zero-knowledge proofs (\cref{instantiation:zksnark}), required by this protocol, with minimal gas overhead.

\BLSCurve~\cite{bowe18zexe}, like \BNCurve, has the advantage that scalar field elements can be represented within \ethWordLen-bit words (although the same is not true of base field elements). However, the \evm~provides no native support for \BLSCurve, which increases the complexity of the \mixer~implementation (see \cref{zeth-protocol:process-tx}~for details of the operations to be performed). An advantage that \BLSCurve does provide, is that is it the ``inner'' curve of a one-layer chain (as described in \cite{bowe18zexe,housni2020onelayer}). Therefore zero-knowledge proofs using \BLSCurve can be efficiently verified by statements in other zero-knowledge proofs using an approporiate ``outer'' pairing. Support for \BLSCurve in \zeth~therefore admits several applications (no explicitly covered by this document), such as aggregation of proofs over multiple \zeth~transactions (e.g.~\cite{rondelet2020zecale}).

Further details related to implementation and optimization are given in \cref{chap:implementation}.

\input{./chapters/chap03-sec01.tex} % PRFs, COMM and CRHs (may need to be split if we decide to instantiate these with different functions)
\input{./chapters/chap03-sec02.tex} % MKHASH
\input{./chapters/chap03-sec03.tex} % Zeth statement after instantiation
\input{./chapters/chap03-sec04.tex} % OT-SIG
\input{./chapters/chap03-sec05.tex} % Encryption scheme
\input{./chapters/chap03-sec06.tex} % ZkSNARK


\documentclass{article}
\usepackage{amsmath,amssymb,amsthm,fullpage,enumerate,bm,hyperref}
\theoremstyle{definition}
\newtheorem{prop}{Proposition}
\newtheorem{defi}{Definition}
\begin{document}
\section{Shorter proof that $\mathbb{C}^n/L$ is a manifold}
Let us assume that $L$ acts freely and properly discontinuously.

Let $U\subseteq\mathbb{C}^n$ open, then
\[\pi^{-1}(\pi(U))=\bigcup_{\lambda\in L}\lambda+U,\]
So $\pi(U)$ is open. Pick $U$ such that $(\lambda+U)\cap U=\emptyset$ for every $\lambda\neq 0$. Then $\pi:U\to\pi(U)$ is bijective, and therefore a homeomorphism.

Let $x_0+L$ be a point in $\mathbb{C}^n/L$. Take $x_0'\in x_0+L$ and let $U$ be a neighborhood of $x_0'$ making $\pi:U\to\pi(U)$ a homeomorphism.

Let $\mathcal{U}=(\pi(U),\phi)$ be given by $\phi(u)=\pi^{-1}(u)$. Then $\mathcal{U}$ is a coordinate system at $x_0+L$.

Suppose $(\pi(U),\phi)$ and $(\pi(V),\psi)$ are coordinate systems at $[x_0]$ and $[y_0]$ respectively. Then if $\pi(U)\cap\pi(V)\neq\emptyset$ and $a\in\pi(V)\cap\pi(U)$, we get
\[\phi\circ\psi^{-1}(u)=\phi(\pi(u))=u,\]
so the transition maps are holomorphic.

%Let $\hat{U}=\pi^{-1}(\pi(U))$. Then $\hat{U}$ is saturated (follows from bijectivity) and hence
%\[\pi^{-1}(\pi(\hat{U}))=\bigcup_{u\in\hat{U}}u+L.\]
%Let now $\mathbf{f}:\hat{U}\to\mathbb{C}^n$ be defined by
%\[\mathbf{f}(\lambda+x)=x.\]
%This is well-defined because ``freely and properly discontinuously'' implies that the $\lambda+U$ are disjoint.
%
%Let $\phi(\pi(z))=z$
\end{document}


\chapter*{Acronyms}

\begin{table}

NTV & Narrow Tilting Vehicle \medskip \\
DOF & Degree(s) Of Freedom \medskip \\
DTC & Direct Tilt Control \medskip \\
STC & Steering Tilt Control  \medskip \\
SDTC & Steering and Direct Tilt Control  \medskip \\
PID & Proportional Integral Derivative  \medskip \\
LQR & Linear Quadratic Regulator  \medskip \\
\end{table}

\chapter*{Notations}

\begin{longtable}{ll}
$\psi$ & Vehicle yaw angle \medskip \\
$\theta$ & Vehicle tilt angle \medskip \\
$y$ & Lateral vehicle distance from instantaneous center of circular path\medskip \\
$m$ & Mass of the vehicle \medskip \\
$m$ & Mass of the vehicle without wheels \medskip \\
$m_f$ & Mass of each front wheel \medskip \\
$m_r$ & Mass of the rear wheel \medskip \\
$h$ & Height of center of gravity (c.g.) of vehicle from ground \medskip \\
$h_f$ & Height c.g. of front wheels from ground \medskip \\
$h_r$ & Height of c.g. of the rear wheel from ground \medskip \\
$h_o$ & Height of c.g. of vehicle without wheels from ground \medskip \\
$L_f$ & Longitudinal distance from center of gravity to front axle \medskip \\
$L_r$ & Longitudinal distance from center of gravity to rear axle \medskip \\
$L_r$ & Longitudinal distance from c.g. of vehicle to c.g. of vehicle without wheels \medskip \\
$I_x$ & Tilting moment of inertia of the vehicle \medskip \\
$I_z$ & Yaw moment of inertia of the vehicle \medskip \\
$I_z\,o$ & Yaw moment of inertia of the vehicle without wheels\medskip \\
$I_{wheel\:f\:\theta}$ & Tilting inertia of each front wheel about its own axis \medskip \\
$I_{wheel\:f\:rot}$ & Inertia of each front wheel about its rotating axis \medskip \\
$I_{wheel\:f\:\phi}$ & Yaw inertia of each front wheel about its own axis \medskip \\
$I_{wheel\:r\:\theta$ & Tilting inertia of the rear wheel about its own axis \medskip \\
$I_{wheel\:r\:rot}$ & Inertia of the rear wheel about its rotating axis \medskip \\
$I_{wheel\:r\:\phi}$ & Yaw inertia of the rear wheel about its own axis \medskip \\
$R_{wf}$ & Front wheel radius \medskip \\
$R_{wr}$ & Rear wheel radius \medskip \\
$F_z_f$ & Vertical reaction in each front wheel \medskip \\
$F_z_r$ & Vertical reaction in the rear wheel \medskip \\
$C_f$ & Cornering stiffness of each front wheel \medskip \\
$C_r$ & Cornering stiffness of the rear wheel \medskip \\
$\lambda_f$ & Camber stiffness of each front wheel \medskip \\
$\lambda_r$ & Camber stiffness of the rear wheel \medskip \\
$\delta$ & Front wheel steering angle \medskip \\
$\beta$ & Front wheel trail angle \medskip \\
$\gamma$ & Front wheel trail \medskip \\
$\gamma_{pneumatic}$ & Front wheel pneumatic trail \medskip \\
$M_{\delta}$ & Steering torque input from driver \medskip \\
$M_{trail}$ & Camber stiffness of the rear wheel \medskip \\
$M_{t}$ & Tilt torque from actuator \medskip \\
$\alpha_f$ & Slip angle at front wheel \medskip \\
$\alpha_r$ & Slip angle at front wheel \medskip \\

$V_x$ & Longitudinal vehicle velocity \medskip \\
$R$ & Curvature radius of the curve path \medskip \\
$b$ & Width of the vehicle in the base \medskip \\

\end{longtable}


\chapter{Introduction}
\label{chap:intro}

\section{Motivation}

Linear least-squares (\stsc{LS}) regression is, without doubt, the workhorse of
data analysis in social sciences, economics and related fields. The reasons for
the popularity of \stsc{LS} regression are obvious. The procedure convinces by
its formal and practical simplicity. \stsc{LS} regression is easy to implement
from a technical point of view and its results, the estimated regression
coefficients, are easy to interpret. Furthermore, \stsc{LS} regression is easy
to teach because its math is relatively simple and is didactically convenient
because \stsc{LS} solutions for small datasets can easily be computed manually
for purpose of exercise and understanding. From a statistical point of view,
\stsc{LS} regression is favorable because it can be shown that under the
assumption of homoscedastic (i.e., equal-variance) and normally distributed
errors the \stsc{LS} estimator is the best (i.e., most efficient) unbiased
estimator (\stsc{BUE}) for the coefficients of a linear regression model. That
is, among all possible unbiased estimators, the \stsc{LS} estimator has the
smallest sampling variance under these conditions.\footnote{Noting the
equivalence between the \stsc{LS} estimator and the arithmetic mean, the
\stsc{BUE} property of the \stsc{LS} estimator is not much of a surprise given
the fact that Carl Friedrich Gauß derived the normal distribution as a
justification for the arithmetic mean. That is, the normal distribution is
\emph{defined} as the distribution under which the \stsc{LS} procedure leads to
the best unbiased estimator for the expected value (for historical background
see \citealp{huber72}).} Also under relaxed assumption, such as non-normal or
heteroscedastic (i.e., non-equal-variance) errors, the \stsc{LS} estimator is
consistent and has, in many cases, good efficiency
properties.\footnote{Although in the later case, the ordinary \stsc{LS} estimate
of the sampling variance is biased and needs to be adjusted by applying
heteroscedasticity-robust variance estimation; see \citealp{white80}.} For
example, in case of homoscedastic non-normal errors, the \stsc{LS} estimator is
the beast linear unbiased estimator (\stsc{BLUE}), that is, has the smallest
sampling variance among all “linear” unbiased estimators.\footnote{The term
“linear” does not refer to the fact that the coefficients of a linear
regression model are to be estimated. An estimator is said to be \emph{linear}
if it is a linear function of the observations $Y_1,\ldots,Y_n$ of the
dependent variable of the regression model. More precisely,
$\sthat{\boldsymbol\beta}$ is a linear estimator of the regression parameters
vector $\boldsymbol\beta \in {\mathbb R}^p$ if there exists a matrix $\stmat{A}
\in {\mathbb R}^{p \times n}$ such that
$\sthat{\boldsymbol\beta}=\stmat{A}\stvec{Y}$ with
$\stvec{Y}=(Y_1,\ldots,Y_n)^t$.}

The outstanding usefulness of \stsc{LS} regression should not be challenged
here. It is important, however, to realize that \stsc{LS} regression may not
always be the best---or at least not the only---choice for analyzing a given
dataset. The restrictiveness of the conditions under which the \stsc{LS}
estimator is deemed best---homoscedasticity and normality of errors---implies
that situations are possible in which alternative estimators can be valuable.
For example, as mentioned above, if the errors are homoscedastic but
non-normal, the \stsc{LS} estimator may be the best linear unbiased estimator,
but this also means that there can be non-linear estimators that, depending on
the nature of the deviation from normality, substantially outperform the
\stsc{LS} estimator in terms of efficiency.\footnote{The limitation to linear
estimators is not much less restrictive than the limitation to normal errors.}
In particular, in case of distributions with heavy tails, that is, if extreme
values are more frequent than in a normal distribution (an example being the
$t$-distribution with few degrees of freedom), the efficiency of the \stsc{LS}
estimator can quickly become poor. Furthermore, the \stsc{LS} estimator may
yield misleading results if the data are “contaminated” by erroneous
observations or, more generally, by a secondary data-generating process.

\paragraph{Efficiency under alternative error distributions}

Assume, for now, that the data are not contaminated and, more or less, follow a
uniform data-generating process that can be described by a linear regression
model. Why, under such a condition, can a low efficiency of the \stsc{LS}
estimator be a problem? Although the
\stsc{LS} estimator is unbiased, more efficient estimators would be preferable
because the precision of an estimator has a direct effect on the value of the
results. For example, the power of a significance test and, therefore, the
potential of the test to find an existing relation, decisively depends on the
efficiency of the employed estimator.

In the context of error distributions with heavy tails the efficiency argument
can also be motivated as follows. Although the \stsc{LS} estimator is unbiased
on average, there is a good chance for a single sample---and in practice often
only one sample is available---to contain extreme values that bias the
regression results in one or the other direction. Robust regression methods
that are less sensitive to such outliers will typically provide more valid
results in such situations, being closer to the true value of the parameter to
be estimated.

Figure~\ref{fig:outliers-and-fits} shows two examples of data sets that have
been generated according to model
\[
    Y = \beta_0 + \beta_1 X + \epsilon
\]
with $\beta_0 = \beta_1 = 0$ (that is, the “true” regression function is a
horizontal line at $y=0$) and $\epsilon$ following a $t$ (Student) distribution with two
degrees of freedom, that is $\epsilon \sim t_2$. Included as lines are the
estimated regression fits using \stsc{LS} estimation, as well as two robust
estimators (an \stsc{M} estimator and an \stsc{MM} estimator). As is evident,
the \stsc{LS} solution is affected by the outliers and suggests a positive
relation between $X$ and $Y$ in the two examples, whereas the two robust
estimator are relatively stable. Robust methods, so to say, contain a safeguard
against extreme data constellations that can occur at random due to sampling or
a stochastic data-generating process. As a diagnostic by-product, robust
methods inform about whether given data are characterized by an anomalous
constellation or not, because only in the former case the results from
\stsc{LS} and the robust methods will substantially differ.

\begin{figure}[h!]
    \centering
    \epsfig{file=eps/2/1}
    \caption{Example scatter plots with outliers and different regression fits}
    \label{fig:outliers-and-fits}
\end{figure}

\paragraph{Bias due to data contamination}

Now assume that the data are “contaminated”, that is, that the majority of data
points follows a well-defined model, but that there are also some observations
that come from a different distribution. For example, while collecting the
data, coding errors could have occurred for some of the observations. In a
study by \citet{jasso85} on the relation between marital duration and coital
frequency there were four observations with a value of 88 for the monthly
coital frequency. Although such values would not be impossible (as argued by
\citealp{jasso85}), the observations were highly suspicious as no other values
of comparable magnitude existed in the data. As argued by \citet{kahnudry86},
the four observations probably were miscoded missing values, whose designated
value was 99. The problem with such miscoded observations is that they can have
strong effects on the results provided by a \stsc{LS} regression. That is,
regression results and the substantive conclusions drawn from them may differ
depending on whether the miscoded observations are kept in the data or not. It
seems important to use methods for data analysis that are able to identify such
problems because, in the words of \citet[18]{anscombe73}, “[w]e are usually
happier about asserting a regression relation if the relation is still apparent
after a few observations (any ones) have been deleted---that is, we are happier
if the regression relation seems to permeate all the observations and does not
derive largely from one or two.”

Conceptually, contamination can be understood as a situation in which the
observed data are the result of a mixture of two or more data-generating
processes. In the case of coding errors there may be a main process of
substantive interest (e.g., the relation between marital duration and coital
frequency), as well as a secondary process (data miscoding by interviewers)
that leads to observations that follow a different distribution and have a
different interpretation. \stsc{LS} regression will not be able to distinguish
the two processes and its results will be valid for neither one of the
processes. If, however, the data are dominated by one of the processes (that
is, if one of the processes is responsible for the bulk of the data) and the
two processes do lead to distinguishable data structures, statistical
procedures to identify the main process are possible. This is where robust
regression comes in. One of the goals of robust regression techniques is to
provide estimates that are resistant against partial contamination of the data.
Robust methods are supposed to correctly identify the primary relation in the
data even if, for example, parts of the data are glaringly erroneous.

An illustrative example comes from astronomy. Figure~\ref{fig:hrdiagram} shows
the Hertzsprung-Russell diagram of star cluster CYG OB1 (see
\citealt[27]{rousseeuw:leroy:1987}). Displayed is the logarithm of the light
intensity of the stars against the logarithm of their effective surface
temperature (using a reversed axis). Furthermore, the graph shows as lines the results of three
different regression estimators, the \stsc{LS} estimator (solid line), a low
breakdown point \stsc{M} estimator (dashed line), and a high breakdown point
\stsc{MM} estimator (dotted line). The results from the \stsc{LS} estimator and
the low breakdown point \stsc{M} estimator are almost identical. They are
strongly influenced by the group of four stars in the upper right corner of the
diagram. In contrast, the high breakdown point \stsc{MM} estimator completely
ignores the four outliers and adequately captures the trend in the main part of
the data. Hence, at least one of the two employed robust estimators
successfully identified the main process (due to the estimator's high breakdown
point; see below).

\begin{figure}[h!]
    \centering
    \epsfig{file=eps/2/2}
    \caption{Hertzsprung-Russell diagram of the star cluster CYG OB1 including different regression fits (source: \citealp[27]{rousseeuw:leroy:1987})}
    \label{fig:hrdiagram}
\end{figure}

Again, from a diagnostic perspective, the interesting cases are the ones in
which \stsc{LS} regression and robust estimators lead to differing results.
Substantial differences between robust regression and the \stsc{LS} estimator
indicate that the data cannot be fully descried by a uniform model and that a
part of the observations stands in stark contrast to the main trend in the
data. With the help of the residuals from robust regression, the atypical
observations can be identified and, for example, be subjected to a separate
analysis. In this way, robust regression can contribute to a better
understanding of the data and, potentially, give way to new insights and new
hypotheses. In fact, according to \citet[1]{kruskal60}, the atypical
observations may prove to be the most interesting part of the data: “An
apparently wild (or otherwise anomalous) observation is a signal that says:
`Here is something from which we may learn a lesson, perhaps of a kind not
anticipated beforehand, and perhaps more important than the main object of the
study.'” The four outliers in figure~\ref{fig:hrdiagram}, by the way, are not
errors. The explanation is that there are two different types of stars:
main-sequence stars and giants. That is, conceptually, the observation stem
from two different populations.

\paragraph{Goals and use of robust regression}

To summarize, we can state that robust regression estimators (1) should achieve
good efficiency also in case of non-normal errors and (2) should be resistant
against contamination of the data by outliers. The maximum proportion of
contamination a robust estimator is able to absorb is called the
\emph{breakdown point}.

Both aspects can be formalized with the help of the viewpoint coined by
\citet{huber64} that observed data follow a mixture distribution
\[
    F_\varepsilon = (1 - \varepsilon) F_{\boldsymbol\theta} + \varepsilon G
\]
where $F_{\boldsymbol\theta}$ is the distribution of interest according to the
supposed model, $G$ is an arbitrary alternative distribution, and $\varepsilon
\in [0,1]$ determines the mixing proportion. For example, in line with the
assumptions of classic linear regression, $F_{\boldsymbol\theta}$ could be a
distribution according to the linear model
\[
    Y = \beta_0 + \beta_1 X + \epsilon
\]
where $X$ has a given distribution and $\epsilon$ is an independent and
identically normally distributed error term. The distribution of the observed
data, however, is contaminated by observations from an unspecified alternative
distribution $G$ and does not fully follow this model. The goal of robust
regression now is to deliver reasonable results for $F_{\boldsymbol\theta}$
even if the model is somewhat misspecified, that is, if $\varepsilon>0$. In the
words of \citet[7]{heritier.etal.09}, robust methods are “a set of statistical
tools for correct estimation and inference about $F_{\boldsymbol\theta}$ when the
data-generating process is $F_\varepsilon$, not only when $\varepsilon=0$, as
with classical methods, but also for relatively small $\varepsilon$ and
\emph{any} $G$. As a by-product, data not fitting $F_{\boldsymbol\theta}$ exactly can be
easily identified, and the model can possibly be changed and refitted". In
addition, to be of diagnostic value, robust estimators should be serious
competitors of classic methods in case of $\varepsilon=0$. In particular,
robust estimators should achieve good “gaussian efficiency”, that is, they
should achieve a high relative efficiency compared to \stsc{LS} estimation in
the ideal case of normally distributed errors.\footnote{Note that the
estimation of “robust standard errors” is not the primary concern of robust
regression. The term “robust standard errors” refers to estimators for the
sampling variances of the coefficient estimates that are consistent also if the
assumption of identically distributed errors is violated (i.e., if the errors
are heteroscedastic; see \citealp{white80}). To prevent false conclusions with
respect to confidence intervals and significance tests, it is always a good
idea to consider “robust standard errors”, be it with classic regression or
with robust regression.}

Yet, robust regression should be seen as a complement and not so much as a
substitute to \stsc{LS} regression. In our view, the main use of robust
regression lies in its diagnostic potential. Classic regression techniques may
lead to meaningful results in many situations, but a comparison to robust
results is always advisable. Before drawing far-reaching conclusions based on
classic methods one should evaluate whether the conclusions are “robust”, that
is, whether methods that rely on less restrictive assumptions and are less
affected by outliers and atypical data constellations come to the same
conclusions.

If classic procedures and robust regression lead to substantially diverging or
even contradicting results, the robust results can provide an immediate
contribution to a better understanding of the data. As a by-product of robust
estimation, observations that do not fit the supposed model can easily be
identified, offering clues about possible misspecification, the nature of
outliers, and alternative data-generating processes. Compared to classic
regression diagnostics for the identification of influential observations (see
\citealp{belsley80,cookweisberg82,Chatterjee88,fox91}) robust regression
methods have the advantage that they can also identify “masked” multiple
outliers that would go undetected by classic diagnostics. However, robust
techniques are no panacea and cannot, for example, fully replace diagnostic
methods that are concerned with the identification of structural
misspecification (such as omitted variable bias, wrong functional form, or
missing interaction terms).

\alert{
[Should there also be some text giving a brief historical account of the development
of robust statistics and robust regression?]
}

\section{What is covered in this book?}

\alert{
\dots
}

\section{Robust statistics in Stata}

\alert{
\begin{itemize}
    \item
    Summary of existing tools
    \item
    Brief presentation of our new packages; basic usage and syntax
\end{itemize}
}

\endinput


\documentclass[preprint]{sigplanconf}

\usepackage{graphicx}
\usepackage{comment}
\usepackage{amsmath}
\usepackage{xspace}
\usepackage{amssymb}
\usepackage{stmaryrd}
\usepackage{proof}
\usepackage{multicol}
\usepackage[nodayofweek]{datetime}
\usepackage{etex}
\usepackage[all, cmtip]{xy}
\usepackage{xcolor}
\usepackage{listings}
\usepackage{multicol}
\newcommand\hmmax{0} % default \newcommand\bmmax{0} % default 4
\usepackage{bm}
\usepackage{cmll}

\newcommand{\vecspace}[1]{\mathbb{V}_{#1}}
\renewcommand{\vec}[2]{\begin{bmatrix} #1 \\ #2 \end{bmatrix}}
\newcommand{\Fpx}[1]{\mathbb{F}_{#1}}
\newcommand{\modulusp}[1]{\left | #1 \right |}
\newcommand{\fname}[1]{\ulcorner #1 \urcorner}
\newcommand{\fconame}[1]{\llcorner #1 \lrcorner}

\newcommand{\xcomment}[2]{\textbf{#1:~\textsl{#2}}}
\newcommand{\amr}[1]{\xcomment{Amr}{#1}}
\newcommand{\roshan}[1]{\xcomment{Roshan}{#1}}
\newcommand{\jacques}[1]{\xcomment{Jacques}{#1}}

\newcommand{\asterix}[0]{*}

\newcommand{\ie}{\textit{i.e.}\xspace}
\newcommand{\eg}{\textit{e.g.}\xspace}

\newcommand{\lcal}{\ensuremath{\lambda}-calculus\xspace}
\newcommand{\G}{\ensuremath{\mathcal{G}}\xspace}

\newcommand{\code}[1]{\lstinline[basicstyle=\small]{#1}\xspace}
\newcommand{\name}[1]{\code{#1}}

\def\newblock{}

\newenvironment{floatrule}
    {\hrule width \hsize height .33pt \vspace{.5pc}}
    {\par\addvspace{.5pc}}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{proposition}[theorem]{Proposition}
\newenvironment{proof}[1][Proof.]{\begin{trivlist}\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}

\newcommand{\arrow}[1]{\mathtt{#1}}

\newcommand{\dgm}[2][0.95]{
\begin{center}
\scalebox{#1}{
\includegraphics{diagrams/#2.pdf}
}
\end{center}
}

%subcode-inline{bnf-inline} name langRev
%! swap+ = \mathit{swap}^+
%! swap* = \mathit{swap}^*
%! dagger =  ^{\dagger}
%! assocl+ = \mathit{assocl}^+
%! assocr+ = \mathit{assocr}^+
%! assocl* = \mathit{assocl}^*
%! assocr* = \mathit{assocr}^*
%! identr* = \mathit{uniti}
%! identl* = \mathit{unite}
%! dist = \mathit{distrib}
%! factor = \mathit{factor}
%! eta = \eta
%! eps = \epsilon
%! eta+ = \eta^+
%! eps+ = \epsilon^+
%! eta* = \eta^{\times}
%! eps* = \epsilon^{\times}
%! trace+ = trace^+
%! trace* = trace^{\times}
%! (o) = \circ
%! (;) = \fatsemi
%! (*) = \times
%! (+) = +
%! LeftP = L^+
%! RightP = R^+
%! LeftT = L^{\times}
%! RightT = R^{\times}
%! alpha = \alpha
%! bool = \textit{bool}
%! color = \textit{color}
%! Gr = G

%subcode-inline{bnf-inline} regex \{\{(((\}[^\}])|[^\}])*)\}\} name main include langRev
%! Gx = \Gamma^{\times}
%! G = \Gamma
%! [] = \Box
%! |-->* = \mapsto^{\asterix}
%! |-->> = \mapsto_{\ggg}
%! |--> = \mapsto
%! <--| = \mapsfrom
%! |- = \vdash
%! <><> = \approx
%! ==> = \Longrightarrow
%! <== = \Longleftarrow
%! <=> = \Longleftrightarrow
%! <-> = \leftrightarrow
%! ~> = \leadsto
%! -o+ = \multimap^{+}
%! -o* = \multimap^{\times}
%! -o = \multimap
%! ::= = &::=&
%! /= = \neq
%! @@ = \mu
%! [^ = \lceil
%! ^] = \rceil
%! {| = \{
%! |} = \}
%! bot = \bot
%! bot1 = \bot_1
%! dots = \ldots
%! ^^^ = ^{\dagger}
%! elem = \in
%! forall = \forall
%! exists = \exists
%! empty = \epsilon
%! Pi = \Pi
%! Pi0 = \Pi^{o}
%! PiEE* = \Pi^{\eta\epsilon}_{*}
%! PiEE+ = \Pi^{\eta\epsilon}_{+}
%! PiEE = \Pi^{\eta\epsilon}
%! CatSet = \textbf{Set}
%! theseus = Theseus
%! sqrt(x) = \sqrt{#x}
%! surd(p,x) = \sqrt[#p]{#x}
%! inv(x) = \frac{1}{#x}
%! frac(x,y) = \frac{#x}{#y}
%! * = \times

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

\conferenceinfo{ICFP'13}{}
\CopyrightYear{}
\copyrightdata{}
\titlebanner{}
\preprintfooter{}

\title{Negative and Fractional Types}

\authorinfo{Roshan P. James}
           {Indiana University}
           {rpjames@indiana.edu}
\authorinfo{Zachary Sparks}
           {Indiana University}
           {zasparks@indiana.edu}
\authorinfo{Jacques Carette}
           {McMaster University}
           {carette@mcmaster.ca}
\authorinfo{Amr Sabry}
           {Indiana University}
           {sabry@indiana.edu}

\maketitle

\begin{abstract}

\end{abstract}

\category{D.3.1}{Formal Definitions and Theory}{}
\category{F.3.2}{Semantics of Programming Languages}{}
\category{F.3.3}{Studies of Program Constructs}{Type structure}

\terms
Languages, Theory

\keywords

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}

\nocite{infeffects}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Terms, Types, and Equalities}

There are two ways to read types and Curry-Howard:
\begin{enumerate}
\item One first concentrates on the \emph{types}, as propositions.  We can
  come up with a ``type system'' which reflects a logic.  Then, as a second
  step, choose the proofs which inhabit these types/propositions, and call
  these proofs \emph{terms}.
\item Alternatively, one first concentrates on the \emph{terms}, focusing on
  their operational semantics as primary.  Then, as a second step, one
  designs a ``type system'' to classify the terms, so as to be able to prove
  progress and preservations theorems, to ensure that well-typed terms
  ``don't go wrong''.
\end{enumerate}

Under the first interpretation, coming up with an operational interpretation
of the terms can be challenging: witness the ongoing effort to understand
aspects of classical logic as a type system for a (programming) calculus.
Similarly, various modal logics as well as linear logic are still being given
different interpretations as type systems for calculi, to different degrees
of effectiveness.

The second interpretation is not straightforward either.  The definition of
``doing wrong'' frequently gets expanded to covering effects, permissions,
memory access, and so forth, which can seriously affect the decidability
properties of the type system (not to mention efficiency when decidability is
not an issue).

Even in the first interpretation, the understanding is that terms represent
\emph{values}, which are irreducible terms (proof terms reduce principally
via cut elimination, but there are other reduction rules for projections,
etc).

We wish to shift the focus and consider \emph{equivalences} as our types.
This will mean, under the first interpretation, that our terms will be
witnesses for these equivalences.  The underlying reason is that we wish to
examine \emph{reversible computation}.  From an information-theoretic point
of view, this means that information \emph{must be preserved}, although it
can certainly be rearranged in many different ways.

In other words, we wish to regard types with shape $T_1\equiv T_2$, where
$T_1$ and $T_2$ are usual value-types.  In fact, we want more: we wish to
regard these as \emph{oriented}: the eventual operational interpretation will
regard equivalence witnesses as \emph{inducing} a transformation from values
of types $T_1$ to values of type $T_2$.  Of course, as these are
equivalences, there will always be a term which inhabits $T_2\equiv T_1$
whenever there is one inhabiting $T_1 \equiv T_2$.  This will be clearly
visible when we give rules for terms, as these will always be symmetric (and
will provably induce invertible transformations).

So we start with a type theory $\mathcal{T}$, and move to another type theory
whose only shape is $T_1\equiv T_2$.  The constants of this new type theory
(denoted $\mathcal{T}^{\equiv}$) will be proofs of type equivalences of the
original theory.  Note that this is a very general set-up: given any
equational theory, we can ``reify'' the axioms as constants.  [Insert the
example of doing this for Monoid here].  If some of the constructors of
$\mathcal{T}$ respect equivalences, then this induces combinators on
$\mathcal{T}^{\equiv}$; the rules of equivalences (reflexivity, transitivity,
symmetry) induce more.

Note that it is very important that the theories be equational: the only
thing we can talk about are total equivalences.  One of the most natural
theory to consider, at least in the usual setting of type theories
$\mathcal{T}$ with sums and products, is that of \emph{semirings} (sometimes
jokingly called \emph{rigs}), as the rules of semirings turns out to exactly
reflect the judgments of such a type theory.

What happens in equational theories is that we declare a number of values to
be \emph{equal}.  Moving to the categorical setting, we are no longer
interested in equalities, but just equivalences.  In equational theories, the
equality witnesses are not particularly interesting, as they have no
computational content -- if $a = b$, there is no way we can distinguish $a$
and $b$, whereas if we only have $a \equiv b$, that may not be the case.
[The difference is that between syntax and semantics, where we have
equivalences on the syntax which reflect equilities in the semantics.  In
other words, plus(one,one) and two are easily distinguished, but 1+1 and 2
are not.]

Furthermore, we can use these equivalences in an effective way: we can create
a (total!) function $ev : T_1 \equiv T_2 \rightarrow T_1 \rightarrow T_2$.
In other words, given a proof of an equivalence between terms, and a value of
the first type, we can get a value of the second type.

It is important to understand that $ev$ \emph{mixes} two levels: that of
(proofs of) equivalence and that of values.  $ev$ is an \emph{induced
  action}.

One further remark: our language of equivalences is actually a \emph{free}
theory.  There are absolutely no equalities (or equivalences) given between
its terms.  Of course, some of its terms are ``observationally equivalent'',
in the sense that $ev$ will not be able to witness any difference.
Nevertheless, we will not regard such terms as equal.

What needs to be shown then is the relationship between the equational theory
of semirings and the first-order type theory with sums and products.

Then we can investigate how adding further axioms to our equational theory
(and corresponding witnesses to our type theory) changes things.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The Core Reversible Language: {{Pi}} }
\label{sec:pi}

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

\acks We thank Michael Adams, Will Byrd, Lindsey Kuper, and Yin Wang for
helpful comments and questions. This project is supported by NSF grant
1217454 on ``Information Effects.'' Initial stages of the research were
partially funded by Indiana University's Office of the Vice President for
Research and the Office of the Vice Provost for Research through its Faculty
Research Support Program.  We also acknowledge support from Indiana
University's Institute for Advanced Study.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{small}
\bibliographystyle{abbrvnat}
\bibliography{cites}
\end{small}

\end{document}

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


\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{todonotes}

\title{\bf{Laboratory Project Two: Calibration of an Orifice Meter}}
\author{Jon Langston \& Nicholas Malaya \& Owen O'Neal \\ Department of Mechanical Engineering \\ University of Texas at Austin} \date{}

\begin{document}
\maketitle
\date{}
\newpage
\section{Presentation of Calibration Data}

\textbf{A calibration of the $C_d$ vs $Re$ and comment on whether your
results were as expected.}

We have adjusted the sample rates down  300 samples at a rate of 100
Hz. The results are shown in Figure
\ref{oriface-time}, below. The samples appear to still be correlated in
time.

\begin{figure}[!htb]
  \begin{center}
    \includegraphics[width = 12 cm]{figs/oriface_time.png}
    \caption{Example raw time series data from a single orifice meter
      run. The calculated mean of the signal is shown in black, along with
      the two $\sigma$ (standard deviation) confidence interval in
      red.}
    \label{oriface-time}
  \end{center}
\end{figure}

Let's go deeper, and look at the samples over a shorter period of time. Instead of the full 3
second sampling time, we examine just 0.4 seconds. The result of this is shown in \ref{oriface-time-4}.
From this perspective, it appears we are still indeed oversampling, as at least subsequent points
tend to be correlated with each other.

\begin{figure}[!htb]
  \begin{center}
    \includegraphics[width = 12 cm]{figs/oriface_time_04.png}
    \caption{Example raw time series data from a single orifice meter
      run, plotted over a shorter time period.}
    \label{oriface-time-4}
  \end{center}
\end{figure}

Examining the probability distribution functions in Figure \ref{oriface-hist},
we can see that while the results are clearly better than the other lab, where we used 1000 Hz and 1000 samples.
However, while these results are closer to that of a gaussian,
they are still not normally distributed. In other words, we still have not found an ideal data sampling rate
for the pressure transducer.

  \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/oriface_hist.png}
    \caption{Histogram depicting the frequency of voltages in our
    signal. This was generated with fifty bins, but the results did not
    appear to be sensitive to the number selected.}
    \label{oriface-hist}
   \end{center}
  \end{figure}

We proceed with our calculations of the quantities of interest. We
intend to plot $C_d$ as a function of Reynolds number. We have not made
a direct measurement of either quantity, and must calculate them as
surrogate quantities from our data.

The Reynolds number is defined as,
\begin{equation}
 \text{Re} = \frac{UL}{\nu}.
\end{equation}

The kinematic viscosity ($\nu$) and the orifice diameter ($L$) are
given. We can calculate the bulk fluid velocity ($U$) from our knowledge
of the flow rate and the system dimensions,
\begin{equation}
 U = \frac{Q}{A} = \frac{Q}{\pi r^2} = \frac{Q}{\pi d^2/4}.
\end{equation}
The Reynolds number is therefore calculated as,
\begin{equation}
 Re = \frac{Q L}{\pi \nu d^2/4}.
\end{equation}

Turning our attention to the calibration coefficient, Equation (9.2)
from page 211 in Stavros' text describes a relation for
the flow rate as a function of the pressure drop,
\begin{equation*}
 Q = C_d \frac{\pi d^2 / 4}{\sqrt{1-(d/D)^4}}\sqrt{\frac{2 \Delta p}{\rho}}.
\end{equation*}
This can be manipulated to provide an equation for $C_d$ as,
\begin{equation}
 C_d = \frac{Q (1-\beta^4)^{1/2}}{\pi d^2/4} \left(\frac{\rho}{2 \Delta
					      P}\right)^{1/2}.
\end{equation}

The results of $C_d$ vs. Re are plotted in Figure \ref{orif}. We can see a general trend of increasing
values of $C_d$ as a function of $Re$, followed by the curve ``flattening out''. For flow in a duct,
the transition between laminar and turbulent flow occurs around a few thousand Re, so the vast majority
of our data lies in the turbulent regime. Our expectation is that the $C_d$ becomes independent of Re at high
(e.g. turbulent) Re, and the data appears to be consistent with this. The value of $C_d$ asymptotes to a value near 0.6, which is roughly in line with values we found in the literature for these aspect ratios ($\beta$ values).

  \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/cd_v_re_zero_axis.jpg}
    \caption{A plot of $C_d$ as a function of Reynolds Number. Only the first point is likely to be
outside of the fully developed turbulence regime. }
    \label{orif}
   \end{center}
  \end{figure}

  \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/cd_v_re.jpg}
    \caption{A plot of $C_d$ as a function of Reynolds Number. This plot is zoomed into the region of the data,
    to make the difference between points more pronounced.}
    \label{orif}
   \end{center}
  \end{figure}

The first data point, as previously mentioned, appears to be anomalously low. The value of this point is
still high enough ($\approx 5000$) that we would expect it to be turbulent. However, it is possibly close enough
to the transition that it is not yet fully developed. A zoomed in version of this plot is shown
in figure \ref{oriface-time-4}.

\subsection{Checking the Zero Setting}

Before beginning data collection, the pressure transducers were both recorded at zero
flow in order to ensure zero pressure measurement.  The constants for the intercepts
of the given calibrations were adjusted so that the transducers output zero pressure
drop when disconnected from the laminar flow element (transducer A) and orifice meter
(transducer B).  The intercept constant for transducer A was changed from -1.075 inH2O
to -1.06 inH2O; for transducer B, from -1.026 inH2O to -1.00 inH2O.  As the LabVIEW
Virtual Instrument limited these calibration constants to the hundredths place,
these options provided zero pressure drop within $\pm .005$ inH2O.

In order to further ensure accuracy of the given transducer calibrations, each transducer
was separately coupled to a micro-manometer and measurements were taken at the selected
pressures of 1 and 2 inH2O.  Transducer A output readings of 0.9919 and 1.9920 inH2O,
respectively, while B output readings of 0.9842 and 1.9716 inH2O, respectively.
Considering the uncertainty associated with setting the manometer at the desired
pressure, these results corroborate the stated accuracy of the transducer calibrations.

\subsection{Repeatibility of the Measurements}

We attempted to control for several factors to enhance repeatability of the experiment.
We observed a large transient period  between adjusting the voltage and the measured
pressure drop. It is our expectation that the blower had a long equilibration time
before reaching a statistically steady state. Small fluctuations in voltage, on
the order of 0.01-0.02 volts, which persisted after the blower reached
quasi-steady state can be attributed to variations in velocity associated with turbulent flow.

We have qualitatively assessed the repeatability of measurements in this case by gathering
a second set of statistics. This was conducted with the same practitioners at the same time
of day, after the first set of experimental data had been saved. The air blower was
turned off and the zero-flow measurements were checked; once again, both transducers
output $\pm0.005$ inH2O of a zero reading.  The data were not gathered at precisely
the same pressure drop locations, making direct comparison between data gathering
series impossible. However, the results from both series, when plotted
against each other clearly exhibit the same trend to within a small margin.

  \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/Q_dP_fits.jpg}
    \caption{A plot of repeatability of the experiment. }
    \label{orif-zoom}
   \end{center}
  \end{figure}

\newpage
\section{Uncertainty Analysis}

\textbf{Uncertainty of flow rate measured using the orifice meter with
your calibration.}

Taking the differences in pressure measured across the laminar flow element and orifice meter,
we can calculate the discharge coefficient using the equations below. The average discharge coefficient
calculated from our pressure measurements was nominally 0.615 across both series.

\begin{equation}
  C_d = \frac{Q_{\text{LFE}} }{A_0} * (1-\beta^4)^{1/2} * \left(\frac{\rho}{\Delta P_{\text{trans}}}\right)^{1/2}
\end{equation}
where,
\begin{equation}
  Q_{\text{LFE}} = 20.5 \Delta P_{\text{LFE}} * \frac{\mu(21 C)}{\mu(\text{actual})}
\end{equation}

The uncertainty in the discharge coefficient, $U_{C_d}$, has contributions from the uncertainties in
the flow rate, $U_Q$, measured from the laminar flow element and the change in pressure, $U_{\Delta P}$,
measured from the pressure transducer. We can neglect uncertainties in the area of the orifice, $A_o$,
and the ratio of diameters from the pipe and orifice meter, $\beta$, because they are taken into account
when calibrating $C_d$ as a correction factor. Changes in the density of air, $\rho$, are neglected because our
reynolds number while turbulent should remain well below Mach 0.3.

Neglecting uncertainties in $A_o$, $\beta$, and $\rho$, the percent error for $C_d$ can be expressed as:
\begin{equation}
  \frac{U_{C_d}}{C_d} = \sqrt{ \left(\frac{U_{Q}}{Q}\right)^2 + \left( 0.5 \frac{U_{C_d}}{C_d} \right)^2}
\end{equation}

For the subsequent calculations, we assume $U_Q$ and $U_{\Delta P}$ are bias uncertainties and cannot be
made more accurate by taking multiple measurements. Taking the specifications given in the lab
guidelines, $U_{\Delta P}$ is assumed to be a constant 0.002 in. H20. $U_Q$ is a piecewise function equal to
0.2\%*RDG from $10-100\%$ FS and 0.02\%*FS below 10\% FS. Full scale for the laminar flow element is 160
CFM, so the measurements at 5, 10, and 15 CFM use this latter value for uncertainty.

Results:
\begin{itemize}
\item Series 1: $\frac{U_{C_d}}{C_d} = 0.066$ @ 5 CFM and 0.0021 @ 50 CFM
\item Series 2: $\frac{U_{C_d}}{C_d} = 0.076$ @ 5 CFM and 0.0021 @ 50 CFM
\end{itemize}

  \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/PercentUncertaintyCdVsQ_Series1.jpg}
    \caption{The uncertainty quantification for discharge coefficient, $C_d$ for the first series of measurements.}
    \label{orif-s1}
   \end{center}
  \end{figure}

  \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/PercentUncertaintyCdVsQ_Series2.jpg}
    \caption{The uncertainty quantification for discharge coefficient, $C_d$ for the second series of measurements.}
    \label{orif-s2}
   \end{center}
  \end{figure}

Both series of measurements showed the percent error of Cd decreasing exponentially as flow
rate increased. Upon examination of our sources of error this makes sense. At low flow rates, i.e. Q < 15
CFM, we need to detect a smaller change in pressure. The constant uncertainty of 0.002 in H20 for our
pressure transducer is a much greater percentage of the pressure readings at these low flow rates. The
change in pressure increases non-linearly as flow rate increases, and so at high CFMs the percent error is
not as significant.

Having calibrated the orifice meter by determining the best obtainable value for $C_d$, we can
calculate the uncertainty of subsequent measurements of flow rate, $Q_{\text{orifice}}$, using this device.

\begin{equation}
  Q_{\text{orifice}} = \frac{C_d * A_0}{(1-\beta^4)^{1/2}} \left(\frac{2 \Delta P_{\text{trans}}}{\rho}\right)^{1/2}
\end{equation}

Neglecting uncertainties in $A_o$, $\beta$, and $\rho$, the percent error for $Q_{\text{orifice}}$
can be expressed using the equation below. Uncertainties for Q were calculated
assuming a best and worst case scenario: where $U_{\Delta P}$ is a precision
 and bias uncertainty, respectively.

\begin{equation}
  \frac{U_{Q}}{Q} = \sqrt{ \left(\frac{U_{C_d}}{C_d}\right)^2 + \left( 0.5 \frac{U_{\Delta P}}{\Delta P} \right)^2}
\end{equation}

Results:
\begin{itemize}
\item Series 1: Worst: $\frac{U_Q}{Q} = 0.093$ @ 5CFM and 0.0023 @ 50 CFM
\item Series 1: Best:  $\frac{U_Q}{Q} = 0.066$ @ 5CFM and 0.00084 @ 50 CFM
\item Series 2: Worst: $\frac{U_Q}{Q} = 0.11$ @ 5CFM and 0.0023 @ 50 CFM
\item Series 2: Best:  $\frac{U_Q}{Q} = 0.076$ @ 5CFM and 0.00084 @ 50 CFM
\end{itemize}

These results show a similar trend as the uncertainty of the discharge coefficient, decreasing
exponentially as flow rate increases. For flow rates above 20 CFM, both series predict an uncertainty
well below 1\% of the flow rate measurement from the orifice meter.

  \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/PercentUncertaintyQVsQ_Series1.jpg}
    \caption{The uncertainty quantification for flow rate, $Q$ for the first series of measurements.}
    \label{orif-s1}
   \end{center}
  \end{figure}

  \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/PercentUncertaintyQVsQ_Series2.jpg}
    \caption{The uncertainty quantification for flow rate, $Q$ for the second series of measurements.}
    \label{orif-s2}
   \end{center}
  \end{figure}

%
%
%
\end{document}

% LocalWords:  reynolds H20 piecewise RDG yar


\subsection{The dual problem for non-linear optimisation}


\chapter{Evaluation}\label{evaluation}

In this chapter, we will evaluate our proposed planning model based on deep reinforcement learning built upon Transformer \ref{transformer} architecture utilizing Graph Attention Network \ref{graph-attention-network} and benchmark the performance against constructive heuristics and metaheuristics.

\section{Dataset}
The dataset used for training and evaluation was generated on the fly via a uniform probability distribution within a given range. The reason we decided to generate the data is that learning reinforcement policy requires a large amount of training data. Since it learns by interacting with the environment, we do not need labeled datasets and generating them seems as the best approach. Nevertheless, in further work, the model will require other kinds of distribution to simulate a real-world demand.

In real-world routing applications, the geographic coordinate system is typically used for specifying locations. However, our proposed model requires locations between $[0, 1]$ to achieve model convergence. The locations of depots and delivery nodes were generated via uniform distribution within a range of $[0, 1] \times [0, 1]$.

The data for the demand capacity of a delivery node is a discrete number $\{1, \cdots, 9\}$ chosen uniformly at random with assumption that the depot has a demand capacity of zero.

Lastly, each location has assigned time windows that work as a soft constraint at which time a vehicle is supposed to visit the node. We generate different lengths of time windows based on the problem size (20, 50, 100). For the problem size of 20 nodes, the time window value occurs in a range of $\{0, \cdots, 10\}$ with the condition that the length of the time window is less than four. The problem size of 50 nodes has the upper bound set to 20 with a maximal length of 6 and the case of 100 nodes, the upper bound is 40 and the maximal window length is 9. Similarly, the start and end of a time window are generated with uniform distribution.

\section{Sample Solutions}
To better imagine the complexity and variability of solving \gls{vrptw}, in Figure \ref{fig:sample-20} and \ref{fig:sample-50} we illustrate a random solution predicted by our proposed deep learning model. On the left, we visualize the customer's time windows using Gantt diagram and on the right are shown the routes for each vehicle. Each color represents a vehicle which servers the customers represented by a node with a generated time window.

\begin{figure}[ht]
    \centering
    \includegraphics[width=1.0\textwidth]{resources/evaluation/sample-20.png}
    \caption{Sample solution of random \gls{vrptw} instance for problem size 20.}
    \label{fig:sample-20}
\end{figure}

The \gls{ai} model has to optimize the route path with focus to minimize the travelled distance, but simultaneously early and late arrivals should be avoided. Our model is able to solve \gls{vrptw} instance considers both distance and time window constrains. The windows are soft constrained, which results in a much larger combinatorial space of possible solutions than considering just hard constrained time windows. As illustrated on Figure \ref{fig:sample-50} the model sometimes sacrifices the time of a served customer in order to optimize the route distance and vice versa.

\begin{figure}[ht]
    \centering
    \includegraphics[width=1.0\textwidth]{resources/evaluation/sample-50.png}
    \caption{Sample solution of random \gls{vrptw} instance for problem size 50.}
    \label{fig:sample-50}
\end{figure}

The model has successfully learned the policy how to pick the next node to visit, the time windows are almost cascadingly sorted, and the routes are suboptimally optimized based on distance. However, it is clearly not an optimal solution, but it proves that the problem of vehicle routing with soft constrained time windows is possible to be solved with \gls{ml} and the research is on the right path to outperform regular metaheuristics. In the section \ref{benchmarking} we compare the model with our implemented constructive heuristics and metaheuristics

\section{Experiments}
\subsection{Time Windows}
The main goal of this thesis was to integrate the soft constraint of time windows to \gls{vrp} model introduced by Kool et al.\cite{attention-route}. The model is extended by our proposed cost function \ref{vrptw-cost} that penalizes early and late arrivals. The early arrival is not as crucial as delayed visit, so we have decided that the penalty for early arrival is always less than late visit $p_e < p_l$.

\begin{figure}[ht]
    \centering
    \includegraphics[width=1.0\textwidth]{resources/evaluation/tw-problem.png}
    \caption{Low penalty for early visit of node results in poor performance.}
    \label{fig:tw-problem}
\end{figure}

Finding a proper penalty values $p_e$ and $p_l$ for time windows is one of the most important steps because an incorrect penalty highly influences the model in choosing the next node to visit.

The Figure \ref{fig:tw-problem} illustrates how the performance is degraded by choosing an incorrect penalty value for early arrival $p_e$. If the early penalty is too low, the model will strictly focus on minimizing the late arrival and Gantt diagram of time windows looks like a plan for just a single vehicle.

We have empirically tested various kinds of penalties and updated them based on our observations. After the experiments, we have chosen $p_e = 0,25$ and $p_l  = 0,5$ which resulted in predicting a feasible plans with properly distributed time windows across the vehicles as shown in Figure \ref{fig:nice-tw}.

\begin{figure}[ht]
    \centering
    \includegraphics[width=1.0\textwidth]{resources/evaluation/sample-50.png}
    \caption{Properly distributed time windows across the vehicles.}
    \label{fig:nice-tw}
\end{figure}

\subsection{Balancing Plans}
In real-world solution of \gls{vrp}, we aim to balance the number of served customers across vehicles. It means the number of nodes in a given route is supposed to be uniformly distributed across all routes. However, we have noticed that the model was constantly adding additional routes of size one as illustrated on Figure \ref{fig:unbalanced}.

\begin{figure}[ht]
    \centering
    \includegraphics[width=1.0\textwidth]{resources/evaluation/unbalanced-plan.png}
    \caption{Unbalanced delivery plans.}
    \label{fig:unbalanced}
\end{figure}

Therefore, we have decided to penalize the delivery plans that are not balanced by including an unbalance penalty. We calculate the standard deviation of plans with the objective to be minimized using our cost function. This approach helped in creating balanced delivery plans.

\subsection{Generalization}
A great downside of this proposed model is its sensitivity to data input, which results in poor model generalization. If we introduce to a model a distribution of data which has not been seen before, it is not possible to predict sensible delivery plans and the model just serves each of the nodes by a single vehicle. This behavior is shown in Figure \ref{fig:model-breaks}. The model has even problems with generalization to different input data distributions in a single dataset.

\begin{figure}[ht]
    \centering
    \includegraphics[width=1.0\textwidth]{resources/evaluation/data-sensitivity.png}
    \caption{If the model does not know how to solve the instance, it just sends each vehicle to serve one node.}
    \label{fig:model-breaks}
\end{figure}

Another model sensitivity is to the instance problem size. If the model is trained on the problem size of 20 nodes, the model performance is continuously degraded by a larger difference of the problem size on which it was trained on. We tried training the model on a dataset of different problem sizes, but the network was not effectively learning. The model has to be trained on a problem size with a minimal difference.

The solution is to train multiple models for each of the problem sizes and data distribution. However, this seems as a great obstacle in using this model in real-world environment and thus a new model with improved model generalization needs to be proposed by researches.

\subsection{Training Process}

The training process of such a network is very time consuming and with our limited available hardware, the \gls{vrptw} model for solving 50 nodes requires at least 5 days to be fully trained. Therefore, experimenting with a different values of network hyperparameters is not part of this thesis. We only focused on proving if even such a problem like \gls{vrptw} can be sub-optimally solved via \gls{ml}. We have used the same hyperparameters as Kool et al. \cite{attention-route} in their research.

During the training process, we have observed multiple values of the cost function \ref{vrptw-cost} to understand if the network was successfully learning to solve the problem.

\begin{figure}[ht]
    \centering
    \includegraphics[width=0.75\textwidth]{resources/evaluation/avg-cost.png}
    \caption{Average cost (reward) per epoch on training data.}
    \label{fig:avg-cost}
\end{figure}

In Figure \ref{fig:avg-cost} we observe the average cost of the predicted solutions per epoch. It fairly quickly plateaued, but if we look at the average cost on the validation dataset \ref{fig:avg-cost-val}, the value was still decreasing. The model was still improving just on different parts of the cost function.

\begin{figure}[ht]
    \centering
    \includegraphics[width=0.75\textwidth]{resources/evaluation/val-avg-cost.png}
    \caption{Average cost (reward) per epoch on validation data.}
    \label{fig:avg-cost-val}
\end{figure}

If we would experiment with hyperparameter tuning, in this case, we could try to use the decaying learning rate which we assume would further more decreased the cost function.

\begin{figure}[ht]
    \centering
    \includegraphics[width=0.75\textwidth]{resources/evaluation/avg-tw-cost.png}
    \caption{The average cost for time windows per epoch.}
    \label{fig:avg-cost-tw}
\end{figure}

In Figure \ref{fig:avg-cost-tw} we observe the average penalty for early and late arrivals of the predicted routes per epoch. The model quickly learns the policy strategy how to predict the next node to visit based on the time constraint. We assume that the model first learns the strategy for minimizing the time window based on the drastic drop of the time window cost function and then it learns to optimize the distance of routes. In Figure \ref{fig:avg-cost-distance} we observe the average total distance of predicted routes per epoch and the cost is constantly decreasing while the model learns to optimize the distance.

\begin{figure}[ht]
    \centering
    \includegraphics[width=0.75\textwidth]{resources/evaluation/avg-distance-cost.png}
    \caption{The average distance cost per epoch.}
    \label{fig:avg-cost-distance}
\end{figure}

In Figure \ref{fig:avg-cost-balance} is the last observed part of the cost function, the unbalance penalty, which is slowly decreasing while the model learns to distribute the nodes uniformly across the vehicles.

\begin{figure}[ht]
    \centering
    \includegraphics[width=0.75\textwidth]{resources/evaluation/avg-balance-cost.png}
    \caption{The average cost of balanced plans.}
    \label{fig:avg-cost-balance}
\end{figure}

The cost function is used as a reward function for \gls{rl}. It is important to note that the model can never achieve a value of the cost function which would converge to zero.
\newline

\section{Benchmarking}\label{benchmarking}
We know that our deep reinforcement learning model for sub-optimally solving \gls{vrptw} can predict a solution for \gls{vrptw} instances \ref{fig:sample-50}. However, to evaluate the model performance, we need to compare it with other reliable methods like constructive heuristics and metaheuristics.

The first benchmark is insertion heuristics \ref{insertion-heuristics} which produces a feasible solution in a matter of seconds. It is frequently used to generate an initial solution which is then optimized by a local search algorithm or population-based method. The second typical benchmark used in research papers is OR-Tools framework \ref{or-tools} and its is widely used for many optimization tasks. Lastly, the third benchmark combines insertion heuristics as an initial solution and OR-Tools planner as a metaheuristic.

In tables \ref{tab:result-20}, \ref{tab:result-50} and \ref{tab:result-100} are measured the average cost of our implemented planners on 64 random \gls{vrptw} instances. We evaluate on all the essential subparts of the cost function where the \textit{AggCost} is the same as being used in our model architecture \ref{vrptw-cost}. Additionally, we have tracked the computation time per each instance to emphasize on the great advantage of our model.

Our proposed deep reinforcement learning model is $\text{RL\_AM\_PLANNER}$. Additionally, we have implemented RL\_AM\_OR\_TOOLS\_PLANNER, a planner that uses the predicted solution of our model as a constructive heuristic which is then optimized by OR-Tools.

\begin{table}[ht]
\centering
\resizebox{\textwidth}{!}{

\begin{tabular}{lrrrrr}
\toprule
{\textbf{Model}} & DistanceCost & DelayCost & EarlinessCost & ComputationTime & \textbf{AggCost} \\
{} &          Km &       min. &           min. &             sec &       \\
\midrule
\textbf{INSERTION\_HEURISTIC}    &           981 &          0 &            847 &                1 &    \textbf{1,193} \\
\textbf{RL\_AM\_PLANNER}          &           610 &         38 &            871 &                0.5 &      \textbf{847} \\
\textbf{OR\_TOOLS}               &           482 &          4 &            814 &              120 &      \textbf{687} \\
\textbf{OR\_TOOLS\_INSERTION}     &           488 &          1 &            798 &              121 &      \textbf{688} \\
\textbf{RL\_AM\_OR\_TOOLS\_PLANNER} &           482 &          4 &            814 &              120 &      \textbf{688} \\
\bottomrule
\end{tabular}

}
\caption{Benchmarking of VRPTW solvers for problem size of 20 nodes.}
\label{tab:result-20}
\end{table}

\begin{table}[ht]
\centering
\resizebox{\textwidth}{!}{

\begin{tabular}{lrrrrr}
\toprule
{\textbf{Model}} & DistanceCost & DelayCost & EarlinessCost & ComputationTime & \textbf{AggCost} \\
{} &          Km &       min. &           min. &             sec &       \\

\midrule
\textbf{INSERTION\_HEURISTIC}    &         2,306 &          0 &          4,355 &               39 &    \textbf{3,395} \\
\textbf{RL\_AM\_PLANNER}          &         1,297 &        100 &          3,634 &                2 &    \textbf{2,255} \\
\textbf{OR\_TOOLS}               &           757 &        539 &          6,180 &              154 &    \textbf{2,571} \\
\textbf{OR\_TOOLS\_INSERTION}     &         2,007 &          3 &          3,967 &              192 &    \textbf{3,000} \\
\textbf{RL\_AM\_OR\_TOOLS\_PLANNER} &           759 &        537 &          6,161 &              156 &    \textbf{2,568} \\
\bottomrule
\end{tabular}

}
\caption{Benchmarking of VRPTW solvers for problem size of 50 nodes.}
\label{tab:result-50}
\end{table}

\begin{table}[ht]
\centering
\resizebox{\textwidth}{!}{

\begin{tabular}{lrrrrr}
\toprule
{\textbf{Model}} & DistanceCost & DelayCost & EarlinessCost & ComputationTime & \textbf{AggCost} \\
{} &          Km &       min. &           min. &             sec &       \\
\midrule
\textbf{INSERTION\_HEURISTIC}    &         4,654 &          0 &         17,548 &              750 &    \textbf{9,041} \\
\textbf{RL\_AM\_PLANNER}          &         ${5,852}^*$ &          ${1}^*$ &         ${15,805}^*$ &               16 &    \textbf{${9,804}^*$} \\
\textbf{OR\_TOOLS}               &         1,034 &      2,885 &         23,719 &              199 &    \textbf{8,406} \\
\textbf{OR\_TOOLS\_INSERTION}     &         4,478 &          0 &         17,109 &              807 &    \textbf{8,755} \\
\textbf{RL\_AM\_OR\_TOOLS\_PLANNER} &         ${1,034}^*$ &      ${2,885}^*$ &         ${23,719}^*$ &              ${219}^*$ &    \textbf{${8,406}^*$} \\
\bottomrule
\end{tabular}
}
\caption{Benchmarking of VRPTW solvers for problem size of 100 nodes.}
\label{tab:result-100}
\end{table}

Our proposed model RL\_AM\_PLANNER is outperforming the constructive heuristic as expected, but OR-Tools as our metaheristics, clearly outperforms the deep learning model. The RL\_AM\_PLANNER model for the problem size of 100 was not fully trained and the data may be biased (marked with $x^*$). However, it is important to appreciate the negligible computational time which the deep learning model requires to predict a feasible but still highly suboptimal solution in compression with metaheuristics solvers.


To begin with, let us focus on the problem that has been used in section \ref{sec:MPM} to illustrate shortcomings of the MPM which motivated the derivation of the DGMPM.
We thus consider an infinite medium in directions $\vect{e}_2$ and $\vect{e}_3$ and of length $L$ in direction $\vect{e}_1$. The Cauchy stress and infinitesimal strain tensor are of the form:
\begin{align*}
  & \tens{\sigma} = \sigma \: \vect{e}_1\otimes \vect{e}_1 \\
  & \tens{\eps} = \eps \: \vect{e}_1\otimes \vect{e}_1
\end{align*}
so that the bar assumption holds. Riemann-type initial conditions on the horizontal velocity $v=\vect{v}\cdot\vect{e}_1$ are prescribed in the bar, that is, $v=v_0>0$ for $x_1\in\[0,L/2\]$ and $v=-v_0$ for $x_1\in \:]L/2,L]$.

% Parameters:
% CFL=0.5
% NTmaxi = 300
% length = 6.0
% ppc=1
% Nelem = 50
% E = 2.0e11
% Sigy = 400.0e6
% H = 10e9
% rho = 7800.0
% c=np.sqrt(E/rho)
% sigd =0.
% v0=1.*Sigy/(2*rho*c)
% v0=2.*Sigy/(rho*c)
% factor=1.
% timeOut = 1.*length/c
% t_order=1
% timeUnload = 2*timeOut
% algo = 'USL'
% update_position=False
% mpm_mapping=True
% limit=-1
% hardening='kinematic'
% fvmlimiter=-1

\subsection{Elastoviscoplastic material}

Juste comparer DGMPM et MPM avec du strang et godunov 1ppc et 2ppc. Stiff $dt/tau=100$ non-stiff $dt/tau=1/50$ bdf3 pour strang. Pas de RK2 godunov car le RK2 n'a une influence que sur la partie convective qui est équivalent au 1ppc Euler.

\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_stressnon-stiff20}}
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_stressnon-stiff30}}
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_stressnon-stiff45}}
  \caption{elastic-viscoplastic RP stress (non-stiff)}
  \label{fig:stress_elastoviscoplastic_RP}
\end{figure}

\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_epspnon-stiff20}}
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_epspnon-stiff30}}
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_epspnon-stiff45}}
  \caption{elastic-viscoplastic RP epsp (non-stiff)}
  \label{fig:epsp_elastoviscoplastic_RP}
\end{figure}

\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_stressstiff20}}
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_stressstiff30}}
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_stressstiff45}}
  \caption{elastic-viscoplastic RP stress (stiff)}
  \label{fig:stress_elastoviscoplastic_RP}
\end{figure}

\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_epspstiff20}}
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_epspstiff30}}
  {\input{chapter4/pgfFigures/evp_dgmpm_mpm_epspstiff45}}
  \caption{elastic-viscoplastic RP epsp (stiff)}
  \label{fig:epsp_elastoviscoplastic_RP}
\end{figure}

\subsection{Elastoplastic material}
Comparison with mpm for 1ppc which does not involve the treatment of rhs and so the choice of some parameter for integrating it.
\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/EP_dgmpm_mpm_stress20}}
  {\input{chapter4/pgfFigures/EP_dgmpm_mpm_stress30}}
  {\input{chapter4/pgfFigures/EP_dgmpm_mpm_stress45}}
  \caption{elastic-plastic RP stress (1ppc)}
  \label{fig:stress_elastoplastic_RP}
\end{figure}
\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/EP_dgmpm_mpm_epsp20}}
  {\input{chapter4/pgfFigures/EP_dgmpm_mpm_epsp30}}
  {\input{chapter4/pgfFigures/EP_dgmpm_mpm_epsp45}}
  \caption{elastic-plastic RP epsp (1ppc)}
  \label{fig:epsp_elastoplastic_RP}
\end{figure}
% \begin{figure}[h!]
%   \centering
%   {\input{chapter4/pgfFigures/EP_dgmpm_mpm_velo20}}
%   {\input{chapter4/pgfFigures/EP_dgmpm_mpm_velo30}}
%   {\input{chapter4/pgfFigures/EP_dgmpm_mpm_velo45}}
%   \caption{elastic-plastic RP velo}
%   \label{fig:velo_elastoplastic_RP}
% \end{figure}
Comparison with mpm for 1ppc and 2ppcs with RK2 (requires additional bc treatment and constitutive). Only ep solver
\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/EP_dgmpm_ppc_stress20}}
  {\input{chapter4/pgfFigures/EP_dgmpm_ppc_stress30}}
  {\input{chapter4/pgfFigures/EP_dgmpm_ppc_stress45}}
  \caption{elastic-plastic RP stress}
  \label{fig:stress_elastoplastic_RP}
\end{figure}
\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/EP_dgmpm_ppc_epsp20}}
  {\input{chapter4/pgfFigures/EP_dgmpm_ppc_epsp30}}
  {\input{chapter4/pgfFigures/EP_dgmpm_ppc_epsp45}}
  \caption{elastic-plastic RP epsp}
  \label{fig:epsp_elastoplastic_RP}
\end{figure}

Comparison with fvm and FEM (lumped mass matrix + radial return for integrating constitutive equations)
\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/EP_dgmpm_fvm_stress20}}
  {\input{chapter4/pgfFigures/EP_dgmpm_fvm_stress30}}
  {\input{chapter4/pgfFigures/EP_dgmpm_fvm_stress45}}
  \caption{elastic-plastic RP stress}
  \label{fig:stress_elastoplastic_RP}
\end{figure}
\begin{figure}[h!]
  \centering
  {\input{chapter4/pgfFigures/EP_dgmpm_fvm_epsp20}}
  {\input{chapter4/pgfFigures/EP_dgmpm_fvm_epsp30}}
  {\input{chapter4/pgfFigures/EP_dgmpm_fvm_epsp45}}
  \caption{elastic-plastic RP epsp}
  \label{fig:epsp_elastoplastic_RP}
\end{figure}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../mainManuscript"
%%% End:


    \filetitle{qqtoday}{IRIS serial date number for current quarter}{dates/qqtoday}

	\paragraph{Syntax}\label{syntax}

\begin{verbatim}
Dat = qqtoday()
\end{verbatim}

\paragraph{Output arguments}\label{output-arguments}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \texttt{Dat} {[} numeric {]} - IRIS serial date number for current
  quarter.
\end{itemize}

\paragraph{Description}\label{description}

\paragraph{Example}\label{example}