\documentclass[11pt,twoside]{article}
\usepackage{amsmath,latexsym,amssymb,amsfonts,amsbsy}
\usepackage{graphicx}

\textwidth 16cm \textheight 22cm \oddsidemargin 0in
\evensidemargin 0in
%
\newfont{\bb}{msbm10}
\def\Bbb#1{\mbox{\bb #1}}

\def\diag{{\rm diag}}
\def\Diag{{\rm Diag}}
\def\tridiag{{\rm tridiag}}
\def\det{{\rm det}}
\def\sign{{\rm sign}}
\def\opt{{\rm opt}}
\def\rnm{\mathbb{R}^{n\times m}}
\def\rmn{\mathbb{R}^{m\times n}}
\def\cmn{\mathbb{C}^{m\times n}}
\def\cnm{\mathbb{C}^{n\times m}}
%
\def\cnn{\mathbb{C}^{n\times n}}
\def\rnn{\mathbb{R}^{n\times n}}

\def\exp{{\rm exp}}
\def\v{}
\def\vect{}
\newtheorem{algorithm}{Algorithm}[section]
\newtheorem{method}{Method}[section]
\newtheorem{example}{Example}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{corollary}{Corollary}[section]
\newcommand{\vecspace}{\bf C}
\newcommand{\IC}{\makebox{{\Bbb C}}}
\newcommand{\IR}{\makebox{{\Bbb R}}}
\newcommand{\leals}{\makebox{{\Bbb L}}}
\newcommand{\neals}{\makebox{{\Bbb N}}}
\newcommand{\Z}{\makebox{{\Bbb Z}}}
\newcommand{\Frac}{\displaystyle\frac}
\newcommand{\Sum}{\displaystyle\sum}
\newcommand{\Lim}{\displaystyle\lim}
\newcommand{\Max}{\displaystyle\max}
\newcommand{\Prod}{\displaystyle\prod}
\newcommand{\Min}{\displaystyle\min}
%\newcommand{\Bigl}{\displaystyle\{ }
%\newcommand{\Bigr}{\displaystyle\} }
\newcommand{\compar}[1]{\langle {#1} \rangle}
\newcommand{\ccompar}[1]{\langle\langle {#1}\rangle\rangle}
\def \endproof{\vrule height8pt width 5pt depth 0pt}
\baselineskip=14pt
\parindent=0pt
\parskip=3pt
\overfullrule=0pt
\renewcommand\theequation{\arabic{equation}}
\renewcommand\thefigure{\arabic{figure}}
\begin{document}
\cleardoublepage \pagestyle{myheadings}

\bibliographystyle{plain}

\title{\bf Technical Document: Poisson Surface Reconstruction in MATLAB}

\author{Maolin Tian\\
{\it School of Mathematical Science}\\
{\it Shanghai Jiao Tong University}\\
{\it Email: tml10016@163.com }\\[2mm]
}

\maketitle \markboth{\small  Maolin Tian}
{\small  Technical Document of Poisson Surface Reconstruction in MATLAB }

\begin{abstract}
The details of Poisson surface reconstruction for computing in MATLAB.
\end{abstract}

\bigskip

\section{Poisson Reconstruction}\label{PR-sec}
The Poisson equation \cite{PR} is
\begin{equation}\label{dbXV}
\Delta \chi  = \nabla \cdot \vec{V}.
\end{equation}
Let the smoothing filter \(F\) be B-spline.
That is,
\begin{equation}\label{FFs}
F_p (q) = B(\frac{q-p}{w}) \frac{1}{w^3},
\end{equation}
\begin{equation}\label{BBBB}
B(x,y,z) = (B(x)B(y)B(z))^{*n},
\end{equation}
and
\begin{equation}\label{Bt10}
B(t) = \left\{
\begin{aligned}
& 1 , |t| < 0.5 \\
& 0 , \text{otherwise}.
\end{aligned}
\right.
\end{equation}
The sampling density is estimated by
\begin{equation}\label{sampling_density}
W (q) = \sum_{s \in S} F_{s.p} (q).
\end{equation}
The vector field is
\begin{equation}\label{dXFN_discrete}
\vec{V}(q) = \sum_{s \in S}  F_{s.p} (q) \  s.\vec{N} \  \frac{1}{W(s.p)}.
\end{equation}

Assume the solution
\begin{equation}\label{XxB}
\chi(p)=\sum_{i=1}^N x_i F_i (p).
\end{equation}
By Galerkin method, the linear system from (\ref{dbXV}) is
\begin{equation}\label{dxBdVB}
-\langle \nabla \chi(p), \nabla F_i \rangle
=\langle \nabla \cdot \vec{V}, F_i \rangle,
\end{equation}
denoted by \(-Ax = b\), where
\begin{equation}\label{ABB}
A_{ij} = \langle \nabla F_i, \nabla F_j \rangle
\end{equation}
and
\begin{equation}\label{bVB}
b_i = \langle \vec V, \nabla F_i \rangle.
\end{equation}

\section{Computation in MATLAB}
The equations (\ref{sampling_density}), (\ref{ABB}) and (\ref{bVB}) in Section \ref{PR-sec} are multivariate.
Computationally, we need represent them in univariate form.
Here we consider the case of 2D, where input is 2-D points and output is the curve.
Let \(b(x)=B(x)^{*n}\) be the univariate B-spline with degree n.
Then \(B(x,y)\) is separable since from (\ref{BBBB})
\begin{equation}\label{Bxy_Bxn_Byn}
\begin{aligned}
B(x,y)
&= (B(x)B(y))^{*n}\\
&= (B(x))^{*n}\ (B(y))^{*n}\\
&= b(x)\ b(y).
\end{aligned}
\end{equation}
By (\ref{ABB}),
\begin{equation}\label{Aij_dFi_dFj}
\begin{aligned}
A_{ij}
&= \langle \nabla F_i, \nabla F_j \rangle\\
&= \int \nabla F_i \cdot \nabla F_j\, dp\\
&= \int \frac{\partial}{\partial x} F_i \frac{\partial}{\partial x}  F_j \, dp
+ \int \frac{\partial}{\partial y} F_i \frac{\partial}{\partial y}  F_j \, dp.
\end{aligned}
\end{equation}
Let \(i.c\) be the center of grid \(i\),
\(i.x\) is the first component and \(i.y\) is the second.
By (\ref{FFs}),
\begin{equation}\label{Aij_bb_bb}
\begin{aligned}
& \int \frac{\partial}{\partial x} F_i \frac{\partial}{\partial x}  F_j \, dp \\
&= \int \frac{\partial}{\partial x} (B(\frac{p-i.c}{i.w})\frac{1}{i.w^2})\
\frac{\partial}{\partial x}  (B(\frac{p-j.c}{j.w})\frac{1}{j.w^2})\,  dp\\
&= \int \frac{\partial}{\partial x} B(\frac{p-i.c}{i.w})\frac{1}{i.w^3}\
\frac{\partial}{\partial x}  B(\frac{p-j.c}{j.w})\frac{1}{j.w^3}\,  dp\\
&= \int \int \frac{\partial}{\partial x} b(\frac{x-i.x}{i.w})b(\frac{y-i.y}{i.w})\frac{1}{i.w^3}\
\frac{\partial}{\partial x}  b(\frac{x-j.x}{j.w})b(\frac{y-j.y}{j.w})\frac{1}{j.w^3}\,  dx\,  dy\\
&= - \frac{1}{i.w^3\, j.w^3} \int b'(\frac{i.x-j.x-x}{i.w}) b'(\frac{x}{j.w})\,  dx
\int b(\frac{i.y-j.y-y}{i.w}) b(\frac{y}{j.w})\,  dy% \\
% &= \frac{1}{i.w^2\, j.w^2}\ (b' * b')(\frac{i.x}{i.w} - \frac{j.x}{j.w})\ (b * b)(\frac{i.y}{i.w} - \frac{j.y}{j.w}).
\end{aligned}
\end{equation}
The width is in \(\{2^{-d}|\,d\le D\}\), where \(D\) is max depth.
\(D\) is small, therefore the number of \(s.w,\,i.w,\,j.w\) is finite.
Let
\begin{equation}b_w(t)=b(\frac{t}{w}),\end{equation}
\begin{equation}b'_w(t)=(b_w(t))'.\end{equation}
(\ref{Aij_bb_bb}) is
\begin{equation}\label{xFixFjdp}
\begin{aligned}
& \int \frac{\partial}{\partial x} F_i \frac{\partial}{\partial x}  F_j \, dp \\
&= - \frac{1}{i.w^2\, j.w^2} (b_{i.w}'*b_{j.w}')(i.x-j.x)
\ (b_{i.w}*b_{j.w})(i.y-j.y)
\end{aligned}
\end{equation}

Similarly, (\ref{sampling_density}) can be computed by
\begin{equation}\label{WpsSFspp}
\begin{aligned}
W (p)
&= \sum_{s \in S} F_{s.p} (p)\\
&=\sum \frac{1}{s.w^2} b (\frac{x-s.x}{s.w}) \  b(\frac{y-s.y}{s.w}).
\end{aligned}
\end{equation}
And (\ref{bVB}) can be computed by (\ref{dXFN_discrete}) and
\begin{equation}\label{biVFidp}
\begin{aligned}
b_i &=\int \vec V \cdot \nabla{F}_i\,  dp\\
&=\int \sum_{s \in S}  F_{s.p} (q) \  s.\vec{N} \  \frac{1}{W(s.p)} \cdot \nabla{F}_i\,  dp\\
&=\sum_{s \in S} \frac{1}{W(s.p)} \int F_{s.p} \  s.\vec{N} \cdot \nabla{F}_i\, dp\\
&=\sum \frac{1}{W(s.p)} \  s.\vec{N} .x \int F_{s.p}\ \frac{\partial}{\partial x}\ F_i\, dp\\
&\  +\sum \frac{1}{W(s.p)} \  s.\vec{N} .y\int F_{s.p}\ \frac{\partial}{\partial y}\ F_i\, dp.
\end{aligned}
\end{equation}
Here \( s.\vec{N}.x\) is the first component of \(s.\vec{N}\).
As in (\ref{Aij_bb_bb}),
\begin{equation}\label{FspxFip}
\int F_{s.p}\ \frac{\partial}{\partial x} F_i\, dp
= \frac{1}{s.w^2 i.w^2} (b_{s.w}*b_{i.w}')(s.x-i.x)
\  (b_{s.w}*b_{i.w})(s.y-i.y)
\end{equation}

Hence, we can represent \( A_{ij},W(p),b_i\) by \(b(x)\),
and we need compute \(b_w*b_w,\, b_w*b_w',\, b_w'*b_w',\, b_w\).
It is easy to compute them,
since the 4\(D\) univariate piecewise functions are simple.
We first compute a value table of them to accelerate.
Then get an approximate value from the table in computation.

\begin{thebibliography}{99}

 \bibitem{PR}
 Kazhdan, M., Bolitho, M., and Hoppe, H.
 {\em Poisson surface reconstruction}.
 In Proceedings of the fourth Eurographics symposium on Geometry processing (Vol. 7).

\end{thebibliography}

\end{document}


\newcommand{\symb}[2]{\makebox[6em][l]{#1} #2}% used to generate the list of symbols

\chapter{List of Symbols}

\symb{$i$}{Unit imaginary number; or, an index of numbers}\\
\symb{$j$, $ j' $}{Fine-structure angular momentum quantum number of individual atoms in a ground state or excited state (with prime), respectively; or, indices of numbers}\\
\symb{$f$, $ f' $}{Hyperfine-structure or hyperfine angular momentum quantum number of individual atoms in a ground state or excited state (with prime), respectively}\\
\symb{$J$, $ J' $}{The collective fine-structure angular momentum quantum number of an atomic ensemble in a ground state or excited state, respectively}\\
\symb{$F$, $ F' $}{The collective hyperfine-structure angular momentum quantum number of an atomic ensemble in a ground state or excited state, respectively}\\
\symb{$ \hat{\mathbf{S}}$, $\hat{S}_i$}{Stokes operator and its $i$-th component $ (i=0,1,2,3) $}\\
\symb{$\mathbf{e}_i$}{The unit vector along the $ i $ direction}\\
\symb{$\mathbf{u}\mathbf{v}$}{The outer product of vector $ \mathbf{u} $ and vector $ \mathbf{v} $ to form a tensor}\\
\symb{$\delta_{jk}$}{Kronecker delta function}\\
\symb{$\delta(x)$}{Dirac delta function}\\
\symb{$\dt A$}{Time derivative of $A$}\\
\symb{$A^\dagger$}{Hermitian conjugate of $A$}\\
\symb{$A^*$}{Complex conjugate of $A$}\\
\symb{$A^\transp$}{Transpose of $A$}\\
\symb{$\hat{A}^{(n)}$}{Operator $ \hat{A} $ on the $ n $th atom}\\
\symb{$\hat{\rho}^{\otimes N}$}{Tensor product of $ N $ operator $ \hat{\rho} $}\\
\symb{$\det(A)$}{Determinant of $A$}\\
\symb{$\tr(A)$, $ \tr\left[ A\right] $}{Trace of $A$}\\
%\symb{$\av{A}$}{Expectation value of $A$}\\
\symb{$[A,B]$}{Commutator of $A$ and $B$}\\
\symb{$\{A,B\}$}{Anticommutator of $A$ and $B$}\\
\symb{$\re(z)$}{Real part of $z$}\\
\symb{$\im(z)$}{Imaginary part of $z$}\\
\symb{$\mathrm{abs}[z]$, $ |z| $}{Absolute value of $z$}\\
\symb{$\identity$, $\nullmatrix$}{The identity matrix and null matrix}\\
\symb{$ \hat{\mathbbm{1}} $}{Identity operator}\\
\symb{$\unittensor$}{The identity tensor}\\
\symb{$ \expect{\hat{A}} $}{Expectation value of operator $ \hat{A} $}\\
\symb{$ \Delta A^2 $, $ \expect{\Delta A^2} $}{Variance of operator $ \hat{A} $: $ \expect{\hat{A}^2}-\expect{\hat{A}}^2 $}\\
\symb{$ \Delta A $, $ \expect{\Delta A} $}{The square root of $ \Delta A^2 $}\\
\symb{$ \expect{\Delta A \Delta B} $}{Covariance of operators $ \hat{A} $ and $ \hat{B} $}\\
\symb{$\Delta$}{Detuning}\\
\symb{$\Omega$}{Rabi frequency}\\
\symb{$\xi^2$}{metrologically relevant squeezing parameter}\\
\symb{$\chi$}{Coupling strength between atoms and light}\\
\symb{$\kappa$}{Measurement strength}\\
\symb{$\gamma_s$}{Characteristic photon scattering rate}\\
\symb{$\gamma_{op}$}{Optical pumping rate}\\
\symb{$I_{\rm in}$}{Intensity of input light}\\
\symb{$\br$,\,$\br'$}{Full spatial position vectors of a detector and the source}\\
\symb{$\br_\perp$,\,$\br'_\perp$}{The transverse spatial position vectors of a detector and the source}\\
\symb{$n_1$}{Index of refraction of the core of a waveguide}\\
\symb{$n_2$}{Index of refraction of the cladding of a waveguide}\\
\symb{$\tensor{\mathbf{G}}$}{Tensors of spatial degrees of freedom}\\
\symb{$\tensor{\mathbf{G}}(\br,\br')$}{The dyadic Green's function or Green's function tensor responded at position $ \br $ due to a source at $ \br' $}\\
\symb{$\hat{\tensor{\boldsymbol{\alpha}}}$}{Polarizability tensor operator}\\
\symb{$\Gamma_0$}{The decay rate or spontaneous emission rate of an atom in free-space}\\
\symb{$\Gamma_{\rm 1D}$}{The decay rate or spontaneous emission rate of an atom coupled to guided modes}\\
\symb{$\hat{T}^{(K)}$}{Rank-$K$ tensor operator}\\
\symb{$C^{(K)}_{j'ff'}$, $C^{(K)}_{j'f}$}{Rank-$K$ hyperfine atomic transition coefficients defined by Eqs.~\eqref{eq:Cjpffp} and~\eqref{eq:Cjpf} }\\
\symb{$C^{f_1,m_1;f_2,m_2}_{f',m'}$}{Clebsch-Gordan coefficients $ \bra{f_1,m_1;f_2,m_2}f',m'\rangle $}\\
\symb{$o^{j'f'}_{jf}$}{Relative oscillation strengths defined by Eq.~\eqref{Eq::OscStrength}}\\
\symb{$ \sigma_0 $}{On-resonance cross section of an atom}\\
\symb{$ N_A $}{Total number of atoms}\\
\symb{$ \hat{N}_C $, $ N_C $}{Number operator in the \emph{clock space} and its expectation value}\\
\symb{$ C_1 $}{Cooperativity per atom}\\
\symb{OD, OD$/ N_A $}{Optical depth, and optical depth per atom}\\
\symb{$\hat{a}$, $\hat{a}^\dagger$ }{Creation and annihilation operators for bosonic modes}\\
\symb{$ \beta $, $\beta_0$}{Propagation constant of a guided mode}\\
\symb{$ k $, $k_0$}{The total wave vector number of a propagating light}\\
\symb{$ \omega $, $\omega_0$}{Angular frequency of a light or an electromagnetic wave}\\
\symb{$\lambda$}{Wavelength of a light or an electromagnetic wave}\\
\symb{$\ket{\uparrow}$}{Fiducial state}\\
\symb{$\ket{\downarrow}$}{Coupled state}\\
\symb{$\ket{T}$}{Transfer state}\\
\symb{$\mathrm{c.c.}$}{Complex conjugate}\\
\symb{$\mathrm{H.c.}$}{Hermitian conjugate}
%\symb{$\braket{\psi}{\uppsi}$}{Annihilation operator of the state $\psi(\xbf)$, i.e., $\int\uppsi(\xbf)\,\psi^*(\xbf)\,\dif \xbf$}\\
%\symb{$\braket{\uppsi}{\psi}$}{Creation operator of the state $\psi(\xbf)$, i.e., $\int\uppsi^\dagger(\xbf)\,\psi(\xbf)\,\dif \xbf$}\\
%\symb{$\ket{\varPsi}$}{Slanted capital Greek letters for many-body quantum states}\\


\documentclass[12pt,letterpaper]{article}
\usepackage{amsmath,
            amsfonts,
            amssymb}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}

%%% Package setup
\captionsetup{font=small,
			  labelfont=bf,
			  labelsep=period}

\hypersetup{
	bookmarksopen=true,
	colorlinks=true,
	linkcolor=blue,
	citecolor=blue,
	urlcolor=black,
	linktoc=all,
	pdftitle={Wave propagation info},
	pdfauthor={N. Guarin-Zapata},
	pdfkeywords={Wave propagation, Signal processing},
	pdfsubject={Wave propagation},
	pdfpagemode=UseOutlines,
	pdfstartview=FitH}

%%% User specified LaTeX commands
\newcommand*{\bs}[1]{\boldsymbol{#1}}

%%% Title

\title{\textbf{Information for simulations in Wave Propagation}}
\author{Nicolás Guarín-Zapata}
\date{\today}

%%% Document
\begin{document}
\maketitle

\section{Consistent units}
Although is a good practice to convert the equations to their dimensionless versions, we still need to plug numbers into our numerical algorithms. For that aim we need to use consistent units, as presented in the following table.
\begin{table}[h]
\centering
\begin{tabular}{ccccc}
\hline
\textbf{Quantity} & \textbf{SI} & \textbf{SI (mm)} & \textbf{US (ft)} & \textbf{US (inch)} \\
\hline
Length & m & mm & ft & in \\
Force & N & N & lbf & lbf \\
Mass & kg & tonne (10$^3$ kg) & slug & lbf s$^2$/in \\
Time & s & s & s & s \\
Stress & Pa (N/m$^2$) & MPa (N/mm$^2$) & lbf/ft$^2$ & psi (lbf/in$^2$) \\
Energy & J & mJ (10$^{-3}$) & ft lbf & in lbf \\
Density & kg/m$^3$ & tonne/mm$^3$ & slug/ft$^3$ & lbf s$^2$/in$^4$ \\
\hline
\end{tabular}
\end{table}

\section{Relations between elastic constants}

\begin{table}[h]
\centering
\begin{tabular}{ccccccc}
\hline
&$\bs{K}=$  &$\bs{E}=$  &$\bs{\lambda}=$  &$\bs{G}=$  &$\bs{\nu}=$  &$\bs{M}=$ \\
\hline
$\bs{(K,E)}$  &$K$ &$E$ &$\frac{3K(3KE)}{9K-E}$ &$\frac{3KE}{9K-E}$ &$\frac{3K-E}{6K}$ &$\frac{3K(3K+E)}{9K-E}$\\
$\bs{(K,\lambda)}$ &$K$ &$\frac{9K(K-\lambda)}{3K-\lambda}$ &$\lambda$ &$\frac{3(K-\lambda)}{2}$ &$\frac{\lambda}{3K-\lambda}$ &$3K-2\lambda$\\
$\bs{(K,G)}$ &$K$ &$\frac{9KG}{2K+G}$ &$K-\frac{2G}{3}$ &$G$ &$\frac{3K-2G}{2(3K+G)}$ &$K+\frac{4G}{3}$\\
$\bs{(K,\nu)}$ &$K$ &$3K(1-2\nu)$ &$\frac{3K\nu}{1+\nu}$ &$\frac{3K(1-2\nu)}{2(1+\nu)}$ &$\nu$ &$\frac{3K(1-\nu)}{1+\nu}$\\
$\bs{(E,G)}$ &$\frac{EG}{3(3G-E)}$ &$E$ &$\frac{G(E-2G)}{EG-E}$ &$G$ &$\frac{E}{2G}-1$ &$\frac{G(4G-E)}{3G-E}$\\
$\bs{(E,\nu)}$ &$\frac{E}{3(1-2\nu)}$ &$E$ &$\frac{E\nu}{(1+\nu)(1-2\nu)}$ &$\frac{E}{2(1+\nu)}$ &$\nu$ &$\frac{E(1-\nu)}{(1+\nu)(1-2\nu)}$\\
$\bs{(\nu,G)}$ &$\lambda+\frac{2G}{3}$ &$\frac{G(3\lambda+2G)}{\lambda+G}$ &$\lambda$ &$G$ &$\frac{\lambda}{2(\lambda+G)}$ &$\lambda+2G$\\
$\bs{(\nu,\lambda)}$ &$\frac{\lambda(1+\nu)}{3(1-2\nu)}$ &$\frac{\lambda(1+\nu)(1-2\nu)}{\nu}$ &$\lambda$ &$\frac{\lambda(1-2\nu)}{2\nu}$ &$\nu$ &$\frac{\lambda(1-\nu)}{\nu}$\\
$\bs{(G,\lambda)}$ &$\frac{2G(1+\nu)}{3(1-2\nu)}$ &$2G(1+\nu)$ &$\frac{2G\nu}{1-2\nu}$ &$G$ &$\nu$ &$\frac{2G(1-\nu)}{1-2\nu}$ \\
$\bs{(G,M)}$ &$M-\frac{4G}{3}$& $\frac{G(3-M-4G)}{M-2G}$ &$M-2G$ &$G$ &$\frac{M-2G}{2(M-G)}$ &$M$\\
\hline
\end{tabular}
\label{tab:elastic_constants}
\end{table}

$K$: Bulk modulus, $\lambda$: Lamé's first parameter, $E$: Young's
modulus, $G$: Shear modulus, $\nu$: Poisson's ratio, $M$: P-wave
modulus.

\section{Relations for elastic wave speeds}

The P-wave is a dilatational wave with speed $\alpha$ given by
\begin{align*}
 & \alpha^{2}=\frac{\lambda+2G}{\rho},\qquad\alpha^{2}=\frac{G(1-\nu)}{\rho},\\
 & \alpha^{2}=\frac{M}{\rho},\qquad\alpha^{2}=\frac{E(1-\nu)}{(1+\nu)(1-2\nu)\rho},\\
 & \alpha^{2}=\frac{2\beta^{2}(1-\nu)}{1-2\nu}.
\end{align*}
 The S-wave is a distorsional wave with speed $\beta$ given by
\begin{align*}
 & \beta^{2}=\frac{G}{\rho}\\
 & \beta^{2}=\frac{E}{2(1+\nu)\rho},\\
 & \beta^{2}=\frac{\alpha^{2}(1-2\nu)}{2(1-\nu)}.
\end{align*}
 Some particular values for the ratio
\[
\frac{\alpha^{2}}{\beta^{2}}=\frac{2(1-\nu)}{1-2\nu}
\]
 are
\begin{align*}
 & \frac{\alpha^{2}}{\beta^{2}}=\frac{4}{3}\quad\mbox{for }\nu=-1\enspace,\\
 & \frac{\alpha^{2}}{\beta^{2}}=2\quad\mbox{for }\nu=0\enspace,\\
 & \frac{\alpha^{2}}{\beta^{2}}=4\quad\mbox{for }\nu=\frac{1}{3}\enspace,\\
 & \frac{\alpha^{2}}{\beta^{2}}\rightarrow\infty\quad\mbox{when }\nu\rightarrow\frac{1}{2}\enspace.
\end{align*}

\begin{figure}[h]
\centering
\includegraphics[width=0.9\textwidth]{img/E_vs_density-vector.pdf}
\caption{Ashby chart for Young Modulus vs density. The lines show the sound speed, that is the speed for a wave in a rod made of this material and is between the longitudinal and shear wave speeds --for Poisson ratios in (-0.5,0.5). Taken from \emph{Ashby, Michael F. ``Materials selection in mechanical design." MRS BULLETIN 30 (2005): 995.}}
\end{figure}

\section{Courant-Friedrichs-Lewy condition}

The Courant-Friedrichs-Lewy condition (CFL condition) is a necessary condition for convergence while solving certain partial differential equations (usually hyperbolic PDEs) numerically by the method of finite differences. It arises when explicit time-marching schemes are used for the numerical solution. The condition is named after Richard Courant, Kurt Friedrichs, and Hans Lewy who described it in their 1928 paper
\cite{CFL}.

The criterion could be stated as
\begin{align*}
C=v_{x}\frac{\Delta t}{\Delta x}\leq C_{max}\qquad\mbox{in 1D}\enspace;\\
C=v_{x}\frac{\Delta t}{\Delta x}+v_{y}\frac{\Delta t}{\Delta y}\leq C_{max}\qquad\mbox{in 2D}\enspace;\\
C=v_{x}\frac{\Delta t}{\Delta x}+v_{y}\frac{\Delta t}{\Delta y}+v_{z}\frac{\Delta t}{\Delta z}\leq C_{max}\qquad\mbox{in 3D}\enspace;
\end{align*}
 Where $v_{x_{i}}$ is the phase speed (for wave phenomena) in the $x_{i}$ direction, $\Delta x_{i}$ is the minimum spatial discretization in $x_{i}$ direction, $\Delta t$ is the time step and $C_{max}$ is the maximum allowable value for $C$, which depends on the time discretization scheme but should be less than 1.

In the case of elastodynamics and for a spatial discretization with
the finite element method, the criterion could be re-stated as
\begin{align*}
C\leq\alpha\frac{\Delta t}{h}\leq C_{max}\qquad\mbox{in 1D}\enspace;\\
C\leq2\alpha\frac{\Delta t}{h}\leq C_{max}\qquad\mbox{in 2D}\enspace;\\
C\leq3\alpha\frac{\Delta t}{h}\leq C_{max}\qquad\mbox{in 3D}\enspace;
\end{align*}
where $\alpha$ is the phase speed for the P-wave and $h$ is the
minimum distance between consecutive nodes. This give us the maximum
allowable timestep as
\begin{align}
\Delta t\leq C_{max}\frac{h}{\alpha}\qquad\mbox{in 1D}\enspace;\\
\Delta t\leq\frac{C_{max}}{2}\frac{h}{\alpha}\qquad\mbox{in 2D}\enspace;\\
\Delta t\leq\frac{C_{max}}{3}\frac{h}{\alpha}\qquad\mbox{in 3D}\enspace.
\end{align}
A graphical representation of the criterion is given in Figure \ref{fig:CFL}. Intuitively, we can think about the CFL condition as a limit in the speed for transferring information from one node to its neighbors; this \emph{speed} should be less than the speed for propagation of phenomena in the wave.
\begin{figure}[h]
\centering
\includegraphics[width=0.7\textwidth]{img/CFLcondition.png}
\caption{Graphic representation of the CFL condition in 1D. \textit{L.A. Barba et al. Practical Numerical Methods with Python, 2014.}}\label{fig:CFL}
\end{figure}

\section{Nyquist criterion}

The Nyquist–Shannon sampling theorem (also Nyquist-Shannon-Whittaker theorem), after Harry Nyquist and Claude Shannon, in the literature more commonly referred to as the Nyquist sampling theorem or simply as the sampling theorem, is a fundamental result in the field of information theory, in particular telecommunications and signal processing. Sampling is the process of converting a signal (for example, a function of continuous time or space) into a numeric
sequence (a function of discrete time or space). Shannon's version of the theorem states \cite{Shannon, Nyquist, wiki:nyquist, Whittaker}:
\begin{quote}
If a function $x(t)$ contains no frequencies higher than $B$ hertz,
it is completely determined by giving its ordinates at a series of
points spaced $1/(2B)$ seconds apart.
\end{quote}
This theorem implies for us in the numerical simulation of wave propagation
that
\[
h\leq\frac{\lambda}{2}\enspace,
\]
 where $h$ is the maximum distance between consecutive nodes and
$\lambda$ is the shortest wavelength that want to be sampled. So,
the selection of $h$ is commonly
\[
h=\frac{\lambda}{k}\enspace,
\]
 where $k>2$ is a factor that depends on the numerical method. For
finite element methods $k$ is commonly 10, and for spectral element
methods $k$ is reduced to 5 \cite{Komatitsch99}.

\section{Information for different pulse signals}
In wave propagation problems we must work with time signals that are finite in time, let's say wave pulses (or wave packets in the Quantum Mechanics jargon). Some times we are interested in wave pulses because they are useful as wavefronts representation. Furthermore, wave packets are important since we cannot store information in a wave with a single frequency\footnote{That's why phase speed of waves can be higher than speed of light. For non-dissipative media, the energy (and so the information) travel with the group velocity \cite{book:Brillouin1}.}. There is a trade off between the localization in time (duration of the pulse) and frequency (concentration of the energy around a specific value). This fact is well discussed in Quantum Mechanics texts since it re ects the discussion about wave{particle duality and uncertainty principle \cite{book:Zetilli}. When we have finite time signals its corresponding Fourier transform will be in the whole frequency domain. In general terms, while more concentrated in the time domain, more spread in the frequency domain. From a numerical point of view we need to truncate the maximum frequency allowed for our simulations.

In the following \emph{subsections} we exposed some truncation tips for different wave pulses. This is important because numerically we cannot consider the complete spectrum of a pulse, since normally they cover the whole frequency domain. We will refer to the function in time as $f(t)$, and to its Fourier transform as $\hat{f}(\omega)$. Since the ``energy" carried for the wave per frequency is proportional to the square of the absolute value of the Fourier transform $\hat{f}^2(\omega)$, we can compare the energy in the frequency interval $[0,\omega_{\max}]$ to the energy content in $[0,\infty)$\footnote{We just need to compute one halfspace because the other half has the same values.}. Thus, as a figure of merit we define
\begin{equation}
R(\omega_{\max}) = \frac{\int\limits_{0}^{\omega_{\max}} \hat{f}^2 (\omega)\ \rm{d}\omega}{\int\limits_{0}^{\infty} \hat{f}^2 (\omega)\ \rm{d}\omega}\times 100\% \enspace ,
\label{eq:trunc_energy}
\end{equation}
and tell us the proportion of energy taken into account if we neglect circular frequencies higher than $\omega_{\max}$.

\subsection{Ricker wavelet}
It is common to use a Ricker wavelet as the input signal in simulations since it has the energy concentrated around a circular frequency $\omega_{c}$. Let's write the signal as
\[f(t)=\left(\frac{12t^{2}}{b^{2}}-1\right)e^{-\frac{6t^{2}}{b^{2}}}\enspace,\]
 where $b$ is the elapsed time between the peaks in the time domain \cite{Papageorgiou91}. The Fourier transform for this signal is
\[\hat{f}(\omega)=-\frac{\sqrt{\pi}b^{3}\omega^{2}e^{-\frac{b^{2}\omega^{2}}{24}}}{2\ 6^{3/2}}\enspace, \]
with a characteristic\footnote{The characteristic frequency is the value at which the peak appears.} circular frequency
\[\omega_{c}=\frac{2\sqrt{6}}{b}. \]
To satisfy the sampling theorem we need to design our simulations
thinking about the shortest wavelength, so we need to think about
the maximum frequency. To know where to trunk the signal (in the frequency domain) we could compute how much energy is in $[0,\omega_{max}]$ and compare this value with the energy stored in the interval $[0,\infty)$. Some particular values are :
\begin{align*}
 & R(1.0\omega_{c})=45.06\%\enspace;\\
 & R(1.5\omega_{c})=89.09\%\enspace;\\
 & R(2.0\omega_{c})=99.32\%\enspace;\\
 & R(3.0\omega_{c})=99.99\%\enspace;\\
 & R(4.0\omega_{c})=100.00\%\enspace.
\end{align*}
This can be depicted in Figure \ref{fig:ricker-areas}
\begin{figure}[H]
    \centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/ricker_area=1.pdf}
        \caption{Area under the curve in $[0,\omega_c]$.}
    \end{subfigure}\
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/ricker_area=2.pdf}
        \caption{Area under the curve in $[0,2\omega_c]$.}
    \end{subfigure}\\
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/ricker_area=3.pdf}
        \caption{Area under the curve in $[0,3\omega_c]$.}
    \end{subfigure}
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/ricker_area=4.pdf}
        \caption{Area under the curve in $[0,4\omega_c]$.}
    \end{subfigure}
    \caption{Energy distribution in the spectrum of the Ricker wavelet.}
    \label{fig:ricker-areas}
\end{figure}

\subsection{Gaussian wavelet}
One option to obtain a wavelet with the energy concentrated in a single frequency value is to use a signal which spectrum is a Gaussian function (Normal distribution) of the form\footnote{Both, the positive and negative frequencies are \textit{valid}. That's why we should include the second term in brackets.}
\begin{equation}\label{eq:gaussian_freq}
\hat{f}(\omega)=\frac{1}{\omega_\sigma \sqrt{2\pi}} \left[e^{-\frac{(\omega - \omega_0)^2}{2\omega_\sigma^2}}+ e^{-\frac{(\omega + \omega_0)^2}{2\omega_\sigma^2}} \right] \enspace ,
\end{equation}
where \(\omega\) is the angular frequency, \(\omega_0\) is the value of angular frequency for the highest density (mean value), \(\omega_\sigma\) is the value around \(\omega_0\) to have roughly 80\% of the energy (standard deviation). In the time domain, the signal looks like
\begin{equation}\label{eq:gaussian_time}
f(t) = 2 e^{-\frac{(\omega_\sigma t)^2}{2}}\cos(\omega_0 t) \enspace ,
\end{equation}
that is, basically, a harmonic function modulated by a Gaussian.

If we consider that \(\omega_0/\omega_\sigma >0\) we can have the expressions
\begin{align*}
    &R(\omega_0) = 50\%;\\
    &R(\omega_0 + \omega_\sigma) = 84.27\%;\\
    &R(\omega_0 + 2\omega_\sigma) = 97.73\%;\\
    &R(\omega_0 + 3\omega_\sigma)= 99.87\%;\\
    &R(\omega_0 + 4\omega_\sigma) = 100.00\%
\end{align*}
that is depicted in Figure \ref{fig:gaussian-areas}
\begin{figure}[H]
    \centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/gaussian_area=1.pdf}
        \caption{Area under the curve in $[0,\omega_0]$.}
    \end{subfigure}\
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/gaussian_area=2.pdf}
        \caption{Area under the curve in $[0,\omega_0 + \omega_\sigma]$.}
    \end{subfigure}\\
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/gaussian_area=3.pdf}
        \caption{Area under the curve in $[0,\omega_0 + 2\omega_\sigma]$.}
    \end{subfigure}
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/gaussian_area=4.pdf}
        \caption{Area under the curve in $[0,\omega_c + 3\omega_\sigma]$.}
    \end{subfigure}
    \caption{Energy distribution in the spectrum of the Gaussian wavelet.}
    \label{fig:gaussian-areas}
\end{figure}

\subsection{Square pulse}
A square pulse with duration \(\Delta t\) is given  by
\begin{equation}\label{eq:square_time}
f(t/\Delta t) =
\begin{cases}
    0 &\mbox{if } |t| >= \Delta t/2 \\
    1 & \mbox{if } |t| < \Delta t/2
\end{cases}
\end{equation}

And the Fourier transform is given by
\begin{equation}\label{eq:square_freq}
\hat(f)(\omega \Delta t) = \frac{\sin\left(\frac{\omega \Delta t}{2}\right)}{\left(\frac{\omega \Delta t}{2}\right)} \enspace ,
\end{equation}
for this case, the ratios \(R\) are:
\begin{align*}
    &R(\pi/2\Delta t) = 77.37\%;\\
    &R(\pi/\Delta t) = 90.28\%;\\
    &R(2\pi/\Delta t) = 94.99\%;\\
    &R(3\pi/\Delta t) = 96.64\%.
\end{align*}

This can be depicted in Figure \ref{fig:square-areas}
\begin{figure}[H]
    \centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/square_area=1.pdf}
        \caption{Area under the curve in $[0,\pi/2\Delta t]$.}
    \end{subfigure}\
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/square_area=2.pdf}
        \caption{Area under the curve in $[0,\pi/\Delta t]$.}
    \end{subfigure}\\
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/square_area=3.pdf}
        \caption{Area under the curve in $[0,2\pi/\Delta t]$.}
    \end{subfigure}
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/square_area=4.pdf}
        \caption{Area under the curve in $[0,3\pi/\Delta t]$.}
    \end{subfigure}
    \caption{Energy distribution in the spectrum for the square wavelet.}
    \label{fig:square-areas}
\end{figure}

\subsection{Triangle pulse}
The triangle pulse is given by the convolution of two square pulses, and the Fourier transform is
\begin{equation}
\hat{f}(\omega) = \left[\frac{\sin(\omega/2)}{(\omega/2)}\right]^2 \enspace .
\end{equation}

For this case the ratios are:
\begin{align*}
    &R(\pi/2\Delta t) = 65.77\%;\\
    &R(\pi/\Delta t) = 94.98\%;\\
    &R(2\pi/\Delta t) = 99.71\%;\\
    &R(3\pi/\Delta t) = 99.87\%.
\end{align*}

That are depicted in Figure \ref{fig:triangle-areas}
\begin{figure}[H]
    \centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/triangle_area=1.pdf}
        \caption{Area under the curve in $[0,\pi/2\Delta t]$.}
    \end{subfigure}\
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/triangle_area=2.pdf}
        \caption{Area under the curve in $[0,\pi/\Delta t]$.}
    \end{subfigure}\\
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/triangle_area=3.pdf}
        \caption{Area under the curve in $[0,2\pi/\Delta t]$.}
    \end{subfigure}
    %
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{img/triangle_area=4.pdf}
        \caption{Area under the curve in $[0,3\pi/\Delta t]$.}
    \end{subfigure}
    \caption{Energy distribution in the spectrum for the triangle wavelet.}
    \label{fig:triangle-areas}
\end{figure}

\begin{thebibliography}{9}
\bibitem{book:Brillouin1} Brillouin, Le\'on, and Arnold Sommerfeld. Wave propagation and group velocity. Vol. 960. New York: Academic Press, 1960.

\bibitem{CFL} Courant, R.; Friedrichs, K.; Lewy, H. (1928), \emph{\"Uber die partiellen Differenzengleichungen der mathematischen Physik} (in German), Mathematische Annalen 100 (1): 32--74.

\bibitem{Shannon} C. E. Shannon, \emph{Communication in the presence of noise}, Proc. Institute of Radio Engineers, vol. 37, no. 1, pp. 10--21, Jan. 1949. Reprint as classic paper in: Proc. IEEE, vol. 86, no. 2, (Feb. 1998), \url{http://web.stanford.edu/class/ee104/shannonpaper.pdf} (accesed may 26, 2016).

\bibitem{Komatitsch99} D. Komatitsch and J. Tromp,\emph{Introduction to the spectral element method for three-dimensional seismic wave propagation}, Geophysical Journal International, 1999, (139): 806--822.

\bibitem{Papageorgiou91} A. Papageorgiou and J. Kim,\emph{Study of the propagation and amplification of seismic waves in Caracas Valley with reference to the 29 July 1967 earthquake: SH waves}, Bulletin of the Seismological Society of America, 1991, 81 (6): 2214--2233.

\bibitem{wiki:nyquist} Wikipedia contributors, \emph{Nyquist-Shannon sampling theorem}, Wikipedia, The Free Encyclopedia, \url{https://en.wikipedia.org/w/index.php?title=Nyquist%E2%80%93Shannon_sampling_theorem} (accessed May 26, 2016).

\bibitem{Nyquist} H. Nyquist, Certain topics in telegraph transmission theory, Trans. AIEE, vol. 47, pp. 617--644, Apr. 1928 Reprint as classic paper in: Proc. IEEE, Vol. 90, No. 2, Feb 2002, , \url{http://www.astro.ufrgs.br/med/imagens/nyquist.pdf} (accesed may 26, 2016).

\bibitem{Whittaker} E. T. Whittaker, On the Functions Which are Represented by the Expansions of the Interpolation Theory, Proc. Royal Soc. Edinburgh, Sec. A, vol.35, pp. 181--194, 1915.

\bibitem{book:Zetilli} Nouredine Zettili. Quantum mechanics: concepts and applications. Wiley, 2009.

\end{thebibliography}

\end{document}


% !TEX root =../thesis-letomes.tex

\chapter{Discussion}

\section{Fan Search vs. ES}
In this section, we will examine the usefulness of using the ES algorithm over the brute force alternative. Do we get anything out of estimating a gradient? Do our results’ quality scale with a more complex model?

The ES method is in the general case a more intelligent of searching for these things. However, its not a magical panacea that just spits out fabulous results from a naive application. The fan search method took advantage of a lot of human intuition in terms of where to search. We gave it a limited fan of possibilities in a region that we knew to be reasonable. The ES algorithm definitely gave the best results when we imposed equivalent limitations on it.

\subsection{Variational Optimization}
The fractal nature of the space heavily indicates that some variational optimization method would help. If we are to follow ridges of arbitrary width, we need to be able to scale our across-ridge variance down, so most of $\sigma\epsilon$ falls within the ridge we are following. See \cref{fig:confusioninfractalarea} for examples of the confusion that we see when we are looking at a fractal area. We did not extend the algorithm with proper variational training, but a 'fake' version of it, with a linearly declining $\sigma$ and a strategically chosen starting point gave us some promising signs. In \cref{fig:chilling_on_ridge}, this is implemented, and it lets us stay within the bounds of the ridge. We would need to implement this properly to make any conclusions.

\subsection{Stopping Criterion}
If a measure like the above were added, we could use it as a meaningful stopping criterion as well. Once $\sigma$ is on the order of \num{1e-4} in the 'position' dimension for example, the required precision of the associated maneuver is in the order of tenths of a second. This is not really a reasonable sensitivity for an actual Moon mission. Thus, when we take reality into account, we see that we can't really use solutions that are too granular. What we are looking for are patches of adjacent good solutions at a large enough scale that they allow \emph{some} flexibility in terms of when the maneuver is begun and how hard we burn.

\subsubsection{Ballpark Numbers for Realistic Precision Cutoff}
The circular orbit angular speed is given by
\begin{equation}
    \omega = \sqrt{\frac{\mu}{(R_\Earth + h)^3}}
\end{equation}
where $\mu = G M_\Earth$ and $h$ is the altitude above Earth's surface.

We will now assume that we can accurately control the burn start and stop time to a precision of order 1 second; 0.1 s seems too precise and 10 s seems too sloppy. This ``reaction time'' in turn gives us an uncertainty of angular position of:
\begin{equation}
    \Delta t = \omega \cdot 1 s = \sqrt{\frac{\mu}{(R_\Earth + \SI{160}{\km})^3}} \cdot \SI{1}{\second} = 0.001196 \ \text{rad}
\end{equation}
Thus, we cannot expect to be able to replicate a set of starting conditions that are sensitive to imprecision on the third or fourth decimal point.

\section{Performance Optimization}
Computing performance ended up representing a large portion of our efforts in this project, perhaps even more that we anticipated, and the tradeoff between code readability and performance was drawn in stark relief. We used several tools to make things easier: Initially, we wanted to get the parallelism 'for free' by using PaGMO to handle our multi-threading and use Numba to compile our python scripts. Seemed like a good idea; that's what the respective tools are made for. However, while Numba definitely gave fantastic performance increases over normal python (200-300 times faster), it was not enough. And while PaGMO worked fine (after some work getting it running at all), it only parallelized to CPUs, and had an unacceptable startup overhead that made rapid prototyping (one of the main draws of python) tedious to say the least.

We had to apply the adage of \textit{"if you want something done right, do it yourself"}, and implement these things by hand, with a C implementation of the integrator, and a CUDA interface for parallelization. This of course also meant redesigning the otherwise simple ES algorithm to fit the much less sophisticated data types that graphics cards work with. It was easily worth the effort. This new iteration of the program completes four orders of magnitude more fitness evaluations in roughly the same time, compared to its predecessor. It makes it reasonable to get results with \textit{some} confidence that the problem space is significantly explored.

More performance would be nice, and definitely achievable, but we have hit a point of diminishing returns on further effort in this regard. The obvious possible improvements would be to reduce the number of variables that we save in the core integrator loop: We use 96 registers per parallel evaluation, which means that the card is memory capped at 25\% capacity. We could realistically expect a doubling in performance if we refactored the C integrator with this in mind. Again, we didn't bother with this, since the current speed is \textit{good enough}.

\section{Self-evaluation}
Was our time well spent? Did we gain anything from our "reinventing the wheel", re-implementing the lunar simulator? Should we have focused on running on the old code without delving into it?

If we could go back in time to the start of the project, and counsel our past selves, we would tell ourselves to not underestimate the complexity of scaling the moon-problem to 3D. We should break that monolithic problem into smaller problems instead, something that would have let us attack three separate 2D problems with some handover logic instead. Especially, we should have admitted to ourselves earlier that there is not much interesting optimization to do on the long deep space section of the trajectory, and that any LETO magic will happen very close to Mars. This is a case of difference in scale becoming a difference in kind between having the moon and mars as your target. The distance is so great between Earth and Mars that LETOs of the Earth-Moon kind---where we go back and forth between the two bodies repeatedly---make the mission utterly uninteresting because the trip time would be decades or centuries. For LETOs to the the Moon mission case, we get tip times of weeks or months, which is fine if the mission is unmanned. In a Mars mission, it takes a travel time of months and turns it into decades or centuries. At that scale, whatever technology you are sending up will be antiquated by the time it arrives. We simply do not see a reasonable use-case for a supply mission that takes a hundred years to arrive. The literature also supports this indirectly; we have not been able to find any literature that tries to optimize on the fundamental shape of the Hohmann transfer. On the contrary, we have learned since the inception of this project that all the interesting optimizations happen within a couple million kilometers of Mars as we also learned towards the end from \cite{Topputo2014}.


Our approach to adaptive refinement in CASTRO uses a nested
hierarchy of logically-rectangular grids with simultaneous refinement
of the grids in both space and time.  The integration algorithm on the grid hierarchy
is a recursive procedure in which coarse grids are advanced in time,
fine grids are advanced multiple steps to reach the same time
as the coarse grids and the data at different levels are then synchronized.

During the regridding step, increasingly finer grids
are recursively embedded in coarse grids until the solution is
sufficiently resolved.  An error estimation procedure based on
user-specified criteria evaluates where additional refinement is needed
and grid generation procedures dynamically create or
remove rectangular fine grid patches as resolution requirements change.

A good introduction to the style of AMR used here is in Lecture 1
of the Adaptive Mesh Refinement Short Course at
https://ccse.lbl.gov/people/jbb/index.html

\section{Synchronization Algorithm}

Here is the AMR algorithm for the compressible equations with
self-gravity.  The gravity component of the algorithm
is closely related to (but not identical to) that in Miniati and Colella,
JCP, 2007 (in press).

Over a coarse grid time step
we collect flux register information for the hyperbolic part of the synchronization:
\begin{equation}
\delta\Fb = -\Delta t_c A^c F^c + \sum \Delta t_f A^f F^f
\end{equation}
Analogously, at the end of a coarse grid time step
we store the mismatch in normal gradients of $\phi$ at the coarse-fine interface:
\begin{equation}
\delta F_\phi =  - A^c \frac{\partial \phi^c}{\partial n}
+ \sum A^f \frac{\partial \phi^f}{\partial n}
\end{equation}
Because we want the composite $\phi^{c-f}$ to satisfy the multilevel version of  (\ref{eq:Self Gravity}) at each time $t^n$, we do not accumulate $\frac{\partial \phi^f}{\partial n}$ over time, rather we add coarse and fine fluxes only at integer coarse times.

At the end of a coarse grid time step we can define
${\overline{\Ub}}^{c-f}$ and $\overline{\phi}^{c-f}$
as the composite of the data from coarse and fine grids as a provisional solution at
time $n+1$. (Assume $\overline{\Ub}$ has been averaged down so that the data on coarse cells
underlying fine cells is the average of the fine cell data above it.)

The synchronization consists of two parts:

\begin{itemize}
\item Step 1:  Hyperbolic reflux

In the hyperbolic reflux step, we update the conserved variables with the flux synchronization
and adjust the gravitational terms to reflect the changes in $\rho$ and $\ub$.
\begin{equation}
{\Ub}^{c, \star} = \overline{\Ub}^{c} + \frac{\delta\Fb}{V},
\end{equation}
where $V$ is the volume of the cell and the correction from $\delta\Fb$ is supported only on coarse cells adjacent to fine grids.

\item Step 2:  Gravitational synchronization

In this step we correct for the mismatch in normal derivative in $\phi^{c-f}$ at the coarse-fine
interface, as well as accounting for the changes in source terms for $(\rho \ub)$
and $(\rho E)$ due to the change in $\rho.$

On the coarse grid only, we define
\begin{equation}
(\delta \rho)^{c} =  \rho^{c, \star} - {\overline{\rho}}^{c}  .
\end{equation}

We then form the composite residual, which is composed of two contributions.
The first is the degree to which the current $ \overline{\phi}^{c-f}$
does not satisfy the original equation on a composite grid (since we have solved for
$\overline{\phi}^{c-f}$ separately on the coarse and fine levels).  The second
is the response of $\phi$ to the change in $\rho.$
We define
\begin{equation} R \equiv  - 4 \pi G \rho^{\star,c-f} - \Delta^{c-f} \; \overline{\phi}^{c-f}
= - 4 \pi G (\delta \rho)^c - (\nabla \cdot \delta F_\phi ) |_c   .
\end{equation}

Then we solve
\begin{equation}
 \Delta^{c-f} \; \delta \phi^{c-f} = R
\label{eq:gravsync}
\end{equation}
as a two level solve at the coarse and fine levels.
We define the update to gravity,
\begin{equation}
\delta {\bf g}^{c-f} = \nabla (\delta \phi^{c-f})  .
\end{equation}

Define the \sync sources for momentum on the coarse and fine, $S^{\sync,c}_{\rho \ub}$, and
$S^{\sync,f}_{\rho \ub}$, respectively as follows:
\begin{eqnarray}
S^{\sync,c}_{\rho \ub} &=& \left(
        \overline{\rho}^c + (\delta \rho)^c \right) ({\bf g}^{c,n+1} + \delta {\bf g}^{c-f}) -
        \overline{\rho}^c                 \; {\bf g}^{c,n+1} \nonumber \\
           &=& \left[( \delta \rho)^c {\bf g}^{c,n+1} +
                \rho^{c,\star} \delta {\bf g}^c)  \right ] \\
S^{\sync,f}_{\rho \ub} &=& \overline{\rho}^{f} \; \delta {\bf g}^f  .
\end{eqnarray}
These momentum sources lead to the following energy sources:
\begin{eqnarray}
S^{\sync,c}_{\rho E} &=& S^{\sync,c}_{\rho \ub} \cdot
         \left(   \overline{\ub}^{c,n+1} + S^{\sync,c}_{\rho \ub} \Delta t_c / (2 \overline{\rho}^{c,n+1}) \right) \\
S^{\sync,f}_{\rho E} &=& S^{\sync,f}_{\rho \ub} \cdot
         \left(
    \overline{\ub}^{f} + S^{\sync,f}_{\rho \ub} \Delta t_f / (2 \; \overline{\rho}^{f} )
         \right)
\end{eqnarray}

The coarse and fine level state is updated using:
\begin{eqnarray}
(\rho \ub)^{c,n+1} =  (\rho \ub)^{c, \star } + \myhalf \Delta t_c S^{\sync,c}_{\rho \ub} ,&&
(\rho \ub)^{f,n+1} =  (\overline{\rho \ub})^{f} + \myhalf \Delta t_f S^{\sync,f}_{\rho \ub},  \\
(\rho E)^{c,n+1} =  (\rho E)^{c, \star } + \myhalf \Delta t_c S^{\sync,c}_{\rho E} ,&&
(\rho E)^{f,n+1} =  (\overline{\rho E})^{f} + \myhalf \Delta t_f S^{\sync,f}_{\rho E}  .
\end{eqnarray}
As the final component of this step we need to
\begin{itemize}
\item add $\delta \phi^{c-f}$ directly to
to $\phi^{c}$ and $\phi^{f}$ and interpolate $\delta \phi^{c-f}$ to any finer
levels and add to the current $\phi$ at those levels.

\item if level $c$ is not the coarsest level in the calculation, then we must transmit the
effect of this change in $\phi$ to the coarser levels by updating the flux register between
level $c$ and the next coarser level, $cc.$ In particular, we set
\begin{equation}
\delta {F_\phi}^{cc-c} = \delta F_\phi^{cc-c}
+ \sum A^c \frac{\partial (\delta \phi)^{c-f}}{\partial n}  .
\end{equation}
\end{itemize}

\end{itemize}


\section{Floquet Conductivity in Landau Levels}

Now we can derive conductivity expression for a given Landau level using Floquet conductivity expression derived in [*Ref:my report 2.488]. Before that let's consider the inverse scattering time matrix element in the previous section. From Eq. \eqref{5.3} we can express the $N$th Landau level's inverse scattering time central element ($n=n'=0$) as
\begin{equation} \label{6.1}
  \begin{aligned}
    \qty(\frac{1}{\tau(\varepsilon,k_x)})^{00}_{N} =
    \frac { N_{imp}^2 A^2 \hbar V_{imp}}{16\pi^4 \qty(eB)^2}
    \delta(\varepsilon - \varepsilon_{N}) &
    \int_{-\infty}^{\infty} d {k'}_x \;
    J_0^2\qty(\frac{g\hbar}{eB}[{k}_x - {k'}_x])
    \\
    & \times
    \qty|
    \int_{-\infty}^{\infty} d\bar{k} \;
    {\chi}_{N}\qty(\frac{\hbar}{eB}\bar{k})
    {\chi}_{N}\qty(\frac{\hbar}{eB} \qty[{k'}_x - {k}_x - \bar{k}])|^2.
  \end{aligned}
\end{equation}
Now we can introduce a new parameter with physical meaning of scatterin-induced broading of the Landau level as follows
\begin{equation} \label{6.2}
  \Gamma^{00}_{N}(\varepsilon,k_x) \equiv \hbar \qty(\frac{1}{\tau(\varepsilon,k_x)})^{00}_{N}
\end{equation}
and this modify our previous expressing as
\begin{equation} \label{6.3}
  \begin{aligned}
    \Gamma^{00}_{N}(\varepsilon,k_x)  =
    \frac { N_{imp}^2 A^2 \hbar V_{imp}}{16\pi^4 \qty(eB)^2}
    \delta(\varepsilon - \varepsilon_{N}) &
    \int_{-\infty}^{\infty} d {k'}_x \;
    J_0^2\qty(\frac{g\hbar}{eB}[{k}_x - {k'}_x])
    \\
    & \times
    \qty|
    \int_{-\infty}^{\infty} d\bar{k} \;
    {\chi}_{N}\qty(\frac{\hbar}{eB}\bar{k})
    {\chi}_{N}\qty(\frac{\hbar}{eB} \qty[{k'}_x - {k}_x - \bar{k}])|^2.
  \end{aligned}
\end{equation}
In addition, for the case of elastic scattering within the same Landau level, one can present the delta distribution of the energy using the same physical interpretation as follows
\begin{equation} \label{6.4}
  \delta(\varepsilon - \varepsilon_{N}) \approx
  \frac{1}{\pi \Gamma^{00}_{N}(\varepsilon,k_x)}
\end{equation}
and this leads to
\begin{equation} \label{6.5}
  \begin{aligned}
    \qty[\Gamma^{00}_{N}(\varepsilon,k_x)]^2  =
    \frac { N_{imp}^2 A^2 \hbar V_{imp}}{16\pi^5 \qty(eB)^2}
    \int_{-\infty}^{\infty} d {k'}_x \;
    J_0^2\qty(\frac{g\hbar}{eB}[{k}_x - {k'}_x])
    \qty|
    \int_{-\infty}^{\infty} d\bar{k} \;
    {\chi}_{N}\qty(\frac{\hbar}{eB}\bar{k})
    {\chi}_{N}\qty(\frac{\hbar}{eB} \qty[{k'}_x - {k}_x - \bar{k}])|^2.
  \end{aligned}
\end{equation}
and
\begin{equation} \label{6.6}
  \begin{aligned}
    \Gamma^{00}_{N}(\varepsilon,k_x)  =
    \qty[
    \frac { N_{imp}^2 A^2 \hbar V_{imp}}{16\pi^5 \qty(eB)^2}
    \int_{-\infty}^{\infty} d {k'}_x \;
    J_0^2\qty(\frac{g\hbar}{eB}[{k}_x - {k'}_x])
    \qty|
    \int_{-\infty}^{\infty} d\bar{k} \;
    {\chi}_{N}\qty(\frac{\hbar}{eB}\bar{k})
    {\chi}_{N}\qty(\frac{\hbar}{eB} \qty[{k'}_x - {k}_x - \bar{k}])|^2
    ]^{-1/2}.
  \end{aligned}
\end{equation}
Using the numerical calculations we can see that the above integral is does not depend on the value of $k_x$ and we can choose any values for $k_x$. Therefore applying $k_x =0$ and letting $k'_x \rightarrow k_1,\bar{k}\rightarrow k_2$ we can modify our equation as
\begin{equation} \label{6.7}
  \begin{aligned}
    \Gamma^{00}_{N}(\varepsilon,k_x)  =
    \qty[
    \frac { N_{imp}^2 A^2 \hbar V_{imp}}{16\pi^5 \qty(eB)^2}
    \int_{-\infty}^{\infty} d k_1\;
    J_0^2\qty(\frac{g\hbar}{eB} k_1)
    \qty|
    \int_{-\infty}^{\infty} dk_2 \;
    {\chi}_{N}\qty(\frac{\hbar}{eB} k_2)
    {\chi}_{N}\qty(\frac{\hbar}{eB} \qty[k_1 - k_2])|^2
    ]^{-1/2}.
  \end{aligned}
\end{equation}

\noindent
Now we can compare the central element of energy level broading for each Landau level using normalized Landau energy broading(inverse scattering time) against applied dressing field's electric field's amplitude ($E$) as follows
\begin{equation} \label{6.8}
    \Lambda^{00}_{N} \equiv
    \frac{\Gamma^{00}_{N}(\varepsilon,k_x)}
    {\Gamma^{00}_{N}(\varepsilon,k_x)\big|_{E=0}}.
\end{equation}
As you can see in the Fig. \ref{fig6.1}, when the applied dressing field's intensity is increasing the broading of the Landau energy level decreasing. The effect of this decreasing is depend on the considering Landau level and for higher the level lower the effect.
\begin{figure}[ht!]
  \centering
  \includegraphics[scale=0.5]{figures/fig04.pdf}
  \caption{Normalized broading of Landau levels agaist dressing fileds amplitude. Red line represents $N=0$, blue line represents $N=1$, green line represents $N=2$ and purplr color line represents $N=3$ Landau levels.}
  \label{fig6.1}
\end{figure}

\noindent
Then we can use Floquet conductivity expression derived in [*Ref:my report 2.488] as follows
\begin{equation} \label{6.9}
  \begin{aligned}
    \lim_{\omega \to 0}
    \text{Re}[{\sigma}^{xx}(0,\omega)] &=
    \frac{-1}{4\pi\hbar A}
    \int_{\lambda-\hbar\Omega/2}^{\lambda+ \hbar\Omega/2} d\varepsilon
    \bigg(
    -\frac{\partial f}{\partial \varepsilon} \bigg)
    \frac{1}{A}\sum_{\mb{k}} \\
    & \times
    \sum_{s,s'=-\infty}^{\infty}
    {j}^x_s(\mb{k}){j}^x_{s'}(\mb{k})
    \tr_s \big[
    \big(
    \mb{G}^{r}_0 (\varepsilon;\mb{k}) - \mb{G}^{a}_0 (\varepsilon;\mb{k})
    \big)
    \odot_s
    \big(
    \mb{G}^{r}_0 (\varepsilon;\mb{k}) - \mb{G}^{a}_0 (\varepsilon;\mb{k})
    \big)
    \big].
  \end{aligned}
\end{equation}
However, in this case we are consider only $x$ directional momentum as a quantum number to seperate different states and let $\lambda = \varepsilon_N$. In addition, with the current operator derivation IF we get component values only for $s=s'=0$ our conductivity rquation will be modified to
\begin{equation} \label{6.10}
  \begin{aligned}
    \lim_{\omega \to 0}
    \text{Re}[{\sigma}^{xx}(0,\omega)] &=
    \frac{-1}{4\pi\hbar A}
    \int_{\varepsilon_N - \hbar\Omega/2}^{\varepsilon_N + \hbar\Omega/2} d\varepsilon
    \bigg(
    -\frac{\partial f}{\partial \varepsilon} \bigg)
    \frac{1}{L_x}\sum_{{k_x}}
    \qty[{j}^x_0({k_x})]^2
    \\
    & \times
    \tr \big[
    \big(
    \mb{G}^{r}_0 (\varepsilon;{k_x}) - \mb{G}^{a}_0 (\varepsilon;{k_x})
    \big)
    \big(
    \mb{G}^{r}_0 (\varepsilon;{k_x}) - \mb{G}^{a}_0 (\varepsilon;{k_x})
    \big)
    \big].
  \end{aligned}
\end{equation}
Now we can expand the above expressing using unitary transformation
\begin{equation} \label{6.11}
    \qty(\mb{T})_{\alpha}^{nn'} \equiv \ket*{\phi_{\alpha}^{n+n'}}
\end{equation}
where
\begin{equation} \label{6.12}
    \ket{\phi_{\alpha}(t)} = \sum_{n = - \infty}^{\infty} e^{-in\omega t}
    \ket{\phi_{\alpha}^{n}}.
\end{equation}
Therefore our conductivity equation becomes
\begin{equation} \label{6.13}
  \begin{aligned}
    \lim_{\omega \to 0}
    \text{Re}[{\sigma}^{xx}(0,\omega)] &=
    \frac{-1}{4\pi\hbar A}
    \int_{\varepsilon_N - \hbar\Omega/2}^{\varepsilon_N + \hbar\Omega/2} d\varepsilon
    \bigg(
    -\frac{\partial f}{\partial \varepsilon} \bigg)
    \frac{1}{L_x}\sum_{{k_x}}
    \qty[{j}^x_0({k_x})]^2
    \\
    & \times
    \qty[
    \mb{T}^{\dagger}(k_x)
    \big(
    \mb{G}^{r}_0 (\varepsilon;{k_x}) - \mb{G}^{a}_0 (\varepsilon;{k_x})
    \big)
    \mb{T})(k_x)
    ]^2_{00}.
  \end{aligned}
\end{equation}
As derived in [*Ref:my report 2.547] we can present this matrix multiplication result as follows
\begin{equation} \label{6.14}
  \begin{aligned}
    \qty[
    \mb{T}^{\dagger}(k_x)
    \big(
    \mb{G}^{r}_0 (\varepsilon;{k_x}) - \mb{G}^{a}_0 (\varepsilon;{k_x})
    \big)
    \mb{T})(k_x)
    ]^2_{00} &
    \approx
    \qty[
    \mb{T}^{\dagger}(k_x)
    \big(
    \mb{G}^{r}_0 (\varepsilon;{k_x})\mb{G}^{a}_0 (\varepsilon;{k_x})
    \big)
    \mb{T})(k_x)
    ]_{00} \\
    & =
    \frac{-1}
    {
      \qty(\frac{\varepsilon}{\hbar} - \frac{\varepsilon_N}{\hbar})^2
      +
      \qty(\frac{\Gamma^{00}_{N}(\varepsilon,k_x)}{2\hbar})^2
    }
  \end{aligned}
\end{equation}
and this can be more simplified as
\begin{equation} \label{6.15}
  \begin{aligned}
    \qty[
    \mb{T}^{\dagger}(k_x)
    \big(
    \mb{G}^{r}_0 (\varepsilon;{k_x}) - \mb{G}^{a}_0 (\varepsilon;{k_x})
    \big)
    \mb{T})(k_x)
    ]^2_{00} =
    \frac{-\hbar^2}
    {\qty[\Gamma^{00}_{N}(\varepsilon,k_x)]^2}
    \qty[
      1 +
      \qty(\frac{{\varepsilon}-{\varepsilon_N}}{\Gamma^{00}_{N}(\varepsilon,k_x)/2})^2
    ]^{-1}.
  \end{aligned}
\end{equation}
Since the squared termed in the square brackets goinf to zero with valid conditions we can use binomial approximation for the square bracket term and get the following derivation
\begin{equation} \label{6.16}
  \begin{aligned}
    \qty[
    \mb{T}^{\dagger}(k_x)
    \big(
    \mb{G}^{r}_0 (\varepsilon;{k_x}) - \mb{G}^{a}_0 (\varepsilon;{k_x})
    \big)
    \mb{T})(k_x)
    ]^2_{00} =
    \frac{-\hbar^2}
    {\qty[\Gamma^{00}_{N}(\varepsilon,k_x)]^2}
    \qty[
      1 -
      4\qty(\frac{{\varepsilon}-{\varepsilon_N}}{\Gamma^{00}_{N}(\varepsilon,k_x)})^2
    ]
  \end{aligned}
\end{equation}

\noindent
Now the conductivity expression get modify as
\begin{equation} \label{6.17}
  \begin{aligned}
    \lim_{\omega \to 0}
    \text{Re}[{\sigma}^{xx}(0,\omega)] =
    \frac{\hbar}{4\pi A L_x}
    \int_{\varepsilon_N - \hbar\Omega/2}^{\varepsilon_N + \hbar\Omega/2} d\varepsilon
    \bigg(
    -\frac{\partial f}{\partial \varepsilon} \bigg)
    \sum_{{k_x}}
    \qty[{j}^x_0({k_x})]^2
    \frac{\hbar^2}
    {\qty[\Gamma^{00}_{N}(\varepsilon,k_x)]^2}
    \qty[
      1 -
      4\qty(\frac{{\varepsilon}-{\varepsilon_N}}{\Gamma^{00}_{N}(\varepsilon,k_x)})^2
    ]
  \end{aligned}
\end{equation}

\noindent
Then assuming we are considering fermions in aero temperature for this scenario we can describe the particle distribution function using the Fermi-Dirac distribution in zero-tempurature.
\begin{equation} \label{6.18}
    -\frac{\partial f}{\partial \varepsilon} = \delta(\varepsilon_F - \varepsilon)
\end{equation}
where $\varepsilon_F$ represent the Fermi energy for the considered material.

\noindent
With this approximation we can derive that
\begin{equation} \label{6.19}
  \begin{aligned}
    \lim_{\omega \to 0}
    \text{Re}[{\sigma}^{xx}(0,\omega)] =
    \frac{\hbar}{4\pi A L_x}
    \int_{\varepsilon_N - \hbar\Omega/2}^{\varepsilon_N + \hbar\Omega/2} d\varepsilon
    \delta(\varepsilon_F - \varepsilon)
    \sum_{{k_x}}
    \qty[{j}^x_0({k_x})]^2
    \frac{\hbar^2}
    {\qty[\Gamma^{00}_{N}(\varepsilon,k_x)]^2}
    \qty[
      1 -
      4\qty(\frac{{\varepsilon}-{\varepsilon_N}}{\Gamma^{00}_{N}(\varepsilon,k_x)})^2
    ]
  \end{aligned}
\end{equation}
and
\begin{equation} \label{6.20}
  \begin{aligned}
    \lim_{\omega \to 0}
    \text{Re}[{\sigma}^{xx}(0,\omega)] =
    \frac{\hbar}{4\pi A L_x}
    \sum_{{k_x}}
    \qty[{j}^x_0({k_x})]^2
    \frac{\hbar^2}
    {\qty[\Gamma^{00}_{N}(\varepsilon_F,k_x)]^2}
    \qty[
      1 -
      4\qty(\frac{{\varepsilon_F}-{\varepsilon_N}}{\Gamma^{00}_{N}(\varepsilon_F,k_x)})^2
    ]
  \end{aligned}
\end{equation}

\hfill$\blacksquare$