% \section{Types of analysis}
% \section{Viewing analysis results}
% \section{Static analysis}
% \section{Modal analysis}
% \section{Steady-state analysis}
% \section{Transient analysis}

\section{Types of analysis}

SUGAR supports three basic styles of analysis:
\begin{description}
\item[Static analysis]:
  In static analysis, we find the equilibrium state of a device.
Static analysis is sometimes called DC analysis by analogy to
the equilibrium analysis for direct current circuits.

\item[Linearized analysis]:
  A linearized approximation to a system near equilibrium can
provide valuable information about the stability of the system
and the nature of small oscillations about equilibrium.  SUGAR
provides two flavors of linearized analysis:
\begin{itemize}
\item In \emph{modal analysis}, the characteristic modes of the
      system (and their corresponding frequencies) are determined.
      SUGAR can display the shapes of the displacements corresponding
      to various modes.
\item In \emph{steady-state analysis}, SUGAR computes the frequency
      response of a user-specified variable when another user-specified
      variable is sinusoidally excited.  The output of steady
      state analysis is Bode plots.
\end{itemize}

\item[Transient analysis]:
  In transient analysis (or dynamic analysis), the motion of the system
is integrated forward in time.  Transient analysis in SUGAR is still
somewhat unreliable; we hope to have better support for it soon.

\end{description}

%\section{Viewing analysis results}
%
%All the analyses except steady state analysis result in one or more
%\emph{displacement}, which represent how much the device is displaced
%from its original state as described in the netlist.  In static analysis,
%the displacement represents the equilibrium position; in modal analysis,
%displacements represent the shapes of the fundamental vibrating modes;
%and in transient analysis, the displacements represent snapshots of the
%device in time.

\section{Static analysis}

In static analysis, we attempt to find an equilibrium state for a MEMS
device.  In the most general case, the equilibrium may not be unique;
in this case, SUGAR will usually find the equilibrium position closest
to where it starts looking (which, by default, is the undisplaced position).

The equilibrium state is characterized by a collection of force and moment
balance equations (and their electrical and thermal analogues):
\[
  F(x) = 0
\]
where $x$ is a vector of displacements from the original positions
(and voltages, temperatures, etc) of the device.
We solve these equations using a standard Newton-Raphson
iteration.  For linear problems, a Newton-Raphson iteration will converge
in one steps; for nonlinear problems, the iteration may never converge.
Currently, SUGAR assumes the iteration has converged when the size of the
change between iterations is sufficently small in an appropriately scaled
norm.  If convergence has not set in after 40 iterations, the routine
exits with a diagnostic message.

The function to perform static analysis is \texttt{cho\_dc}:
\begin{center}
\begin{verbatim}
res = cho_dc(net, q0, is_sp)
\end{verbatim}
\end{center}
The first argument, \texttt{net}, is the netlist structure
returned from \texttt{cho\_load}.  The other arguments are optional.
The starting value for the iteration is given by \texttt{q0};
by default, the iteration starts at the undisplaced position
($\mathtt{q0} = 0$).  The flag \texttt{is\_sp} tells the routine
whether it should use sparse solvers or not; by default, the flag is
true (sparse solvers are used).  The function returns a vector
of displacements to reach the computed equilibrium (\texttt{res.q}),
and a flag that indicates whether the iteration converged
(\texttt{res.converged}).

In some cases, it is possible to find tricky equilibrium positions
by approaching them step-by-step.  For example, suppose we wanted
to determine the equilibrium position of a device near a pull-in
voltage.  As we approach the critical voltage, it becomes more
difficult to find the equilibrium position, and past the critical
voltage, no equilibrium exists.  If the commands
\begin{verbatim}
  params.V = Vfinal;
  net = cho_load('device.net', params);
  q = cho_dc(net)
\end{verbatim}
fail, we could try
\begin{verbatim}
  q = [];
  for V = 0:.5:Vfinal
    params.V = V
    net = cho_load('device.net', params);
    q = cho_dc(net, q);
  end
\end{verbatim}
Even if we were still unable to find the equilibrium position, we might
get useful information from seeing how nearly we were able to approach
the final voltage, and what the equilibrium was at the last point
where we were able to find it.

There are two ways to view the results of a static analysis:
\begin{enumerate}

\item
We can view individual components of the displacement vector using
the command \texttt{cho\_dq\_view}:
\begin{verbatim}
% Find displacement of the y coordinate at node 'tip'
tipy = cho_dq_view(q, net, 'tip', 'y');
\end{verbatim}
Alternately, we could look up the index of the tip $y$ coordinate,
and then look at the corresponding entry of the \texttt{q} vector:
\begin{verbatim}
% Find displacement of the y coordinate at node 'tip'
tipy_index = lookup_coord(net, 'tip', 'y');
tipy = q(tipy_index);
\end{verbatim}

\item
We can display the shape of the displaced structure using the
\texttt{cho\_display} routine:
\begin{verbatim}
% Display the undisplaced structure in figure 1,
% and the displaced structure in figure 2.
q = cho_dc(net);
figure(1); cho_display(net);
figure(2); cho_display(net, q);
\end{verbatim}

\end{enumerate}

\section{Steady-state and Modal Analysis}

We determine system behavior near equilibrium by analyzing the linearized
system.  In modal analysis, we find the resonant behavior of the structure,
assuming no damping, by solving the eigenproblem
\[
  \det(\lambda^2 M - K) = 0
\]
The eigenvalues give the resonant frequencies, and the corresponding
eigenvectors give the resonant modes.  The routine \verb|cho_mode| returns
selected frequencies and mode shapes for a structure, along with the
operating point at which linearization took place.  Mode shapes can
be viewed graphically using the \verb|cho_modeshape| commands.  For small
problems, the default dense solvers are adequate; for larger problems,
users should select the number of modes they want, and those modes
will be computed using a less expensive iterative method.

To use the steady-state analysis routine, a user specifies a single
input degree of freedom and a single output degree of freedom,
usually by naming a nodal variable.  SUGAR then draws a Bode plot
illustrating the amplitude gain and phase shift between a harmonic
excitation at the input and a measured harmonic at the output.  Note
that, unlike the modal analysis routine, the steady state routine
does not discard damping terms.

%To determine the steady-state response, SUGAR first linearizes the system of
%ordinary differential equation at the point of static equilibrium. The second
%order system of ODEs is then converted into first order form given by
%\begin{eqnarray}
%  \dot{x} & = & Ax + Bu \\
%  y       & = & Cx + Du
%\end{eqnarray}
%where $x$ is the system dynamic state variable, $u$ is the sinusoidal external
%excitation, and $y$ is the system dynamic response. $A$, $B$, $C$, and $D$ are
%the system, input coupling, output, and feed forward matrices respectively [1].
%The solution of equation provides Bode plots as well as modal analysis.

\section{Transient Analysis}

\emph{Note: Note yet in SUGAR 3.0}

%The transient solver simulates the dynamic response of a MEMS device.
%The device model may contain nonlinear elements, non-harmonic excitations,
%and other features which would make linearized analysis suspect.

%This solver calculates the transient response of a MEMS device, which may
%contain nonlinear elements and excitations that are functions of time t and
%state vector q. Several ODE solvers are available, whereby speed may be traded
%for accuracy and long-term stability. These numerical methods include an
%implicit second order Rosenbrock solver for stiff problems where low accuracy
%is acceptable, an explicit Runge-Kutta 4th-5th order solver for non-stiff
%systems, an implicit multi-step integration method of varying order for stiff
%problems requiring higher accuracy, and a simple explicit Euler algorithm. The
%transient solvers require the system ODEs to be in first order form. We do this
%in the standardized way [2] by introducing a new state vector $Q$ where
%\[
%  \dot{Q} =
%    \frac{d}{dt}
%      \left(
%        \begin{array}{l}
%          x \\
%          \dot{x}
%        \end{array}
%      \right) = f(t,x)
%\]

%\section{Future analysis routines}
%
%In the future, we plan to also support \emph{sensitivity analysis}.
%Sensitivity analysis is not an independent style of analysis as much
%as it is an extension to the forms of analysis listed above.
%For example, a static sensitivity analysis might tell how the
%equilibrium position would change due to variations from the nominal
%material properties, layer thicknesses, etc.  Similarly, sensitivity
%analysis used with the linearized analysis routines might tell how the
%fundamental frequencies of the device would change if the device
%properties were perturbed, and sensitivity analysis of transient results
%would tell how the dynamic response would be affected by perturbing
%device properties.  Some forms of sensitivity analysis were supported
%in SUGAR 1.01, but that code has not yet been integrated into SUGAR 2.0.
%

%\section{Sensitivity Analysis}

%The predicted performance of MEMS is subject to process variations that occur
%during the fabrication stage. Small variations in geometry may lead to
%performance, which is substantially different from the ideal. SUGAR models this
%effect by perturbing the system stiffness matrix K.
%For static analysis
%\[
%  F = [K(g) + \Delta K(d)] x
%\]
%where $g$ contains the ideal layout geometry and process file parameters. $d$
%is the variation in $g$ given by Gaussian, uniform, or uniform distribution of
%corners. The perturbation in stiffness, $\Delta K(d)$, is determined by both
%probabilistic and deterministic techniques.

%A Monte-Carlo algorithm [3] evaluates the most likely outcome of equation
%(3.5) by drawing many samples from a random distribution of geometric
%variables.  Given the bounds on the geometric variables, an Ellipsoidal
%Calculus technique [4] is used to find the extreme bounds on performance
%parameters, i.e. the worst-case scenario.

%  References
%
% [1]  Norman S.Nise, "Control System engineering,"  The Benjamin/Cummings
%      Publishing, Inc, CA (1991)
% [2]  S. Sastry, "Nonlinear Systems Analysis, Stabil ity, and Control," Springer (1999)
% [3]   D.J.C MacKay, "Introduction to Monte Car lo Methods," M. I. Jordan, (1999)
% [4]  G. Calafiore, L. El Ghaoui, "Confidence ellipsoids for uncertain linear equations
%      with structure," In Proceedings of the IEEE CDC , (1999)


% latexmk -pvc -pdf
\documentclass[9pt, a4paper]{article}
\usepackage[margin=0.65in]{geometry}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{blindtext}
\usepackage[english]{babel}
\newenvironment{Figure}
    {\par\medskip\noindent\minipage{\linewidth}}
    {\endminipage\par\medskip}

\title{Simulating phase contrast imaging for materials with variable density}
\author{Ana C. Fabela Hinojosa \\
\small{Supervisors: Assoc. Prof. Marcus Kitchen}}
\small{\date{\today,  \\Due date: Friday 23\textsuperscript{th} September, 2021}}

\begin{document}
\maketitle
\section{Current objective}

In this project, I study the theoretical perspective of coherent X-ray imaging. Using simulations, I aim to determine whether a density difference alone can give phase contrast and, if so, whether it is likely to be detected in real experiments. I created several simulations of cylinder-shaped sample materials and subjected these samples to X-ray wave-fields of different energies. In some of my simulations, I use a single cylinder made of a homogeneous material. In others I use two embedded concentric cylinder-shaped samples of materials with either an equal chemical composition and different densities or, different chemical compositions, and densities.
With these simulations I demonstrate the importance of material density in phase contrast imaging and by 1) showing how distinctly, phase contrast arises between material boundaries designed to mimic the grey and white matter of the brain and 2) whether the observed phase contrast is density-dependent. The eventual aim is to verify if successful phase retrieval is possible for such samples given variable sample material densities.

\section{Theory fundamentals}
For the single cylinder simulations I use the projection approximation to solve a partial differential equation known as the transport-of-intensity equation (TIE). This equation describes the relationship between the intensity and phase distribution in an optical system, and hence it can be used to quantify the contrast (i.e. refractive (phase) effects) present in propagation-based X-ray phase contrast images\cite{PagsTutes}.
\begin{equation}\label{eq:1}
-\nabla_{T} [I(x, y, z) \nabla_{T} \phi(x, y, z)] = k \frac{\partial I (x, y, z)}{\partial z},
\end{equation}
where $k$ is the wave-number, $I(x, y, z)$ is the intensity and $\phi(x, y, z)$ is the phase of the X-ray beam.
The projection approximation takes into account, X-ray--matter interaction, therefore the position dependent and complex form of the refractive index is introduced: $n(x, y, z) = 1 - \delta(x, y, z) + i \beta(x, y, z)$. The real part of this complex quantity corresponds to the refractive index, while the imaginary part is related only to the absorptive properties of the sample\cite{PagsTutes}.
Under the projection approximation, the Beer-Lambert law of attenuation is used to describe the attenuation of intensity within the sample,
\begin{equation}\label{eq:2}
I(x, y, z_0) = \mathrm{exp}[-\int_{t} \mu(x, y, z) dz] I(x, y, 0),
\end{equation}
where $\mu = 2k\beta$ is the \textit{linear attenuation coefficient} of the sample and constitutes the imaginary part of the sample's complex refractive index.
The real part of the complex refractive index ($\delta$) is known as the refractive index decrement, describing phase-shifts in the wave-front which continuously accumulate in the direction of propagation
\begin{equation}\label{eq:3}
\Delta \phi(x, y) = -k \int_{t}\delta(x, y, z)dz,
\end{equation}
where $t$ is the projected thickness of the object in the direction of the light flow.
The TIE effects observable changes onto the intensity (eq.\ref{eq:2}) and phase (eq.\ref{eq:3}) after these are used as the initial conditions of the propagation problem.

To implement the spatial evolution in the direction of the wave-front propagation, I use the fourth-order Runge-Kutta with the TIE. I employ the Runge-Kutta evolution algorithm as
\begin{equation} \label{eq:4}
\begin{split}
&k_1 = f(z, I_n, \phi),\\
&k_2 = f(z + \frac{\Delta z}{2}, I_n + \frac{1}{2}k_1, \phi)),\\
&k_3 = f(z + \frac{\Delta z}{2}, I_n + \frac{1}{2}k_2, \phi)),\\
&k_4 = f(z + \Delta z, I_n + k_3, \phi)),\\
&I_{n + 1} = I_{n} + \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4) + O(\Delta z^5),\\
\end{split}
\end{equation}
where the spatial evolution step is set as $\Delta z = 1$~mm. The propagation via fourth order Runge-Kutta over a spatial interval is done by solving a differential equation $f$ using four Euler-style steps (i.e. the $k_i$ coefficients) where each Euler-style step involves one evaluation of the differential equation with slightly different input parameters. This method combines the information obtained for each solution to match a Taylor series expansion up to fourth order. The combined evaluations of the differential equation eliminate the error terms order by order, resulting in the remaining error being very small\cite{N_R}.

For the two-cylinder simulations, I also use the projection approximation, but this time I model the propagation of the monochromatic X-ray wave-field using a method known as the angular spectrum formulation (ASF). This method uses Fourier decomposition of wave-fields at a single plane into distinct component plane waves. Each plane wave component is propagated through the Fourier domain to a destination plane, and then the propagated wave-field components are reconstructed via an inverse spatial Fourier transform\cite{Goodman}. To implement the ASF, I use the X-ray imaging XRI library, since the existing algorithm has already implemented several fixes to undesirable instabilities that can appear in the simulations. This library was built by the Monash X-ray imaging group.

\subsection{Imaging brain structures}
The optical properties of grey and white matter are extremely similar. However, it is known that there is a small difference in the values of the attenuation coefficients of these materials. CT brain imaging has been reported to yield clearly demarcated tissue borders at the grey/white matter boundaries\cite{Beltran2}. I want to determine if density differences alone would create phase contrast or whether phase contrast is dependent on both density and material differences.
To simulate grey and white matter, I use the attenuation coefficients for both materials $\mu_{GM},\mu_{WM}$ obtained from CT imaging of rabbit and kitten brain samples. This data was acquired at Japan's SPring-8 synchrotron radiation facility using an X-ray energy of $E = 24$keV and a sample-to-detector distance of $5$m\cite{Linda}. In my calculations, I also use experimental grey and white matter densities reported in the ``IT’IS Database for thermal and electromagnetic parameters of biological tissues" (see reference \cite{ITIS}). To find the complex refractive index components of the whole brain (i.e. $\delta_B$ and $\mu_B$) under certain energy X-rays, I use the X-ray imaging group ``X-ray attenuation calculator" which employs the values recorded in NIST in database 66\cite{NIST} making these easily accessible via a GUI, (note: I use this specific tool in all my simulations, not only the ones pertaining the brain materials).
Using all these tools I calculated an approximate estimate for the grey and white matter refractive index decrements ($\delta_{GM}$ and $\delta_{WM}$) The calculations were simple. In one, I modelled the refractive index decrements as proportional to the ratio of the attenuation coefficient value for the full brain from reference\cite{NIST} and the density of the grey or white matter values reported in reference \cite{ITIS} (for example for grey matter: $\delta_{GM} = \frac{\mu_B}{\rho_{GM}} \delta_B$). In contrast, my second model considered the refractive index decrement to be solely proportional to the ratio between the attenuation coefficient value for the full brain and the value corresponding to either the grey or white matter attenuation coefficients (for example for grey matter: $\delta_{GM} = \frac{\mu_B}{\mu_{GM}} \delta_B$).

\section{Current results}
\subsection{Simulating a single homogeneous cylinder}
I solved the TIE in two-dimensions using the projection approximation to establish my initial conditions. My method applies the fourth order Runge-Kutta evolution algorithm described earlier, to propagate the intensity of the monochromatic scalar electromagnetic wave-field over a total distance in meters. Originally, my code discretised a two-dimensional space as an array with dimensions $x, y = 1024, 512$. I first attempted to solve the TIE in Fourier space. To calculate the wave-field's derivative terms in equation (\ref{eq:1}), I used the Fourier derivative theorem to write the derivatives. I defined functions describing the geometry and, optical properties (i.e. refractive index: $\delta(x, y, z)$ and $\mu(x, y, z)$) of the simulated cylinder. Both $\delta$ and $\mu$ functions use a sigmoid function with adjustable gradient to slightly blur the edge of the cylinder and, avoid instability while solving the integrals in equations (\ref{eq:2}) and (\ref{eq:3}). My method was slow due to the Fourier derivatives, and the output intensity profile after propagation did not appear very stable, as several instability oscillations can be seen in figure \ref{fig:1}, to fix this issue, I adjusted the ratio of the spacings in my discretised space several times to make sure that the Nyquist mode of the TIE was resolved adequately. Nevertheless I was unable to obtain a completely smooth, and realistic looking intensity profile in figure \ref{fig:1}.
\begin{Figure}\label{fig:1}
\centering
\includegraphics[width=\linewidth]{Fourier_intensity_profile.pdf}
\captionof{figure}{Phase contrast image (a), cross section (b), and enhanced view of (b) showing small ringing artefacts (instability)(c) obtained using the Fourier TIE method. This method was not able to simultaneously match the expected phase contrast peak height, given this energy and, sample material parameters while at the same time remaining fully stable. The parameters used to obtain this image were an X-ray energy of $22.1629$ keV (corresponding to a Ag k-alpha 1 source), a refractive index decrement for the water cylinder of $\delta = 4.68141\times10^{-7}$ and an attenuation coefficient of $\mu = 64.38436~\mathrm{m^{-1}}$. The cylinder radius was $R = 6.375$ mm. The sigmoid function blurred $0.5$ pixels over the edge of the imaged cylinder. The propagation distance used was $z = 1$ m.}
\end{Figure}

To complement this investigation, I took a slightly different approach and solved the TIE in position space using finite differences. I use \texttt{numpy.gradient} to evaluate each derivative and \texttt{scipy.ndimage.laplace} to evaluate the phase Laplacian term in the TIE. My code discretised the two-dimensional space as a 2D array $x, y = 1024, 1024$.
The probable underlying reason why my Fourier method didn't work as expected was due to an effect known as Gibbs phenomenon, this effect occurs when the nth partial sum of a Fourier series undergoes large oscillations near regions with jump discontinuities\cite{Gibbs} (i.e. like the phase contrast fringes). Discovering that higher degree polynomial interpolation does not always improve accuracy was interesting and certainly unexpected.
\begin{Figure}\label{fig:2}
\centering
\includegraphics[width=\linewidth]{FD_intensity_profile.pdf}
\captionof{figure}{Phase contrast image and cross section obtained using finite differences and Runge-Kutta. As can be seen here, the phase contrast peaks are much higher than the profile found using the Fourier method in figure \ref{fig:1}. The parameters used to obtain this image were an X-ray energy of $22.1629$ keV (corresponding to a Ag k-alpha 1 source), a refractive index decrement for the water cylinder of $\delta = 4.68141\times 10^{-7}$ and an attenuation coefficient of  $\mu = 64.38436~\mathrm{m^{-1}}$. The cylinder radius was $R = 6.375$ mm. The sigmoid function blurred $0.14$ pixels over the edge of the imaged cylinder. The propagation distance used was $z = 1$ m. The apparent asymmetry of the two-dimensional phase contrast image is due to aliasing.}
\end{Figure}
This result presented an apparent improvement in the height of the expected phase contrast fringes. Because of this, I made sure  and made sure that all input parameters were the equal as those used in the code I used to compare my outputs (the script I used for comparisons was was made by my supervisor).

\subsection{Testing if Runge-Kutta propagation increases phase contrast}

In figure \ref{fig:3}, I obtain phase contrast cross sections from solving the TIE using my finite-difference--Runge-Kutta method and the finite difference method developed by the x-ray imaging group. I demonstrate that my method returns a smooth, and realistic looking phase contrast cross section with higher phase contrast than that returned by the X-ray group's method.

\begin{Figure}\label{fig:3}
\centering
\includegraphics[width=\linewidth]{RK_TEST.pdf}
\captionof{figure}{Phase contrast cross sections obtained by testing: (a) my finite differences with Runge-Kutta propagation method and (b) the TIE propagation method developed by the X-ray imaging group. The input parameters and spatial discretisation codes were identical in both (a) and (b). The parameters were for a single cylinder with a radius of  $R = 2$ mm. The X-ray energy used was $50$keV. The refractive index decrement for the water cylinder is $\delta = 9.21425\times 10^{-8}$ and an attenuation coefficient of $\mu = 22.69615\mathrm{m^{-1}}$. In figure (a), the sigmoid function blurred $0.14$ pixels over the edge of the imaged cylinder.
The spatial discretisation arrays used in (a) and (b) were both 2D arrays: $x, y = 1024, 1024$ and, the pixel size was$5\mathrm{\mu}$ m.The propagation distance used was $z = 1$ m.}
\end{Figure}
\begin{Figure}\label{fig:3.5}
\centering
\includegraphics[width=0.6\linewidth]{RK_TEST_difference.pdf}
\captionof{figure}{Phase contrast cross sections as per figure \ref{fig:3} plotted together to quantify the difference in phase contrast results. The difference in the brightness peaks and troughs between these results are $I_{\mathrm{peak}} = 0.165$ and $I_{\mathrm{trough}} = -0.055$ respectively.}
\end{Figure}
Further tests need to be done to prove definitely that the addition of the Runge-Kutta algorithm for spatial propagation can drastically improve phase contrast. Nevertheless, the result shown in figures \ref{fig:3} and \ref{fig:3.5} is interesting because it is possible that my method could even improve phase retrieval results.

\subsection{Density difference test: water and ice}
To test if there is a density dependence in phase contrast, I first used a sample consisting of two cylinders with the outermost one made of water and the innermost one made of ice.
\begin{Figure}\label{fig:4}
\centering
\includegraphics[width=\linewidth]{ice_water_AS.pdf}
\captionof{figure}{Phase contrast image and cross section obtained with the angular spectrum formulation method developed by the X-ray imaging group. The X-ray energy used in this simulation was $E = 22.1629$ keV. The water cylinder has a refractive index decrement $\delta_w = 4.69337\times10^{-7}$, the attenuation coefficient of water is $\mu_w = 64.55083~\mathrm{m^{-1}}$. The ice cylinder has a refractive index decrement $\delta_i = 4.31790\times10^{-7}$, and attenuation coefficient $\mu_i = 59.38677~\mathrm{m^{-1}}$. The density difference between these materials is $\Delta \rho = 0.08~\mathrm{g cm^{-3}}$. The cylinder's radii were $R_w = 2$mm and $R_i = 1$mm. The propagation distance used was $z = 2.5$ m.}
\end{Figure}
With the result in figure \ref{fig:4}. I demonstrate that any changes in material density throughout the imaged sample do affect the imaging process, and therefore the stability the propagation based imaging algorithm developed by Paganin et al. (2002) is actually dependent on the ratio of the differences in the refraction and attenuation coefficients $\Delta \delta$ and $\Delta \mu$ of the imaged materials.
In another simulation I made, I take into account the apparatus parameters and the resolution of the detector used in the lab. I made this simulation to see whether or not we would be able to see the any small fringes in a real experiment. Using magnification factors we would use in the lab (i.e. $2.5$X and $4.0$X) and our photon detector dimensions I resized the spatial array boundaries to match those of the detector. I also scaled the pixel size to match the pixels in the photon detector. I did this so that the pixels in the object plane are adequately sized given the expected size of the pixels in the detector plane. I also calculated the effective propagation distance by dividing the simulation propagation distance by the desired magnification factor.
\begin{Figure}\label{fig:5}
\centering
\includegraphics[width=\linewidth]{LAB_ice_water_AS_2_magnifications.pdf}
\captionof{figure}{Phase contrast cross sections were obtained with parameters equal to those in the simulation in figure \ref{fig:4}.}
\end{Figure}
The plan was to test these results experimentally, but given that the phase contrast fringes observable in figure \ref{fig:5} were so small, we decided against doing the experiment, since we would not observe much in a lab setting.
\subsection{Density difference test: Grey matter and white matter}
To continue my tests of the importance of density in phase contrast, I assume in figure \ref{fig:6}. that grey and white matter have the same chemical compositions but distinct densities.
\begin{Figure}\label{fig:6}
\centering
\includegraphics[width=\linewidth]{pessimistic_case.pdf}
\captionof{figure}{Phase contrast image (a), cross section (b), and enhanced view of one the inner cylinder phase contrast fringes (c) obtained with the angular spectrum formulation method as developed by the X-ray imaging group. In (c) it can be seen that the phase contrast fringes from the inner cylinder are extremely small but can still be observed when the image in (b) is amplified enough. The X-ray energy is $E = 24$ keV. The grey matter cylinder has a refractive index decrement $\delta_{GM} = 4.1345\times10^{-7}$, and the attenuation coefficient of grey matter is $\mu_{GM} = 58.2978~\mathrm{m^{-1}}$. The white matter cylinder has a refractive index decrement $\delta_{WM} = 411.87\times10^{-7}$ and its attenuation coefficient $\mu_{WM}= 58.0747~\mathrm{m^{-1}}$. The density difference between these materials is $\Delta \rho = 0.004~\mathrm{g cm^{-3}}$\cite{ITIS}. The cylinders' radii were $R_{GM} = 2$ mm and $R_{WM} = 1$ mm. The propagation distance used was $z = 2.5$ m.}
\end{Figure}
My simulations demonstrate that even a small density difference like the one seen in \ref{fig:6} can produce phase contrast fringes. Nevertheless, my simulations only consider perfect data, therefore the fringes would be too small to see using real sample materials in a lab experiment.

\subsection{Chemical difference test: Grey matter and white matter}
\begin{Figure}\label{fig:7}
\centering
\includegraphics[width=\linewidth]{optimistic_case.pdf}
\captionof{figure}{Phase contrast image and phase contrast cross section obtained with the angular spectrum formulation method developed by the X-ray imaging group. The X-ray energy used in this simulation was $E = 24$keV. The grey matter cylinder has a refractive index decrement $\delta_{GM} = 4.591\times10^{-7}$, the attenuation coefficient of grey matter is $\mu_{GM} = 52\mathrm{m^{-1}}$\cite{Linda}. The white matter cylinder has a refractive index decrement $\delta_{WM} = 4.2631\times10^{-7}$ and attenuation coefficient $\mu_{WM}= 56~\mathrm{m^{-1}}$\cite{Linda}. The cylinders' radii were $R_{GM} = 2$ mm and $R_{WM} = 1$ mm. The propagation distance used was $z = 2.5$m.}
\end{Figure}

\section{Future Plans}

To definitely demonstrate that adding the Runge-Kutta algorithm for spatial propagation drastically improves phase contrast as per figure \ref{fig:3}, I must test my method against other propagation methods used by the X-ray group. These methods include the angular spectrum formulation and Fresnel propagation. If my method consistently yields higher phase contrast, I need to investigate whether higher phase contrast is an accurate measure that would increase the chances of improving phase retrieval results.

I aim to finish my density simulations by creating a graphic user interface (GUI) that allows the user to modify interactively the density parameters of the imaged concentric cylinders in the simulation. The goal is to make an easily operated visual representation of the changes in phase and intensity of the X-rays as they interact with the imaged object in-situ.

My supervisor and I are planning to test an X-ray target made of silver which has been obtained for the laboratory apparatus. I need to make simulations using the characteristic radiation spectrum of silver and see how the phase contrast fringes behave when isolating monochromatic X-ray fringes and comparing them to each other. My aim is to eventually obtain real laboratory data and analyse it to compare the efficacy of the new silver target to that of the classic tungsten target currently used in the apparatus.

\section{Conclusion}
The aim of my project is to investigate how the phase of incident X-rays changes as the density of distinct sample materials in an arbitrary imaging system changes. I demonstrate that any changes in material density throughout the imaged sample affect the imaging process. The eventual goals of these simulations is to verify if successful phase retrieval can be done of the imaged objects given their variable densities. This report presents a brief outline of the theory behind coherent X-ray imaging, a description of my current progress, and a brief description of my future aims.

\bibliography{mybib}
\bibliographystyle{unsrt}
\end{document}


\documentclass{article}
%
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{IEEEtrantools}
\usepackage{filecontents}

\newcommand{\cT}{{\mathcal T}}
\newcommand{\cS}{{\mathcal S}}
\newcommand{\cG}{{\mathcal G}}
\newcommand{\cL}{{\mathcal L}}
\newcommand{\cW}{{\mathcal W}}
\newcommand{\bbR}{{\mathbb R}}
\newcommand{\uP}{\underline{P}}
\newcommand{\oP}{\overline{P}}

\newcommand\mydescriptionopt{
	\IEEEsetlabelwidth{$g \in \cG_{\textit{off}}^0$]}
	\IEEEusemathlabelsep
}
\begin{document}

\section{Nomenclature}
\subsection{Indices and Sets}
\begin{IEEEdescription}[\mydescriptionopt]
	\item[$g \in \cG$] Set of thermal generators.
	\item[$g \in \cG_{\textit{on}}^0$] Set of thermal generators which are initially committed (on).
	\item[$g \in \cG_{\textit{off}}^0$] Set of thermal generators which are not initially committed (off).
	\item[$w \in \cW$] Set of renewable generators.
	\item[$t \in \cT$] Hourly time steps: $1, \ldots, T$, $T$ = {\tt time\_periods}
	\item[$l \in \cL_g$] Piecewise production cost intervals for thermal generator $g$: $1, \ldots, L_g$.
	\item[$s \in \cS_g$] Startup categories for thermal generator $g$, from hottest ($1$) to coldest ($S_g$): $1, \ldots, S_g$.
\end{IEEEdescription}

\subsection{System Parameters}
\begin{IEEEdescription}[\mydescriptionopt]
	\item[$D(t)$]    Load (demand) at time $t$ (MW), {\tt demand}.
	\item[$R(t)$]    Spinning reserve at time $t$ (MW), {\tt reserves}.
\end{IEEEdescription}

\subsection{Thermal Generator Parameters}
\begin{IEEEdescription}[\mydescriptionopt]
	\item[$CS_g^s$]  Startup cost in category $s$ for generator $g$ (\$), {\tt startup['cost']}.
	\item[$CP_g^l$]  Cost of operating at piecewise generation point $l$ for generator $g$ (MW), {\tt piecewise\_production['cost']}.
	\item[$DT_g$]    Minimum down time for generator $g$ (h), {\tt time\_down\_minimum}.
	\item[$DT^0_g$] Number of time periods the unit has been off prior to the first time period for generator $g$, {\tt time\_down\_t0}.
	\item[$\oP_g$]   Maximum power output for generator $g$ (MW), {\tt power\_output\_maximum}.
	\item[$\uP_g$]   Minimum power output for generator $g$ (MW), {\tt power\_output\_minimum}.
	\item[$P_g^0$]   Power output for generator $g$ (MW) in the time period prior to t=1, {\tt power\_output\_t0}.
	\item[$P_g^l$]   Power level for piecewise generation point $l$ for generator $g$ (MW); $P^1_g = \uP_g$ and $P^{L_g}_g = \oP_g$, {\tt piecewise\_production['mw']}.
	\item[$RD_g$]    Ramp-down rate for generator $g$ (MW/h), {\tt ramp\_down\_limit}.
	\item[$RU_g$]    Ramp-up rate for generator $g$ (MW/h), {\tt ramp\_up\_limit}.
	\item[$SD_g$]    Shutdown capability for generator $g$ (MW), {\tt ramp\_shutdown\_limit}.
	\item[$SU_g$]    Startup capability for generator $g$ (MW), {\tt ramp\_startup\_limit}
	\item[$TS^s_g$] Time offline after which the startup category $s$ becomes active (h), {\tt startup['lag']}.
	\item[$UT_g$]    Minimum up time for generator $g$ (h), {\tt time\_up\_minimum}.
	\item[$UT^0_g$] Number of time periods the unit has been on prior to the first time period for generator $g$, {\tt time\_up\_t0}.
	\item[$U_g^0$]  Initial on/off status for generator $g$, $U_g^0=1$ for $g \in \cG_{\textit{on}}^0$, $U_g^0=0$ for $g \in \cG_{\textit{off}}^0$,  {\tt unit\_on\_t0}.
	\item[$U_g$] 	Must-run status for generator $g$, {\tt must\_run}.
\end{IEEEdescription}

\subsection{Renewable Generator Parameters}
\begin{IEEEdescription}[\mydescriptionopt]
	\item[$\oP_w(t)$] Maximum renewable generation available from renewable generator $w$ at time $t$ (MW), {\tt power\_output\_maximum}.
	\item[$\uP_w(t)$] Minimum renewable generation available from renewable generator $w$ at time $t$ (MW), {\tt power\_output\_minimum}.
\end{IEEEdescription}

\subsection{Variables}
\begin{IEEEdescription}[\mydescriptionopt]
	\item[$c_g(t)$]    Cost of power produced above minimum for thermal generator $g$ at time $t$ (MW), $\in \bbR$.
	\item[$p_g(t)$]    Power above minimum for thermal generator $g$ at time $t$ (MW), $\geq 0$.
	\item[$p_w(t)$]  Renewable generation used from renewable generator $w$ at time $t$ (MW), $\geq 0$.
	\item[$r_g(t)$]    Spinning reserves provided by thermal generator $g$ at time $t$ (MW), $\geq 0$.
	\item[$u_g(t)$]    Commitment status of thermal generator $g$ at time $t$, $\in \{0,1\}$.
	\item[$v_g(t)$]    Startup status of thermal generator $g$ at time $t$, $\in \{0,1\}$.
	\item[$w_g(t)$]    Shutdown status of thermal generator $g$ at time $t$, $\in \{0,1\}$. \
	\item[$\delta^s_g(t)$] Startup in category $s$ for thermal generator $g$ at time $t$, $\in \{0,1\}$.
	\item[$\lambda_g^l(t)$]  Fraction of power from piecewise generation point $l$ for generator $g$ at time $t$ (MW), $\in [0,1]$.
\
\end{IEEEdescription}

\section{Model Description}
Below we describe the unit commitment model given by~\cite{morales2013tight}, with the piecewise production cost description from~\cite{sridhar2013locally}.
The unit commitment problem can then be formulated as:
{\allowdisplaybreaks
		\begin{align}
		& \text{min } \sum_{g \in \cG} \sum_{t \in \cT} \left( c_g(t) + CP_g^1 \, u_g(t) + \sum_{s = 1}^{S_g} \left( CS^s_g \delta^s(t) \right) \right) \label{eq:obj} %\tag{UC} %\\
		%\text{subject to }  & &  \nonumber
		\end{align}
		subject to:
		\begin{align}
		& \sum_{g \in \cG} \left( p_g(t) + \uP_g u_g(t) \right) + \sum_{w\in\cW} p_w(t) = D(t) & \hspace{5cm} \forall t \in \cT \label{eq:UCDemand} \\
		& \sum_{g \in \cG} r_g(t) \geq R(t) &  \forall t \in \cT \label{eq:UCReserves}
		\end{align}
		\begin{align}
		& \sum_{t=1}^{\min\{UT_g - UT_g^0, T\}} (u_g(t) - 1) = 0 & \hspace{3cm} \forall g \in \cG_{\textit{on}}^0 \label{eq:initialUpRequirement} \\
		& \sum_{t=1}^{\min\{DT_g - DT_g^0, T\}} u_g(t) = 0 & \forall g \in \cG_{\textit{off}}^0 \label{eq:initialDownRequirement} \\
		& u_g(1) - U_g^0 = v_g(1) - w_g(1) & \forall g \in \cG \label{eq:LogicalInitial} \\
		& \sum_{s=1}^{S_g-1} \sum_{t=\max\{1, TS^{s+1}_g - DT^0_g + 1\}}^{\min\{TS^{s+1}_g -1,T\}} \delta^s_g(t) = 0 & \forall g \in \cG \label{eq:STIInit}\\
		& p_g(1) + r_g(1) - U_g^0(P_g^0-\uP_g) \leq RU_g & \forall g \in \cG \label{eq:RampUpInit} \\
		& U_g^0(P_g^0-\uP_g) - p_g(1) \leq RD_g & \forall g \in \cG \label{eq:RampDownInit} \\
		& U_g^0(P_g^0-\uP_g) \leq (\oP_g - \uP_g) U_g^0 - \max\{(\oP_g - SD_g),0\} w_g(1) & \forall g \in \cG \label{eq:MaxOutput2Init}
		\end{align}
		\begin{align}
		& u_g(t) \geq U_g & \hspace{1cm} \forall t \in \cT, \, \forall g \in \cG \label{eq:MustRun} \\
		& u_g(t) - u_g(t-1) = v_g(t) - w_g(t) & \forall t \in \cT\setminus\{1\}, \, \forall g \in \cG \label{eq:Logical} \\
		& \sum_{i= t-\min\{UT_g,T\} + 1}^t v_g(i) \leq u_g(t) & \forall t \in \{\min\{UT_g,T\} \ldots, T\}, \, \forall g \in \cG \label{eq:Startup} \\
		& \sum_{i= t-\min\{DT_g,T\} + 1}^t w_g(i) \leq 1 - u_g(t) & \forall t \in \{\min\{DT_g, T\}, \ldots, T\}, \, \forall g \in \cG \label{eq:Shutdown} \\
		& \delta^s_g(t) \leq \sum_{i = TS^s_g}^{TS^{s+1}_g-1} w_g(t-i) & \forall t \in \{TS^{s+1}_g,\ldots,T\},\,\forall s \in \cS_g\!\setminus\!\{S_g\},\,  \forall g \in \cG \label{eq:STISelect} \\
		& v_g(t) = \sum_{s = 1}^{S_g} \delta^s_g(t) & \forall t \in \cT,\, \forall g \in \cG \label{eq:STILink}
		\end{align}
		\begin{align}
		& p_g(t) + r_g(t) \leq (\oP_g - \uP_g) u_g(t) - \max\{(\oP_g - SU_g),0\} v_g(t) & \forall t \in \cT, \, \forall g \in \cG \label{eq:MaxOutput1} \\
		& p_g(t) + r_g(t) \leq (\oP_g - \uP_g) u_g(t) - \max\{(\oP_g - SD_g),0\} w_g(t+1) & \forall t \in \cT\setminus \{T\}, \, \forall g \in \cG \label{eq:MaxOutput2} \\
		& p_g(t) + r_g(t) - p_g(t-1) \leq RU_g & \forall t \in \cT\setminus\{1\}, \, \forall g \in \cG \label{eq:RampUp} \\
		& p_g(t-1) - p_g(t) \leq RD_g & \forall t \in \cT\setminus\{1\}, \, \forall g \in \cG \label{eq:RampDown}
		\end{align}
		\begin{align}
		& p_g(t) = \sum_{l \in \cL_g} (P_g^l - P_g^1) \lambda_g^l(t) &\hspace{5cm} \forall t \in \cT, \, \forall g \in \cG \label{eq:PiecewiseParts} \\
		& c_g(t) = \sum_{l \in \cL_g} (CP_g^l - CP_g^1) \lambda_g^l(t) & \forall t \in \cT, \, \forall g \in \cG \label{eq:PiecewisePartsCost} \\
		& u_g(t) = \sum_{l \in \cL_g} \lambda_g^l(t) & \forall t \in \cT, \forall g \in \cG \label{eq:PiecewiseLimits}
		\end{align}
		\begin{align}
		& \uP_w(t) \leq p_w(t) \leq \oP_w(t) &\hspace{6cm} \forall t \in \cT, \, \forall w \in \cW \label{eq:WindLimit}
		\end{align}
}%
Note that in constraints~\eqref{eq:initialUpRequirement}, \eqref{eq:initialDownRequirement}, and \eqref{eq:STIInit}, we use the convention that empty sums are $0$.

%% add the bibtex
\begin{filecontents*}{MODEL.bib}
@article{morales2013tight,
	title={Tight and compact {MILP} formulation for the thermal unit commitment problem},
	author={Morales-Espa{\~n}a, G. and Latorre, J. M. and Ramos, A.},
	journal={IEEE Transactions on Power Systems},
	volume={28},
	number={4},
	pages={4897--4908},
	year={2013},
	publisher={IEEE}
}
@article{sridhar2013locally,
	title={Locally ideal formulations for piecewise linear functions with indicator variables},
	author={Sridhar, Srikrishna and Linderoth, Jeff and Luedtke, James},
	journal={Operations Research Letters},
	volume={41},
	number={6},
	pages={627--632},
	year={2013},
	publisher={Elsevier}
}
\end{filecontents*}

\bibliographystyle{acm}
\bibliography{MODEL}

\end{document}


%
% File acl2018.tex
%
%% Based on the style files for ACL-2017, with some changes, which were, in turn,
%% Based on the style files for ACL-2015, with some improvements
%%  taken from the NAACL-2016 style
%% Based on the style files for ACL-2014, which were, in turn,
%% based on ACL-2013, ACL-2012, ACL-2011, ACL-2010, ACL-IJCNLP-2009,
%% EACL-2009, IJCNLP-2008...
%% Based on the style files for EACL 2006 by
%%e.agirre@ehu.es or Sergi.Balari@uab.es
%% and that of ACL 08 by Joakim Nivre and Noah Smith

\documentclass[11pt,a4paper]{article}
\usepackage[hyperref]{acl2018}
\usepackage{times}
\usepackage{latexsym}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
%\usepackage{bibtex}
\usepackage{url}

\aclfinalcopy % Uncomment this line for the final submission
%\def\aclpaperid{***} %  Enter the acl Paper ID here

%\setlength\titlebox{5cm}
% You can expand the titlebox if you need extra space
% to show all the authors. Please do not make the titlebox
% smaller than 5cm (the original size); we will check this
% in the camera-ready version and ask you to change it back.

\title{Trying Tries Algorithm}

\author{Denizhan Pak \\ Indiana University - Computational
       Linguistics Department\\ {\tt denpak@iu.edu}}

\date{October 10, 2019}

\begin{document}
\maketitle
\begin{abstract}
        There are many reasons to apply morphological analysis at the
        sentence level. For the application of computational tools to
        corpus data it is important that all tokens are specified to
        allow the tools to have as informative data as possible.
        To determine the list of morphemes in a language however is a time
        consuming task and unsupervised algorithm could relieve quite a few
        researchers and grad students. In this paper we propose a
        potentially useful unsupervised machine learning algorithm to
        accomplish just this task.
\end{abstract}

\section{Introduction}
Morpheme parsing is an important task from a computational linguistics
standpoint as it provides a way to denote meaningful units within a corpus
in turn this allows us to apply the many tools which use these units using the
lowest components which still provide information. We propose that smaller
semantic units can be differentiated by their relative frequency. More
explicitly if we are able to identify substrings which occur as a cohesive
unit with a high relative frequency then those units correspond to morphemes
or some other sort of semantic unit. The algorithm below provides an
unsupervised method through which such semantic units can be distinguished.
The algorithm uses a data structure similar to a "trie" however edges between
nodes are assigned a transition probability, we shall call this a "p-trie."
The algorithm requires 3 user determined hyper parameters:
$0 < \lambda $, $< 1 < \rho$, and a function $f:\mathbb{Z}\to[0,1]$.
Where $\rho$ is a reinforcement rate,
$\lambda$ is a learning rate, and $f$ is a probability function. (For the
purpose of this project I will be using a translated sigmoidal function.)
\begin{algorithm}
  \label{alg:algorithm1}
\caption{Build Trie}
\begin{algorithmic}
\STATE $context \leftarrow root$
\FOR{$char$ in $corpus$}
\IF{$pointer ==  root$}
\STATE $p_1 = 1,p_2=1$
\ELSE
\STATE $p_1 = \lambda, p_2 = \rho$
\ENDIF
\IF{$char$ in $context\to children$}
\STATE $weight_{char} \leftarrow weight_{char} * p_2$
\ELSE
\STATE $weight_{char} \leftarrow p_1$
\STATE $context\to children\ \textbf{append}\ char$
\ENDIF
\STATE $r \leftarrow \textbf{random number(0,1)}$
\IF{$r > f(weight_{char})$}
\STATE $context \leftarrow root$
\ELSE
\STATE $context \leftarrow char$
\ENDIF
\ENDFOR
\STATE $\textbf{return}\ root$
\end{algorithmic}
\end{algorithm}
At the end of the algorithm the function will have returned a $p-trie$ with
the estimated probability values. Once we have a $p-trie$ it is possible to
extract potential morphemes as sequences of nodes that start at the root. We
can even assign a certainty per morpheme which is the product of the weights
along its edges. This certainty can then be used to rate the likelihood of
possible segmentations. If the corpus is not large enough an easy approach to
improving access to data would simply be to randomize the words in the corpus
and run the algorithm through it again starting with the existing $p-trie$.
This technique is similar to random walks along markov chain. Since it is a
Bayesian method we can incorporate priors by passing a previously calculated
$p-trie$ \cite{Bayesian}.
\section{Proposed Goals}
\subsection{Minimum Viable Product}
The minimum viable product of this project is a complete implementation of the
algorithm defined in \textbf{Algorithm} \ref{alg:algorithm1} along with a
comprehensive performance analysis. The
analysis will include accuracy testing across multiple corpora in multiple
languages along with the effects of different parameterizations.
\subsection{Expected Product}
The expected product will be the minimum viable product as well as specific
optimizations such as simulated annealing for the parameter values, a more
complex function for reinforcement, and an automated randomization of the
corpus designed to improve performance.
\subsection{High-Achievement Product}
The high-achievement product will be the expected product as well as a generalization of the algorithm which could be applied to finding meaningful
sub-sequences in any sequential data with a particular eye toward word
embeddings. As well as a potential generative application of the generated
$p-trie$.
\section{Requirements}
\begin{itemize}
        \item A working python implementation of the algorithm.
        \item A well documented description of the algorithm and its
                performance.
        \item A report characterizing the algorithm including its strengths
                and weaknesses.
\end{itemize}
\section{Timelines}
\begin{itemize}
        \item 10.15-10.22 A first implementation of the algorithm and basic
                testing using a single corpus.
        \item 10.22-10.29 Testing algorithm using varying parameter sets
                across multiple languages and corpora.
        \item 10.29-11.06 Implementation of simulated annealing and varied
                reinforcement and corpora randomization.
        \item 11.06-11.16 Evaluation of new implementation across corpora
                and languages.
        \item 11.16-11.26 Generalization of the algorithm to any subsequence
               and evaluation of performance on different data such as word
               embeddings.
       \item 11.26-12.03 Writing final report and preparing presentation.
\end{itemize}
This does not include literature review or the writing of documentation both
of which I intend to do as they coincide with different parts of the timeline
above.
\section{Data Policy}
All data and code will be made available on a public git page. The code will
be written in Python. The data for testing and evaluation will be taken from
the tree UD treebanks \cite{UDDocumentation} dataset from the following languages:
\begin{itemize}
        \item English
        \item Turkish
        \item Chinese
        \item Japanese (if time suffices)
        \item Toki Pona (if time suffices)
\end{itemize}
Finally the effectiveness of the algorithm will be compared to the morphessor \cite{Morphessor}
python implementation.
\newpage
\section{References}
\begin{thebibliography}{9}

  \bibitem{Bayes}
  Knight, Kevin
  \textit{Bayesian Inference with Tears
  a tutorial workbook for natural language researchers}
  \bibitem{Morphessor}
    Creutz, Mathias and Lagus, Krista,
    \textit{Unsupervised models for morpheme segmentation and morphology
    learning}
    \bibitem{UDDocumentation}
    de Marneffe, Marie-Catherine  and
      Dozat, Timothy  and
      Silveira, Natalia  and
      Haverinen, Katri  and
      Ginter, Filip  and
      Nivre, Joakim  and
      Manning, Christopher D.,
      \textit{Universal Stanford dependencies: A cross-linguistic typology}
      \bibitem{ByteEnc}
      Gage, Philip
      \textit{A New Algorithm for Data Compression}
\end{thebibliography}
\section{Appendix}
In \textbf{Figure 1} the flow diagram is presented
to explain the functioning of the algorithm.
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
    text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
    text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
    minimum height=2em]
    \begin{figure}

\begin{tikzpicture}[node distance = 2cm, auto]
    % Place nodes
    \node [block] (init) {initialize trie};
    \node [cloud, right of=init] (system) {corpus};
    \node [block, below of=init] (root) {set context to root};
    \node [block, below of=root] (terbed) {get input value $\to char$};
    \node [decision, below of=terbed] (pointer) {is pointer set to root?};
    \node [block, left of=pointer, node distance=3cm] (update)
            {set $p_1 = p_2 = 1$};
    \node [block, right of=pointer, node distance=3.3cm] (child)
            {set $p_1 = \lambda$ and $p_2 = \rho$};
    \node [decision, below of=pointer, node distance=3.3cm] (expected) {is
            $char$ a child node of pointer?};
    \node [block,below of=expected, right of=expected, node distance=2.33cm]
           (notchild) {add $char$ as child with transition probability $p_1$};
    \node [block, below of=expected, left of=expected, node distance=2.33cm]
            (ischild) {multiply transition probability of char by $p_2$};

    \node [block, below of=expected, node distance=6cm] (transition)
            {set context (probabilistically) $p_3 = f(\text{transition probability of $char$})$};
    \node [block, below of=transition, node distance=3.3cm] (input)
            {set context to $char$};
    % Draw edges
    \path [line] (init) -- (root);
    \path [line] (root) -- (terbed);
    \path [line] (terbed) -- (pointer);
    \path [line] (pointer) -| node [near start] {yes} (update);
    \path [line] (pointer) -- node [near start] {no} (child);
    \path [line] (update) |- (expected);
    \path [line] (child) |- (expected);
    \path [line] (expected) -- node  {yes} (ischild);
    \path [line] (expected) -- node  {no} (notchild);
    \path [line,dashed] (system) |- (terbed);
    \path [line] (ischild) -- (transition);
    \path [line] (notchild) -- (transition);
    \path [line, dashed] (transition) -- node {$p_3$} (input);
    \path [line, dashed] (transition) -|++  (-5,13) node [near start]{$1-p_3$}|- (root);
    \path [line] (input) -|++  (-5,13) |- (terbed);
\end{tikzpicture}
        \label{Flow}
        \caption{Flow Diagram}
 \end{figure}

% include your own bib file like this:
%\bibliographystyle{acl}
%\bibliography{acl2018}
\end{document}


\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{float}
\usepackage{amsmath}
\usepackage{scrextend}
\addtolength{\textwidth}{1in}
\addtolength{\textheight}{1in}
\addtolength{\evensidemargin}{0.5in}
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\topmargin}{-0.5in}
\title{gl-billiards}
\author{Dan Lapp\\Taras Mychaskiw\\COSC 3P98 Project}
\date{January 8th, 2014}

\begin{document}
\maketitle
    \begin{abstract}
    \end{abstract}

    \thispagestyle{empty}
    \tableofcontents
    %\cleardoublepage
    %\newpage
    \thispagestyle{empty}
    \mbox{}
    \clearpage
    \setcounter{page}{1}

    \section{Physics Engine}

        \subsection{Taking a Shot}
        Once a ball is hit by the cue, there are two ways energy is transferred to the ball. First, and more noticeable of the two
        is the transfer of linear momentum. This sends the ball moving around the table in straight lines. Second is the transfer
        of angular momentum, which applies spin to the ball. Spin can cause the ball to stop in it's tracks after a collision,
        bounce off cushions in strange (but predictable) ways and to any pool player, is just as if not more important an aspect
        to the game as the linear momentum.
            \subsubsection{Linear Momentum}
            To simplify the shot making process, the pool cue is assuming to act like a spring. That is, the further you pull
            the cue away from the cue you are going to hit, the more powerful your shot will be. Spring motion can be described
            using Hooke's Law,
            \begin{equation}
                \vec F = -k \vec x
                \label{equ:hookes_law}
            \end{equation}
            where, $\vec F$ is the force, $\vec x$ is how much the spring is stretched and $k$ is the spring constant, which
            describes basically how powerful (springy) the spring is.
            \\
            Hooke's Law is equivalent to Newton's Second Law, which states
            \begin{equation}
                \vec F = m \vec a
                \label{equ:newton}
            \end{equation}
            where, $\vec F$ is the force, $m$ is the mass of the object and $\vec a$ is the acceleration of the object. Setting
            Equation~\ref{equ:hookes_law} equal to Equation~\ref{equ:newton} gives
            \begin{eqnarray}
                -k \vec x &=& m \vec a \nonumber \\
                -k \vec x &=& m \frac{\Delta \vec v}{\Delta t} \nonumber \\
                \Delta \vec v &=& \frac{-k \Delta t}{m}\vec x  \nonumber
            \end{eqnarray}
            where $\vec v$ is the velocity of the object, and $t$ is the time. For pool, the initial velocity of the ball being struck is
            always zero, so we can simplify the above equation to
            \begin{equation}
                \vec v = \frac{-k t}{m}\vec x
                \label{equ:shot_velocity}
            \end{equation}
            where $\vec x$ is the distance between the ball and the tip of the cue, $m$ is the mass of the ball, $t$ is how much time the
            cue is in contact with the ball and $k$ is the spring constant of the cue. The values for $t$ and $k$ needed to be experimentally
            found though trial and error, essentially trying values until what happened in the simulation closely represented real life. The
            values for $t$ and $k$ were found to be $0.1$s and $10$N/m.
            %\end{Linear Velocity}

            \subsubsection{Angular Momentum}
            Angular momentum transfer is more complex. The starting point for this section is also Newton's Second Law, but written
            in a form more usable to the problem at hand.
            \begin{equation}
                \vec \tau = I \vec \alpha
                \label{equ:newton_rotation}
            \end{equation}
            where $\vec \tau$ is the torque applied to the object around it's center of rotation, $I$ is the moment of inertia of the
            object and $\vec \alpha$ is the angular acceleration of the object.
            \\
            Torque is always given by the equation,
            \begin{equation}
                \vec \tau = \vec r \times \vec F
                \label{equ:torque}
            \end{equation}
            where $\vec F$ is the force being applied, $\vec r$ is the vector between where the force is being applied and the center
            of rotation of the object, and $\times$ is the vector cross product.
            \\
            An important note is the inertia for a solid sphere is given by,
            \begin{equation}
                I_{sphere} = \frac{2}{5} m R^2
                \label{equ:inertia_sphere}
            \end{equation}
            where $R$ is the radius and $m$ is the mass of the sphere.
            \\
            Setting Equation~\ref{equ:newton_rotation} equal to Equation~\ref{equ:torque}, subbing in Equation~\ref{equ:inertia_sphere}
            for $I$ and Equation~\ref{equ:hookes_law} for $\vec F$, and solving gives,
            \begin{eqnarray}
                \vec r \times -k \vec x &=& \frac{2}{5} m R^2 \frac{\Delta \vec \omega}{\Delta t} \nonumber \\
                \Delta \vec \omega &=& \frac{5}{2} \left(\frac{\Delta t}{m R^2}\right) (\vec r \times -k \vec x) \nonumber
            \end{eqnarray}
            where $\vec \omega$ is the angular velocity of the ball, and $t$ $t$ is how much time the cue is in contact with the ball (the same $t$
            as in the previous section). Again, for pool, when the ball is struck it is entirely at rest, so the initial angular velocity is zero.
            The above equation then simplifies to
            \begin{equation}
                \vec \omega = \frac{5}{2} \left(\frac{\Delta t}{m R^2}\right) (\vec r \times -k \vec x)
                \label{equ:shot_angular}
            \end{equation}
            where $\vec x$ is the distance between the ball and the tip of the cue, $m$ is the mass of the ball, $R$ is the radius of the ball,
            $t$ is how much time the cue is in contact with the ball, $k$ is the spring constant of the cue and finally $\vec r$ is the vector
            between the center of the ball and where the cue strikes the ball.
            %\end{Angular Velocity}
        %\end{Taking a Shot}

        \subsection{Event System}
        For the purposes of this program, an event is a ball-ball collision, or a ball banking off of the cushion. The way gl-billiards works
        is each time the screen is redisplayed, some physics updater function is called with a parameter $dt$, which is how much time has passed
        since the last frame. The engine simulates the pool game up until a time $dt$ has passed. For example, if $1$s was passed, then it would
        simulate $1$s of play before returning, then the screen would be updated as if $1$s had passed.
        \\
        So, the engine determines which events occur within time $dt$. Event detection then becomes \textit{when} do events happen instead
        of \textit{if} they happened. The entire update function works as follows:\\
        \texttt{
            update($dt$)                                                        \\
            \begin{addmargin}[1em]{0em}
            find earliest event that occurs within time $dt$, call it $event$   \\
            if no such event                                                    \\
                \begin{addmargin}[1em]{0em}
                roll balls until $dt$                                           \\
                \end{addmargin}
            otherwise                                                           \\
                \begin{addmargin}[1em]{0em}
                roll balls until $event$ occurs                                 \\
                handle $event$                                                  \\
                $dt$ <-- $dt$ - $event$.$getTime()$                             \\
                call update($dt$) again                                         \\
                \end{addmargin}
            \end{addmargin}
        }
        In this manner, all events that happen within $dt$ and handled automatically before the frame updates and the balls slow
        down due to friction. Note that "roll balls" simply means each ball moves at it's speed for some amount of time. Pocketing
        detection needs to be done there, as it is not a standard event. That is, if a ball is pocketed, it cannot possible participate
        in any events in time $dt$, since it would bank off the cushion or collide with another ball first. \\
        After $update(dt)$ is finished, each ball gets affected by friction and slows down slightly. Friction takes the form of a
        slight decrease in the velocity of the ball.
        %\end{Event System}

        \subsection{Event Detection}
            \subsubsection{Ball-Ball Collision Detection}
            A ball-ball collision will occur when the centers of the balls are two radii apart. In gl-billiards, the trajectory
            of each ball is simplified to be a straight line per frame since friction is only applied at the end of each frame.
            Thus, the trajectory of each ball becomes,
            \begin{equation}
                \vec r = \vec r_0 + \vec v t
                \label{equ:position}
            \end{equation}
            where $\vec r$ is the position of the ball, $\vec r_0$ is the starting position, $\vec v$ is the velocity of the ball and
            $t$ is the amount of time elapsed. Then, for each possible collision to occur, the program needs to find at what times the
            distance from one ball to the other is equal to twice the radius of the ball. Mathematically, this becomes
            \begin{eqnarray}
                | \vec r_1 - \vec r_2 | &=& 2 R   \nonumber   \\
                \sqrt{ (\vec r_1 - \vec r_2) \cdot (\vec r_1 - \vec r_2) } &=& 2 R  \nonumber
            \end{eqnarray}
            where $R$ is the radius of a ball. Squaring both sides, and subbing in Equation~\ref{equ:position} for both
            $\vec r_1$ and $\vec r_2$ (using $\vec{dr_0} = \vec r_{0_1} - \vec r_{0_2}$ and $\vec{dv} = \vec v_1 - \vec v_2$),
            \begin{eqnarray}
                (\vec{dr_0} \cdot \vec{dr_0}) + (\vec{dr_0} \cdot \vec{dv}) t + (\vec{dv} \cdot \vec{dv}) t^2 &=& 4 R^2
                \label{equ:collision_time}
            \end{eqnarray}
            This is a quadratic equation for $t$ which can be solved easily. If there are real roots to the equation, then
            a collision occurs, and it occurs at the minimal possible $t$ value which is a solution to Equation~\ref{equ:collision_time}.
            %\end{Ball-Ball Collision Detection}

            \subsubsection{Ball-Wall Collision Detection}
            Ball-wall collision detection is similar to ball-ball, except the ball is a distance one radius away from the wall when it collides.
            Since the wall doesn't move, a different strategy had to be employed to detect when a ball-wall collision occurs. In this case,
            both the and wall positions are described using parametric equations.
            \begin{eqnarray}
                \vec r = \vec r_0 + (dt~\vec v) T_b         \label{equ:ball_parametric} \\
                \vec w = \vec s + (\vec f - \vec s) T_w     \label{equ:wall_parametric}
            \end{eqnarray}
            Where, $\vec r$ is the position of the ball, $\vec r_0$ is the initial position of the ball, $\vec v$ is the velocity of the ball,
            $dt$ is the amount of time that will pass this frame; $\vec w$ is a point on the wall, $\vec s$ is one endpoint on the wall, and $\vec f$
            is the other endpoint of the wall. $T_b$ and $T_w$ are the parametric variables, and range between $0$ and $1$. \\
            To determine when the ball hits the wall, where the ball hits must be determined first. The center of the ball hits the wall when
            $\vec r = \vec w$, thus the ball actually collides with the wall when $\vec r - R \vec n = \vec w$, where $\vec n$ is the normal
            vector to the wall. For simplicity below, we will ignore this offset value, as it is a fairly simple transformation. So, the collision
            occurs when
            \begin{eqnarray}
                r_{0_x} + (dt~v_x) T_b = s_x + (f_x - s_x) T_w  \nonumber \\
                r_{0_y} + (dt~v_y) T_b = s_y + (f_y - s_y) T_w  \nonumber \\
            \end{eqnarray}
            Solving for $T_b$ and $T_w$ gives
            \begin{eqnarray}
                T_b &=& \frac{(f_x - s_x)\cdot(s_y - r_{0_y}) - (f_y - s_y)\cdot(s_y - r_{0_y})}{(dt~v_y)\cdot(f_x - s_x) - (dt~v_x)\cdot(f_y - s_y)} \nonumber \\
                T_w &=& \frac{(dt~v_x)\cdot(s_y - r_{0_y}) - (dt~v_y)\cdot(s_y - r_{0_y})}{(dt~v_y)\cdot(f_x - s_x) - (dt~v_x)\cdot(f_y - s_y)} \nonumber \\
            \end{eqnarray}
            If both $T_b$ and $T_w$ are between $0$ and $1$, then a ball-wall collision occurs. The point at which can be found by subbing in $T_b$ or $T_w$
            into Equations~\ref{equ:ball_parametric} or \ref{equ:wall_parametric} respectfully. Then the amount of time passed can be solved for using Equations~\ref{equ:position}.
            %\end{Ball-Wall Collision Detection}
        %\end{Event Detection}

        \subsection{Event Handling and Velocity Updates}
            \subsubsection{Ball-Ball Collisions}
            %\end{Ball-Ball Collisions}

            \subsubsection{Ball-Wall Collisions}
            %\end{Ball-Wall Collisions}

            \subsubsection{Friction}
            %\end{Friction}
        %\end{Event Handling and Velocity Updates}

    %\end{Physics}

\end{document}


Monadic AAM begins with recognizing that the abstract semantics from
section~\ref{section:AAMByExample:AbstractSemantics} look suspiciously monadic.
%
In this section we will rewrite the exact same function but in monadic style.
%
After the exercise, the monad will be generalized in
section~\ref{section:MonadicAAM:Generalizing} and this generalization will be
exploited in section~\ref{section:MonadicAAM:Optimizations}.

\subsubsection{Nondeterminism}
\input{sections/04MonadicAAM/00MonadicStyle/00Nondeterminism/Z.tex}

\subsubsection{State}
\input{sections/04MonadicAAM/00MonadicStyle/01State/Z.tex}


% Created 2020-09-29 ter 18:34
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[top=3cm, bottom=2cm, left=3cm, right=2cm]{geometry}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[theorems, skins]{tcolorbox}
\usepackage[style=abnt,noslsn,extrayear,uniquename=init,giveninits,justify,sccite,
scbib,repeattitles,doi=false,isbn=false,url=false,maxcitenames=2,
natbib=true,backend=biber]{biblatex}
\usepackage{url}
\usepackage[cache=false]{minted}
\usepackage[linktocpage,pdfstartview=FitH,colorlinks,
linkcolor=blue,anchorcolor=blue,
citecolor=blue,filecolor=blue,menucolor=blue,urlcolor=blue]{hyperref}
\usepackage{attachfile}
\usepackage{setspace}
\usepackage{tikz}
\author{Gabriel Petrini}
\date{October 1st, 2020}
\title{Estimating Dynamic Models Without Solving Value Functions}
\begin{document}

\maketitle
\tableofcontents

\bibliography{References}

\section*{\cite{hotzMiller1993}}
\label{sec:org9c92db5}

Dynamic discrete choice models are complicated to estimate because of the future value terms. \citet{hotzMiller1993} show:

\begin{itemize}
\item Differences in conditional value functions \(v_j-v_{j'}\) can be mapped into \uline{conditional choice probabilities} ( \(p_j\)'s )
\item We can pull the \(p_j\)'s from the data in a first stage
\item \textbf{Empirical example:} optimal stopping with respect to couples' fertility
\end{itemize}

\subsection*{Difference in \(v\)'s and logit errors}
\label{sec:orgc62eac5}

Consider an individual who faces two choices where the errors are T1EV. The probability of choice 1 is:
\begin{align*}
p_1&=\frac{\exp(v_1)}{\exp(v_0)+\exp(v_1)}
\end{align*}

The ratio of \(p_1/p_0\) is then:
\begin{align*}
\frac{p_1}{p_0}&=\frac{\exp(v_1)}{\exp(v_0)} = \exp(v_1 - v_0)
\end{align*}
implying that:
\begin{align*}
\ln(p_1/p_0)&=v_1-v_0
\end{align*}

\subsection*{General structure}
\label{sec:org916f1e4}

The inversion theorem of Hotz and Miller says that there exists a mapping, \(\psi\), from the conditional choice probabilities, the \(p\)'s, into the differences in the conditional valuation functions, \(v_j-v_k\):
\begin{align*}
V_{t+1}&=v_{0t+1}+\mathbb{E}\max\{\epsilon_{0t+1},v_{1t+1}+\epsilon_{1t+1}-v_{0t+1},...,\\
&\phantom{\text{----}}v_{{J}t+1}+\epsilon_{{J}t+1}-v_{0t+1}\}\\
V_{t+1}&=v_{0t+1}+\mathbb{E}\max\{\epsilon_{0t+1},\psi_0^1(p_{t+1})+\epsilon_{1t+1},...,\psi_0^{{J}}(p_{t+1})+\epsilon_{{J}t+1}\}
\end{align*}

The \(p\)'s can be taken from the data.  However:

\begin{enumerate}
\item We need the mapping, \(\psi\),
\item We need to be able to calculate the expectations of the \(\epsilon\)'s
\item We need to do something with the \(v_0\)'s
\end{enumerate}
\end{document}


\chapter{Literature Review}

\section{Tensegrity Structures}
It is possible to design free-standing structures with axially loaded compression elements in a well crafted network of tensional elements.
Such an arrangement is called a tensegrity structure (tensile integrity).
Each element of the structure experiences either pure axial compression or pure tension \cite{BuckminsterFuller1975}\cite{Snelson1965}.
The absence of bending or shear forces allows for highly efficient use of materials,
resulting in lightweight, yet robust systems.

Because the struts are not directly connected,
tensegrities have the unique property that externally applied forces distribute through the structure via multiple load paths.
This creates a soft structure, for a soft robot, out of inherently rigid materials.
Since there are no rigid connections within the structure, there are also no lever arms to magnify forces.
The result is a global level of robustness and tolerance to forces applied from any direction.

%Tensegrity structures are composed of axially loaded compression elements encompassed within a network of tensional elements, and thus each
%element experiences either pure linear compression or pure tension.  As a result, individual elements can be extremely lightweight as there are no
%bending or shear forces that must be resisted.  Because the struts are not directly connected, a unique property of tensegrity structures is how externally applied forces distribute through the structure
%via multiple load paths, creating a system level robustness and tolerance to forces applied from any direction.
%Because there are no rigid connections within the structure, there are also no lever arms to magnify forces.  Instead, all experienced forces act linearly on each structural element.  Combined with the ability to diffuse forces globally,
This makes tensegrity robots inherently compliant and extremely well suited for physical interactions with complex and poorly modeled natural environments.
Active motion in tensegrity robots can be performed by changing cable lengths in parallel,
enabling the use of many small actuators that work together, rather than individual heavy actuators which work in series.
There are also many indications that tensegrity properties are prevalent throughout biological systems,
and the morphology of the SUPERball that we are studying,
especially when carrying a payload,
ends up bearing a striking resemblance to the nucleated tensegrity model of cell structure~\cite{Wang2009}\cite{Wang2001}.

\section{Prior Work in Tensegrity Robotics Design}
An important advantage of tensegrity structures with respect to general pin-jointed structures is their increased mass-efficiency due to a high fraction of tensile members.
Tensile members are generally more mass-efficient as they do not need to resist buckling.
A further advantage from a robotics perspective is that forces diffuse in a tensegrity.
There are no lever arms and torques do not accumulate at the joints as in a classic serial manipulator.
Forces distribute through multiple load paths, thus increasing robustness and tolerance to mechanical failure.

%advantages
%applications
The static properties of tensegrities have been thoroughly studied and some basic analysis is discussed in section \ref{modeling}.
On the other hand, few examples are known of truly dynamic motion of these structures.
Early examples of kinematic motion include the work at EPFL's IMAC laboratory~\cite{Fest2004}.
Skelton and Sultan introduced algorithms for the positioning of tensegrity based telescopes and the dynamic control of a tensegrity flight simulator platform~\cite{sultan2000tensegrity}.
Although there were some early efforts at MIT's CSAIL lab, it wasn't until the work of Paul and Lipson at Cornell University that the concept of tensegrity robotics became widespread~\cite{Paul2006a}.
Paul and Lipson were the first to study the properties of dynamic tensegrity structures in hardware and simulation.
A few years later Fivat and Lipson designed the IcoTens, a small actuated tensegrity icosahedron robot, but did not publish results.
In recent years, the BIER lab at the University of Virginia has been studying Central Pattern Generator based control for tensegrity based fish tails,
which is closely related to the control architectures proposed for SUPERball~\cite{Caluwaerts2013rsif,Bliss2012}.
Mirats-Tur has presented design and controls work on various other tensegrity morphologies that have been tethered or fixed to the ground~\cite{GraellsRovira2009,miratstur2011athree-dof}.
At Union College, Rieffel and colleagues are following an interesting line of work by considering vibration based actuation for small tensegrities~\cite{khazanov2014developing}.
Related work was presented by B\"ohm and Zimmermann, who demonstrated controlled locomotion of vibration driven tensegrity robots with a single actuator~\cite{bohm2013vibration}.
Finally, Shibata, Hirai and colleagues have developed pneumatically actuated rolling tensegrity structures~\cite{Shibata2009}.
%goal

Building upon these works, the \SB{} project seeks to push forward the tensegrity robotics field and develop truly untethered, highly dynamic and compliant robots exploiting the aforementioned advantages.

\section{Tensegrity Robotics for Space Exploration}
%NASA is supporting research into tensegrity robotics to create robots with many of the same qualities that benefit biological systems.
The high strength-to-weight ratio of tensegrity structures is very attractive due to the impact of mass on mission launch costs.
Large tensegrity structures have been shown to be deployable from small compact configurations which enable them to fit into space constrained launch fairings.
While the above qualities have inspired studies of deployable antennae and other large space structures~\cite{Tibert2002},
it is in the realm of planetary exploration that we see the most significant role for many of the unique force distribution qualities of tensegrity robots.
The NIAC project currently funding this research~\cite{NIACfinalreport} specifically studies landing and surface mobility of tensegrities,
exploiting the controllable compliance and force distribution properties which make for reliable and robust environmental interactions.

The main goal is to develop tensegrity probes with an actively controllable tensile network
 to enable compact stowage for launch, followed by deployment in preparation for landing.
Due to their natural compliance and
structural force distribution properties, tensegrity probes can safely absorb
significant impact forces, enabling high speed Entry, Descent, and Landing
(EDL) scenarios where the probe itself acts much like an airbag.  However,
unlike an airbag which must be discarded after a single use, the tensegrity
probe can actively control its shape to provide compliant rolling mobility
while still maintaining the ability to safely absorb impact shocks that might
occur during exploration.  This combination of functions from a single
structure enables compact and lightweight planetary exploration missions
with the capabilities of traditional wheeled rovers, but with a mass and
cost similar or less than a stationary probe.

Therefore, a large fraction of the overall weight (as measured at atmospheric entry) of a tensegrity mission can be used for the scientific payload
due to the dual use of the structure as a lander and a rover.
This allows for cheaper missions and enable new forms of surface exploration that utilize the natural tolerance to impacts of tensegrities~\cite{Vytas_IPPW_2013}.

% Because  of  the  limited  research  into  actuated  tensegrity
% robotics,   many   design   aspects   have   yet   to   be   carefully
% studied. To date, the majority of constructed tensegrity robots
% have  been  simple  prototypes  using  servo  motors,  limited
% sensing,  and  are  often  tethered  for  power  and  control  [5].
% Others have had fewer limbs than the SUPER ball, or have
% been  secured  to  the  ground  as  opposed  to  free-standing
% [6][7]. Some related approaches utilize tensegrity as part of a
% larger, more complicated system, but not as the primary loco-
% motion method [8]. Others have created designs that do not
% use direct cable actuation, as in the SUPER ball, but instead
% have  more  limited  forms  of  locomotion  through  vibration
% [9][10]. Finally, the most similar designs to the SUPER ball
% have not been engineered to specific design requirements nor
% have  the  advanced  sensing  framework  needed  for  controls
% testing [11]
%
% The  high  strength-to-weight  ratio  of  tensegrity  structures
% is very attractive due to the impact of mass on mission launch
% costs.  Large  tensegrity  structures  have  been  shown  to  be
% deployable from small compact configurations which enable
% them to fit into space constrained launch fairings. While the
% above qualities have inspired studies of deployable antennae
% and  other  large  space  structures  [12],  it  is  in  the  realm
% of  planetary  exploration  that  we  see  the  most  significant
% role  for  many  of  the  unique  force  distribution  qualities  of
% tensegrity  robots.  A  recent  NIAC  project  [13]  specifically
% studies  landing  and  surface  mobility  of  tensegrities,  ex-
% ploiting  the  controllable  compliance  and  force  distribution
% properties which make for reliable and robust environmental
% interactions.
% The   main   goal   is   to   develop   tensegrity   probes   with
% an  actively  controllable  tensile  network  to  enable  compact
% stowage  for  launch,  followed  by  deployment  in  preparation
% for  landing.  Due  to  their  natural  compliance  and  structural
% force  distribution  properties,  tensegrity  probes  can  safely
% absorb significant impact forces, enabling high speed Entry,
% Descent, and Landing (EDL) scenarios where the probe itself
% acts  much  like  an  airbag.  However,  unlike  an  airbag  which
% must  be  discarded  after  a  single  use,  the  tensegrity  probe
% can  actively  control  its  shape  to  provide  compliant  rolling
% mobility  while  still  maintaining  the  ability  to  safely  absorb
% impact  shocks  that  might  occur  during  exploration.  This
% combination  of  functions  from  a  single  structure  enables
% compact and lightweight planetary exploration missions with
% the capabilities of traditional wheeled rovers, but with a mass
% and cost similar or less than a stationary probe.
%
% Therefore, a large fraction of the overall weight (as mea-
% sured  at  atmospheric  entry)  of  a  tensegrity  mission  can  be
% used  for  the  scientific  payload  due  to  the  dual  use  of  the
% structure  as  a  lander  and  a  rover.  This  allows  for  cheaper
% missions  and  enable  new  forms  of  surface  exploration  that
% utilize the natural tolerance to impacts of tensegrities [14].
%
% Buckminster Fuller [1] and the artist Kenneth Snelson [2]
% initially  explored  tensegrity  structures  in  the  1960s.  Until
% the  mid-1990s  the  majority  of  tensegrity  related  research
% was  concerned  with  form-finding  [15]  and  design  analysis
% of  static  structure  [16][17].  More  recently,  active  control
% efforts  for  tensegrities  began  to  emerge  [18],  as  well  as
% descriptions  of  the  dynamics  of  tensegrity  structures  taking
% the connectivity pattern into account [17].
% The tensegrity principle allows for compliance and multi-
% path load distribution, which is ideal for physical interaction
% with  the  environment.  However,  these  aspects  also  present
% significant  challenges  to  traditional  control  approaches.  A
% recent  review  [19]  shows  that  there  are  still  many  open
% problems in actively controlling tensegrities, especially when
% interacting  with  an  environment  during  locomotion  or  ma-
% nipulation  tasks.  Though  work  has  been  done  to  control  a
% tensegrity  to  change  into  a  specified  shape  [20],  practical
% determination  of  the  desired  shape  itself  is  an  ongoing
% challenge.  Recently,  locomotion  of  icosahedral  tensegrity
% robots  through  body  deformation  was  demonstrated  [21].
% Other work has addressed collision between rigid tensegrity
% elements during control generation [22][23].
% The  approach  taken  by  the  NASA  Dynamic  Tensegrity
% Robotics  Lab  builds  on  this  by  developing  body  defor-
% mation  control  algorithms  based  on  central  pattern  gen-
% erators  [24][25],  distributed  learning,  reservoir  computing,
% and  genetic  algorithms  [26],  instead  of  traditional  linear
% and  nonlinear  systems  approaches.  To  date,  our  approach
% has  shown  promising  results  at  productively  harnessing  the
% potential  of  complex,  compliant,  and  nonlinear  tensegrity
% structures.

% \section{Motivation an Goal}