%\section{Calibration and Validation}
%\section{Validation}
\label{sec:validation}

% VALIDATION TODO
%
% show major effort
% table of results
% show hierarchy
% precisely define cases
%
%

%
% meshed vanes are 24x more expensive
%

The previous chapters briefly outlined the physical phenomenon under
consideration, the mathematical models proposed to simulate it,
and the numerical solution of these models for a variety of system
configurations and scenarios. Before these simulations can be used
as a tool to evaluate proposed system designs, it is necessary to
validate that the physical models in use accurately represent
reality. As defined by Moser {\em et al.}\cite{Moser2012Validating},
``validation is the process of determining whether a mathematical model
is a sufficient representation of reality for the purposes for which the
model will be used--that is, for predicting specified QoIs (Quantities
of Interest) to inform a specific decision.''

This chapter contains a discussion of the validation of the
computational models against existing experimental data and high
fidelity simulations. This chapter does not exhaustively detail the
validation studies performed in the course of this study. Rather, this
chapter discusses four representative cases and the overall validation
approach pursued.
%A more detailed set of validation data is provided in
%Appendix~\ref{app-validation}.
% The limited validation that was performed
% for the 2016 field tests in discussed in Chapter~\ref{sec:field}.

A challenge in this project is the scarcity of experimental data. Only
two or three cases of experimental measurements are available. These
measurements, for reasons detailed in the next section, are not
sufficient to provide confidence in the output of simulations across a
wide variety  of scenarios. Therefore, a high fidelity model using
meshed vanes with enforced no-slip velocity boundary conditions along
the surface of the turning vanes was developed. These ``gridded'' runs have
been validated against the experimental data, which they match quite
closely. However, as detailed in Section~\ref{subsec:vane},
explicitly meshing the vanes would be far too
expensive to permit a rapid exploration of a variety of
system configurations. Instead, this high fidelity model is used
to generate additional reliable data to permit validation of lower
fidelity models, such as the virtual vanes. Likewise, the results of the
unsteady virtual vane simulations can be used as validation data for a
further reduced, steady Navier-Stokes model. This hierarchy of
validation is shown in Figure~\ref{fig:val_hier}, with data sources that
generate more reliable data at the top, and models that are less
reliable, but also less computationally expensive at the bottom. In
terms of expense, the steady virtual vane model generates a solution in
approximately two minutes, versus twelve hours for the unsteady virtual
vane model. The gridded vanes require another factor of ten in
computational time, and many more man-hours hours of work to generate
the mesh (which were generated using gridgen). An example of one of the
gridded meshes complexity is shown in Figure~\ref{fig:gridded_mesh}.
Therefore, it is unrealistic to perform parameter sweeps or
system configuration investigations with the gridded vanes and these
results are used only for validation studies. Instead, the
steady model is used, with promising results re-evaluated with unsteady
virtual vane models. %and so on up the hierarchy if more confidence is necessary.

%
% https://www.draw.io/
%
 \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 8 cm]{figs/validation_hierarchy}
    \caption{This figure depicts the validation hierarchy. The
    experimental measurements are at the top, where the data is expected
    to be the most reliable, but simultaneously the most
    limited. Moving down the table leads to simulated data sources that
    are less reliable but increasingly cheaper in time to generate. At
    the bottom are the steady virtual vane solutions.}
    \label{fig:val_hier}
   \end{center}
 \end{figure}

 \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 8 cm]{figs/gridded_mesh_example}
    \caption{An example of the gridded mesh, where the turning vanes
    are explicitly represented and a no-slip boundary condition is
    imposed on the surface. This mesh was generated using gridgen.}
    \label{fig:gridded_mesh}
   \end{center}
 \end{figure}

Three kinds of experimental validation data are available. These are
data generated in the laboratory using a heated plate, data from
experiments in the wind tunnel (``Wind-only''), and measurements from field
tests (``Field'') conducted in Arizona. The available data from
these cases and the gridded vanes created to mimic them are are
summarized in Table~\ref{tab:val_data}. Every case shown has been
simulated using the virtual vanes.

%\large
\begin{table}[h]
\centering
\begin{tabular}{l|l|l|l|}
           & Wind-Only                   & Thermal-Only                & Field  \\
  \hline
Experiment & Straight Vanes $60^{\circ}$ & Straight Vanes $60^{\circ}$ & June 2014   \\
           &                           & Straight Vanes $30^{\circ}$   & August 2014 \\
           &                           & Hybrid (Two tier)             & August 2015 \\
  \hline
Gridded    & Straight Vanes $60^{\circ}$ & Straight Vanes $60^{\circ}$ & \\
           & Straight Vanes $30^{\circ}$ & Straight Vanes $30^{\circ}$ & \\
  \hline
\end{tabular}
  \caption{Available truth data from the laboratory experiments
    (cold wind and thermal-only), the field tests, and the gridded
 vanes.}
  \label{tab:val_data}
\end{table}
%
%
%
% http://www.tablesgenerator.com/
%
%

%
% experimental challenges
%
%\normalsize
\section{Thermal-Only Validation}
This section provides examples of the validation performed with the
richest experimental data set, the measurements in the laboratory. All of the
thermal-only the data was generated in a laboratory setting at Georgia
Tech. The general system configuration is depicted in Figure
\ref{fig:lab_image}. These data were taken using stereo particle image
velocimetry (PIV) at Georgia Tech by Mark Simpson and Ari Glezer, and
the errors in in measurement and sampling are
not quoted. The particles are seeded outside of the array vanes and
permitted to naturally convect into the turning vane enclosure. The
particles were from a glycol-water theatrical fog (Rosco Fog Fluid).
Only velocity measurements are available. Several
potentially important quantities, such as the pressure and
temperature, have not been measured.

%
% http://convertonlinefree.com/ConvertImageEN.aspx
%
 \begin{figure}[!htb]
   \begin{center}
    \includegraphics[width = 12 cm]{figs/Optimized-lab_setup}
    \caption{An example of the single tier straight vane laboratory
    configuration. The apparatus is shown with a turbine, but that was
    removed for data gathering. The particles for PIV were seeded
    outside of the turning vanes and entrained into the central region.}
    \label{fig:lab_image}
   \end{center}
 \end{figure}

While no sensitivity analysis has been performed, it is likely that the
largest uncertainty in the laboratory simulation is a result of the
ventilation of the laboratory. The heated plate at the bottom of the
apparatus generated enough heat to cause an increase in room
temperature (30+ Kelvin), which greatly impacts the SoV
performance, as the ground to air thermal gradient drives the
vortex. The laboratory is cooled to maintain
temperature by two inlet HVAC ducts in the room.
%While efforts have been made to characterize the level of ventilation being
%used, these numbers come with non-trivial uncertainties attached.
One vent continuously provides air at 288 Kelvin with a flow rate estimated
to be 1 $\text{m}^3$/s.
%(4-6 m/s with an approximate area of 0.2 $m^2$)
The other vent is active only if the room temperature exceeds 301 Kelvin,
with a flow rate also estimated at 1 $\text{m}^3$/s\cite{mark_comm}.
Finally, the air leaves through the cracks around the laboratory doors and
exhaust vents. Preliminary results indicated that an inflow rate of 1
$\text{m}^3$/s, the lower bound of the possible inflow rates results in
excessive heating of the room, while inflow conditions at the maximum
inflow rate of 2 $\text{m}^3$/s result in a simulated room that is too cold,
compared to the laboratory.

Our simulated vortices are sensitive to ambient room temperature and thus
the inflow rate. It is likely that the laboratory is run where one of
the vents is operating intermittently.
To mimic these conditions in our simulations, Dirichlet boundary conditions
on parts of the sides of the computational domain are used to
establish a constant inflow of cool air at the rates
proscribed by our collaborators. Over the remainder of the side walls,
adiabatic thermal boundary conditions are are used.

The most significant boundary condition disparity is that flow leaves the
domain through the top boundary, instead of out of the sides of the
room. Preliminary results suggested that the SoV phenomenon  was not
sensitive to these boundary condition details. The important element is
the  global energy balance in the room. The flow rate into the room is
adjusted to  1.3 $\text{m}^3$/s for the validation results discussed here.

% \begin{figure}[!htb]
%   \begin{center}
%    \includegraphics[width = 12 cm]{figs/hybrid_profile}
%    \caption{Azimuthal and vertical velocity profiles as a function of
%    radius. The simulation and experimental data broadly agree, with
%    the simulation also exhibiting the characteristic ``twin-peak''
%    structure of the hybrid vanes in the azimuthal velocity. }
%    \label{fig:lab}
%   \end{center}
% \end{figure}

\begin{figure}[htp!]

  \centering
  \includegraphics[width =0.47\textwidth]{figs/sim_vs_exp_30_vt}
%  \caption{Azimuthal velocity}
 \hfill
 \includegraphics[width =0.47\textwidth]{figs/sim_vs_exp_30_vz}%
 %\caption{Vertical velocity}
 \caption{Azimuthal (left figure) and vertical (right figure) velocity
 as a function of radius for the thermal-only cases. Shown are single
 tier straight $30^{\circ}$ vanes. $V_{\theta}^V$ (gold line) is
 the virtual vane simulation, $V_{\theta}^E$ (blue line) the experiment,
 and $V_{\theta}^G$ (red line) the gridded vane. These results were all
 generated by unsteady simulations and then temporally averaged.
 The lack of smoothness in the data is believed to be
 attributable to finite-time averaging, particularly in the case of the
 gridded vanes, which were expensive calculations. }
 \label{fig:val_lab}
\end{figure}

Figure~\ref{fig:val_lab} is a direct comparison
between laboratory measurements for a simple single tier vane
configuration ($30^{\circ}$ straight vanes) and nominally identical
simulations with the gridded and
virtual vanes. The simulations and experiment broadly agree. The
simulation correctly reproduce the peak structure in the azimuthal
velocity observed for this configuration in the experiment. The gridded
vanes closely represent the peak radial location, while the
virtual vanes over-predict the radial location, likely due to the
increased eddy diffusivity that exists in the virtual vanes. The radial
location and magnitude of peak vertical velocity also closely agrees
with experiment.

Similar validation comparisons have been made between several other
configurations with similar levels of agreement,  notably the
$60^{\circ}$ single tier straight vane case, and the two-tier hybrid
vanes.
%Some of these cases are detailed in Appendix~\ref{app-validation}.
These validation studies have provided a level of confidence that our
simulations accurately reproduce the phenomena observed in laboratory.

%\todo{slices and images of thermal only?}

\section{Wind Cases}

The laboratory thermal vortex experiments described in the previous
section did not include the effects of the wind, but experience in
the field indicated that ambient winds were both pervasive and intense
(see Section~\ref{subsec:field_predict} for more details). To ensure that
the virtual vanes accurately represent the impact of ambient winds, a
validation study was performed using the data obtained in the wind
tunnel.

A numerical experiment was performed in which the 60 degree single tier
straight vanes were placed in a isothermal wind. The boundary conditions
are as detailed in Section~\ref{sec:bc}, but in isothermal
conditions. These results were compared to an identical experimental
configuration placed in a wind tunnel. However, no measurements (of
velocity or any quantity) were made for the vanes in these
conditions. Qualitative comparisons, based on descriptions of observed
structures and videos of smoke visualization were made between the
simulations and the wind tunnel experiments. The initial validation was
found to have significant qualitative differences between the virtual
vanes and the experimental images, with the flow visibly exiting out the
back of the vanes instead of being contained within.  As a result of
this inconsistency, the virtual vane model was refined to include a
separation model, which is detailed in Section~\ref{sec:separation}. The
images  did not identify any inconsistencies between the refined
simulation and experiment.

\begin{figure}
  \begin{subfigure}{0.49\textwidth}
   \centering
   \includegraphics[width=.95\linewidth]{figs/gridded_wind}
   \caption{Streamwise Velocity: Gridded Vanes}
  \end{subfigure}
 %\hfill
  \begin{subfigure}{0.49\textwidth}
   \centering
   \includegraphics[width=.95\linewidth]{figs/virtual_wind}
   \caption{Streamwise Velocity: Virtual Vanes}
   \end{subfigure} \\
  \begin{subfigure}{0.49\textwidth}
   \centering
   \includegraphics[width=.95\linewidth]{figs/gridded_wind_span}
   \caption{Spanwise Velocity: Gridded Vanes}
  \end{subfigure}
 %\hfill
  \begin{subfigure}{0.49\textwidth}
   \centering
  \includegraphics[width=.95\linewidth]{figs/virtual_wind_span}
   \caption{Spanwise Velocity: Virtual Vanes}
  \end{subfigure}
 \caption{Horizontal slices through the top of the vanes for the
 wind validation cases. On the left are the explicitly gridded vanes,
 and on the right the virtual vanes. The streamwise velocity (top
 images), which moves left to right, shows penetration through the
 region where the vanes are aligned with the flow in both the gridded
 and virtual vanes. The second row shows the spanwise velocity (red for
 flow moving up the page, blue for flow moving down the page) where it
 can be seen that the virtual vane case correctly reproduces the
 direction and magnitude of velocity inside the vanes.}
 \label{fig:wind_val}
\end{figure}

%
% Attached in the plate from which we inject the fog from. The holes used
% for seeding are the center one (0.5$B!I(B diameter) and the other 4 ones
% which are 0.25$B!I(B diameter. The smallest holes are for alignment pins in
% the tunnel so disregard those ones. Please note that this file is in
% inches and the previous one in millimeters.
% Hidalgo Ardana Pablo
%
% 11/26/14
%
However, these results are limited, and are
only for the cold wind, as the wind tunnel did not include a heated plate.
To provide a more quantitative validation study, the virtual vanes were
compared to gridded vanes for a cold wind case. Both cases had identical
boundary conditions, as detailed in Section~\ref{sec:bc}. A two meter
per second inlet velocity was selected. Figure~\ref{fig:wind_val}
contains images of the simulated averaged
streamwise and  spanwise velocity in a horizontal plane at approximately
the height of the vanes obtained from simulations with gridded and
virtual vanes.
The streamwise velocity penetrates through the region where the vanes
are aligned with the flow in both the gridded and virtual vanes. This
indicates the virtual vane region as defined in
Section~\ref{subsec:vane} is not turning the flow in locations where
the flow velocity is aligned with the vane direction, as intended.
The second row contains images of the spanwise velocity, where it can be
seen that the virtual vane case correctly reproduces the direction and
magnitude of velocity inside the vanes. While the wake has similar
structure between the two cases for the streamwise velocity, the
spanwise velocity in the wake is not as closely represented between the
cases. While there are some differences in the
details of these simulations, the overall character of the flow
inside the vanes is quite similar. This demonstrates that the virtual
vane formulation can indeed accurately represent the interaction with the wind,
at least in the case without thermal differences.

\section{Comparisons between Steady and Unsteady Virtual Vanes}
\label{sec:steady_val}

At the bottom of the validation hierarchy are the steady virtual
vanes. This is expected to be the most inaccurate model.
Simultaneously, this is by far the cheapest computationally, and
reduces the run-time from approximately 12 hours (in the case of the
unsteady) to less than two minutes. This reduced run-time permits
rapid exploration of the SoV configuration space, making the steady
virtual vanes an invaluable design tool. For this reason, the steady
model is used extensively in Chapters~\ref{sec:results} and
\ref{sec:field} to explore new SoV vane design concepts.

However, the results of the steady cases must first be
compared to the transient case to ensure the output is consistent.
Figure~\ref{fig:rom_compare} depicts such a case, where the streamwise
velocity in a wind case was used as a direct comparison between the
steady and unsteady virtual vane cases. This was a hot-wind case, with
an ambient freestream velocity of 3 m/s and a temperature difference of 60
Kelvin. The boundary conditions are precisely as described in
Section~\ref{sec:bc}.
%The vanes are an axi-symmetric two-tier structure,
%with inner vane angles of  and degrees, respectively.

These two solutions are similar, with comparable velocity magnitudes and
consistent signs. A comparison between the azimuthal velocities are
shown in Figure~\ref{fig:rom_az}, which makes clear the more diffuse and
weaker magnitude peak in the steady solution. Ultimately, the steady
solution's principle use as a design tool is driven by the response in
kinetic energy flux to sensitivity to small perturbations in the SoV
design (such as vane or cone geometry). To measure this, a comparison
was made between steady and unsteady solutions to changes from a base state
in response to small ($1^{\circ}-5^{\circ}$) perturbations in the vane
angles. The results of this are shown in Figure~\ref{fig:rom_it}, where
the steady solution typically underestimates, but broadly agrees with,
the change in kinetic energy flux attributable to a perturbation in the
system design parameters.  It is for this reason that the steady
solution is believed to be a useful tool to explore the system
configuration space, as it accurately represents favorable design
adjustments, and so can be used in an optimization effort to rapidly
probe various configurations and drive the system towards peak kinetic
energy flux generation.

\begin{figure}[htp!]
 \begin{subfigure}{0.49\textwidth}
 \centering
 \includegraphics[width =0.95\textwidth]{figs/rom_steady}
  \caption{Steady Virtual Vanes}
 \end{subfigure}
 \begin{subfigure}{0.49\textwidth}
  %\hfill
 \includegraphics[width =0.95\textwidth]{figs/rom_unsteady}%
  \caption{Unsteady Virtual Vanes}
 \end{subfigure}
 \caption{A comparison between the streamwise velocity in the averaged
 transient virtual vane solution (right image) and the steady virtual
 vane solution (left image). These horizontal slices were taken at the
 height of the second tier of vanes. The black lines indicate the
 annular vane forcing region. While the steady solution is more diffuse,
 it possesses a similar qualitative structure as the higher fidelity
 solution. The unsteady solution has a larger peak velocity inside the
 apparatus, while simultaneously possessing a larger and more intense
 wake region.}
 \label{fig:rom_compare}
\end{figure}

% Flow features smeared
% what type of vanes are these?
% calibration

\begin{figure}[htp!]
 \centering
 \includegraphics[width =0.7\textwidth]{figs/rom_radial}
 \caption{The azimuthal velocity profile as a function of radius for the
 steady and unsteady cases. The profile is extracted from $\theta =
 90^{\circ}$. The unsteady vanes were temporally averaged. The steady
 solution has a similar radial peak location, but a lower velocity
 magnitude and a more diffuse structure.}
 \label{fig:rom_az}
\end{figure}

% The results between these simulations are broadly consistent.
% Across a range of previously tested configurations the kinetic energy
% flux typically agrees to within 20\% and the sensitivities of the energy
% flux to small perturbations in the system configuration correlate well
% with the results of the higher fidelity transient model.

\begin{figure}[htp!]
 \centering
 \includegraphics[width =0.7\textwidth]{figs/rom_iterate}
 \caption{A comparison between the change in kinetic energy flux due to
 a perturbation in system parameters (vane angle) between the steady and
 unsteady virtual vanes. For each iteration, a design parameter was
 changed, and the \% change in kinetic energy flux was recorded.}
 \label{fig:rom_it}
\end{figure}

\section{Field Configurations}
\label{sec:field_val}

Several field tests have been performed by the experimental team. After
each field test, qualitative observations, measurements and lessons
learned are provided by the field team. Actual measurements
are limited. Due to the complexity of the configuration
(two vane tiers and a cone) gridded vanes cases have not been developed
for the field configurations. This section provides a discussion of some of
the results from the latest field test, as an example of typical
validations performed.

 \begin{figure}[!htb]
  \begin{center}
   \includegraphics[width = 12 cm]{figs/validate_field}
   \caption{A comparison between simulated and experimental data for the
   August 2015 field test. Azimuthal velocity data from the actual field
   test is shown in blue. Two virtual vane simulations with different
   scenario parameters are shown in red and gold. The velocity field was
   temporally averaged but not averaged in space, to reproduce
   the measurements from the field.}
   \label{fig:field_val}
  \end{center}
 \end{figure}
%
% provide an example of these validations below
%

Figure~\ref{fig:field_val} shows velocity data from the
August 2015 field test in blue. These results were
obtained using an anemometer at fixed
azimuthal location (believed to be at a ninety degree angle, where the zero
is defined to be aligned with the streamwise flow direction) to measure the
azimuthal velocity. A time
series from approximately an hour was gathered. This data included large
scenario uncertainties, with estimated 3 m/s variations in wind, 20
degree wind heading changes, and ten degree Celsius shifts in
temperature. Other than the velocities, the only other measurement
taken was the temperature. Due to a DAQ malfunction, the
temperature was only measured at one location at one meter in height.
A solidworks CAD file provided by the experimental team
defined the vane and cone geometry, which were then represented in the
simulations as virtual vanes and a solid surface, as described in
Sections~\ref{subsec:vane} and \ref{subsec:solid_surface}. Hence, the
scenario uncertainty was significant, while the uncertainty in the
system apparatus was small.

\begin{table}[!htb]
\centering
 \caption{The range of conditions represented in
 Figure~\ref{fig:field_val}. The heading is with respect to the presumed
 wind direction. The heading may at first appear not to be significant,
 as the vanes are axisymmetric. However, the rake holding
 the anemometer was placed at a $90^{\circ}$ relative to the presumed
 freestream velocity, and the SoV solution structure is not symmetric.}
\begin{tabular}{l|l|l|l}
Case Name & Wind Velocity (m/s) & Heading & $T_\text{Surface}$
 (Celsius) \\
 \hline
 Peak (Red Line) &  5.0  & $0^{\circ}$ & $60^{\circ}$ \\
 Match (Black Line) &  3.0  & $0^{\circ}$ & $60^{\circ}$ \\
 Minimum (Gold Line) &  2.0  & $20^{\circ}$ & $20^{\circ}$ \\
\end{tabular}
 \label{tab:val_cond}
\end{table}

To span the range of scenario conditions, several simulations were conducted
with different parameters. These simulations were performed with
unsteady virtual vanes on a wind blown domain as detailed in
Section~\ref{sec:bc}.  The azimuthal velocity from two such
simulations (red and gold lines) are plotted against the experimental
data (blue line) in Figure~\ref{fig:field_val}. The red line represents
an upper bound, with the strongest wind speeds and highest thermal
gradient. The gold line is a lower bound, with a more modest ambient
freestream velocity, a lower temperature gradient, and an indirect wind
heading.

These simulations accurately bound the experimental data. Furthermore, a
``Matching'' case was identified that is broadly consistent with the
field results. This corresponded to a 3 m/s wind velocity and a 60
degree Celsius temperature difference. These range of conditions are
summarized in Table~\ref{tab:val_cond}.
As the rake was at fixed azimuthal location, the kinetic energy fluxes were
compared by assuming azimuthal symmetry and integrating in a horizontal
plane at the top of the vanes (where a turbine to extract this energy
would likely be placed). By this metric, the ``Matching'' simulation
kinetic energy flux agrees with the experimental estimate within
10\%. This is likely an optimistic measure, as the simulations indicate
that the velocity field is highly azimuthally asymmetric. Nevertheless,
no significant inconsistencies have been identified between the
experimental results and the simulations.

%
% validation story is incomplete
%
% you have done:
%
% 1) comparions between laboratory + gridded + virtual
%
% 2) comparisons between gridded + virtual in laboratory
%    + field configurations, thermal only and wind
%
% 3) comparisons of virtual vanes to field observations
%    quantitative + qualitative
%
%
% You need to discuss what needs to be validated -- the
% comparison to gridded vanes is a useful validation tool
%


%==============================================================================
\chapter{Quantification of the Difference}
\label{chap:quantifing}
%==============================================================================

Having shown explicitly the discrepancy between the pure and the thermal
descriptions as well as where it is most significant, the author will then
quantify the difference. Related definitions of distances in quantum
mechanics are introduced in \cref{chap:distappd}.
%In this chapter, it will be explained why the difference between the two cases
%is expected to be negatively correlated to the mass of the black hole, then
%the difference will be evaluated.

%------------------------------------------------------------------------------
\section{The Canonical State} %Popescu--Winter Theorem
\label{sec:arbitrary-canonical}
%------------------------------------------------------------------------------

It has been shown in \cite{Popescu2006} that a small subsystem in a large,
isolated system which is subject to a \emph{constraint}, is expected to be very
close to a \emph{canonical state} of it, which reduces to the usual
thermodynamic \emph{canonical ensemble} when the total system is under an
\emph{energy constraint}.

Denoted by $U$, the large system has all its possible pure states in Hilbert
space $\mscrH_U$ which has a finite dimension $d_R = \dim \mscrH_U$. A global
constraint $R$ is also imposed, which restricts the physical Hilbert space of
$U$ to $\mscrH_R \subseteq \mscrH_U$. The \emph{equiprobable state} of $U$ is
\begin{equation}
\mscrE_R \coloneqq d_R^{-1} \Bbbone_R,
\end{equation}
where $\Bbbone_R$ is the identity operator on $\mscrH_R$. An energy constraint,
for instance, reads
\begin{equation}
\abr{H_U} = E_R,
\label{eq:ene-constraint}
\end{equation}
so that a state $\Ket{\alpha}$ in $\mscrH_R^{\rbr{\text{E}}}$ satisfies
\begin{equation}
E_R = \Braket{\alpha | H_U | \alpha} = \sum_E \vbr{\Braket{E | \alpha}}^2 E,
\end{equation}
where $\Ket{E}$ is an energy eigenstate of $U$ with eigenvalue $E$.

The subsystem in concern is named $S$, with \emph{all possible} states in the
Hilbert space $\mscrH_S$; the rest of $U$ is called the \emph{environment} and
denoted by $E$, the pure states of which lie in $\mscrH_E$. One has
\begin{equation}
\mscrH_S \otimes \mscrH_E = \mscrH_U \supseteq \mscrH_R,\qquad
H_U = H_S + H_E + H_\text{int},
\end{equation}
where $H_S$, $H_E$ and $H_\text{int}$ are the system, environment and
interaction Hamiltonian, respectively.

The \emph{canonical state} of $S$ is defined as
\begin{equation}
{\Omega}_S \coloneqq \tr_E {\mscrE}_R,
\end{equation}
where the trace is taken over all the degrees of freedom in the environment.
When the energy constraint \cref{eq:ene-constraint} is used, it can be shown
that $\Omega_S^{(E)}$ is a canonical ensemble\footnote{A derivation of
\cref{eq:canonical-state-def} in classical statistical physics can be found in
\cite[sec.~28]{Landau1980}.}
\begin{equation}
\Omega_S^{(E)} \propto \ee^{- H_S/T_\text{m}}
= \sum_{E_S} \ee^{-E_S/T_\text{m}} \Ket{E_S}\Bra{E_S},
\label{eq:canonical-state-def}
\end{equation}
where $T_\text{m}$ can be identified with a temperature, and $\Ket{E_S}$ is an
eigenstate of the system with eigenvalue $E$. In this case it reduces to
the traditional thermodynamic statistical physics.

%To state the theorems, one additional definition is needed:
The environment also has an \emph{effective} dimension
\begin{equation}
d_E^\text{eff} \coloneqq \rbr{\tr \Omega_E^2}^{-1} \geq d_R/d_S,
\label{eq:def-effective-dim}
\end{equation}
where ${\Omega}_E = \tr_S {\mscrE}_R$. When no constraint is enforced, so that
$\mscrH_S \otimes \mscrH_E \equiv \mscrH_U = \mscrH_R$,
\cref{eq:def-effective-dim} reduces to
\begin{equation}
d_E^\text{eff} = d_R/d_S = d_E.
\end{equation}
Detailed discussions about $d_E^\text{eff}$ can be found in \cite{Popescu2006}.

Equipped with all the definitions above, one picks an arbitrary pure state
$\Ket{\phi}\in\mscrH_R$ and denote the \emph{reduced state} of $S$ by
\begin{equation}
\rfun{\rho_S}{\phi} = \tr_E \Ket{\phi}\Bra{\phi}
\end{equation}
Then a lemma states that the average \emph{trace distance}\footnote{See
\cref{sec:trace-dist}.} between $\rho_S$ and $\Omega_S$ is very small in terms
of the ratio between $d_S$ and $d_S/d_E^\text{eff}$, i.e.\
\begin{equation}
\abr{\rfun{T}{\rfun{\rho_S}{\phi}, {\Omega}_S}} \le \frac{1}{2}
\sqrt{\frac{d_S}{d_E^\text{eff}}}.
\end{equation}
In a typical division where $d_S/d_E$ is small, this average distance will also
be tiny.

More over, the main theorem asserts that those ${\rho}_S$'s which are close to
${\Omega}_S$ dominate; the probability of a large deviation is exponentially
small with respect to the deviation. For an arbitrary $\epsilon > 0$, the
theorem states that
\begin{equation}
\frac{\sfun{V}{\cbr{\Ket{\phi} \in \mscrH_R |
\rfun{T}{\rfun{\rho_S}{\phi}, \Omega_S} \geq \eta}}}
{\sfun{V}{\cbr{\Ket{\phi} \in \mscrH_R}}} \leq \eta',
\label{eq:main-theorem-Popescu}
\end{equation}
where
\begin{equation}
\eta = \epsilon + \frac{1}{2}\sqrt{\frac{d_S}{d_E^\text{eff}}}; \qquad
\eta' = 4\rfun{\exp}{-C d_R \epsilon^2},\quad C = \frac{2}{9\pp^3}.
\label{eq:main-theorem-supp}
\end{equation}
To understand the theorem, first note that the left-hand side of
\cref{eq:main-theorem-Popescu} is a probability measure. More over, one can
choose $\epsilon = d_R^{-1/3}$ as well, so that
\begin{equation}
\eta = \epsilon + \frac{1}{2}\sqrt{\frac{d_S}{d_E^\text{eff}}} \gtrsim
d_R^{-1/3};\qquad
\eta' = 4\rfun{\exp}{-C d_R \epsilon^2} = 4\rfun{\exp}{-C d_R^{+1/3}},
\end{equation}
where $d_E^\text{eff} \gg d_S$ is also assumed. In this case, the probability
of the deviation greater than $d_R^{-1/3}$ is smaller than an
\emph{exponential} of $d_R^{+1/3}$.

Further explanations and proofs of the lemma and the theorem can
be found in \cite{Popescu2006,Popescu2007}.

%------------------------------------------------------------------------------
\section{Distance between the Pure and Mixed States}
\label{sec:dist-radiation}
%------------------------------------------------------------------------------

To apply the aforementioned formalism to the Hawking radiation, one recognises
the universe in the CGHS model as the total isolated system $U$, whereas the
gravitational degrees of freedom as $E$, and the system in concern $S$ is the
radiation field. It has been shown in \cite{Demers1996,Kiefer2001} that the
reduced state of the radiation field can indeed be \emph{thermal} in certain
\emph{decoherence} schemes, while in the collapsing case discussed in
\cref{sec:hawrad-1+1dila,sec:1+1ddlt}, the radiation field remains pure.

In this section, the trace distance between the pure and thermal descriptions
will be evaluated. Due to technical difficulties, the distance has not been able
to be derived exactly. Instead, a lower and an upper bound have been set to the
distance by \emph{Fuchs-van de Graaf inequality} in \cref{eq:ineq-fvdg}, where
only the calculable \emph{Fidelity} (see \cref{sec:fidelity}) is needed.

Note that the wave functional of the Hawking radiation field
\cref{eq:squeezed-wave-functional} is, roughly speaking, the superposition of
quantum-mechanical wave functions per Fourier mode,
\begin{equation}
\sfun{\chi_b}{g} \sim \sum_p \rfun{\chi_b^\rbr{p}}{g_p}
= \sum_p \Braket{g_p | \chi_b^\rbr{p}},
\label{eq:wave-function-decomposed}
\end{equation}
where $g_p \coloneqq \rfun{g}{p}$ is the Fourier transform of the field $g$
evaluated at $p$. On the other hand, the thermal state of the free field can
also be sloppily written as the product of the quantum-mechanical density
operators per mode,
\begin{equation}
{\rho}_\text{th} \sim \bigotimes_p {\rho}_\text{th}^\rbr{p}.
\end{equation}
By \cref{eq:fidelity-pure-mixed}, the fidelity of $\sfun{\chi_b}{g}$ and
$\rho_\text{th}$ can be reduced to the product of the fidelity per mode, because
\begin{equation}
\Braket{\chi_b | {\rho}_\text{th} | \chi_b} \sim \prod_p
\Braket{\chi_b^\rbr{p} | {\rho}_\text{th}^\rbr{p} | \chi_b^\rbr{p}}.
\label{eq:expectation-decomposed}
\end{equation}

Since $\Ket{\chi_b^\rbr{p}}$ is just a quantum-mechanical general Gaussian
state (see \cref{sec:single-harosc}), the result in \cref{eq:fidelity-gg-th}
can be adapted by substituting
\begin{equation}
\Omega = \vbr{p},\qquad \omega = p\,\coth\frac{\pp p}{2\lambda}\quad
\text{and}\quad T = T_\text{HD} \equiv \frac{\lambda}{2\pp},
\end{equation}
yielding the \emph{fidelity per mode}
\begin{equation}
F^\rbr{p} = \frac{\sqrt{u-1}}{\sqrt[4]{u^2+u+1}},\qquad
u \coloneqq \ee^q \equiv \ee^{\vbr{p}/T_\text{HD}},
\label{eq:fidelity-pt}
\end{equation}
so that the trace distance per Fourier mode can be evaluated, see
\cref{fig:trace-dist-per-mode}.

\begin{figure}
\begin{center}
\input{./graphics/graph_trace_dist_mode_bounds}
\end{center}
\caption[Possible value of the trace distance per Fourier mode]{Possible value
of the trace distance between mode wave functions in
\cref{eq:wave-function-decomposed} and the corresponding thermal density
operators. One sees that the difference becomes exponentially small with respect
to $p/T_\text{HD}$, which suggests it would be difficult to distinguish the pure
and thermal descriptions by detecting the high-energy modes in the Hawking
radiation, confirming the results in \cref{sec:corr_Fourier}.
\label{fig:trace-dist-per-mode}}
%, evaluated in terms of lower and upper bound by fidelity
\end{figure}

To approach the trace distance for the wave functional and the total thermal
state, one needs to deal with the product with continuous index in
\cref{eq:expectation-decomposed}. A popular way to go to the `continuous limit'
in \emph{summation} is
\begin{equation}
\sum_p \rfun{g}{p} \to \frac{1}{2\pp\Lambda} \int \dd p\,\rfun{g}{p},
\end{equation}
where $\Lambda$ has the same dimension as $p$ in order to fix the dimension; in
the box-normalisation scheme, for example, the corresponding $\Lambda$ would be
proportional to the volume of the box $V$. A similar method may be used to
normalise the product, namely
\begin{equation}
\prod_p \rfun{f}{p} = \cfun{\exp}{\sum_p \ln\rfun{f}{p}} \to
\cfun{\exp}{\frac{1}{2\pp\Lambda}\int \dd p\,\ln\rfun{f}{p}}.
\end{equation}
Note that the wave functional \cref{eq:squeezed-wave-functional}, which has
always been dealt with, can also be seen as being normalised by the method.
One thus derives
\begin{equation}
F = \cfun{\exp}{\frac{2}{2\pp\Lambda}\int_0^{+\infty}\dd p\,\ln F^\rbr{p}}
= \rfun{\exp}{-\frac{\pp}{9} \frac{T_\text{HD}}{\Lambda}},
\end{equation}
which is shown in \cref{fig:trace-dist-total}.

\begin{figure}
\begin{center}
\input{./graphics/graph_trace_dist_total_bounds}
\end{center}
\caption[Possible value of the trace distance between pure and thermal
descriptions]{Possible value of the trace distance between the pure and thermal
descriptions of the Hawking radiation field. One sees that the difference
between the two cases is positively (negatively) correlated with the Hawking
temperature temperature (mass of black hole).
\label{fig:trace-dist-total}}
\end{figure}

%------------------------------------------------------------------------------
\section{Discussion}
\label{sec:dist-discussion}
%------------------------------------------------------------------------------
Strictly speaking, the formalism in \cref{sec:arbitrary-canonical} is \emph{not}
applicable to the radiation field considered here, because they were proved for
\emph{finite dimensional systems}, while the cases in this work are all
\emph{infinite-dimensional}. However, since a regularised result can be
obtained, it is believable that a mathematically rigorous approach exists, which
will justify the result, similar to the renormalisation procedure in quantum
field theory.

Though the asymptotic behaviour of the trace distance with respect to Hawking
temperature has clearly been revealed by setting bounds to it, it is still
appealing to calculate its \emph{exact value}. One possible approach is by
using the results in \cite{Joos1985}, where the eigenfunctions and eigenvalues
of a general Gaussian density operator have been explicitly solved.

The evaluation of the trace distance was motivated by \citeauthor{Hsu2009} in
\cite{Hsu2009}, where operational meaning of the distance was also discussed in
terms of toy models, which is unfortunately not applicable to the field system.
In future works, it is expected that the distance between the pure and thermal
states will be understood in terms of \emph{experiments} or \emph{observations},
where the essence of physical science lies.

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


\hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block}{}\section{numpp\+:\+:matrix\+:\+:sparse\+:\+:block$<$ T, Rows, Columns $>$ Class Template Reference}
\label{classnumpp_1_1matrix_1_1sparse_1_1block}\index{numpp\+::matrix\+::sparse\+::block$<$ T, Rows, Columns $>$@{numpp\+::matrix\+::sparse\+::block$<$ T, Rows, Columns $>$}}

Block version of sparse matrix.

{\ttfamily \#include $<$sparse\+\_\+block.\+hpp$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_ae63cfc45208606404488f5fe326bb1d3}\label{classnumpp_1_1matrix_1_1sparse_1_1block_ae63cfc45208606404488f5fe326bb1d3}}
using {\bfseries value\+\_\+type} = T
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a9cc87ccc78269d5061ede24a826095b7}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a9cc87ccc78269d5061ede24a826095b7}}
using {\bfseries size\+\_\+type} = std\+::size\+\_\+t
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a2e487b67c00d269e7e64f59548e9de61}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a2e487b67c00d269e7e64f59548e9de61}}
using {\bfseries reference} = T \&
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a469a9838360107bb0ad15b5f8b22910f}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a469a9838360107bb0ad15b5f8b22910f}}
using {\bfseries const\+\_\+reference} = const T \&
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a51437641f0fb291201fa88ade1ecc187}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a51437641f0fb291201fa88ade1ecc187}}
using {\bfseries pointer} = T $\ast$
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a810d06f6c2e6b0e92f73bbb971eeff7c}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a810d06f6c2e6b0e92f73bbb971eeff7c}}
using {\bfseries const\+\_\+pointer} = const T $\ast$
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a83470439e34e65f8abc0d59c81bf09c4}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a83470439e34e65f8abc0d59c81bf09c4}}
{\bfseries block} (const \hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \&)=default
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a48e8a9c7c0610bb7e8b84b67db6e5a6c}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a48e8a9c7c0610bb7e8b84b67db6e5a6c}}
{\bfseries block} (\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \&\&)=default
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_aecf67898fb5cd432a940c4cb22b6790b}\label{classnumpp_1_1matrix_1_1sparse_1_1block_aecf67898fb5cd432a940c4cb22b6790b}}
\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \& {\bfseries operator=} (\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \&\&)=default
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a8ba9f28a47fd22af6fc63d6ba2a467ce}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a8ba9f28a47fd22af6fc63d6ba2a467ce}}
\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \& {\bfseries operator=} (const \hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \&)=default
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_ab613bba3b224199917249af76563a7c3}\label{classnumpp_1_1matrix_1_1sparse_1_1block_ab613bba3b224199917249af76563a7c3}}
{\bfseries block} (std\+::initializer\+\_\+list$<$ std\+::initializer\+\_\+list$<$ T $>$$>$ elements)
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a0cafdc2b3674aa15cfe3575ed8d797c4}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a0cafdc2b3674aa15cfe3575ed8d797c4}}
size\+\_\+type {\bfseries size} () const noexcept
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a36977c382b70c3865ab252138d4617f4}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a36977c382b70c3865ab252138d4617f4}}
const std\+::array$<$ std\+::vector$<$ T $>$, Rows $>$ \& {\bfseries data} () const noexcept
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_acd407b6661d5051136ec040a009651d8}\label{classnumpp_1_1matrix_1_1sparse_1_1block_acd407b6661d5051136ec040a009651d8}}
std\+::array$<$ std\+::vector$<$ T $>$, Rows $>$ \& {\bfseries data} () noexcept
\item
{\footnotesize template$<$typename U $>$ }\\auto \hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block_a9ee2ec26bf97fe00dfc11957de26156c}{operator$\ast$} (const \hyperlink{classnumpp_1_1vector}{numpp\+::vector}$<$ U, Columns, false $>$ \&vec)
\end{DoxyCompactItemize}

\subsection{Detailed Description}
\subsubsection*{template$<$typename T, std\+::size\+\_\+t Rows, std\+::size\+\_\+t Columns$>$\newline
class numpp\+::matrix\+::sparse\+::block$<$ T, Rows, Columns $>$}

Block version of sparse matrix.

\begin{DoxyTemplParams}{Template Parameters}
{\em T} & arithmetic type contained in matrix class \\
\hline
{\em Rows} & number of rows in matrix \\
\hline
{\em Columns} & number of columns in matrix\\
\hline
\end{DoxyTemplParams}
{\bfseries This implementation is an experiment in cache hit-\/rate.~\newline
 } Whole sparse matrix is contained in one array, divided based on blocks of contiguous non-\/zero numbers.~\newline
After each block operation calculating row is performed.

\begin{DoxyWarning}{Warning}
{\bfseries For parallelization of the sparse matrix dense vector multiplication you need compiler with Open\+MP support}

Only sparse matrix dense vector multiplication implemented

{\bfseries Each row has to be seperate std\+::initializer\+\_\+list}
\end{DoxyWarning}
{\bfseries Pros\+:}
\begin{DoxyItemize}
\item Obviously lower memory overhead, for 50\% sparse matrix with no blocks it contains only 150\% storage of dense matrix.
\item Higher cache locality (at least in theory)
\end{DoxyItemize}

{\bfseries Cons\+:}
\begin{DoxyItemize}
\item Impossible S\+I\+MD optimization
\item Additional operations of read for every block
\end{DoxyItemize}

{\bfseries Example\+:}
\begin{DoxyCode}
\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1nested}{numpp::matrix::sparse::nested<double, 3,3>} mat\{\{0,  0,   1\},
                                                \{0,  2.3, 0\},
                                                \{0,  0,   13.7\}
                                               \};
constexpr numpp::matrix::vector<double, 3> vec\{1,2,3\};
\textcolor{keyword}{auto} result = mat*vec;
\end{DoxyCode}

\begin{DoxyCode}
\textcolor{preprocessor}{#include"numpp/structures/matrices/sparse.hpp"}
\end{DoxyCode}

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a9ee2ec26bf97fe00dfc11957de26156c}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a9ee2ec26bf97fe00dfc11957de26156c}}
\index{numpp\+::matrix\+::sparse\+::block@{numpp\+::matrix\+::sparse\+::block}!operator$\ast$@{operator$\ast$}}
\index{operator$\ast$@{operator$\ast$}!numpp\+::matrix\+::sparse\+::block@{numpp\+::matrix\+::sparse\+::block}}
\subsubsection{\texorpdfstring{operator$\ast$()}{operator*()}}
{\footnotesize\ttfamily template$<$typename T , std\+::size\+\_\+t Rows, std\+::size\+\_\+t Columns$>$ \\
template$<$typename U $>$ \\
auto \hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{numpp\+::matrix\+::sparse\+::block}$<$ T, Rows, Columns $>$\+::operator$\ast$ (\begin{DoxyParamCaption}\item[{const \hyperlink{classnumpp_1_1vector}{numpp\+::vector}$<$ U, Columns, false $>$ \&}]{vec }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Function multiplying sparse matrix and dense vector

\begin{DoxyParams}{Parameters}
{\em vec} & Vector which will be multiplied \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
vector$<$\+U, Rows, false$>$
\end{DoxyReturn}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
structures/matrices/sparse/sparse\+\_\+block.\+hpp\end{DoxyCompactItemize}


\section{Bool}\label{Bool}

The BOOL library includes the following files:

\begin{itemize}

\item {\tt Bool.v} defines standard operations on booleans and states
  and proves simple facts on them.
\item {\tt IfProp.v} defines a disjunction which contains its proof
  and states its properties.
\item {\tt Zerob.v} defines the test against 0 on natural numbers and
  states and proves properties of it.
\item {\tt Orb.v} states and proves facts on the boolean or.
\item {\tt DecBool.v} defines a conditional from a proof of
  decidability and states its properties.
\end{itemize}


\section{Anomaly detection: A survey}
\label{ch:chandola2009}

\textit{Anomaly Detection: A Survey} by Chandola. \\
Cited 1853. \textit{ACM Computing Surveys (CSUR), 2009}
\newline

\textbf{Main point} is that \begin{inparaenum}[\itshape a\upshape)]
\item semi-supervised and unsupervised detections are mainly applicable.
\item performance is dependent on the assumptions, advantages and disadvantages of algorithms.
\end{inparaenum}

\subsection{Intrusion detection}
\begin{description}
\item[Challenge] \hfill \\
$\bullet$ Huge volumne of data $\rightarrow$ algorithm need to be efficient. \\
$\bullet$ Intrusions occur as patterns, keep changing over time. \\
$\bullet$ Online analysis is preferred. \\
\end{description}

\subsection{Spectral anomaly detection}
\begin{description}
\item[Assumption] \hfill \\
$\bullet$ Data can be embedded into a lower dimensional subspace. \\

\item[Advantage] \hfill \\
$\bullet$ Suitable for handling high dimension. \\

\item[Disadvantage] \hfill \\
$\bullet$ Data need to be separable in lower dimension. \\
$\bullet$ High computational complexity. \\
\end{description}


\documentclass[main.tex]{subfiles}
\begin{document}

\marginpar{Tuesday\\ 2020-11-3, \\ compiled \\ \today}

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/roche-equipotential}
\caption{Equipotential lines for the Roche potential \(\phi _R\). \(M_{1, 2}\) mark the two masses, while the Lagrange points\(L\) are the ones in which the potential is stationary: \(\nabla \phi _R = 0\).}
\label{fig:roche-equipotential}
\end{figure}

% The equation of motion of a particle in the corotating frame is
% %
% \begin{align}
% \pdv{\vec{v}}{t}
% + \qty(\vec{v} \cdot \vec{\nabla}) \vec{v}
% = - \frac{1}{\rho } \vec{\nabla} P
% - \vec{\omega} \wedge \vec{v}
% - \vec{\nabla} \phi _R
% \,,
% \end{align}
% %
% where \(\phi _R\) is the Roche potential, which can be written in terms of the parameters \(q = M_2 / M_1 \) and \(a\);
%
% \todo[inline]{there might be a wrong sign in the last lecture!}
%
% \begin{align}
% \phi _R = - \frac{GM_1}{\abs{\vec{r} - \vec{r}_1}}
% - \frac{GM_2}{\abs{\vec{r} - \vec{r}_2}}
% - \frac{1}{2} \qty(\vec{\omega} \wedge \vec{r})^2
% \,.
% \end{align}
% \todo[inline]{insert diagram for the quantities in the potential}

Also, if \(\theta \) is the angle between \(\vec{\omega}\) and \(\vec{r}\) we can write
%
\begin{align}
\qty(\vec{\omega} \wedge \vec{r})^2 = \omega^2 r^2 \sin^2 \theta
\,.
\end{align}

Let us come back to the Roche potential, whose equipotential contours we sketch in figure \ref{fig:roche-equipotential}.
In terms of the aforementioned variables \(q\) and \(\theta \) it can be written as
%
\begin{align}
\phi _R &=
- G (M_1 + M_2 ) \qty[ + \frac{1}{2} \frac{\omega^2 r^2 \sin^2\theta }{G (M_1 + M_2 )}
+ \frac{GM_1 }{G (M_1 + M_2 ) \abs{\vec{r} - \vec{r}_1 }}
+ \frac{GM_2 }{G (M_1 + M_2 ) \abs{\vec{r} - \vec{r}_2 }}
 ]  \\
 &= - G (M_1 + M_2 )
 \qty[
     \frac{1}{2} \frac{\omega^2r^2 \sin^2\theta }{G(M_1 + M_2 )}
     + \frac{1}{(1 + q) \abs{\vec{r} - \vec{r}_1}}
     + \frac{q}{(1 + q) \abs{\vec{r} - \vec{r}_2}}
 ]
\,.
\end{align}

We can then use Cartesian coordinates centered in \(M_1 \):
then,
%
\begin{align}
\phi _R = - \frac{G (M_1 + M_2  )}{2 a^3}
\qty[ \frac{2 a^3}{1 + q}
\frac{1}{\sqrt{x^2 +y^2 +z^2}}
+
\frac{2 q a^3}{1 + q}
\frac{1}{\sqrt{(x-a)^2 + y^2 +z^2}}
+ \qty[(x - x _{\text{CM}})^2 + y^2]
]
\,,
\end{align}
%
where
%
\begin{align}
x _{\text{CM}} = \frac{qa}{1 + q}
\,,
\end{align}
%
so if we rescale all the spatial coordinates by the major semi axis \(a\) we get
%
\begin{align}
\phi _R = - \frac{G (M_1 + M_2 )}{2a}
\qty[
\frac{2}{1 +q}
\frac{1}{\sqrt{x^2 +y^2 +z^2}}
+
\frac{2 q}{1 + q}
\frac{1}{\sqrt{(x-1)^2 + y^2 + z^2}}
+ \qty[\qty(x - \frac{q}{1 + q})^2 + y^2]
]
\,.
\end{align}

If the stars are stationary, or in slow evolution. Then, their surfaces will be (at least in first approximation) at rest. Therefore, the derivative terms vanish, and we get
%
\begin{align}
0  = - \frac{1}{\rho } \vec{\nabla} P - \vec{\nabla} \phi _R
\,,
\end{align}
%
but the surface is defined by \(\vec{\nabla} P = 0\), which by this equation corresponds to \(\vec{\nabla} \phi _R = 0\).

The star will then take the shape of an equi-Roche potential surface.
What is this shape? See \ref{fig:roche-equipotential}.

% \todo[inline]{Make 2D plots, cuts of the surface}

\subsection{The Roche lobe}

We have roughly spherical contours near the stars, and a figure-eight contour eventually.
The center of this contour is called \(L_1 \), the first or ``inner'' Lagrange point.

Analogy with a dog food container for Roche Lobe overflow.

Is the overflow stable? It depends on whether the volume of the Roche lobe increases or decreases as the donor star loses mass: in the latter case.

% Tight worn jeans?

We can introduce a characteristic \textbf{radius} of the Roche Lobe, calculated by
%
\begin{align}
V _{\text{lobe}} = \frac{4}{3} \pi R _{\text{lobe}}^3
\,,
\end{align}
%
although the lobe is not a sphere this allows us to give a characteristic number.
We can calculate \cite[]{eggletonApproximationsRadiiRoche1983}:
%
\begin{align}
\frac{R_{\text{lobe}}}{a} = f(q) \approx
\begin{cases}
    \num{.38} + \num{.2} \log_{10} q  & \num{.5} < q < \num{20}\\
    \num{.46}  \qty( \frac{q}{1 + q})^{1/3}
    & 0 < q < \num{.5}
\end{cases}
\,,
\end{align}
%
and we can see that the dependence on \(q\) is quite weak. A plot of this is shown in figure \ref{fig:roche-lobe-radius}:
%
\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/roche-lobe-radius}
\caption{Radius of the Roche lobe as a function of \(q\).}
\label{fig:roche-lobe-radius}
\end{figure}

However, the orbital separation \(a\) is itself a function of \(q\), and the dependence \(a(q)\) is much more relevant than the dependence of \(R _{\text{lobe}} / a\).

In order to calculate \(a(q)\), let us make some assumptions.
\begin{enumerate}
    \item \(M_1 + M_2 = \const\). This is realistic: it is hard for the binary star system as a whole to lose or gain mass.
    \item The total angular momentum \(L _{\text{tot}}\) is a constant. This is a bit tricky: even a small amount of mass loss can result in high angular momentum loss.
    \item \(L _{\text{tot}} = L _{\text{orb}}\): all the angular momentum is orbital. We are neglecting the spins of the stars, and the angular momentum of the gas. This is realistic, since tidal forces move the configuration towards a tidally locked state.
\end{enumerate}

The conservation of mass tells us that \(M_1 (1 + q)\) is constant.
The orbital angular momentum is written in terms of the distances of the stars from the center of mass:
%
\begin{align}
L _{\text{orb}} &= M_1 v_1 a_1 + M_2 v_2 a_2  \\
&= M_1 a_1^2 \omega + M_2 a_2^2 \omega
\,,
\end{align}
%
so if we place the origin of our coordinates in the center of mass we can write everything in terms of the orbital separation \(a = a_1 + a_2 \):
% \todo[inline]{So \(a\) is not the semimajor axis}
%
\begin{align}
-M_1 a_1 + M_2 a_2 &= 0  \\
- (M_1 + M_2 ) a_1 + M_2 a &= 0  \\
a_1 &= \frac{qa}{1+q} \\
a_2 &= \frac{a}{1 +q}
\,.
\end{align}

In terms of angular momentum we get
%
\begin{align}
\qty[
    M_1 \frac{q^2 a^2}{(1 + q)^2}
    + M_2 \frac{a^2}{(1+q)^2}
]\omega &= \const \\
M_1 a^2
\qty[
    \frac{q^2}{(1 + q)^2}
    + \frac{q}{(1+q)^2}
]\omega &= \const
\,,
\end{align}
%
which means
%
\begin{align}
\frac{a^2 M_1 \omega q}{1 + q} =
\frac{a^2 M_1 2 \pi  q}{P(1 + q)}
= \const
\,,
\end{align}
%
since \(\omega = 2\pi / P\), where \(P\) is the orbital period.
We also know that (because of mass conservation) \(M_1 \propto (1 + q)^{-1}\), therefore
%
\begin{align}
\frac{a^2 q}{(1+q)^2} \frac{1}{P}
\,,
\end{align}
%
but also Kepler's third law tells us that \(a^3 \propto P^2\): so, \(P \propto a^{3/2}\). This yields
%
\begin{align}
\frac{a^{2 - 3/2} q}{(1+q)^2} = \sqrt{a} \frac{q}{(1+q)^2} = \const
\,,
\end{align}
%
therefore
%
\begin{align}
a \propto \frac{(1 + q)^{4}}{q^2}
\,.
\end{align}

The Roche lobe \(R_2\) for \(M_2\) is given by \(R_2 = a f\), therefore
%
\begin{align}
\log R_2 = \log a + \log f
\,,
\end{align}
%
and if we consider a variation of \(q\), the variation of \(\log R_2 \) will be given by the sum of the variations of the two logarithms.

Because of the expression we derived, we have
%
\begin{align}
\log a &= 4 \log (1 +q) - 2 \log q + \const \\
\Delta \log a &= 4 \frac{\Delta q}{1 + q} - 2 \frac{\Delta q}{q }  \\
&= \frac{4q -2 -2 q}{(1 + q) q} \Delta q = 2 \frac{\Delta q}{q} \frac{q -1}{q +1}
\,.
\end{align}

Then, the fractional variation is approximately
%
\begin{align}
\frac{\Delta R_2}{R_2} = \Delta \log R_2 \approx
2\frac{\Delta q}{q} \frac{q -1}{q +1}
\,,
\end{align}
%
since \(\Delta \log f\) is negligible (see figure \ref{fig:roche-lobe-relative-corrections}).
As the star \(M_2 \) donates mass, \(M_2 \) decreases and \(M_1 \) increases. Then, \(q = M_2 / M_1 \) decreases, therefore \(\Delta q < 0\).

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/roche-lobe-relative-corrections.pdf}
\caption{Relative size of the corrections --- \(\Delta \) means derivative with respect to \(q\). One can notice that for typical \(q \gtrsim 2\) the magnitude of \(\Delta \log a\) is about one order of magnitude larger than that of \(\Delta \log f\). Also, we can see that \(\Delta \log a + \Delta \log f\) is indeed positive for \(q > 1\) --- the curve is not shown in the region in which it is negative.}
\label{fig:roche-lobe-relative-corrections}
\end{figure}

If we want the Roche lobe to shrink, we want \(\Delta R_2 < 0\): so, we want \(q - 1 > 0\).
This means that \textbf{Roche lobe accretion is self-sustaining, or stable iff the donor star is larger than the receiver}.
% Including \(\Delta f\), things don't change by much.
If we include \(\Delta f\), as one can see in figure \ref{fig:roche-lobe-relative-corrections}, the picture is quite similar --- the noticeable correction we have is that systems with \(\num{.8} < q < 1\) might still have Roche Lobe Overflow.

Is this the case in real systems? Usually the mass of the BH is of at least a few solar masses, so we need an unusually large companion.
For example, the companion to the BH in Cygnus X-1 is a very large O-star.

\section{Accretion disks}

Now we will discuss what happens when this is indeed the case. What is the fate of the matter passing through the inner Lagrange point?

\subsection{Circularization}

Let us change the perspective: we are not comoving with respect to the orbiting stars anymore.
Let us call \(b_1 \) the separation of the \(L_1 \) point from the center of star 1. This is slightly larger than \(R_1 \).

If we are stationary at the center the companion compact star will appear to rotate at a large velocity compared to us.

The components of this velocity can be decomposed into the parallel and perpendicular to the separation vector between the star, however the component \(v _ \parallel\) will be of the order of the speed of sound in the gas: roughly,
%
\begin{align}
v_{\parallel} \approx c_s = \sqrt{ \pdv{P}{\rho }} = \sqrt{\frac{k_B T}{\mu m_p}} \approx \num{10} \sqrt{ \frac{T}{\SI{e4}{K}}} \SI{}{km /s}
\,;
\end{align}
%
while the component \(v_\perp\) will be large: of the order of
%
\begin{align}
v_\perp \sim b_1 \omega
\,,
\end{align}
%
and the distance \(b_1\) will be roughly given by \cite[]{plavecTablesRocheModel1964}
%
\begin{align}
b_1 \approx a (\num{.5} - \num{.227} \log q)
\,,
\end{align}
%
while by Kepler's third law
%
\begin{align}
4 \pi^2 a^3 = G (M_1 + M_2 ) P^2
\,,
\end{align}
%
so
%
\begin{align}
a \approx \num{3e11} \qty(\frac{M_1 }{M_{\odot}})^{1/3}
\qty(1 + q)^{1/3}
\qty(\frac{P}{\SI{1}{d}})^{2/3}
\SI{}{cm}
\,,
\end{align}
%
while the angular velocity is
%
\begin{align}
\omega = \frac{2 \pi }{P} \approx \num{7e-5} \qty(\frac{P}{\SI{1}{d}})^{-1} \SI{}{rad/s}
\,.
\end{align}

This means that the perpendicular velocity is approximately
%
\begin{align}
v_{\perp} \approx \num{100} \qty(\frac{M_1 }{M_{\odot}})^{1/3}
\qty(1 + q)^{1/3}
\qty(\frac{P}{\SI{1}{d}})^{-1/3}
\SI{}{km/s}
\,,
\end{align}
%
an order of magnitude more than the speed of sound.

\end{document}


\documentclass[../notes.tex]{subfiles}

\pagestyle{main}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter\ (#1)}{}}
\setcounter{chapter}{19}

\begin{document}

\chapter{The Second Law of Thermodynamics}
\section{Thermodynamic Cycles}
\begin{itemize}
    \item \marginnote{8/23:}Examples: Engines and pumps.
    \item In a thermodynamic cycle, the energy doesn't change, so $W_\text{on gas}=-Q$, i.e., $W_\text{by gas}=Q_\text{net}$.
    \item Thus, $W_\text{by engine}=Q_\text{in}-Q_\text{out}$ per cycle.
    \item \textbf{Otto cycle}: The thermodynamic cycle used in car engines. \emph{Also known as} \textbf{auto cycle}.
    \begin{figure}[h!]
        \centering
        \begin{tikzpicture}[
            scale=1.8,
            every node/.append style={black},
            pics/point/.style args={#1:#2}{code={
                \node [circle,fill=pix,inner sep=1.5pt,label={#1:$#2$}] {};
            }}
        ]
            \footnotesize
            \draw [stealth-stealth] (0,2) node[above]{$p$} -- (0,0) -- (3,0) node[right]{$V$};

            \draw [blx,thick,dashed] plot[domain=1:2.5,samples=500] (\x,{1.67/\x});
            \draw [blx,thick,dashed] plot[domain=0.6:2.5,samples=500] (\x,{1/\x});
            \draw [blx,thick,dashed] plot[domain=0.3:2.5,samples=500] (\x,{0.5/\x});
            \draw [blx,thick,dashed] plot[domain=0.12:2.5,samples=500] (\x,{0.2/\x});

            \draw [orx,very thick,postaction={decorate},decoration={
                markings,
                mark=at position 0.25  with {\arrow{>} \node[above right,fill=white,inner sep=1.5pt]{$Q=0$};},
                mark=at position 0.465 with {\arrow{>} \node[right=3pt,fill=white,inner sep=1.5pt]{$Q_\text{out}$};},
                mark=at position 0.65  with {\arrow{>} \node[below left,fill=white,inner sep=1.5pt]{$Q=0$};},
                mark=at position 0.91  with {\arrow{>} \node[left =3pt,fill=white,inner sep=1.5pt]{$Q_\text{in}$};}
            }] plot[domain=0.8:2] (\x,{0.845/\x^(1.756)}) -- plot[domain=2:0.8] (\x,{0.4/\x^2}) -- cycle;

            \pic at (0.8,{1/0.8}) {point=:};
        \end{tikzpicture}
        \caption{Otto cycle.}
        \label{fig:ottoCycle}
    \end{figure}
    \begin{itemize}
        \item Two adiabatic and two isochoric processes.
    \end{itemize}
    \item \textbf{Stirling engine cycle}: The thermodynamic cycle used in steam engines.
    \begin{figure}[h!]
        \centering
        \begin{tikzpicture}[
            scale=1.8,
            every node/.append style={black},
            pics/point/.style args={#1:#2}{code={
                \node [circle,fill=pix,inner sep=1.5pt,label={#1:$#2$}] {};
            }}
        ]
            \footnotesize
            \draw [stealth-stealth] (0,2) node[above]{$p$} -- (0,0) -- (3,0) node[right]{$V$};
            \draw [very thin,dashed] (0.8,{0.5/0.8}) -- (0.8,0) node[below]{$V_1$};
            \draw [very thin,dashed] (2,{0.5/2}) -- (2,0) node[below]{$V_2$};

            \draw [blx,thick,dashed] plot[domain=1:2.5,samples=500] (\x,{1.67/\x});
            \draw [blx,thick,dashed] plot[domain=0.6:2.5,samples=500] (\x,{1/\x}) node[right]{$T_1$};
            \draw [blx,thick,dashed] plot[domain=0.3:2.5,samples=500] (\x,{0.5/\x}) node[right]{$T_2$};
            \draw [blx,thick,dashed] plot[domain=0.12:2.5,samples=500] (\x,{0.2/\x});

            \draw [orx,very thick,postaction={decorate},decoration={
                markings,
                mark=at position 0.25 with {\arrow{>} \node[above=4pt,fill=white,inner sep=1.5pt]{$+Q_2$};},
                mark=at position 0.45 with {\arrow{>} \node[right=3pt,fill=white,inner sep=1.5pt]{$-Q_3$};},
                mark=at position 0.65 with {\arrow{>} \node[below=3pt,fill=white,inner sep=1.5pt]{$-Q_4$};},
                mark=at position 0.91 with {\arrow{>} \node[left =3pt,fill=white,inner sep=1.5pt]{$+Q_1$};}
            }] plot[domain=0.8:2] (\x,{1/\x}) -- plot[domain=2:0.8] (\x,{0.5/\x}) -- cycle;
            \draw [orx,very thick] plot[domain=0.8:2] (\x,{1/\x}) -- plot[domain=2:0.8] (\x,{0.5/\x}) -- cycle;

            \pic at (0.8,{1/0.8}) {point=:};
        \end{tikzpicture}
        \caption{Stirling engine cycle.}
        \label{fig:stirlingCycle}
    \end{figure}
    \begin{itemize}
        \item Two isothermal and two isochoric processes.
        \item For the isothermal processes, $\Delta E_\text{int}=0$, so $Q=W_\text{by gas}=nRT\ln(V_f/V_i)$.
        \item For the isochoric process, $Q=nC_V\Delta T$.
        \item $Q_1+Q_3=nC_V(T_1-T_2)+nC_V(T_2-T_1)=0$, so we only have to worry about $Q_2$ and $Q_4$ to determine the work done by the gas:
        \begin{align*}
            W_\text{by gas} &= Q_2+Q_4\\
            &= nR\ln\left( \frac{V_2}{V_1} \right)\cdot(T_1-T_2)
        \end{align*}
        \item To get more work, you want the \textbf{compression factor} to be as big as possible.
        \item You also want the difference between the two temperatures to be as big as possible.
        \item The engine is powered until $T_1=T_2$, because at that point you can't exchange heat.
    \end{itemize}
    \item \textbf{Compression factor}: The ratio of the final volume to the initial volume, i.e., $V_2/V_1$.
    \item \textbf{Efficiency}: The quotient of the work an engine does and the heat you put in per cycle. \emph{Denoted by} $\bm{e}$. \emph{Given by}
    \begin{align*}
        e &= \frac{W_\text{engine}}{Q_\text{in}}\\
        &= \frac{Q_\text{in}-Q_\text{out}}{Q_\text{in}}\\
        &= 1-\frac{Q_\text{out}}{Q_\text{in}}
    \end{align*}
    \item \textbf{Carnot cycle}.
    \begin{figure}[h!]
        \centering
        \begin{tikzpicture}[
            scale=1.8,
            every node/.append style={black},
            pics/point/.style args={#1:#2}{code={
                \node [circle,fill=pix,inner sep=1.5pt,label={#1:$#2$}] {};
            }}
        ]
            \footnotesize
            \draw [stealth-stealth] (0,2) node[above]{$p$} -- (0,0) -- (3,0) node[right]{$V$};

            \draw [blx,thick,dashed] plot[domain=1:2.5,samples=500] (\x,{1.67/\x}) node[right]{$T_H$};
            \draw [blx,thick,dashed] plot[domain=0.6:2.5,samples=500] (\x,{1/\x});
            \draw [blx,thick,dashed] plot[domain=0.3:2.5,samples=500] (\x,{0.5/\x}) node[right]{$T_L$};
            \draw [blx,thick,dashed] plot[domain=0.12:2.5,samples=500] (\x,{0.2/\x});

            \draw [orx,very thick,postaction={decorate},decoration={
                markings,
                mark=at position 0.13 with {\arrow{>} \node[above=6pt,xshift=2pt,fill=white,inner sep=1.5pt]{$Q_\text{in}$};},
                mark=at position 0.33 with {\arrow{>} \node[right=3pt,fill=white,inner sep=1.5pt]{$Q=0$};},
                mark=at position 0.58 with {\arrow{>} \node[below=3pt,fill=white,inner sep=1.5pt]{$Q_\text{out}$};},
                mark=at position 0.81 with {\arrow{>} \node[left =3pt,fill=white,inner sep=1.5pt]{$Q=0$};}
            }] plot[domain=1.1:1.6] (\x,{1.67/\x}) plot[domain=1.6:2] (\x,{21.178/\x^(6.404)}) plot[domain=2:1.4] (\x,{0.5/\x}) plot[domain=1.4:1.1] (\x,{2.69/\x^(6.001)});

            \pic at (1.1,{1.67/1.1}) {point=:};
        \end{tikzpicture}
        \caption{Carnot cycle.}
        \label{fig:carnotCycle}
    \end{figure}
    \begin{itemize}
        \item Two isothermal and two adiabatic processes.
        \item For this engine, $e=1-Q_\text{out}/Q_\text{in}=1-T_L/T_H$.
        \begin{itemize}
            \item Thus, as the temperatures approach each other, efficiency approaches 1.
            \item But, you cannot run an engine when the heat bath temperatures are equal to each other.
        \end{itemize}
        \item Therefore, the Carnot cycle is the most efficient engine you can build, but it's just not physically viable.
        \begin{itemize}
            \item A car run on the Carnot cycle would have great mileage but wouldn't get you very far.
        \end{itemize}
        \item Conclusion: The Carnot cycle is interesting, but it does not yield a particularly useful engine.
    \end{itemize}
\end{itemize}

\section{The Second Law}
\begin{itemize}
    \item \textbf{Second Law of Thermodynamics}: It is not possible to remove heat at a high temperature and convert it entirely to work done by the engine. In other words, some heat is always exhausted to the low temperature.
    \item Maximizing engine efficiency:
    \begin{itemize}
        \item You want to maximize the temperature difference.
        \item You could technically run an engine between air temperature and ice, but it's hard to lug around a bunch of ice.
        \item Additionally, you can't have $T_H$ be too high because hotter engines emit nastier exhaust (specifically, exhaust that contributes more to acid rain).
        \item Recall that the area on a $pV$-graph encompassed by the cycle is equal to the work done by the gas.
    \end{itemize}
    \item If you run a heat engine backwards, you get a \textbf{heat pump}.
    \item \textbf{Heat pump}: A device that removes heat from low temperature sinks and exhausts it into high temperature sinks.
    \begin{itemize}
        \item This is an air conditioner.
        \item The second law of thermodynamics asserts that you can't remove heat at a low temperature and move it to a high temperature without doing work on the gas. Thus, you have to plug in the air conditioner and provide power --- heat won't magically flow from cold to hot.
    \end{itemize}
\end{itemize}

\section{Statistical Mechanics}
\begin{itemize}
    \item Free expansion.
    \begin{itemize}
        \item Imagine you have gas on one side of a thermally insulated container separated from the rest of the container by a partition.
        \item If you remove the partition, the gas will expand out to fill the entire container.
        \item However, the gas is not working against a force ($p=0$) and heat is not flowing in ($Q=0$).
        \item Therefore, $\dd{E_\text{int}}=\dd{Q}-p\dd{V}=0-0\dd{V}=0$.
        \item From this, we can conclude that $\Delta T=0$.
        \item Note that this is an \textbf{irreversible process}.
    \end{itemize}
    \item \textbf{Irreversible process}: A process that looks like it could occur on a microscopic level but could not on a macroscopic level.
    \begin{itemize}
        \item Imagine a video of the milk molecules moving in a cup of coffee (which would look normal forwards and backwards) vs. a video of milk spreading out in a cup of coffee (which most certainly would not look normal backwards).
    \end{itemize}
    \item \textbf{Macrostate}: A set of thermal variables ($n,p,V,T$) defining a system at an instant in time.
    \item \textbf{Microstate}: A way of arranging the molecules in a system that produces a macrostate.
    \begin{itemize}
        \item Multiple microstates can correspond to the same macrostate.
    \end{itemize}
    \item Consider a box with 10 molecules inside.
    \begin{itemize}
        \item Each molecules has a 50/50 chance of being on the left \emph{or} right side of the box.
        \item We want to achieve the macrostate defined by 10 molecules on the left side and 0 on the right.
        \begin{itemize}
            \item There is only 1 corresponding microstate (namely that just described).
        \end{itemize}
        \item We want to achieve the macrostate defined by 3 molecules on the left side and 7 on the right.
        \begin{itemize}
            \item There are $\frac{10!}{7!3!}=120$ corresponding microstates.
        \end{itemize}
        \item For the even 5/5 split, there are $\binom{10}{5}=252$ corresponding microstates.
    \end{itemize}
    \item If there are $N$ molecules and we want $m$ on the left and $N-m$ on the right, the number of microstates that will realize this macrostate is $\frac{N!}{m!(N-m)!}$.
    \begin{itemize}
        \item This corresponds to a binomial distribution.
    \end{itemize}
    \item \textbf{Fundamental Assumption of Statistical Physics}: All microstates of a system are equally probable.
    \item \textbf{Number of microstates of a macrostate}: \emph{Denoted by} $\bm{\Omega_\textbf{macro}}$.
    \item It follows from the fundamental assumption that
    \begin{equation*}
        P_\text{macro} \propto \Omega_\text{macro}
    \end{equation*}
    \item Relating this back to our example, since $P_{m,N-m}\propto\Omega{m,N-m}$ we have that $(5,5)$ is approximately twice as likely as $(3,7)$.
    \item If we have $N_A$ of molecules, it is going to be much more likely that the molecules are evenly (or almost evenly) distributed on both sides of the box than anything else.
    \begin{itemize}
        \item $\Omega_{N_A,0}=1$ still, but $\Omega_{N_A/2,N_A/2}=\frac{N_A!}{(N_A!)^2}\approx 10^{N_A/3}\approx 10^{\num{2e23}}$, which is a huge number.
    \end{itemize}
    \item If you make $N$ and $m$ continuous rather than integer quantities, the binomial distribution becomes a Gaussian distribution.
    \begin{itemize}
        \item Thus, Gaussian distributions describe the probability distribution corresponding to the number of molecules on the left and the right.
        \item The standard deviation of the Gaussian distribution of $N_A$ macrostates is $\sigma\approx\sqrt{N_A}$.
        \item Thus, the fraction of the width of the central peak to all states is $\sigma/N_A\approx 10^{-12}$.
        \item Therefore, the width of the spike is approximately one-trillionth the width of the whole distribution, meaning that although you won't typically see a perfect 50/50 split, you won't see very large fluctuations (even 49/51 is very unlikely).
    \end{itemize}
    \item It's not that you \emph{can't} have all of the air molecules move to one side of the room; it's that you \emph{won't} have this happen.
\end{itemize}

\section{Office Hours (Gazes)}
\begin{itemize}
    \item Preference for sine vs. cosine when describing harmonic waves?
    \begin{itemize}
        \item No preference.
        \item Gazes tends to start with sines, but it really doesn't matter; there is no canonical preference.
    \end{itemize}
    \item We say that the open end of a pipe is a node and we often say that closed ends are antinodes. However, on the midterm, there was a question with a tuning fork at one end of a pipe with water at the bottom, and we were supposed to infer that the open end with the tuning fork was an antinode and the end with water was a node. As such, I'm wondering if there's any unambiguous way we can identify open and closed ends of pipes.
    \begin{itemize}
        \item We do assume the end with the tuning fork to be a pressure node and the water to be a pressure antinode.
        \item It's a \emph{pressure} node at the end of the tube, but a displacement antinode.
        \item Some transmission does occur at the end of a tube.
        \item Flaring the ends of instruments cuts down on reflection and increases transmission.
    \end{itemize}
    \item How do we know that even rays with not so well understood geometry converge on the image?
    \begin{itemize}
        \item A computer can just brute force the problem and come to this conclusion.
    \end{itemize}
    \item When refracting an object through multiple lenses, the side the \emph{original} object is on is always the $+s$ and $-s'$ side, even when the first image may be on the other side of the next lens?
    \begin{itemize}
        \item Yes.
        \item Because the rays just continue on through the second lens. Those \emph{rays} act as the object and effectively determine the sign.
    \end{itemize}
    \item Plano-convex lens on top of a mirror?
    \begin{itemize}
        \item You can make the contraption image the same way as a concave mirror.
        \item Allows analogy of concave mirrors to regular lenses.
        \item Also helps define our sign convention: flips what defines positive image distance.
    \end{itemize}
    \item When do we make use of vibration? In Problem 19.43, shouldn't we have needed to use $\frac{7}{2}nR\Delta T$ for every degree Kelvin above $\SI{1000}{\kelvin}$?
    \begin{itemize}
        \item Didn't quite cross over the threshold.
        \item Won't have to account for this on the final.
        \item Everything is monoatomic on the final!
    \end{itemize}
\end{itemize}

\section{Entropy}
\begin{itemize}
    \item \marginnote{8/24:}\textbf{Entropy} (of a macrostate): The following quantity, where $k$ is the Boltzmann constant. \emph{Denoted by} $\bm{S_\textbf{macro}}$.
    \begin{equation*}
        S_\text{macro} = k\ln\Omega_\text{macro}
    \end{equation*}
    \item $\Delta S>0$ (i.e., entropy increases) for an irreversible process.
    \item Entropies of multiple systems:
    \begin{itemize}
        \item Consider 2 systems in macrostates $A$ and $B$, respectively.
        \item The number of microstates pertaining to each macrostate is $\Omega_A$ and $\Omega_B$, respectively.
        \item We know that $P_A\propto\Omega_A$ and $P_B\propto\Omega_B$.
        \item Moreover, the probability $P_{AB}$ that the combination of the two systems in in microstate $AB$ is equal to $P_AP_B$ by fundamental probability laws, and the total number of microstates for the combination is equal to $\Omega_A\Omega_B$.
        \item It follows that
        \begin{align*}
            S_{AB} &= k\ln(\Omega_A\Omega_B)\\
            &= k\ln\Omega_A+k\ln\Omega_B\\
            &= S_A+S_B
        \end{align*}
        i.e., that entropies are additive.
    \end{itemize}
    \item Primary consequences of the second law of thermodynamics:
    \begin{itemize}
        \item Wrt heat engines: You will never see gas taking in $Q_\text{in}$ and converting entirely to $W_\text{by gas}$ (i.e., there will always be some $Q_\text{out}$).
        \item Wrt heat pumps: You will never see $Q$ extracted from $T_L$ and exhausted to $T_H$ without some $W_\text{on gas}$.
        \item Wrt entropy: You will never see a decrease in entropy.
    \end{itemize}
    \item Change in entropy for a reversible process:
    \begin{itemize}
        \item Consider the Carnot cycle (Figure \ref{fig:carnotCycle}).
        \item For the cycle, $\Delta S_\text{gas}=0$.
        \item If we add or subtract $Q$ of heat at a constant $T$,
        \begin{equation*}
            \Delta S = \frac{Q}{T}
        \end{equation*}
        \item Thus,
        \begin{align*}
            \Delta S_\text{univ} &= \Delta S_{Q_\text{in}}+\Delta S_{Q_\text{out}}\\
            &= \frac{Q_\text{in}}{T_H}-\frac{Q_\text{out}}{T_L}\\
            \intertext{The above is true for any thermodynamic cycle. But since $Q_\text{in}/Q_\text{out}=T_H/T_L$ for a Carnot cycle\dots}
            &= \frac{Q_\text{out}T_H/T_L}{T_H}-\frac{Q_\text{out}}{T_L}\\
            &= 0
        \end{align*}
        for a Carnot cycle.
        \item Thus, overall, $\Delta S=0$. This is actually true of any reversible process.
    \end{itemize}
    \item Thus, since every process is either reversible or irreversible, $\Delta S_\text{univ}\geq 0$ for every process in this universe.
\end{itemize}

\end{document}


% 06Holonomic.tex

\subsection{6.1. The Robenius Integrability Condition}

Can one always find a surface orthogonal to a family of curves in $\mathbb{R}^3$?

\subsection{6.2. Integrability and Constraints}

\subsection{6.3. Heuristic Thermodynamics via Caratheodory}

Can one go adiabatically from some state to any nearby state?

\subsubsection{6.3a. Introduction}

\subsubsection{6.3b. The First Law of Thermodynamics}

Consider system of regions of fluids separated by ``diathermous'' membranes \\
\phantom{\quad \, } allow only passage of heat, not fluids \\

assume system connected \\
assume each state in thermal equilibrium

Let $p_i,v_i$ (uniform) pressure and volume of $i$th region \\
\phantom{\quad \, } at thermal equilibrium, ``equations of state'' $p_iv_i = n_iRT_i$ \\
\phantom{\quad \quad \, } $p_i v_i = n_iRT_i$ eliminate all but 1 pressure
\[
\Longrightarrow p_1, v_1,v_2, \dots v_n
\]
assume globally defined energy function $U$

path in $M^{n+1}$ represents sequence of states each in equilibrium, i.e. assume very slow changes in time, quasi-static irreversible processes, e.g. ``stirring'' \\
on $M$, $\text{dim}{M} = n+1$, assume $\exists \, $ work 1-form $W$, work done by system
\[
W = p_i dv_i = p_i(U,v_1\dots v_n)dv_i \quad \quad \, i=1 \dots n
\]
heat 1-form, heat added or removed from system, assume $Q \neq 0$
\[
Q = \sum_{i=0}^n Q_i(U,v_1 \dots v_n) dv_i \quad \, (v_0 = U)
\]

1st. law of thermodynamics
\[
dU = Q-W
\]
energy conservation

\subsubsection*{6.3c. Some Elementary Changes of State}

1. Heating at constant volume.

\phantom{\quad \, } path $\gamma_I \in M$, $\text{dim}M = n+1$ s.t. $dv_1 = \dots = dv_n =0$.  $W=0$
\phantom{\quad \, } $dU = Q_0 dU$.  $\dot{\gamma}_I = c_0 \frac{\partial}{ \partial U}$

2. Quasi-static adiabatic process.  No heat exchanged,
\[
Q(\dot{\gamma}_{\text{II}}) = 0 \quad \, \text{ so } dU = -W
\]

3. Stirring at constant volume adiabatic, but not quasistatic  \\
\phantom{\quad \, } $Q,W$ makes no sense but \\
\phantom{\quad \, } work is being done by (or on) system, $U(y') - U(x)$, difference of internal energy \\
assume connected mechanical manifold $V$, $\text{dim}V =n$ \\
\phantom{assume } diff. $\pi:M \to V$ \\
\phantom{assume diff} $\pi$ onto \\
\phantom{assume diff} $\pi_*$ onto \\
\phantom{assume diff} $\pi$ submersion

By main thm. on submanifolds of Sec. 1.3d, \\
\phantom{\quad \, } if $v\in V$, then $\pi^{-1}(v)$ 1-dim. embedded submanifold of $M$ \\
\phantom{\quad \quad \, } assume $\forall \, \pi^{-1}(v)$ connected, we're assuming given any pair of states \\
\phantom{\quad \quad \quad \, } lying on $\pi^{-1}(v)$, 1 of them can be obtained by other by ``heating at constant volume''

assume $W$ on $M$ is $0$ when $\left. W \right|_{\pi^{-1}(v)} =0$ \\
on the other hand, $Q \neq 0$ on $\pi^{-1}(v)$; $dU = Q \neq 0$ (first law) \\
\phantom{\quad \, } $(U,v^1 \dots v^n)$ local coordinate system for $M$ ($U$ global coordinate)

\subsubsection{6.3d. The Second Law of Thermodynamics}

cyclic process starts and ends at the same state

Kelvin 2nd. law of thermodynamics \\
\phantom{\quad \, } $\nexists $ quasistatic cyclic process can $Q$ converted entirely into $W$  \\

Caratheodory (1909) 2nd. law of thermodynamics \\
\phantom{\quad \, } $\forall \, $ neighborhood $N \ni $ state $x$, $\exists \, y$ not accessible from $x$ via quasistatic adiabatic paths, i.e. paths s.t. $Q=0$

LaTeX_and_pdfs/the geometry of physics problems/06Holonomic.tex


\subsection{Label smoothing}

Regualrising of classifiers assume some incorrect (similar for regression?)


\clearpage
\makeatletter
\efloat@restorefloats
\makeatother

\begin{appendix}
\hypertarget{parallel-set-of-non-bayesian-analyses}{%
\section{Parallel set of non-Bayesian
analyses}\label{parallel-set-of-non-bayesian-analyses}}

In this appendix, we report the output of a parallel set of non-Bayesian
linear mixed-effects models for the primary analyses (Reaction Time,
Accuracy, EWMA) in Experiments 1 and 2. The \(p\) values for each
coefficient were computed via the Satterthwaite approximation using the
\texttt{lmerTest} R package (Kuznetsova, Brockhoff, \& Christensen,
2017).

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle rt trio}Output of the MLE model predicting log reaction time as a function of center stimulus type in Experiment 1.}
\begin{tabular}{llllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{df} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (ASL) & 6.96 & 0.08 & 91.84 & 62.58 & < .001\\
Face & -0.37 & 0.11 & -3.32 & 84.45 & < .01\\
Object & -1.12 & 0.10 & -11.13 & 79.76 & < .001\\
Bullseye & -1.30 & 0.13 & -10.04 & 97.77 & < .001\\
scale(Months) & -0.01 & 0.04 & -0.18 & 75.55 & 0.86\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: log(RT) \textasciitilde{} stimuli + scale(Months) + (1 | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle acc trio}Output of the MLE model predicting accuracy as a function of center stimulus type in Experiment 1.}
\begin{tabular}{lllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (ASL) & 1.07 & 0.14 & 7.66 & < .001\\
Face & -0.64 & 0.20 & -3.19 & < .01\\
Object & -1.14 & 0.19 & -6.16 & < .001\\
Bullseye & -1.15 & 0.22 & -5.26 & < .001\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: correct \textasciitilde{} stimuli + (1 | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle ewma trio prop lang}Output of the MLE model estimating the difference in random responding in the EWMA as a function of center stimulus type in Experiment 1.}
\begin{tabular}{lllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (ASL) & 1.73 & 0.21 & 8.31 & < .001\\
Face & -1.80 & 0.29 & -6.26 & < .001\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: guess \textasciitilde{} stimuli + (1 | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle rt noise}Output of the MLE model predicting log reaction time as a function of noise condition and age category (adults vs. children) in Experiment 2.}
\begin{tabular}{llllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{df} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (Clear) & -0.76 & 0.05 & -13.92 & 49.62 & < .001\\
noise & 0.09 & 0.04 & 2.31 & 54.35 & 0.02\\
adults & 0.16 & 0.06 & 2.88 & 56.01 & < .01\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: log(rt) \textasciitilde{} noise\_condition + age\_category + (noise\_condition | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle acc noise}Output of the MLE model predicting accuracy as a function of noise condition and age category (adults vs. children) in Experiment 2.}
\begin{tabular}{lllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (Clear) & 0.48 & 0.13 & 3.78 & < .001\\
noise & 0.22 & 0.14 & 1.52 & 0.13\\
adults & 1.75 & 0.15 & 11.54 & < .001\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: correct \textasciitilde{} noise\_condition + age\_category + (noise\_condition | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle ewma noise}Output of the MLE model estimating the difference in random responding (EWMA model) as a function of noise condition and age category (adults vs. children) in Experiment 2.}
\begin{tabular}{lllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (Clear) & 1.81 & 0.15 & 12.23 & < .001\\
noise & 0.73 & 0.17 & 4.18 & < .001\\
children & -2.56 & 0.10 & -25.75 & < .001\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: guess\_num \textasciitilde{} noise\_condition + age\_category + (noise\_condition | subid) + (noise\_condition | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\hypertarget{bayesian-data-analysis-models-experiment-1}{%
\section{Bayesian data analysis models: Experiment
1}\label{bayesian-data-analysis-models-experiment-1}}

In this appendix, we report the full output of the Bayesian linear mixed
effects models in Experiment 1.

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-rt-model}Output of the regression predicting reaction time (milliseconds) as a function of center stimulus type in Experiment 1.}
\begin{tabular}{lll}
\toprule
Center Stimulus Type & \multicolumn{1}{c}{Mean RT} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Bullseye & 288.71 & [229.8, 355.17]\\
Object & 344.51 & [295.71, 397.31]\\
Face & 724.78 & [603.2, 862.81]\\
ASL & 1,047.89 & [897.29, 1213.52]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-acc-model}Output of the logistic regression predicting accuracy as a function of center stimulus type in Experiment 1.}
\begin{tabular}{lll}
\toprule
Center Stimulus Type & \multicolumn{1}{c}{Mean Accuracy} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Object & 0.46 & [0.37, 0.53]\\
Bullseye & 0.48 & [0.38, 0.58]\\
Face & 0.63 & [0.54, 0.7]\\
ASL & 0.76 & [0.7, 0.81]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-acc-contrasts}Output of the model estimating differences in Accuracy for specific contrasts of interest in Experiment 1.}
\begin{tabular}{lll}
\toprule
Contrast & \multicolumn{1}{c}{Mean Difference Accuracy} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Object vs. Chance & -0.04 & [-0.13, 0.03]\\
Bullseye vs. Chance & -0.02 & [-0.12, 0.08]\\
ASL vs. Face & 0.13 & [0.04, 0.23]\\
Face vs. Object/Bullseye & 0.16 & [0.07, 0.24]\\
ASL vs. English & 0.23 & [0.17, 0.29]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-rt-contrasts}Output of the model estimating differences in RT for specific contrasts of interest in Experiment 1.}
\begin{tabular}{lll}
\toprule
Contrast & \multicolumn{1}{c}{Mean Difference RT} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
ASL vs. Face & 323.10 & [132.3, 522.6]\\
Face vs. Object/Bullseye & 408.20 & [286.6, 546.2]\\
ASL vs. English & 595.20 & [444.6, 760.8]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-ewma-cuts}Output of the model estimating the point in the Reaction Time distribution when children's Exponentially Weighted Moving Average statistic crossed the pre-defined guessing threshold for the ASL and Face center stimulus types in Experiment 1.}
\begin{tabular}{lll}
\toprule
Center Stimulus Type & \multicolumn{1}{c}{Mean EWMA Cut Point} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
ASL & 0.68 & [0.59, 0.78]\\
Face & 0.90 & [0.77, 1.03]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-guess-cuts}Output of the model estimating the mean proportion of shifts categorized as language-driven by the Exponentially Weighted Moving Average model for the ASL and Face center stimulus types in Experiment 1.}
\begin{tabular}{lll}
\toprule
Center Stimulus Type & \multicolumn{1}{c}{Mean Language-driven} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Face & 0.34 & [0.23, 0.46]\\
Asl & 0.75 & [0.65, 0.84]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-hddm}Summary of the Drift Diffusion Model output for the drift rate and boundary separation parameters for both all four center stimulus types in Experiment 1.}
\begin{tabular}{llll}
\toprule
Parameter & \multicolumn{1}{c}{Center Stim Type} & \multicolumn{1}{c}{Mean Param Estimate} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Boundary & Face & 1.34 & [1.21, 1.47]\\
Boundary & ASL & 1.76 & [1.65, 1.88]\\
Drift & Face & 0.55 & [0.3, 0.8]\\
Drift & ASL & 0.63 & [0.44, 0.82]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\hypertarget{bayesian-data-analysis-models-experiment-2}{%
\section{Bayesian data analysis models: Experiment
2}\label{bayesian-data-analysis-models-experiment-2}}

In this appendix, we report the full output of the Bayesian linear mixed
effects models in Experiment 2.

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:noise-acc-model}Output of the logistic regression predicting accuracy as a function of noise condition and age group in Experiment 2.}
\begin{tabular}{llll}
\toprule
Noise Condition & \multicolumn{1}{c}{Age Group} & \multicolumn{1}{c}{Mean Accuracy} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Clear & children & 0.61 & [0.54, 0.68]\\
Noise & children & 0.67 & [0.6, 0.74]\\
Clear & adults & 0.90 & [0.87, 0.93]\\
Noise & adults & 0.92 & [0.89, 0.95]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:noise-rt-model}Output of the regression estimating reaction times (milliseconds) as a function of noise condition and age group in Experiment 2.}
\begin{tabular}{llll}
\toprule
Noise Condition & \multicolumn{1}{c}{Age Group} & \multicolumn{1}{c}{Mean RT} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Clear & children & 455.70 & [407, 503.6]\\
Noise & children & 500.20 & [446.6, 555.6]\\
Clear & adults & 542.40 & [486.2, 602.4]\\
Noise & adults & 595.20 & [532.4, 665.3]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:noise-guess-cuts}Output of the model estimating the mean proportion of shifts categorized as language-driven by the Exponentially Weighted Moving Average model for the each noise condition and age group in Experiment 2.}
\begin{tabular}{llll}
\toprule
Noise Condition & \multicolumn{1}{c}{Age Group} & \multicolumn{1}{c}{Mean Language-driven} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Clear & children & 0.36 & [0.32, 0.4]\\
Noise & children & 0.47 & [0.43, 0.51]\\
Clear & adults & 0.81 & [0.77, 0.86]\\
Noise & adults & 0.93 & [0.89, 0.97]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:noise-hddm}Summary of the Drift Diffusion Model output for the drift rate and boundary separation parameters for both processing contexts and age groups in Experiment 2.}
\begin{tabular}{llll}
\toprule
Parameter & \multicolumn{1}{c}{Age Group} & \multicolumn{1}{c}{Mean Parameter Estimate} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Drift & Children & 0.59 & [0.3, 0.89]\\
Drift & Adults & 1.86 & [1.48, 2.25]\\
Boundary & Children & 1.16 & [0.94, 1.39]\\
Boundary & Adults & 1.78 & [1.53, 2.05]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}
\end{appendix}