\section{Pauli blocking simulation.}

\hspace{1.0em}A free particle interaction
cross section is reduced to an effective cross section
by the Pauli-blocking due to Fermi statistics. For each
collision the phase-space densities $f_i$, where $i$ means fermion, in
the final states should be checked in order to assure that the final
distribution in phase space is in agreement with the Pauli principle,
which rules out the posibility of finding more than one fermion in a
single quantum state. There are two different Pauli blocking procedures:
the cascade Pauli blocking procedure, which can be applied for final state
nucleons in case of hadron--nucleus interaction and the Quantum Molecular
Dynamics (QMD) Pauli blocking procedure, which can be applied for any
final state fermions.

\subsection{The cascade Pauli blocking procedure.}

\hspace{1.0em}In this procedure, a  nucleus with atomic number $A$ and
charge $Z$ is treated as an ideal local completely degenerate Fermi gas
of nucleons with coordinates ${\bf r}$, momenta ${\bf p}$.  The nucleon
phase-space density is approximated by
\begin{equation}
\label{PBS1} f_{i}({\bf r}, {\bf p}) = \Theta
({\bf p}_{i}^F({\bf r}) - {\bf p}).
\end{equation}
Because all states below Fermi-level are already occupyied, after each
interaction one should check that the momenta ${\bf p^{\prime}}_i$ of
all secondary nucleons are above the Fermi-level, i. e.
\begin{equation}
\label{PBS2} p^{\prime}_i > p_{i}^F(r).
\end{equation}
If among the secondary nucleons there is a nucleon with momentum lower
the the Fermi-level, then this collision is considered as prohibited
(Pauli-blocked).

\subsection{ The QMD Pauli blocking procedure.}

\hspace{1.0em}We consider nucleons (and other fermions)
are not points in phase space. They are represented by Gaussian shaped
density distributions \cite{URQMD97}:
\begin{equation}
\label{PBS3}\phi({\bf x_i}, t) = (\frac{2\alpha}{\pi})^{3/4}
\exp{\{-\alpha ({\bf x_i}
- {\bf r_i} (t))^2 + \frac{i}{\hbar}{\bf p_i} (t) {\bf x_i}\}},
\end{equation}
where $\alpha=0.25$ \ fm$^{-2}$ is a model parameter and $\hbar =
197.327$ \ MeVfm is the conversion constant. .  The total wave function
is assumed to be a direct product of these functions.  The phase-space
density can be obtained by the Wigner transform of the wave function:
\begin{equation}
\label{PBS4} f({\bf r}, {\bf p})=\sum_{i}f_i({\bf r}, {\bf p}),
\end{equation}
where
\begin{equation}
\label{PBS5} f_i({\bf r}, {\bf p})= \frac{1}{(\pi\hbar)^3}\exp{\{-2\alpha ({\bf r}
- {\bf r}_i(t) )^2 - \frac{1}{2\alpha {\hbar}^2}({\bf p}-{\bf p}_i(t))^2 \}}
\end{equation}
with normalization
\begin{equation}
\label{PBS6} \int d{\bf r}d{\bf p}f_i({\bf r}, {\bf p})=1.
\end{equation}
The normalised on the number of particles density is
\begin{equation}
\label{PBS7} \rho({\bf r})=\sum_{i}\rho_i({\bf r}),
\end{equation}
where
\begin{equation}
\label{PBS8} \rho_i({\bf r})=\int \frac{d{\bf p}}{(\pi\hbar)^3}f_i({\bf r},{\bf p})=
(\frac{\pi}{2\alpha})^{-3/2}\exp{\{-2\alpha ({\bf r}-{\bf r}_i)^2\}}.
\end{equation}

The normalised on the number of particles momentum density is
\begin{equation}
\label{PBS9} g({\bf p})=\sum_{i}g_i({\bf p}),
\end{equation}
where
\begin{equation}
\label{PBS10} g_i({\bf p})=\int \frac{d{\bf r}}{(\pi\hbar)^3}f_i({\bf r},{\bf p})=
\hbar^{-3}(2\pi\alpha )^{-3/2}\exp{\{-\frac{1}{2\alpha \hbar^2} ({\bf p}-{\bf p}_i)^2\}}.
\end{equation}

The overlap phase-space density $f^{ovp}_i$ and particle density
$\rho^{ovp}_i$ of particle $i$ with other particles are given by
\begin{equation}
\begin{array}{c}
\label{PBS11} f^{ovp}_i = \sum_{j\neq i}
\int d{\bf r}d{\bf p} f_i({\bf r},{\bf p})f_j({\bf r},{\bf p})= \\
= \frac{1}{8(\pi \hbar)^{3}}\sum_{j\neq i}
\exp{\{-\alpha ({\bf r}_i-{\bf r}_j)^2-\frac{1}{4\alpha \hbar^2}({\bf p}_i-{\bf p}_j)^2\}}
\end{array}
\end{equation}
and
\begin{equation}
\label{PBS12} \rho^{ovp}_i = \sum_{j\neq i}
\int d{\bf r} \rho_i({\bf r})\rho_j({\bf r})
= \sum_{j\neq i}(\frac{\pi}{\alpha})^{-3/2}
\exp{\{-\alpha ({\bf r}_i-{\bf r}_j)^2\}}.
\end{equation}

Thus the phase-space fermion overlaping densities $f^{ovp}_i$ at the
final states can be directly calculated and used for simulation of
Pauli-blocking.
For two indistinguishable nucleons $i$ and $j$ the  function
\begin{equation}
\begin{array}{c}
\label{PBS13}
F^{block}_{i}=\sum_{j\neq i} 8(\pi \hbar)^3 \delta_{\sigma_i\sigma_j}
\delta_{\tau_i\tau_j}
\int d{\bf r}d{\bf p} f_i({\bf r},{\bf p})f_j({\bf r},{\bf p})]= \\
=\delta_{\sigma_i\sigma_j}\delta_{\tau_i\tau_j}
\exp{\{-\alpha ({\bf r}_i-{\bf r}_j)^2-\frac{1}{4\alpha \hbar^2}
({\bf p}_i-{\bf p}_j)^2\}}
\end{array}
\end{equation}
can be interpreted as the Pauli-blocking probability.
  Here
$\sigma_{i,j}=\pm 1$ and $\tau_{i,j}=\pm 1$ denote spin and isospin
indices of nucleons, respectively.
For example the Pauli-blocking of the two-body collisions can be checked by the
blocking-probability $1- (1-F^{block}_i)(1-F^{block}_j)$.

\subsection{The QMD Pauli-blocking algorithm.}
\hspace{1.0em}For each produced baryon, which is located at position
${\bf r}$ and has momentum ${\bf p}$, the value of
$F^{block}_i$
and at the same time the value of
\begin{equation}
\label{PBS14}
d_i=\sum_{j\neq i}\exp{\{-2\alpha ({\bf r}-{\bf r}_i)^2\}}
\end{equation}
are calculated.  As was found in \cite{Konopka96}, there is an
approximately straight line dependence:
\begin{equation}
\label{PBS15}
F^{block}_i = a_{fit} + b_{fit}d_i,
\end{equation}
where $a_{fit}=1.49641$ and $b_{fit}=0.208736$, which divides
$(F^{block}_i-d_i)$-plane into two the Pauli-blocked and the
Pauli-allowed domains.

Then a collision is only allowed, if computed values fulfill the
conditions:
\begin{equation}
\label{PBS16} F^{block}_i \leq a_{fit} + b_{fit}d_i
\end{equation}
for each outgoing baryon $i$.


\newpage
\chapter{Batch Reactor}

\section{Introduction}
The batch reactor model of Camflow has limited features. The limitation of the batch reactor models is that it is a constant volume batch reactor model and does not solve the energy equation. Only isothermal calculations can be performed with the batch reactor model of Camflow.

\section{Fundamentals}
The following governing equation is solved
\begin{equation}
 \rho \frac{dY_k}{dt} = \dot{s}_k \bar{W}, \quad k=1\ldots K_g.
\end{equation}
Here $\rho$ is the density of the fluid, $Y_k$ is the mass fraction of the k\'th species, $\dot{s}_k$ is the molar production rate of the k\'th chemical species in mol/m$^3$, and $\bar{W}$ is the average molecular weight of the mixture in kg/mol.

\section{Input file}
A complete input file (camflow.xml) for a batch reactor simulation is shown below
{\scriptsize{
 \begin{verbatim}
<?xml version="1.0" encoding="ISO-8859-1"?>
<camflow>
   <reactor model="batch_cv">
   </reactor>
   <op_condition>
      <temperature>isothermal</temperature>
      <pressure unit="Pa">1e5</pressure>
   </op_condition>
   <inlet>
     <fuel>
       <temperature unit="C">800</temperature>
       <molefrac>
         <species name="NO2">0.1</species>
         <species name="N2">*</species>
       </molefrac>
     </fuel>
   </inlet>
   <solver mode="coupled" solver="cvode">
     <tols>
       <species>
         <aTol>1.e-10</aTol>
         <rTol>1.e-08</rTol>
       </species>
       <temperature>
         <aTol>1.e-03</aTol>
         <rTol>1.e-03</rTol>
       </temperature>
       <flow>
         <aTol>1.e-03</aTol>
         <rTol>1.e-03</rTol>
       </flow>
     </tols>
   </solver>
 <report species="mole">
 </report>
</camflow>

\end{verbatim}}
}
The input file follows xml specifications, with camflow as the root element and a number of child elements.
Each child element and its purpose is described below
\begin{itemize}
 \item \textbf{rector} : The reactor element specifies which reactor models is to be simulated and for a constant volume batch reactor camflow expects batch\_cv as the model attribute value.

\item \textbf{op\_conditions} : The element op\_conditions describes the operating conditions for the batch reactor. This includes the specification of the pressure and the condition applied to the solution of energy equation. Currently this model support only isothermal condition, and therefore temperature element should be assigned with isothermal condition.
\item \textbf{inlet} : The inlet element holds the information on reactants and the reactant temperature at time t=0. The temperature of the reactants must be specified using the temperature element with the appropriate units. The mass or mole fraction of the reactant species need to be specified within the element molefrac or massfrac. The sum of mass fractions or mole fraction of the reactant species must sum up to 1. Instead of specifying the mass/mole fractions of all species, the last species can be assigned with *. In this case the mole/mass fraction of the last species will be 1-sum of others.

\item \textbf{solver}: The solver element holds the solver control specifications. The attributes ``mode'' should always be specified as ``coupled'' for batch reactor simulation. The solver name is essentially provided to switch from one solver to another. However, the present version of Camflow uses only CVode as the numerical integrator, and therefore accepts only ``cvode'' as the solver name. The element tols hold the various tolarences that can be applied to the species, energy, and continuity equations. For species a relative tolarence of at least 10$^{-6}$ should be used. The user may need to adjust the tolarence values for the species in case of solution difficulties.

\item \textbf{report}: The desired output for the species composition must be specified in this element using the species attribute. ``mole'' or ``mass'' may be used as the attribute values, and correspondingly the output will be produced either in mole fraction or mass fractions.

\section{Executing the binary}
The batch reactor model of Camflow expects three input files namely, ``camflow.xml'', ``therm.dat'', and ``chem.inp''. All these files must be present in the working directory. Upon succesful execution the output file ``profile.dat'' containing the integration time(s), pressure (Pa), density (kg/m$^3$), temperature (K), and the species compositions in mass or mole fractions.
\end{itemize}

\section{Results}
The following figure shows the major species that results from the batch reactor model using ABF mechanism with a fuel composition of 50 \% O$_2$ and 50 \%C$_2$H$_4$
\begin{figure*}[h]
 \centering
\includegraphics[scale=0.8]{batch_profile.eps}
\caption{Species profiles for ABF mechanism at isothermal condition of 1500 K}
\end{figure*}

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


\chapter{Calibration procedure}
\label{chapter:calibration}

\section{Processing pipeline}

Raw science and house-keeping data are downloaded at
Esrange and transferred to a data archive housed by the Parallel
Data Centre (PDC) at the Royal Institute of Technology (KTH)
in Stockholm. The data processing for the calibration \smr\
measurements is performed at the Dept. of Earth and Space
Sciences at Chalmers University of Technology (Chalmers) in Gothenburg.
A file system at Chalmers is synchronized with the Level0-file archive
at KTH. The KTH archive also contains files with reconstructed attitude
information.  Science and house-keeping data within those files
are imported into Level0 tables of an Odin calibration database.
Dedicated algorithms to process and combine new Level0 to Level1B
data are executed on a regular basis and are described in this
chapter. Level1B data are stored in tables of the Odin calibration database.
Chapter 3 describes its format and how to access the Level1B data.

\section{Radiometric calibration algorithm}

\subsection{Auto-correlator data}

Data from the ACs must be transformed to spectra in the frequency domain
prior to the radiometric calibration.
This preparation of AC data basically involves a quantisation correction and the application
of a Fourier transform.
In the spectrometer hardware, the input signal is quantized into three levels:
high positive, high negative, and low amplitude. The input signal is furthermore delayed,
cross multiplied and integrated to obtain a measure of the auto-correlation function of the
input signal \(s(t)\). Below is given an overview of the applied processing steps that
transforms the measure of the auto-correlation function to a spectrum in the frequency
domain:

\begin{itemize}

\item Accurate quantization correction requires accurate knowledge of the threshold
 levels used at quantization. The quantization correction used is only valid
if the absolute values of the the positive and negative threshold levels are equal.
The \smr\ correlators provide monitor channels to check the
assumption of equal absolute values of the positive and negative threshold levels.
Only when this condition is fulfilled the data will be further processed,
otherwise the data will be blanked (filled with zeros).

\item The estimation of the true correlation \(\rho\) from the measured correlation
coefficient \(r\) at lag \(\tau\) is then achieved by performing a quantization correction using
Kulkarni and Heiles approximation described in \citet{ohlberg:theod:03}.

\item A Hanning smoothing is applied, which results in that the obtained resolution
of the spectra is 2\,MHz although the channel spacing is 1\,MHz

\item The Fourier transform of the auto correlation function gives the
power spectral density, or a spectrum in the frequency domain.

\end{itemize}

\subsection{Radiances}

The radiance emitted by a blackbody per frequency unit is
\begin{equation}
 B_{\nu} = \frac{2h\nu^{3}}{c^{2}}\frac{1}{\exp(\frac{h\nu}{kT})-1},
\end{equation}
where \(\nu\) is frequency, \(h\) is Planck's constant, \(k\) is Boltzmann's constant,
\(c\) is the speed of light, and \(T\) is the physical temperature of the
blackbody.
The Rayleigh--Jeans correspondence (valid when \(h\nu/kT\)<<1) reads
\begin{equation}
 B_{v}=\frac{2\nu^{2}kT}{c^{2}}.
\end{equation}

The \smr\ radiometers are heterodyne systems which receive a power (\(P_{\nu}\))
per unit frequency range (spectral power density),
\begin{equation}
P_{\nu} = \frac{c^{2}}{2\nu^{2}}B_{\nu}
\end{equation}
where \(\nu\) is frequency, \(h\) is Planck's constant, \(k\) is Boltzmann's constant,
when viewing a blackbody source at temperature (\(T\)) that completely
fills the antenna field of view.
If the Rayleigh--Jeans approximation is valid, we then have that
\begin{equation}
P_{\nu} = kT.
\end{equation}
For a theoretical receiver and channel of bandwidth \(\Delta \nu\), with zero loss and gain
and a unit frequency response, the received power is
\begin{equation}
 P = kT\Delta \nu.
\end{equation}

Brightness temperature (\(T_{b}\)) and antenna temperature (\(T_{a}\))
are two closely related quantities. They are both defined with respect to a
matching blackbody temperature. However, they differ in that \(T_{b}\) corresponds
to radiance while \(T_{a}\) must be seen as a measure on power.
The brightness temperature is defined as the physical temperature
a blackbody would have to generate the same radiance as the one of concern.
That is, for a given radiance \(I\), \(T_{b}\) is defined as
\begin{equation}
 I = B_{v}(T_{b}),
\end{equation}
and in the Rayleigh--Jeans approximation this gives
\begin{equation}
 T_{b} = \frac{c^{2}I}{2kv^{2}}.
\end{equation}
Hence, the Rayleigh--Jeans temperature of a blackbody can be written as
\begin{equation}
 T_{b} = \frac{h\nu}{k}\frac{1}{\exp(\frac{h\nu}{kT})-1}.
\label{eq:tbrj}
\end{equation}

The antenna temperature is defined as the temperature of an ideal black
body that would result in the same received power at the antenna aperture
as in the actual case, which gives that (using Rayleigh--Jeans approximation)
\begin{equation}
T_{a} = \frac{P}{k\Delta \nu}
\end{equation}

A radiometer detects radiant power but the measured power can be converted to an
antenna or brightness temperature or a radiance, but it should be
remembered that it is only power that can actually be measured.

\subsection{\smr\ observation sequence and measured signals}
\label{sec:smrobs}

\begin{figure}[t]
\includegraphics[width=14cm]{cal_signals.png}
\caption{ The upper panel shows the tangent altitude of the main beam
for a number of scans.
The middle panel shows the internal load temperature.
The lower panel shows intensity variation,
of one of the sub-bands of freqmode~1,
for the three types of signals (described in text) involved
in the intensity calibration scheme.}
\label{fig:intensityvar}
\end{figure}

For calibration purposes, Odin/SMR performs areonomy observation in a switching
mode, i.e. switching between the main beam and an unfocused sky beam.
In nominal operation every other recorded signal comes from an unfocused cold sky
beam, except around the lower and upper turning points of the scan where the reference
beam is directed towards the internal load, typically three consecutive load spectra are
recorded. The internal load acts as a blackbody emitter at an ambient temperature of around 285
K.

The intensity calibration of \smr\ is thus performed by using
information from three types of signals (see Fig~\ref{fig:intensityvar}),
i.e. the cold sky beam signal (\(c_{s}\)), the load signal (\(c_{l}\)),
and the main beam signal (\(c_{a}\)).
The calibration scheme is based on the assumption that the
digital value (e.g. \(c_{a,i}\)) read out from channel \(i\) of the
spectrometer is proportional to the power of the
observed signal. The contributions to the three signals
can be expressed as:

\begin{equation}
c_{a,i}=g_{i}\left(\eta_{a} T_{a,i} + T_{rec,i} + (1-\eta_{a})T_{amb,i} \right) =
g_{i}\left(\eta_{a} T_{a,i} + T_{rec,i} + T_{sp} \right) ,
\end{equation}
\begin{equation}
\label{eq:skybeam}
c_{s,i}=g_{i}\left(T_{s,i}+T_{rec,i}\right) \approx g_{i}\left(T_{rec,i}\right),
\end{equation}
\begin{equation}
c_{l,i}=g_{i}\left(T_{l,i}+T_{rec,i}\right),
\end{equation}
where \(g_{i}\) is the receiver gain, \(\eta_{a}\) is the main beam
efficiency (it is assumed that beam efficiencies for
both the sky beam and load signals are unity),
\(T_{amb,i}\) is the receiver ambient temperature,
and \(T_{rec,i}\) is the receiver noise temperature.
\(T_{a,i}\), \(T_{s,i}\), and \(T_{l,i}\) are the antenna temperature,
cosmic background temperature, and load temperature, all expressed
as equivalent Rayleigh--Jeans brightness temperatures (\(T_{b}\)).
The Rayleigh--Jeans brightness temperature of the cosmic background radiation
at 500 GHz is only 0.003\,K, (Eq.~\ref{eq:tbrj}) and typical \(T_{rec}\) value of \smr\ is 3000\,K,
thus the approximation in eq.~\ref{eq:skybeam} results in negligible error.

The main beam signal is always at a higher level than the cold sky signal
(Fig.~\ref{fig:intensityvar}), which is due
to thermal emission from a baffle which only affects the main beam signal.
Thus, the main beam intercepts with the baffle
and the spill over contribution (\(T_{sp}\)):
\begin{equation}
\label{eq:tspill1}
T_{sp}=(1-\eta_{a})T_{amb}.
\end{equation}

\subsection{Calibration: basic equations}
\label{sec:caleq}
The aim of the calibration process is to use
information from the signals described in Sect.~\ref{sec:smrobs}
in order to derive an estimate of the antenna temperature.
Here we derive expressions for how the unknown \(T_{rec,i}\),
\(g_{i}\), \(T_{sp}\), \(n_{a}\), and \(T_{a,i}\) can be derived.
In Sect.~\ref{sec:calscheme} the actual \smr\ calibration is described.

Eq.~\ref{eq:skybeam} gives that
\begin{equation}
\label{eq:trec}
T_{rec,i}=\frac{c_{s,i}}{g_{i}},
\end{equation}
and \(g_{i}\) can be obtained from the difference between \(c_{l,i}\) and
 \(c_{s,i}\), i.e.
\begin{equation}
\label{eq:gain}
g_{i}=\frac{c_{l,i}-c_{s,i}}{T_{l,i}-T_{s,i}}.
\end{equation}
By combining Eq.~\ref{eq:trec} and~\ref{eq:gain} we obtain
\begin{equation}
\label{eq:trec2}
T_{rec,i}=c_{s,i}\frac{{T_{l,i}-T_{s,i}}}{c_{l,i}-c_{s,i}}.
\end{equation}

\(T_{a,i}\) can be obtained from the difference between between
\(c_{a,i}\) and \(c_{s,i}\), i.e.
\begin{eqnarray}
\label{eq:ta}
T_{a,i} &=& \frac{1}{\eta_{a}}\left(\frac{c_{a,i}-c_{s,i}}{g_{i}} - T_{sp}\right) \nonumber\\
 &=& \frac{1}{\eta_{a}}\left( \left(c_{a,i} - c_{s,i}\right)\frac{T_{rec,i}}{c_{s,i}} -T_{sp} \right).
\end{eqnarray}

For measurements at tangent altitude above the atmosphere,
\(T_{a,i}\) = 0. Thus, we have that for these measurements
to a very good approximation

\begin{equation}
\label{eq:tspill2}
T_{sp,i}= \left(c_{a,i}-c_{s,i}\right)\frac{T_{rec,i}}{c_{s,i}}.
\end{equation}

Combining Eq.~\ref{eq:tspill1} and~\ref{eq:tspill2} gives that
\begin{equation}
\label{eq:eta}
\eta_{a}=1-\frac{T_{sp}}{T_{amb}}=1-\frac{\left(c_{a,i}-c_{s,i}\right)\frac{T_{rec,i}}{c_{s,i}}}{T_{amb}}.
\end{equation}

\subsection{Ripple}
\label{sec:ripples}
Equation~\ref{eq:ta} can be thought of as the main intensity
calibration equation for the \smr\ calibration scheme.
In the derivation of Eq.~\ref{eq:ta}
the reference signals are assumed to be ``clean''.
In practice, there seems to be a small imbalance between
measurements and references for \smr.
Small perturbations of the sky and load signals will
result in undesired features in calibrated
spectra (which we denote as ``ripple'')
if not taken into account (see Fig.~\ref{fig:ripple1}).
The sensitivity of calibrated \(T_{a,i}\)
to small perturbations on \(T_{s,i}\) and \(T_{l,i}\) are:
\begin{equation}
\frac{dT_{a,i}}{dT_{s,i}}=\frac{1}{\eta_{a}}\left(1-\frac{c_{a,i}-c_{s,i}}{c_{l,i}-c_{s,i}}\right)\approx \frac{1}{\eta_{a}}\left(1-\frac{T_{a,i}}{T_{l,i}}\right)
\end{equation}
and
\begin{equation}
\frac{dT_{a,i}}{dT_{l,i}}=\frac{1}{\eta_{a}}\left(\frac{c_{a,i}-c_{s,i}}{c_{l,i}-c_{s,i}}\right)\approx \frac{1}{\eta_{a}}\left(\frac{T_{a,i}}{T_{l,i}}\right).
\end{equation}
Thus, the sensitivity is linearly proportional to \(T_{a,i}\).
When \(T_{a,i}\) is close to or 0 K (as it is for measurements at high
tangent altitudes) the sensitivity to perturbations of
the sky beam signal is at its maximum.
On the other hand, perturbations on the load signal then have practically
no impact on \(T_{a,i}\).
If \(T_{a,i}\) were equal to the load temperature the situation would be reversed,
though this is never the case in practice.

A model for the removal of the effects of ripple on the reference signals
on estimated \(T_{a,i}\) (from Eq.~\ref{eq:ta}) to achieve a new
better estimate \(T^{'}_{a,i}\) of the antenna temperature then reads
\begin{equation}
\label{correction}
T^{'}_{a,i}=T_{a,i}-\frac{1}{\eta_{a}}\left(1-\frac{T_{a,i}}{T_{l,i}}\right) s_{0,i}-
 \frac{1}{\eta_{a}}\left(\frac{T_{a,i}}{T_{l,i}}\right) s_{1,i},
\end{equation}
where \(s_{0,i}\) and \(s_{1,i}\) can be seen as spectra that contain
the ripple induced features for \(T_{a,i}\)=0\,K and \(T_{a,i}\)=\emph{load~temperature}
respectively.

\subsection{Intensity calibration scheme}
\label{sec:calscheme}

The intensity calibration scheme can be divided into two parts. The first part can be
seen as a scan based calibration scheme, in which the Equations of Sect.~\ref{sec:caleq} are applied.
The second part takes ripples (\ref{sec:ripples}) into account and uses the results
(for a long period of time of measurements) from the first part of the calibration.

\subsection*{Part 1}

The Odin calibration scheme (version 8) is scan-based, as will be described below, and
this is one of the main differences to previous verisons.

Equation~\ref{eq:ta} is the key equation of the calibration.
From this equation we see that to calibrate a given target signal
we need to determine \(T_{rec,i}\), \(T_{sp}\), \(\eta_{a}\),
and \(c_{s,i}\). The variables \(T_{rec,i}\), \(T_{sp}\), and \(\eta_{a}\)
are assumed to be fairly stable over short time scales.
Common values of all these parameters are used for
the calibration of all \(c_{a}\) signals within a given scan.
\(g\) can vary significant over short time-scales,
and this is taken into account by the division of \(c_{a}\) with
\(c_{s}\) (with a unique \(c_{s}\) for each \(c_{a}\)
signal of the scan). The intensity calibration scheme (version 8)
for a given scan can be summarized as:
\begin{itemize}
\item collect all relevant level0 and level1 data for the scan and for an
additional time-period of \(\pm\)45 minutes.
It is assured that only data with ssb attenuator settings
as in the first load signal of the scan is used.
Furthermore, only data where calibrated sky frequencies changes by less
than 1 MHz from one signal to another is used.

\item filter data, i.e. remove untrusted reference signals:\newline
Only sky beam signals from Sky Beam 1 (SK1) are used.
An SK1 signal is only used if the previous
reference signal was from SK1.
SK1 signals with skybeamhit flags EARTH1, MOON1, and SUN1 are not used.
Only the second load signal is used for each sequence of load signals
observation.

\item estimate an average \(T_{rec}\) spectrum:\newline
Equation~\ref{eq:trec2} is applied to calculate \(T_{rec}\)
for all kept \(c_{l}\) signals, where
the two nearest \(c_{s}\) signals are linearly interpolated
in time to \(c_{l}\).
The mean value of all \(T_{rec}\) is used as the
common \(T_{rec}\) spectrum within a given scan.
\item estimation of a scalar \(T_{sp}\):\newline
\(T_{sp}\) is estimated from measurements at high tangent altitude
by applying Eq.~\ref{eq:tspill2}.
The median of the median
from all \(c_{a}\) signals, measured within the top 10 km
of the range of tangent altitudes, is used as a common scalar \(T_{sp}\).
\item estimation of \(\eta_{a}\):\newline
\(\eta_{a}\) is estimated by applying Eq.~\ref{eq:eta},
using the estimated \(T_{sp}\) described above, and an
assumed \(T_{amb}\) of 300 K.
\item estimate \(T_{a}\): \newline
apply Eq.~\ref{eq:ta}, using the estimated parameters as described
above and
the two nearest \(c_{s}\) signals are linearly interpolated
in time to \(c_{a}\).
\end{itemize}

\subsection*{Part 2}

\begin{figure}[t]
\includegraphics[width=14cm]{calibration_step2_fig.png}
\caption{Schematic of part 2 of the intensity calibration.
The upper panel shows uncorrected average spectra for frequency mode 2 observations
with tangent points between 80 and 120\,km. The color-coding corresponds
to ambient temperature of the satellite (hotload temperature).
The middle panel shows fits of the ripple of the spectra in the
upper panel. The lower panel shows the residual.}
\label{fig:ripple1}
\end{figure}

Part 2 of the calibration deals with the removal
of the effects of ripple on the sky signal on calibrated
spectra from part 1, which neglects this effect.
The removal of the artifacts introduced by the sky signal
ripple is a fairly straight-forward task, as the artifacts
can be estimated from high tangent point measurements
where we know that the intensity of a calibrated spectrum should be 0 K.

Ripple on the load signal is more complicated from
a calibration perspective. The artifacts, in calibrated
atmospheric spectra, from ripple on the
load signal can be seen as weak signal on top of a strong
atmospheric signal, and thus not easy to detect.
For this reason, we leave this effect unresolved.

Figure~\ref{fig:ripple1} shows median spectra of calibrated (Part 1) spectra
from measurements at high tangent altitudes for one of the
observation mode of AC1 (for the further discussion on this figure
ignore the left-most part of the spectra, which comes from two
problematic bands of AC1 that should not be used).
These spectra are expected to be
centered around 0~K (except for the ozone line between 544.8--544.9~GHz),
but due to ripple in the sky signal we can see a wave pattern in the spectra.
Figure~\ref{fig:ripple1} also indicates that the phase of the wave pattern
depends on the measurement conditions, and the temperature of
the load (ambient temperature) is used in Fig~\ref{fig:ripple1}
to describe the measurement condition.

The calibration scheme (Part 2) is as follows:
\begin{itemize}
\item Extract median spectra of calibrated spectra
(from Part 1:ac\underline{ }level1b table)
from measurements at tangent altitudes above 80 km for a range of hot load
temperatures ([277--278~K, 278--279~K, ..., 289--290~K])
for each observation mode, and import the spectra
into the ac\underline{ }level1b\underline{ }average table
\item Estimate a fit to the median spectrum for each mode by
\begin{enumerate}
\item applying a filter that removes channels which are contaminated by
atmospheric information or lines from the median spectrum
\item using the target fitting function
\begin{equation}
y=a+ b\sin(cf+d)
\end{equation}
where \(f\) is the frequency and \(a,b,c,d\) parameters to estimate,
in order to fit the spectrum for each of the four modules of AC1 or AC2.
The fitting is performed in such a way that \(c\) is forced
to be equal for all of the four modules.
Import the fit into the ac\underline{ }cal\underline{ }level1c
table
\end{enumerate}
\item Apply the correction.\\
Equation~\ref{correction} is applied to correct a given calibrated
spectrum (from part~1), where the fit of the median spectrum
with matching hot load temperature range is used as the \(s_{0}\)
spectrum.
\end{itemize}

\section{Radiometric performance and uncertainties}
\label{sec:radper}

\begin{table}
\caption{ Average \(T_{rec}\), \(T_{sp}\), and radiometric noise (for 1.8 sec. integration time) for the various frequency modes }
\label{table:config5}
\begin{tabular}{|l|l|l|l|l|l|l|}
  \hline
  \textbf{Backend} & \textbf{Frontend} & \textbf{LO freq {[}GHz{]}} & \textbf{FM} & \textbf{\(T_{rec}\) {[}K{]}} & \textbf{\(T_{sp}\) {[}K{]}} & \textbf{\(\Delta T [K]\)} \\
  \hline
  AC1              & 495 A2            & 492.750                    & 23          & 3000                  & 7.0  & 2.0\\
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                   &                    & 499.698                   & 25          & 3500 *                & 6.2  & -\\
  \cline{2-2}
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                   & 549 A1             & 548.502                  & 2            & 2800 *                & 8.0 & 1.8 \\
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                  &                     & 553.050                  & 19           & 2900 *                & 7.3 & 1.9 \\
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                  &                     & 547.752                  & 21           & 3100 *                & 8.6 & 2.0 \\
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                  &                     & 553.302                  & 23           & 3200                  & 6.8 & 2.1 \\
  \cline{2-2}
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                 & 555 B2              & 553.298                   & 13           & 3200                  & 14.0 & 2.1 \\
  \cline{2-2}
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                & 572 B1               & 572.762                   & 24           & 3200 *                & 9.4 & 2.1 \\
  \hline
  AC2           & 495 A2               & 497.880                   & 1            & 3200                  & 6.1 & 2.1\\
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                &                      & 492.750                   & 8            & 3200                  & 7.4 & 2.1\\
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                &                      & 494.750                   & 17           & 3200                  & 6.7 & 2.1\\
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                &                      & 499.698                   & 25           & 3200                 & 7.6 & 2.1\\
  \cline{2-2}
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                & 572 B1              & 572.762                    & 14           & 3700 *              & 9.9 & 2.4\\
  \cline{3-3}
  \cline{4-4}
  \cline{5-5}
  \cline{6-6}
  \cline{7-7}
                &                     & 572.964                    & 22           & 3700 *              & 10.0 & 2.4\\
  \hline
\end{tabular}
\end{table}

In this section we deal with uncertainties that are related to calibrated \smr\ spectra.
In Sect.~\ref{sec:radnoise} we describe uncertainties related to radiometric noise.
In Sect.~\ref{sec:gainvar} we describe uncertainties related to rapid gain fluctuations.
In Sect.~\ref{sec:otheruncer} we describe uncertatinties that are related to imperfect knowledge
of load temperature and main beam efficiency.
In Sect.~\ref{sec:trends} trend uncertainties are explored.
In Sect.~\ref{notesoncorr} we describe the noise correlations.
In Sect.~\ref{sec:caluncer} we describe the noise estimate output from the calibration routine.

\subsection{Uncertainties related to radiometric noise}
\label{sec:radnoise}

In the \smr\ calibration process three types of signals are used (all of them containing radiometric noise)
and the obtained noise in calibrated spectra is sensitive to noise in
all of these measurements.
The noise contribution can be divided into three terms
(1) the radiometer noise contribution,
(2) interpolated reference noise contribution, and (3) interpolated gain noise contribution
\cite{jarnot:04}.

These contributions (derived in the following sub-sections) gives that the noise on an individual channel \(\Delta T_{i}\) of a
calibrated \smr\ spectrum using the calibration scheme described in Sect.~\ref{sec:calscheme}.
The noise can be described by
\begin{equation}
\Delta T_{i}^{2} =  \frac{1}{B\tau} \left( (T_{rec,i}+T_{a,i})^2 + \frac{T_{rec,i}^2}{2} +
   \frac{T_{a,i}^{2}}{n} \left( \left( \frac{T_{rec,i} + T_{l,i}}{T_{l,i}} \right)^2 +
   \left( \frac{T_{rec,i} }{T_{l,i}} \right)^2 \right) \right).
\label{eq:raderror}
\end{equation}
For measurements with a nearly blank background (i.e. \(T_{a,i}\approx\)0), uncertainties in the gain estimate
have low impact and the noise expression reduces to
\begin{equation}
\Delta T_{i} =  T_{rec,i}\sqrt{\frac{3}{2}\frac{1}{B\tau}}.
\label{eq:higaltnoise}
\end{equation}
In Table~\ref{table:config5} typical \(T_{rec}\) values and radiometric noise levels
(for measurements having high tangent points)
of the main frequency modes of \smr\ are listed.

As a starting point to derive Eq.~\ref{eq:raderror} we take the derivative of \(T_{a,i}\)
with respect to \(c_{a,i}\), \(c_{s,i}\), and \(g_{i}\):

\begin{equation}
\frac{\partial T_{a,i}}{\partial c_{a,i}} \approx \frac{1}{g_i},
\end{equation}

\begin{equation}
\frac{\partial T_{a,i}}{\partial c_{s,i}} \approx \frac{1}{g_i},
\end{equation}

\begin{equation}
\frac{\partial T_{a,i}}{\partial g_{i}} \approx -\frac{c_{a,i}-c_{s,i}}{g_{i}^{2}} \approx \frac{T_{a,i}}{g_i},
\end{equation}
which implies:

\begin{equation}
\Delta T_{i}^{2} = \frac{\Delta c_{a,i}^{2}}{g_{i}^2} + \frac{\Delta c_{s,i}^{2}}{g_{i}^2} + T_{a,i}^{2}\frac{\Delta g_{i}^{2}}{g_{i}^2},
\end{equation}
where the terms on the right hand side is (1) the radiometer noise contribution,
(2) interpolated reference noise contribution, and (3) interpolated gain noise contribution.
In the following sections these terms are described in more detail.

\subsection*{Precision: radiometer noise contribution}
The radiometer noise contribution induced noise variance in calibrated \(T_{a,i}\) is simply
\begin{equation}
\frac{\Delta c_{a,i}^{2}}{g_{i}^2} = \frac{T_{sys}^{2}}{B\tau}.
\end{equation}

\subsection*{Precision: interpolated reference noise contribution}
In the \smr\ calibration scheme, and for the nominal situation, the sky beam interpolated
reference signal can be written
\begin{equation}
\hat{c}_{s,i}(t_{j+1}) = \frac{1}{2}c_{s,i}(t_{j}) + \frac{1}{2}c_{s,i}(t_{j+2}),
\end{equation}
where \(t_{j}\) represent time.
If the gain fluctuations are small or follow a linear variation during the
observation sequence, the noise in \(\hat{c}_{s,i}(t_{j+1})\) is only due to radiometric
noise and induced noise variance in calibrated \(T_{a,i}\) is
\begin{equation}
\frac{\Delta c_{s,i}^{2}}{g_{i}^2} = \frac{T_{rec}^{2}}{2B\tau}.
\end{equation}

In practice there is also a finite error due to non-linear and non-captured
gain variation and this is described in Sect~\ref{sec:gainvar}.

\subsection*{Precision: interpolated gain noise contribution}

In the calibration scheme, the gain is estimated as
\begin{equation}
g_{i}(t_{j+k}) = \frac{\hat{c}_{s,i}(t_{j+k})}{\overline{T}_{rec,i}} = \hat{c}_{s,i}(t_{j+k})\left(\frac{1}{n}\sum_{j=1}^{n}T_{rec,i}(t_{j})\right)^{-1},
\end{equation}
where
\begin{equation}
T_{rec,i}(t_{j}) = \hat{c}_{s,i}(t_{j}) \frac{ T_{l} - T_{s} }{  c_{l,i}(t_{j})- \hat{c}_{s,i}(t_{j})  }.
\end{equation}
That is, the precision of the interpolated gain depends on the precision of an interpolated
reference measurement and on an average \(T_{rec}\).

We first note that
\begin{equation}
\frac{\partial g_{i}}{\partial \hat{c}_{s,i}(t_{j+k})} = \frac{1}{\overline{T}_{rec,i}}
\end{equation}

\begin{equation}
\frac{\partial g_{i}}{\partial T_{rec,i}} = - \frac{\hat{c}_{s,i}(t_{j+k})}{\overline{T}_{rec,i}^2}.
\end{equation}

For an individual \(T_{rec}\) estimate, we have that
\begin{equation}
 \frac{\partial T_{rec,i}}{\partial c_{s,i}(t_{j})} = \frac{(T_{l}-T_{s})(c_{l,i}-c_{s,i}) + c_{s,i}(T_{l}-T_{s})}
{(c_{l,i}-c_{s,i})^2} \approx \frac{T_{rec,i}}{g_{i}T_{l}}
\end{equation}

\begin{equation}
 \frac{\partial T_{rec,i}}{\partial c_{l,i}} = \frac{-c_{s,i}(T_{l}-T_{s})}{(c_{l,i}-c_{s,i})^2} \approx -\frac{T_{rec,i}}{g_{i}T_{l}}
\end{equation}
Thus, we have

\begin{equation}
 \frac{\partial g_{i}}{\partial c_{l,i}} = \frac{\partial g_{i}}{\partial T_{rec,i}}\frac{\partial T_{rec_{i}}}{\partial c_{l,i}}=
\frac{1}{T_{l,i}-T_{s,i}}
\end{equation}

\begin{equation}
 \frac{\partial g_{i}}{\partial c_{s,i}} = \frac{\partial g_{i}}{\partial T_{rec,i}}\frac{\partial T_{rec_{i}}}{\partial c_{s,i}} =
\frac{-1}{T_{l,i}-T_{s,i}}
\end{equation}
which implies:

\begin{equation}
\Delta g_{i}^{2} =  \frac{\Delta c_{l,i}^{2} + \Delta c_{s,i}^{2}}{(T_{l,i}-T_{s,i})^2} + \frac{ \Delta c_{i}^{2}(t_{j+1})}{T_{rec,i}^{2}}
\approx \frac{\Delta c_{l,i}^{2} + \Delta c_{s,i}^{2}}{T_{l,i}^2}
\end{equation}
and

\begin{equation}
T_{a,i}^{2}\frac{\Delta g_{i}^{2}}{g_{i}^2} = \frac{T_{a,i}^{2}}{T_{l,i}^2} \frac{\Delta c_{l,i}^{2} + \Delta c_{s,i}^{2}}{g_{i}^{2}},
\end{equation}
or, if we take into account that \(T_{rec}\) spectrum is an average from \(n\) measurements

\begin{equation}
 T_{a,i}^{2}\frac{\Delta g_{i}^{2}}{g_{i}^2} =  \frac{1}{B\tau} \left(
   \frac{T_{a,i}^{2}}{n} \left( \left( \frac{T_{rec,i} + T_{l,i}}{T_{l,i}} \right)^2 + \left( \frac{T_{rec,i} }{T_{l,i}} \right)^2 \right) \right).
\end{equation}

\subsection{Uncertainties related to rapid gain fluctuations}
\label{sec:gainvar}
In the preceding section we derived an error for reference noise contribution.
Gain fluctuations on a small time scale (between reference-target-reference
observation sequence) not captured by the interpolation of reference signals
give rise to errors.
In practice there is also a finite error due to non-linear gain variation
i.e. there is a broadband-offset between the estimated and true reference signal
\begin{equation}
\hat{c_{s}}(t_{j+1}) - c_{s}(t_{j+1}) = \Delta c_{s} = \Delta g' T_{rec},
\end{equation}
where \(\Delta g'\) represents the non-captured variation in gain
due to non-linear gain fluctuations.

This error can be described as
\begin{equation}
\Delta T_{i,gain}^2 = T_{rec}^{2}\left(\frac{\Delta g'}{g}\right)^{2}.
\label{eq:gainvar}
\end{equation}

For a given \smr\ spectrum \(\Delta T_{i}\)\(\approx\)2\,K due to this effect,
but when averaging many spectra this effect goes to 0.

\subsection{Other uncertainties}
\label{sec:otheruncer}

There are also errors in calibrated \smr\ spectra due to imperfect knowledge of
the calibration target temperature and main beam efficiency.

\begin{itemize}

\item The accuracy of temperature information of the calibration target
 is (\(\Delta T_{l}\)) around 0.2\,K. The related calibration error (\(\Delta T_{a}\)) is
 \begin{equation}
  \Delta T_{a} \approx \frac{T_{a}}{T_{l}} \Delta T_{l},
 \end{equation}
 which gives that for observations against a blank background the error
 is close to 0, while if \(T_{a}\)=200\,K \(\Delta T_{a}\)\(\approx\)\,0.14 K.

\item Main beam efficiency uncertainty. The main beam efficiency is estimated
 for each scan and this estimate introduces a finite error to calibrated spectrum.
 We have that
 \begin{equation}
  \Delta T_{a} = \frac{\Delta n_{a}}{n_{a}}T_{a},
 \end{equation}
 and

 \begin{equation}
  \Delta n_{a}^{2} = \left(\frac{T_{sp}\Delta T_{amb}}{T_{amb}^{2}}\right)^{2} +
                     \left( \frac{\Delta T_{sp}}{T_{amb}} \right)^2.
 \end{equation}

Thus, error in estimated main beam effciency is sensitive to errors in both assumed
\(T_{amb}\) and estimated \(T_{sp}\), and

\begin{equation}
  \Delta T_{a} = \sqrt{ \left(\frac{T_{sp}\Delta T_{amb}}{T_{amb}^{2}}\right)^{2} +
                     \left( \frac{\Delta T_{sp}}{T_{amb}} \right)^2 } \frac{T_{a}}{n_a}
\label{eq:tanaerr}
\end{equation}

For the moment we assume that \(\Delta T_{sp}\)=0 (see Sect.~\ref{sec:trends} for further
analysis), and focus on the \(\Delta T_{amb}\) term.
There is no temperature sensor on \smr\ that measure the baffle temperature, and a constant
value of 300\,K is used in calibration process.
Anyhow, for  observations against a blank backgrund the error
is close to 0, while if \(T_{a}\)=200\,K, \(T_{amb}\)=300\,K, \(T_{sp}\)=8\,K,
and \(\Delta T_{amb}\)=10\,K, than \(\Delta T_{a}\)\(\approx\)\,0.18 K.

\end{itemize}

\subsection{Trend uncertainties}
\label{sec:trends}
It can not be ruled out that calibrated \smr\ spectra
contain artificial trends that are related to a
possible error in the estimation of main beam efficiency.

The main beam efficiency is determined based on an estimated
\(T_{sp}\) value (see Eq.~\ref{eq:eta}).
The estimation of \(T_{sp}\) (see Eq.~\ref{eq:tspill2})
is done under the assumption that reference signals are ``clean''.
It has been noted that there is a slight mismatch between
main beam and reference signals (see Sect.~\ref{sec:ripples}).
If we assume that the reference signal contains a time varying
broadband offset (\(c_{s}=g(T_{rec}+\Delta T_{off}(t))\))
we have that Eq.~\ref{eq:tspill2} reads
\begin{equation}
 T_{sp}=(c_{a}-c_{s})\frac{T_{rec}}{c_{s}}\approx(1-\eta_{a})T_{amb}-\Delta T_{off}(t),
\end{equation}
thus, \(T_{sp}\) is made up of two contributions and the error
in ``true'' \(T_{sp}\) is \(\Delta T_{off}(t)\).
Equation~\ref{eq:tanaerr} then tells us how this related
error introduces an error in estimated \(T_{a}\) within the calibration algorithm.
Since main beam efficiency error is proportional to \(T_{a}\) it has low impact
on weak signals. However, if \(\Delta T_{off}(t)\) has changed by 1.5\,K
during the mission, one would see an artificial change in strong
signals (around 200\,K) of about 1\,K.

\subsection{Notes on noise correlations}
\label{notesoncorr}

Noise on calibrated \smr\ has correlations of the following type/reason:

\begin{itemize}

\item Radiometric noise from the target signal is correlated between
neighboring channels of a given spectrum (due to Hanning smoothing).

\item The gain variation term (Eq.~\ref{eq:gainvar}) has been found to be correlated
between channels for \smr.
This gain variation has been estimated to give rise to a constant
shift in the brightness temperature across the band (that is, it can
be seen as a flat baseline ripple), where the shift
has a standard deviation of about 2 K and is uncorrelated
between tangent altitudes and front-ends.

\item Noise of two neighboring spectra is correlated due to
the fact that they share one cold sky reference measurements.
The noise linear correlation coefficient from a given channel
from two neighboring spectra should be \(\sim\)\,0.17 due to this
fact. This value was derived from simulations for an ideal
case, in which simulated measurements and references were
given noise of equal magnitude, and the calibration
process replicated.

\item All spectra in a scan share a common (noisy) \(T_{rec}\)
spectrum.

\end{itemize}

\subsection{Precision: estimates from calibration process}
\label{sec:caluncer}

\(T_{rec}\) and obtained random uncorrelated noise level is estimated within the
calibration processing for each scan.

This random noise level is estimated as an effective integration time
(\(\tau_{eff}\)) from calibrated spectra of the upper part of a scan
(with a blank background). Each spectrum of a scan is given an effective
integration time, but it is determined from all spectra within a time
window of \(\pm\)45\,minutes.
Within the calibration algorithm, the noise of each sub-band of
the considered spectrum is calculated as the bias corrected variance, i.e.
\begin{equation}
\Delta T^{2} = \frac{1}{n-1}\sum_{i=1}^{n}(T_{b,i}-\left<T_{b}\right>)^{2}
\end{equation}

An efficiency factor \(\eta\) for each sub-band is then calculated (from the radiometer noise equation) as
\begin{equation}
\eta = \frac{T_{rec}^2}{B\Delta T^{2}\tau}.
\end{equation}

An efficiency factor for the scan is then determined from the sub-band
with the highest average efficiency factor. The alternative option
to use the result from the sub-band with lowest efficiency factor
is not wise. The reason is that even for spectra of the upper part
of the scan, some sub-bands may contain the signature of an emission
line which would be treated as noise here.

The effective integration time associated with a given spectrum
in the Level1B data should then be treated as a
variable that can be plugged into the radiometer noise equation,
i.e.
\begin{equation}
\Delta T = T_{rec}\frac{1}{\sqrt{B\tau_{eff}}},
\end{equation}
to obtain a measure of the noise level of the spectrum
(and \(B\) should be set to 100\,MHz although this is not
the resolution of a channel after calibration).
This obtained noise level should be comparable to the noise
of Eq.~\ref{eq:higaltnoise}.

\section{Frequency calibration}

\subsection{Local oscillator frequency drift}

\begin{table}
\caption{Fitting parameters for the frequency drift correction.}
\label{table:freqcorr}
\begin{tabular}{|l|l|l|l|}
  \hline
  \textbf{Frontend} & \textbf{Constant}  & \textbf{Time Dependence}      & \textbf{Temperature dependence} \\
                    & \textbf{\(c_{0}\)} & \textbf{\(c_{0}\)}            & \textbf{\(c_{0}\)}              \\
  \hline
        555         & 1.00007687         & -9.881469\(\cdot10^{-10}\)    &  -7.20429255\(\cdot10^-{8}\)    \\
  \hline
        495         & 1.00004369         & -3.049353\(\cdot10^{-10}\)    &  -9.77071337\(\cdot10^-{8}\)    \\
  \hline
        549         & 1.00005847         & -6.275934*\(\cdot10^{-10}\)   &  -3.89089138\(\cdot10^-{8}\)    \\
  \hline
        572         & N/A                & N/A                           & N/A                             \\
  \hline
\end{tabular}
\end{table}

Firstly, the operating local oscillator (LO) frequency is calculated
from harmonic reference oscillator and phase locked loop (PLL)
reference oscillator frequencies from the housekeeping level0 data.
A second step is then to account for drifts in the LO frequency.
It has been previously noted that a spectral shift exists in
the current level 1 dataset (version 6 and 7) and that this shift
has been changing over time.
A new model, based on Version 2-0 and Verison 2-1 Level2 data,
is applied for calibration version 8 data that takes into
account of a temperature dependency and a temporal term
of the LO frequency drift.
The correction factor \(k\) and frequency drift corrected
LO frequency \(\hat{f}_{lo,sky}\) is estimated as
\begin{equation}
  \label{eq:freqcorr}
  k = c_{0} + c_{1} \cdot mjd + c_{2} \cdot T_{pll}
\end{equation}
and
\begin{equation}
 \label{eq:freqest}
 \hat{f}_{lo,sky}= k f_{lo,sky},
\end{equation}
where \(T_{pll}\) is the temperature of image load b-side,
and the \(c_{0}\), \(c_{1}\), and \(c_{2}\) terms have been found
to depend on the applied frontend and the applied values are
displayed in Table~\ref{table:freqcorr}. Another correction
is applied for data from the 572 GHz frontend. Due to a PLL
failure of this radiometer, which in practice means
that the LO frequency is noticeably offset from the commanded
frequency, a special correction is applied in the Level1 processing, which is described in Appendix \ref{chapter:freqCorrCO}.
This model keeps the frequency error within \(\pm\)\,0.5\,MHz
(except for data from the 572 GHz radiometer).

%End of paragraph updated with reference to Appendox {chapter:freqCorrCO} by Julia R, 2016-05-30.

\subsection{Doppler correction}

A Doppler correction is applied.
The relative velocity \(v_{geo}\) of the satellite in the direction
of the tangent point is used to translate the LO frequency to an
earth-fixed reference frame. i.e.
\begin{equation}
\hat{f}_{lo} = \hat{f}_{lo,sky}/(1.0 - v_{geo}/c),
\end{equation}
where \(c\) is the speed of light.

\section{Pointing and attitude data processing}

The vertical scanning is achieved by rotation of the satellite
platform by an advanced attitude control system (ACS).
The ACS uses star trackers as the main sensors with backup from gyros,
magnetometers, and Sun sensors. Reaction wheels and magnetic coils serve as
actuators. The ACS pointing accuracy in limb-scanning mode is 5\(^{'}\) in
real time knowledge, and better than 1\(^{'}\) in reconstructed knowledge
(which translates to a \(\sim\)800\,m accuracy in tangent point).

The reconstructed attitude data files contain the estimated
achieved attitude given as a quaternion, and the satellite position
and velocity from GPS receiver on-board of Odin.

In the calibration software at Chalmers, this data is used to calculate
the geographical position of the tangent point, the satellite relative velocity
\(v_{geo}\) of the satellite in the direction of the tangent point.
The hit of the target and sky beams with various objects (e.g. Earth, Moon)
are also tested (using a low precision ephemeris)
and reported as quality indicators.


\documentclass[letterpaper, twoside, 12pt]{book}
\usepackage{packet}

\begin{document}

\setcounter{chapter}{10}
\setcounter{section}{3}

\section{The Cross Product}

\begin{definition}
  For any two non-parallel and non-zero vectors $\harpvec{u}$, $\harpvec{v}$
  in $\mathbb R^3$,
  the \textbf{Right-Hand Rule} gives a specific direction orthogonal to both:
  position both vectors at the origin, and draw a line orthogonal to the
  plane containing both vectors. Then place your right thumb near
  $\harpvec{u}$ and your right index finger near $\harpvec{v}$.
  The direction on the orthogonal line given by extending your middle
  finger is the direction given by the RHR.
\end{definition}

\begin{definition}
  Let \(\harpvec u,\harpvec v\) be vectors.
  Their \textbf{cross product} $\harpvec{u}\times\harpvec{v}$ is the vector
  constructed as follows:
  \begin{enumerate}
    \item If either of \(\harpvec u,\harpvec v\) is the zero vector
      \(\harpvec 0\), then \(\harpvec u\times\harpvec v=\harpvec 0\).
    \item If \(\harpvec u,\harpvec v\) are parallel,
      then \(\harpvec u\times\harpvec v=\harpvec 0\).
    \item Otherwise, let \(\harpvec n\) be the unit vector given by the
     vectors \(\harpvec u,\harpvec v\) and the RHR, and let \(a\) be the area
     of the parallelogram determined by the vectors \(\harpvec u,\harpvec v\).
     Then \(\harpvec u\times\harpvec v=a\harpvec n\).
  \end{enumerate}
  % Let $\theta$ be the angle between two non-zero vectors $\harpvec{u}$,
  % $\harpvec{v}$ in $\mathbb{R}^3$, and let $\harpvec{n}$ be the direction
  % given by the Right-Hand Rule.

  %  to both which follows the Right-Hand Rule and has magnitude
  % equal to the area of the parallelogram formed from both.
  % \[
  %   \harpvec{u}\times\harpvec{v}
  %     =
  %   (|\harpvec{u}||\harpvec{v}|\sin\theta)\harpvec{n}
  % \]
  % \[
  %   |\harpvec{u}\times\harpvec{v}|
  %     =
  %   |\harpvec{u}||\harpvec{v}|\sin\theta
  % \]
\end{definition}

\begin{theorem}
  The cross products of the standard unit vectors are given as follows:
  \begin{itemize}
    \item $\veci \times \vecj = \veck$
    \item $\vecj \times \veci = -\veck$
    \item $\vecj \times \veck = \veci$
    \item $\veck \times \vecj = -\veci$
    \item $\veck \times \veci = \vecj$
    \item $\veci \times \veck = -\vecj$
    \item $\veci \times \veci = \harpvec 0$
    \item $\vecj \times \vecj = \harpvec 0$
    \item $\veck \times \veck = \harpvec 0$
  \end{itemize}
\end{theorem}

\begin{theorem}
  The following properties hold for any three vectors $\harpvec{u}$, $\harpvec{v}$,
  $\harpvec{w}$ and scalars $a$,$b$.
  \begin{itemize}
  \item $\harpvec{v} \times \harpvec{u} = -(\harpvec{u} \times \harpvec{v})$
  \item $(a\harpvec{u}) \times (b\harpvec{v}) = (ab)(\harpvec{u} \times \harpvec{v})$
  \item
    $\harpvec{u} \times (\harpvec{v} + \harpvec{w}) =
    \harpvec{u} \times \harpvec{v} + \harpvec{u} \times \harpvec{w}$
  \item
    $(\harpvec{v} + \harpvec{w}) \times \harpvec{u} =
    \harpvec{v} \times \harpvec{u} + \harpvec{w} \times \harpvec{u}$
  \end{itemize}
\end{theorem}

\begin{problem}
  Compute \((3\veci-4\vecj)\times(\vecj+2\veck)\).
\end{problem}

\begin{definition}
  A \textbf{determinant} is shorthand for writing the following
  algebraic expressions:
    \[
      \begin{array}{|c c|}
      a_1 & a_2 \\
      b_1 & b_2 \\
      \end{array}
        =
      a_1b_2 - a_2b_1
    \]
    \[
      \begin{array}{|c c c|}
      a_1 & a_2 & a_3 \\
      b_1 & b_2 & b_3 \\
      c_1 & c_2 & c_3 \\
      \end{array}
        =
      a_1 \,
      \begin{array}{|c c|}
      b_2 & b_3 \\
      c_2 & c_3 \\
      \end{array}
        -
      a_2 \,
      \begin{array}{|c c|}
      b_1 & b_3 \\
      c_1 & c_3 \\
      \end{array}
        +
      a_3 \,
      \begin{array}{|c c|}
      b_1 & b_2 \\
      c_1 & c_2 \\
      \end{array}
    \]
\end{definition}

\begin{theorem}
  The area of a parallelogram determined by two
  vectors \(\harpvec u,\harpvec v\) with angle \(\theta\) is given by
  \(
    \|\harpvec u\|\|\harpvec v\|\sin\theta
  \).
\end{theorem}

\begin{problem}
  Find the area of the parallelogram determined by the vectors
  \(\<0,3\>\) and \(\<2,2\>\)
\end{problem}

\begin{theorem}
  The area of a parallelogram determined by two \(2D\)
  vectors \(\harpvec u,\harpvec v\) with angle \(\theta\) is given by
  the absolute value of the determinant
  \(
    \begin{array}{|c c|}
    u_1 & u_2 \\
    v_1 & v_2 \\
    \end{array}
  \).
\end{theorem}

\begin{problem}
  Use this to resolve the previous problem.
\end{problem}

\begin{problem}
  Find the area of the triangle with vertices at \((2,3)\), \((-1,4)\),
  and \((1,1)\)
\end{problem}

\begin{theorem}
  The volume of a parallelepiped determined by three three-dimensional
  vectors \(\harpvec u,\harpvec v,\harpvec w\) is given by the absolute
  value of their
  \textbf{triple scalar product}, the determinant
  \(
    \begin{array}{|c c c|}
    u_1 & u_2 & u_3 \\
    v_1 & v_2 & v_3 \\
    w_1 & w_2 & w_3 \\
    \end{array}
  \).
\end{theorem}

\begin{problem}
  Find the volume of the parallelepiped determined by the vectors
  \(\<1,2,3\>\), \(\<0,-1,4\>\), and \(\<2,2,0\>\).
\end{problem}

\begin{theorem}
  By breaking up $\harpvec{u}$, $\harpvec{v}$ into standard unit vectors:
  \[
  \harpvec{u} \times \harpvec{v}
    =
  \begin{array}{|c c c|}
  \veci & \vecj & \veck \\
  u_1 & u_2 & u_3 \\
  v_1 & v_2 & v_3 \\
  \end{array}
    =
  \begin{array}{|c c|}
  u_2 & u_3 \\
  v_2 & v_3 \\
  \end{array}
  ~\veci-
  \begin{array}{|c c|}
  u_1 & u_3 \\
  v_1 & v_3 \\
  \end{array}
  ~\vecj+
  \begin{array}{|c c|}
  u_1 & u_2 \\
  v_1 & v_2 \\
  \end{array}
  ~\veck
  \]
\end{theorem}

\begin{problem}
  Recompute \((3\veci-4\vecj)\times(\vecj+2\veck)\).
\end{problem}

\begin{problem}
  Find the area of the parallelogram determined by $\harpvec{u}=\<4,-3,0\>$
  and $\harpvec{v}=\<2,6,-3\>$.
\end{problem}

\begin{problem}
  Find a unit vector orthogonal to both $\harpvec{u}=\<4,-3,0\>$
  and $\harpvec{v}=\<2,6,-3\>$.
\end{problem}

\begin{theorem}
  The triple scalar product of three vectors is also given by
    \[
      \harpvec{w}\cdot(\harpvec{u}\times\harpvec{v}) =
      (\harpvec{u}\times\harpvec{v})\cdot\harpvec{w} =
      \begin{array}{|c c c|}
      u_1 & u_2 & u_3 \\
      v_1 & v_2 & v_3 \\
      w_1 & w_2 & w_3 \\
      \end{array}
    \]
\end{theorem}

\begin{definition}
  The torque $\tau$ done by a force vector $\harpvec{F}$ on an arm given by
  $\harpvec{D}$ is given by
  \[
    \tau = |\harpvec{F} \times \harpvec{D}|
      =
    |\harpvec{F}||\harpvec{D}|\sin \theta
  \]
\end{definition}

\begin{problem}
  Find the torque enacted by the force \(\<2,2,-2\>\) on a wrench at the point
  \((4,3,2)\) and bolt centered at the point \((1,0,-2)\).
\end{problem}

\end{document}


\documentclass[12pt]{article}

\usepackage[vmargin=1in,hmargin=1in]{geometry}
\usepackage{amsmath}
\usepackage[parfill]{parskip}
\usepackage{hyperref}
\usepackage{natbib}
\usepackage{bm}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{abstract}
\usepackage{lineno}
\usepackage{setspace}

\hypersetup{pdfstartview={Fit},hidelinks}

\newcommand{\bs}{{\bf s}}
\newcommand{\bsi}{{\bf s}_i}
\newcommand{\bx}{{\bf x}}
\newcommand{\bxj}{{\bf x}_j}
\newcommand{\by}{{\bf y}}
\newcommand{\bu}{{\bf u}}
\newcommand{\bui}{{\bf u}_i}
\newcommand{\but}{{\bf u}_{t}}
\newcommand{\buit}{{\bf u}_{it}}
\newcommand{\buip}{{\bf u}_{i,t-1}}
\newcommand{\ed}{\|\bx - \bx'\|}
\newcommand{\cS}{\mathcal{S} }

\title{Ecology Appendix S1 \\ Posterior distribution and Gibbs sampler \\ \it Modeling abundance, distribution, movement, and space
  use with camera and telemetry data}
\author{Richard B. Chandler$^1$\footnote{Corresponding author: rchandler@warnell.uga.edu}, Daniel A. Crawford$^2$, Elina P. Garrison$^3$, \\
  Karl V. Miller$^1$, Michael J. Cherry$^2$}

\begin{document}

\maketitle

\vspace{12pt}

\begin{description}%[labelindent=1pt]%[leftmargin=1cm]%,labelwidth=\widthof{\bfseries Example:}]
%  \large
\item[$^1$] Warnell School of Forestry and Natural Resources, University of Georgia %\\
\item[$^2$] Caesar Kleberg Wildlife Research Institute at Texas A\&M University-Kingsville %\\
\item[$^3$] Florida Fish and Wildlife Conservation Commission %\\
\end{description}

\clearpage

\section*{Posterior distribution}

The posterior distribution of the joint spatial capture-recapture
movement model (with constant $\sigma$ and data augmentation) is

\begin{multline}
  p(p, \lambda_0, \sigma_{\mathrm det}, \rho, \sigma, \{\bu_{it}\}, \{\bs_i\}, \{z_i\}, \psi | {\bm y}^{\rm cap},{\bm y}) \propto \\
  \left\{\prod_{i=1}^M p(y_i^{\rm cap}|z_i, p)
    \left\{\prod_{t=1}^T\left\{\prod_{j=1}^Jp(y_{ijt}|z_i,\lambda_0,\sigma_{\rm det},\buit)
    \right\}p(\buit|\bu_{i,t-1},\bsi,\rho,\sigma)\right\} %\times \\
  p(\bsi)p(z_i|\psi)\right\} \times \\
p(p)p(\lambda_0)p(\sigma_{\rm det})p(\rho)p(\sigma)p(\psi) \\
%  \label{eq:post}
%  \tag{S1}
\end{multline}

where
\[
  p(y_i^{\rm cap}|z_i, p) = \mathrm{Bern}(y_i|z_i\times p)
\]
\[
  p(y_{ijt}|z_i,\lambda_0,\sigma_{\rm det},\buit) = \mathrm{Pois}(y_{ijt}|z_i \times \lambda^{\rm det}_{ijt})
\]
\[
  p(\buit|\bu_{i,t-1},\bsi,\rho,\sigma) =
  \begin{cases}
    \mathrm{Norm}(\buit|\bsi+(\buip-\bsi)\rho, \mathrm{diag}(\sigma^2
    - \sigma^2\rho^2)) & \mathrm{for}\quad t>1 \\
    \mathrm{Norm}(\buit|\bsi, \mathrm{diag}(\sigma^2)) & \mathrm{for}\quad t=1 \\
  \end {cases}
\]
\[
  p(\bsi) = \mathrm{Unif}(\mathcal M)
\]
\[
  p(z_i|\psi) = \mathrm{Bern}(z_i|\psi)
\]
and the other probability distributions are priors for the
parameters. Note that some or all of the $\buit$ locations could be
observed.

\clearpage

\section*{Gibbs sampler}

Sampling from the joint posterior is computationally challenging
because of the latent movement paths for the $M-n$ augmented
individuals. The burden can be reduced by marginalizing these latent
paths while retaining the activity centers $\{\bsi\}$. This is
accomplished using Eq. 6 in the manuscript and the probability density:
\[
  p(0|\lambda_0,\sigma_{\rm det},\rho,\sigma,\bsi,z_i) = \mathrm{Bern}(0|\tilde{p}_i)
\]
The Gibbs sampler begins by initializing the unknown parameters and
then sampling from the following full conditional distributions.

Use Metropolis-Hastings (MH) to sample from:
\[
  p(\rho,\sigma|\cdot) \propto \left\{\prod_{i=1}^n\prod_{t=1}^T
    p(\buit|\bu_{i,t-1},\bsi,\rho,\sigma)\right\}\left\{\prod_{i=n+1}^M p(0|\lambda_0,\sigma_{\rm det},\rho,\sigma,\bsi,z_i)\right\}p(\rho)p(\sigma)
\]

Use MH to sample from:
\[
  p(\lambda_0,\sigma_{\rm det}|\cdot) \propto \left\{\prod_{i=1}^n\prod_{j=1}^J\prod_{t=1}^T
    p(y_{ijt}|z_i,\lambda_0,\sigma_{\rm det},\buit)\right\}\left\{\prod_{i=n+1}^M
    p(0|\lambda_0,\sigma_{\rm det},\rho,\sigma,\bsi,z_i)\right\}p(\lambda_0)p(\sigma_{\rm det})
\]

Sample directly from
\[
  p(\psi|{\bm z}) = \mathrm{Beta}\left(1+\sum_{i=1}^M z_i, 1+M-\sum_{i=1}^M z_i\right)
\]

For $i=n+1,\dots,M$, use MH to sample from
\[
  p(z_i|\cdot) \propto p(y^{\rm cap}_i|z_i,p)
    \left\{\prod_{j=1}^J\prod_{t=1}^T p(y_{ijt}|z_i,\lambda_0,\sigma_{\rm
      det},\buit)\right\}
  p(0|\lambda_0,\sigma_{\rm det},\rho,\sigma,\bsi,z_i)p(z_i|\psi)
\]

Use MH (or direct draw from beta full conditional) to sample from
\[
  p(p|\cdot) \propto \prod_{i=1}^M p(y^{\rm cap}_i|z_i \times p)p(p)
\]

For $i=1,\dots,n$, use MH to sample from
\[
  p(\bsi|\cdot) \propto p(\buit|\rho,\sigma,\bsi)p(\bsi)
\]

For $i=n+1,\dots,M$, use MH to sample from
\[
  p(\bsi|\cdot) \propto p(0|\lambda_0,\sigma_{\rm det},\rho,\sigma,\bsi,z_i)p(\bsi)
\]

For $i=1,\dots,n$ and for cases where $\buit$ is not observed, use MH to sample from
\[
  p(\buit|\cdot) \propto
  p(\bu_{i,t+1}|\bu_{i,t},\bsi,\rho,\sigma)p(\bu_{i,t}|\bu_{i,t-1},\bsi,\rho,\sigma)\prod_{j=1}^J
  p(y_{ijt}|\lambda_0,\sigma_{\rm det},\buit)
\]

\end{document}


\chapter{Terrain-following Coordinates}
\label{chap:terrain-following}
{\bf \Large
\begin{tabular}{ccc}
\hline
  Corresponding author & : & Hisashi Yashiro\\
\hline
\end{tabular}
}

\section{Geometry and Definitions}
We introduce a terrain following coordinate system with a new vertical coordinate $\xi$.
$\xi$-coordinate system is not deformable system. We use the relation between z and $\xi$ as

\begin{eqnarray}
 \xi = \frac{z_{toa}(z-z_{sfc})}{z_{toa}-z_{sfc}},
\end{eqnarray}
Where $z_{toa}$ is the top of the model domain and $z_{sfc}$ is the surface height,
which depends on the horizontal location.

The metrics are defined as
\begin{align}
 G^{\frac{1}{2}} &= \frac{\partial z}{\partial \xi}, \\
 J^{\xi}_{13} &= \left(\frac{\partial \xi}{\partial x}\right)_{z} = -\frac{J^{z}_{13}}{J^{z}_{33}},\\
 J^{\xi}_{23} &= \left(\frac{\partial \xi}{\partial y}\right)_{z} = -\frac{J^{z}_{23}}{J^{z}_{33}},\\
 J^{\xi}_{33} &=       \frac{\partial \xi}{\partial z}            =  \frac{1}         {J^{z}_{33}},
\end{align}
where
\begin{align}
 J^{z}_{13} &= \left(\frac{\partial z}{\partial x}\right)_{\xi},\\
 J^{z}_{23} &= \left(\frac{\partial z}{\partial y}\right)_{\xi},\\
 J^{z}_{33} &= -{G^{\frac{1}{2}}}
\end{align}

If we use the Eqs.(5.2)-(5.5), we obtain following equations:
\begin{align}
 \nabla \cdot (G^{\frac{1}{2}} \phi) &= \left(\frac{\partial G^{\frac{1}{2}} \phi}{\partial x}\right)_{\xi}
                                      + \left(\frac{\partial G^{\frac{1}{2}} \phi}{\partial y}\right)_{\xi}
                                      + (J^{\xi}_{13}+J^{\xi}_{23}+J^{\xi}_{33}) \frac{\partial G^{\frac{1}{2}} \phi}{\partial \xi}, \\
 \nabla \cdot (G^{\frac{1}{2}} \bf u) &= \frac{\partial G^{\frac{1}{2}} u}{\partial x}
                                       + \frac{\partial G^{\frac{1}{2}} v}{\partial y}
                                       + \frac{\partial}{\partial \xi}
                                         \left(J^{\xi}_{13} {G^{\frac{1}{2}}} u
                                              +J^{\xi}_{23} {G^{\frac{1}{2}}} v
                                              +J^{\xi}_{33} {G^{\frac{1}{2}}} w
                                         \right).
\end{align}

\section{Summary of modified equations in the dynamical process}

Prognostic variables by multiplying $G^{\frac{1}{2}}$ are defined as
\begin{align}
 (\rho Q_v)_{i,j,k}           &= G^{\frac{1}{2}}_{i,j,k}             (\rho Q_v)_{i,j,k},        \\
 (\rho Q_l)_{i,j,k}           &= G^{\frac{1}{2}}_{i,j,k}             (\rho Q_l)_{i,j,k},        \\
 (\rho Q_s)_{i,j,k}           &= G^{\frac{1}{2}}_{i,j,k}             (\rho Q_s)_{i,j,k},        \\
 R_{i,j,k}                    &= G^{\frac{1}{2}}_{i,j,k}              \rho_{i,j,k},                \\
 (\rho U)_{i+\frac{1}{2},j,k} &= G^{\frac{1}{2}}_{i+\frac{1}{2},j,k} (\rho u)_{i+\frac{1}{2},j,k}, \\
 (\rho V)_{i,j+\frac{1}{2},k} &= G^{\frac{1}{2}}_{i,j+\frac{1}{2},k} (\rho v)_{i,j+\frac{1}{2},k}, \\
 (\rho W)_{i,j,k+\frac{1}{2}} &= G^{\frac{1}{2}}_{i,j,k+\frac{1}{2}} (\rho w)_{i,j,k+\frac{1}{2}}, \\
 (\rho \Theta)_{i,j,k}        &= G^{\frac{1}{2}}_{i,j,k}             (\rho \theta)_{i,j,k},        \\
 P_{i,j,k}                    &= G^{\frac{1}{2}}_{i,j,k}              p_{i,j,k}
\end{align}

and Eqs.(2.67)-(2.72) are modified using Eqs.(5.2)-(5.5).

\begin{align}
 \frac{\partial \rho Q_v     }{\partial t} + \nabla \cdot \left( \rho Q_v             {\bf u}\right) &= 0 \\
 \frac{\partial \rho Q_l     }{\partial t} + \nabla \cdot \left( \rho Q_l             {\bf u}\right) &= 0 \\
 \frac{\partial \rho Q_s     }{\partial t} + \nabla \cdot \left( \rho Q_s             {\bf u}\right) &= 0 \\
 \frac{\partial R            }{\partial t} + \nabla \cdot \left( R                    {\bf u}\right) &= 0 \\
 \frac{\partial \rho {\bf U} }{\partial t} + \nabla \cdot \left( \rho {\bf U} \otimes {\bf u}\right) &= -\nabla P - Rg {\bf e_z} \\
 \frac{\partial \rho \Theta  }{\partial t} + \nabla \cdot \left( \rho \Theta          {\bf u}\right) &= 0
\end{align}

\section{Spatial descretization}
\subsection{Continuity equation}
\begin{align}
 \left(\frac{\partial R}{\partial t}\right)_{i,j,k}
 = - &\Bigg[ \frac{ (\rho U)_{i+\frac{1}{2},j,k}
                  - (\rho U)_{i-\frac{1}{2},j,k}
                  } {\Delta x} \nonumber \\
          &+ \frac{ (\rho V)_{i,j+\frac{1}{2},k}
                  - (\rho V)_{i,j-\frac{1}{2},k}
                  } {\Delta y} \nonumber \\
          &+ \frac{ (J^{\xi}_{13})_{i,j,k+\frac{1}{2}} \overline{\widetilde{(\rho U)}^x}^z_{i,j,k+\frac{1}{2}}
                  - (J^{\xi}_{13})_{i,j,k-\frac{1}{2}} \overline{\widetilde{(\rho U)}^x}^z_{i,j,k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{23})_{i,j,k+\frac{1}{2}} \overline{\widetilde{(\rho V)}^x}^z_{i,j,k+\frac{1}{2}}
                  - (J^{\xi}_{23})_{i,j,k-\frac{1}{2}} \overline{\widetilde{(\rho V)}^x}^z_{i,j,k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{33})_{i,j,k+\frac{1}{2}} (\rho W)_{i,j,k+\frac{1}{2}}
                  - (J^{\xi}_{33})_{i,j,k+\frac{1}{2}} (\rho W)_{i,j,k-\frac{1}{2}}
                  } {\Delta \xi} \Bigg]
\end{align}
where
\begin{align}
 \overline{\widetilde{(\rho U)}^x}^z_{i,j,k+\frac{1}{2}}
 &= G^{\frac{1}{2}}_{i,j,k+\frac{1}{2}} \frac{ \widetilde{(\rho u)}^x_{i,j,k+1}
                                             + \widetilde{(\rho u)}^x_{i,j,k  }
                                             } {2}, \\
 \overline{\widetilde{(\rho V)}^x}^z_{i,j,k+\frac{1}{2}}
 &= G^{\frac{1}{2}}_{i,j,k+\frac{1}{2}} \frac{ \widetilde{(\rho v)}^x_{i,j,k+1}
                                             + \widetilde{(\rho v)}^x_{i,j,k  }
                                             } {2},
\end{align}
$\widetilde{(\rho u)}^x_{i,j,k}$ and $\widetilde{(\rho v)}^x_{i,j,k}$ are obtained by same manner in eq.(3.20)

\subsection{Momentum equations}
\begin{align}
 \left(\frac{\partial \rho U}{\partial t}\right)_{i+\frac{1}{2},j,k}
 = - &\Bigg[ \frac{ \widetilde{(\rho U)}^x_{i+1,j,k} \overline{u}_{i+1,j,k}
                  - \widetilde{(\rho U)}^x_{i  ,j,k} \overline{u}_{i  ,j,k}
                  } {\Delta x} \nonumber \\
          &+ \frac{ \widetilde{(\rho U)}^y_{i+\frac{1}{2},j+\frac{1}{2},k} \overline{v}_{i+\frac{1}{2},j+\frac{1}{2},k}
                  - \widetilde{(\rho U)}^y_{i+\frac{1}{2},j-\frac{1}{2},k} \overline{v}_{i+\frac{1}{2},j-\frac{1}{2},k}
                  } {\Delta y} \nonumber \\
          &+ \frac{ (J^{\xi}_{13})_{i+\frac{1}{2},j,k+\frac{1}{2}} \widetilde{(\rho U)}^z_{i+\frac{1}{2},j,k+\frac{1}{2}} \overline{\overline{u}}^z_{i+\frac{1}{2},j,k+\frac{1}{2}}
                  - (J^{\xi}_{13})_{i+\frac{1}{2},j,k-\frac{1}{2}} \widetilde{(\rho U)}^z_{i+\frac{1}{2},j,k-\frac{1}{2}} \overline{\overline{u}}^z_{i+\frac{1}{2},j,k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{23})_{i+\frac{1}{2},j,k+\frac{1}{2}} \widetilde{(\rho U)}^z_{i+\frac{1}{2},j,k+\frac{1}{2}} \overline{\overline{v}^y}^{xz}_{i+\frac{1}{2},j,k+\frac{1}{2}}
                  - (J^{\xi}_{23})_{i+\frac{1}{2},j,k-\frac{1}{2}} \widetilde{(\rho U)}^z_{i+\frac{1}{2},j,k-\frac{1}{2}} \overline{\overline{v}^y}^{xz}_{i+\frac{1}{2},j,k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{33})_{i+\frac{1}{2},j,k+\frac{1}{2}} \widetilde{(\rho U)}^z_{i+\frac{1}{2},j,k+\frac{1}{2}} \overline{\overline{w}}^x_{i+\frac{1}{2},j,k+\frac{1}{2}}
                  - (J^{\xi}_{33})_{i+\frac{1}{2},j,k-\frac{1}{2}} \widetilde{(\rho U)}^z_{i+\frac{1}{2},j,k-\frac{1}{2}} \overline{\overline{w}}^x_{i+\frac{1}{2},j,k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ P_{i+1,j,k}-P_{i,j,k}}{\Delta x} \nonumber \\
          &+ \frac{ (J^{\xi}_{13})_{i+\frac{1}{2},j,k+\frac{1}{2}} \overline{P}^{xz}_{i+\frac{1}{2},j,k+\frac{1}{2}}
                  - (J^{\xi}_{13})_{i+\frac{1}{2},j,k-\frac{1}{2}} \overline{P}^{xz}_{i+\frac{1}{2},j,k-\frac{1}{2}}
                  } {\Delta \xi},
\end{align}

where $\widetilde{(\rho U)}^x_{i,j,k}$, $\widetilde{(\rho U)}^y_{i+\frac{1}{2},j+\frac{1}{2},k}$
and $\widetilde{(\rho U)}^z_{i+\frac{1}{2},j,k+\frac{1}{2}}$ is obtained according to the method of eq(3.20)-(3.22).
The velocities at the cell wall for the staggered control volume to x direction are defined by eq(3.23)-(3.25).
$\overline{\overline{u}}^z$ and $\overline{\overline{v}^y}^{xz}$ are defined as

\begin{align}
 \overline{\overline{u}}^z_{i+\frac{1}{2},j,k+\frac{1}{2}}
 &= \frac{ \overline{u}_{i+\frac{1}{2},j,k+1}
         + \overline{u}_{i+\frac{1}{2},j,k  }
         } {2}, \\
 \overline{\overline{v}^y}^{xz}_{i+\frac{1}{2},j,k+\frac{1}{2}}
 &= \frac{ \overline{v}^y_{i+1,j,k+1}
         + \overline{v}^y_{i+1,j,k  }
         + \overline{v}^y_{i  ,j,k+1}
         + \overline{v}^y_{i  ,j,k  }
         } {4}.
\end{align}

$\overline{P}^{xz}$ is defined as
\begin{align}
 \overline{P}^{xz}_{i+\frac{1}{2},j,k+\frac{1}{2}}
 &=  G^{\frac{1}{2}}_{i+\frac{1}{2},j,k+\frac{1}{2}} \frac{ p_{i+1,j,k+1}
                                                          + p_{i+1,j,k  }
                                                          + p_{i  ,j,k+1}
                                                          + p_{i  ,j,k  }
                                                          } {4}.
\end{align}

The momentum equations in the $y$ and $z$ directions are descretized
in the same way:
\begin{align}
 \left(\frac{\partial \rho V}{\partial t}\right)_{i,j+\frac{1}{2},k}
 = - &\Bigg[ \frac{ \widetilde{(\rho V)}^x_{i+\frac{1}{2},j+\frac{1}{2},k} \overline{u}_{i-\frac{1}{2},j+\frac{1}{2},k}
                  - \widetilde{(\rho V)}^x_{i+\frac{1}{2},j+\frac{1}{2},k} \overline{u}_{i-\frac{1}{2},j+\frac{1}{2},k}
                  } {\Delta x} \nonumber \\
          &+ \frac{ \widetilde{(\rho V)}^y_{i,j+1,k} \overline{v}_{i,j+1,k}
                  - \widetilde{(\rho V)}^y_{i,j  ,k} \overline{v}_{i,j  ,k}
                  } {\Delta y} \nonumber \\
          &+ \frac{ (J^{\xi}_{13})_{i,j+\frac{1}{2},k+\frac{1}{2}} \widetilde{(\rho V)}^z_{i,j+\frac{1}{2},k+\frac{1}{2}} \overline{\overline{u}^x}^{yz}_{i,j+\frac{1}{2},k+\frac{1}{2}}
                  - (J^{\xi}_{13})_{i,j+\frac{1}{2},k-\frac{1}{2}} \widetilde{(\rho V)}^z_{i,j+\frac{1}{2},k-\frac{1}{2}} \overline{\overline{u}^x}^{yz}_{i,j+\frac{1}{2},k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{23})_{i,j+\frac{1}{2},k+\frac{1}{2}} \widetilde{(\rho V)}^z_{i,j+\frac{1}{2},k+\frac{1}{2}} \overline{\overline{v}}^z_{i,j+\frac{1}{2},k+\frac{1}{2}}
                  - (J^{\xi}_{23})_{i,j+\frac{1}{2},k-\frac{1}{2}} \widetilde{(\rho V)}^z_{i,j+\frac{1}{2},k-\frac{1}{2}} \overline{\overline{v}}^z_{i,j+\frac{1}{2},k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{33})_{i,j+\frac{1}{2},k+\frac{1}{2}} \widetilde{(\rho V)}^z_{i,j+\frac{1}{2},k+\frac{1}{2}} \overline{\overline{w}}^y_{i,j+\frac{1}{2},k+\frac{1}{2}}
                  - (J^{\xi}_{33})_{i,j+\frac{1}{2},k-\frac{1}{2}} \widetilde{(\rho V)}^z_{i,j+\frac{1}{2},k-\frac{1}{2}} \overline{\overline{w}}^y_{i,j+\frac{1}{2},k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ P_{i,j+1,k}-P_{i,j,k}}{\Delta y} \nonumber \\
          &+ \frac{ (J^{\xi}_{23})_{i,j+\frac{1}{2},k+\frac{1}{2}} \overline{P}^{yz}_{i,j+\frac{1}{2},k+\frac{1}{2}}
                  - (J^{\xi}_{23})_{i,j+\frac{1}{2},k-\frac{1}{2}} \overline{P}^{yz}_{i,j+\frac{1}{2},k-\frac{1}{2}}
                  } {\Delta \xi},
\end{align}

\begin{align}
 \left(\frac{\partial \rho W}{\partial t}\right)_{i,j,k+\frac{1}{2}}
 = - &\Bigg[ \frac{ \widetilde{(\rho W)}^x_{i+\frac{1}{2},j,k+\frac{1}{2}} \overline{u}_{i+\frac{1}{2},j,k+\frac{1}{2}}
                  - \widetilde{(\rho W)}^x_{i-\frac{1}{2},j,k+\frac{1}{2}} \overline{u}_{i-\frac{1}{2},j,k+\frac{1}{2}}
                  } {\Delta x} \nonumber \\
          &+ \frac{ \widetilde{(\rho W)}^y_{i,j+\frac{1}{2},k+\frac{1}{2}} \overline{v}_{i,j+\frac{1}{2},k+\frac{1}{2}}
                  - \widetilde{(\rho W)}^y_{i,j-\frac{1}{2},k+\frac{1}{2}} \overline{v}_{i,j-\frac{1}{2},k+\frac{1}{2}}
                  } {\Delta y} \nonumber \\
          &+ \frac{ (J^{\xi}_{13})_{i,j,k+1} \widetilde{(\rho W)}^z_{i,j,k+1} \overline{u}^x_{i,j,k+1}
                  - (J^{\xi}_{13})_{i,j,k  } \widetilde{(\rho W)}^z_{i,j,k  } \overline{u}^x_{i,j,k  }
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{23})_{i,j,k+1} \widetilde{(\rho W)}^z_{i,j,k+1} \overline{v}^y_{i,j,k+1}
                  - (J^{\xi}_{23})_{i,j,k  } \widetilde{(\rho W)}^z_{i,j,k  } \overline{v}^y_{i,j,k  }
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{33})_{i,j,k+1} \widetilde{(\rho W)}^z_{i,j,k+1} \overline{w}^z_{i,j,k+1}
                  - (J^{\xi}_{33})_{i,j,k  } \widetilde{(\rho W)}^z_{i,j,k  } \overline{w}^z_{i,j,k  }
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{33})_{i,j,k+1} P_{i,j,k+1}
                  - (J^{\xi}_{33})_{i,j,k  } P_{i,j,k  }
                  } {\Delta \xi}
\end{align}

\subsection{Energy equation}

\begin{align}
 \left(\frac{\partial \rho \Theta}{\partial t}\right)_{i,j,k}
 = - &\Bigg[ \frac{ (\rho U)_{i+\frac{1}{2},j,k} \overline{\theta}_{i+\frac{1}{2},j,k}
                  - (\rho U)_{i-\frac{1}{2},j,k} \overline{\theta}_{i-\frac{1}{2},j,k}
                  } {\Delta x} \nonumber \\
          &+ \frac{ (\rho V)_{i,j+\frac{1}{2},k} \overline{\theta}_{i,j+\frac{1}{2},k}
                  - (\rho V)_{i,j-\frac{1}{2},k} \overline{\theta}_{i,j-\frac{1}{2},k}
                  } {\Delta y} \nonumber \\
          &+ \frac{ (J^{\xi}_{13})_{i,j,k+\frac{1}{2}} \overline{\widetilde{(\rho U)}^x}^z_{i,j,k+\frac{1}{2}} \overline{\theta}_{i,j,k+\frac{1}{2}}
                  - (J^{\xi}_{13})_{i,j,k-\frac{1}{2}} \overline{\widetilde{(\rho U)}^x}^z_{i,j,k-\frac{1}{2}} \overline{\theta}_{i,j,k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{23})_{i,j,k+\frac{1}{2}} \overline{\widetilde{(\rho V)}^x}^z_{i,j,k+\frac{1}{2}} \overline{\theta}_{i,j,k+\frac{1}{2}}
                  - (J^{\xi}_{23})_{i,j,k-\frac{1}{2}} \overline{\widetilde{(\rho V)}^x}^z_{i,j,k-\frac{1}{2}} \overline{\theta}_{i,j,k-\frac{1}{2}}
                  } {\Delta \xi} \nonumber \\
          &+ \frac{ (J^{\xi}_{33})_{i,j,k+\frac{1}{2}} (\rho W)_{i,j,k+\frac{1}{2}} \overline{\theta}_{i,j,k+\frac{1}{2}}
                  - (J^{\xi}_{33})_{i,j,k+\frac{1}{2}} (\rho W)_{i,j,k-\frac{1}{2}} \overline{\theta}_{i,j,k-\frac{1}{2}}
                  } {\Delta \xi} \Bigg]
\end{align}
where $\overline{\theta}_{i+\frac{1}{2},j,k}$, $\overline{\theta}_{i,j+\frac{1}{2},k}$ and
$\overline{\theta}_{i,j,k+\frac{1}{2}}$ are is obtained according to the method of eq(3.29)-(3.31).


\documentclass{article}

\usepackage{mathtools}
\usepackage{tikz}

\newtheorem{theorem}{Example}

\begin{document}
\section*{Composite Materials}

Composite materials are mixtures of two or more components without any chemical reactions.

\subsection*{Composition}
\begin{itemize}
    \item Matrix Phase
          \begin{itemize}
              \item Polymers, Ceramics, Metals or Alloys
          \end{itemize}
    \item Dispersed phase
          \begin{itemize}
              \item Powders or fibers
          \end{itemize}
\end{itemize}

Concrete:
\begin{itemize}
    \item Matrix Phase is cement
    \item Dispersed phase is sand
\end{itemize}

\section*{Particulate Composites}
Contain large amounts of coarse particles

Density of a particualte composite:

\begin{equation*}
    \rho_c = \sum_{i=1}^n f_i \rho_i
\end{equation*}

\begin{theorem}
    If 5 wt SiC particles are added to a Co matrix, calculate how many particles are present per $cm^3$ of obtained composite material. Assume that SiC particles are spherical with diameter 5nm.

    \begin{equation*}
        \begin{aligned}
            V_{Co} + V_{SiC}                                   & = V_{comp}                    \\
            \frac{V_{Co}}{V_{Comp}} + \frac{V_{SiC}}{V_{Comp}} & = 1                           \\
            f_{SiC} = 1- f_{Co}                                & = 1 - \frac{V_{Co}}{V_{Comp}} \\
            f_{SiC} = 1 - \frac{\frac{m_Co}{S_Co}}{\frac{m_Co}{S_Co}+\frac{m_SiC}{\rho_SiC}}   \\
            \rho_{SiC} = 3 g/cm^3
        \end{aligned}
    \end{equation*}
    Concentration of SiC Particles
    \begin{equation*}
        \begin{aligned}
            f_{SiC}/ V_SiC = 2.56x10^17 parts/cm^2
            V= 4/3 pi r^2 = 5.24x10^-19cm^3
        \end{aligned}
    \end{equation*}

\end{theorem}
\begin{theorem}
    A silver-tungsten composite for an electrical contact is produced first making a porous tungsten powder metallurgy compact, then infiltrating pure silver into pores. THe density of tungsten compact before infiltration is $14.5 g/cm^3$. Calculate the volume fraction of porosity and the final weight percent of silver in the compact after infiltration.

    \begin{equation*}
        \begin{aligned}
            \rho_{Ag} = 10.49 \\
            \rho_{W} = 19.39
        \end{aligned}
    \end{equation*}
\end{theorem}

\section*{Material Examples}
\begin{itemize}
    \item Cemented Carbides
    \begin{itemize}
        \item Ceramic particles dispersed into metallic matrix (WC dispersed into Co-matrix for cutting tools)
    \end{itemize}
    \item Abrasives
    \begin{itemize}
        \item $Al_2O_3$, $SiC$ and cubic $BN$ bonded by glass, polymer or metallic matrix
    \end{itemize}
    \item Electrical Contacts
    \begin{itemize}
        \item Switches and relays (wear resistance and electrical conductivity)
        \item Ag-W electrical composite.
    \end{itemize}
\end{itemize}

\section*{Laminar Composite Materials}
\begin{itemize}
    \item Thin or thick protective coatings
    \item Claddings
    \item Bimetallics
    \item Laminates
\end{itemize}

\section*{Fiber Reinforced Composites}
\begin{itemize}
    \item Carbon Fibers
    \item Glass Fibers
    \item Aramid Fibers
\end{itemize}

\end{document}