\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{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{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


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: