%!TeX root = brillouin_pulse_math
\documentclass[paper.tex]{subfiles}
\begin{document}

\section{Dispersion Timothy and the Brillouin Precursors}

Uzunoglu \cite{Theoretical2020} mention a handy way to circumvent the lossy-flesh problem: the Brillouin and Sommerfeld precursors\footnotemark, and pulse or wavepacket dispersion in tissues in general. The original text of these papers are in German; translations can be found in Léon Brillouin's 1960 book\cite{Wave1960} on the topic.

\footnotetext{"precursor" is perhaps a misnomer when single pulses are used rather than trapezoidally-modulated tones - Oughston and Najafabadi both call these \textit{Brillouin pulses}.\\ \cite{Optimal2015} \cite{Optimal2017} \cite{Heat2010}.}

These are fascinating structures somewhat similar to solitons, which arise as a result of an interplay between two aspects (Albanese
\cite{Shortrisetime1989}):

\begin{itemize}
	\item The highly dispersive nature of tissue (the variation in speed of light with frequency), which causes a peculiar distortion of short pulses (which necessarily have a broadband spectral content).
	\item The variation in loss (the imaginary part of the complex permittivity and the penetration depth) versus frequency. \wikinote{add image from that mathematica code}
\end{itemize}

A third aspect leads to the formation of the prototypical Brillouin precursor specifically: any sharp
beginning or end of a tone, or other sharply defined structure in a waveform, includes harmonics beyond the tone's carrier wave up to the rise time\wikinote{add image}.

The aspect that makes the precursors useful is that they sidestep Bragg's Law decay, with an amplitude that decays as $1/\sqrt{z}$ rather than $e^{-z}$. Note that Bragg's law is still strictly obeyed in the frequency domain (excepting second-order "bleaching" (Lukofsky \cite{Can}) or induced transparency-like (\cite{Electromagnetically1997}) effects).

Based on Yang's inactivation thresholds, for instance, at 9 GHz, assuming that a torso is about 10 penetration depths in radius and the hypothetical Brillouin train drives the virus equally effectively as a pure sine, implementing a precursor would decrease the field required at the skin to a perfectly practicable 1 kV/m, rather than an air-ionizing 6.6 MV/m ($\frac{1}{\sqrt{10}}=0.316$ versus $e^{-10}=4.5e^{-5}$).

Precursors have been used in practice, by Ong \cite{Detection2003}\footnote{Well, Ong don't really observe the precursor itself directly, it seems.} using simple square waves to detect respiration\footnotemark, Ossberger \cite{Noninvasive2004} for the same purpose; and various techniques for tumor detection.\footnote{TODO: Also another really good paper that I can't find}

While it is clearly possible to produce this abnormal penetration (any sharp edge sufficiently distant from suffices to provoke dispersive distortion), it was not obvious to us that a waveform could be constructed that would be an effective driver for the 10 GHz normal modes in question.

First, if dispersive pulses are too close together, they interfere as they propagate and diminish the precursor thus formed \cite{Dynamical2005}.

As an example, despite the waveform from nonlinear transmission lines\cite{NLTL6275} producing strong wideband components, in cursory simulations they did not appear to satisfy the requirements for usable Brillouin pulses\wikinote{dubious-discuss}\wikinote{citation-needed}. Our working hypothesis is that this is because of destructive interference from the falling edge that immediately follows; but this is mere speculation.\wikinote{dubious-discuss}

Second, and most critically, while the pulse amplitude decays slowly, the total energy contained in such a precursor decays very quickly. The biological ramifications of this are discussed in detail by Adair in \cite{Biophysics2000}.

%temporal Soliton-producing nonlinear transmission lines, and NLTL oscillators constructed therefrom, particularly well suited
%
%At a depth of 8 cm in Cole-Cole muscle, an 8 GHz resonance, attack pattern alpha appears to achieve 4 picometers of oscillation amplitude, rather than 0.01 picometers with $\sin(t\ \omega_{resonance})$. The sharp edges are at approx. 250 GHz.

Dispersive pulse propagation is easily modelled by a Fourier transform, propagation, and an inverse fourier transform (see Franzen \cite{Wideband1999}, see also \cite{Comments1993} and \cite{Shortrisetime1989})\footnote{implemented in\ghfile{/home/arthurdent/Projects/covidinator/electronics/propagation/propagation_numerical_optimize.py}} \footnote{This isn't truly a transient process, of course - the fourier integral is still periodic, wrapping around the window; it's just more transient than a steady-state}.

The loss and refractive index can be obtained from a four term Cole-Cole model\cite{gabriel1996compilation}\footnote{implemented in\ghfile{/electronics/simple_fdtd/fdtd_PCB_extensions/fdtd_PCB_extensions/tissue.py}}. We used parameters from the IT.IS Foundation tissue database\cite{Tissue2018a}. IT.IS Foundation computational phantom 'duke V3.0' was used, \cite{Duke2014}.

%http://web.physics.ucsb.edu/~fratus/phys103/LN/DHM.pdf
% section on Greens functions
% and also
% and
% https://www.int.washington.edu/users/dbkaplan/228_01/green.pdf

\pagebreak
A qualitative statement of the problem we were trying to solve (which may not a useful formulation, especially if Q turns out to be < 1 and the virus exhibits only relaxational and non-resonant behavior):

\begin{toolchain}
An arbitrary waveform propagates through a dispersive, lossy medium with a certain analytic complex
permittivity.

It then drives a damped harmonic oscillator that is initially at rest.\\

What waveform produces the peak transient amplitude on the oscillator?
\end{toolchain}

Each problem has been solved separately. There are some nearly equivalent but not mathematically identical formulations for optimal control of quantum systems with dispersion.\footnotemark However, in the classical domain, this appears to be unprecedented in the literature.

\footnotetext{While not strictly related, \cite{Wavepacket1989} tune a light pulse to match the wavefunction of the desired chemical products in a photo-reaction, which is just pretty darned awesome}

Optimal pulses for several situations in Debye and Lorentz media have been determined by Oughstun's asymptotic method, which appears to be highly satisfactory in terms of physical intution, and also avoids truncation issues that befall fourier-transform techniques. In general, these optimal pulses are simple gaussian monopulses or higher-order gaussian derivatives \cite{Optimal2017} \cite{Optimal2015}.

Macke \cite{Simple2012} have come up with a number of analytic dispersion representations for various signals, such as chirped gaussian pulses; however, as it turns out, it was important that we not constrain ourselves to parameterized shapes.

\subsection{Analytic techniques}

\begin{fquote}[Wait][ \cite{Propagation1965}]
	In such cases, it may be feasible to evaluate the integral by a purely numerical procedure. With the wide availability of the digital computer, this is certainly fashionable at the moment. Consequently, one might say that the problem has been solved and no further discussion is needed. \\

	However, it would be a pity if one accepted this answer since all physical insight into the nature of transient processes has been ignored.
\end{fquote}

\begin{autem}
	autem:
Reflection from tissue interfaces?

Thermal noise will kick the oscillator around; it won't necessarily start at rest. Will this affect the
\end{autem}

One might suggest try to find the optimal transient solution first, and then try to build an input waveform deconvolved through the  transfer function of the tissue. This hardly seems liable to produce a truly optimal solution, however.

Also, this seems similar to a pulse propagating through the tissue's Cole medium and then dissipating the maximum power in a uniform Lorentz medium, which might be another route to attacking it.

Another route might be to set up two ODEs for the wave equation and the oscillator and solve them simultaneously.

\footnote{Progress was hindered by the number of conventions for Fourier normalization. It's all well and good for the signal processing specialists to make all sorts of excuses about brevity, but when crossing fields it's pretty annoying for such a fundamental concept to be so loosely defined. On the same topic, can we finally settle the i vs. j convention, and the choice of reduced units in molecular dynamics?}

%\printendnotes

\subsubsection{Attempt at analytical solution: Zhu et al 's dispersive waveform optimization propagation formulation}

We apologize in advance for the desecration of mathematics in this section.

The most promising analytical technique explored was a slight modification of a formulation for optimal-energy pulses, largely supplied by Prof. Costas Sarris in a yet-unpublished personal communication, based on Zhu, Hum, Costas formulation in \cite{Microwave2012b}, previously discussed by Pozar \cite{Waveform2003}.

This is based on lagrange multipliers and 'functional' or 'variational' calculus\cite{Methods1989}.

Here, rather than taking the derivative with respect to a small change in a variable, we take the derivative with respect to a small change in the function itself - a very useful technique \footnote{that the author was not aware of!} which imposes little to no limitation on the form of the solution. For some intuition, the definition of the first variation and the Gateaux derivative may be of some use.\footnote{The complex conjugate in Sarris' formulation, $\nabla H() = H()^\star$, seems to come from \cite{Signal1969}, page 140 onwards; I cannot make heads or tails of his formulation. Pozar note that this complex conjugate arises from the concept of "adjointness".}

A common setup for such a problem is to use the Euler-Lagrange equation; this is usually brought up in the case of the Brachistochrone problem, or the Principle of Least Action \footnote{For background, see The Feynman Lectures, vol II chapter 19}. In these types of problems, it appears that the path of integration through space from endpoints a to b can be replaced by the whole frequency domain from -$\infty$ to +$\infty$.

$$ e_x(z,t) = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{+\infty}{F(\omega) e^{- j (\omega/c_0)n(\omega)z}\ e^{j\omega t} d\omega} $$

where $\int e^{j \omega t} d\omega$ is the inverse fourier transform. At this point, you could choose to perform a second integral over the time-domain Greens function solution to the harmonic oscillator\cite{Complex2020} - or straightforwardly integrate over the frequency-domain Greens function.

\footnote{Many symbolic math tools have support for functional calculus. However, neither Maxima, SageMath, Mathematica's VariationalD, Matlab's Fundiff, nor Maple's functionalDerivative seem to yield any meaningful result for grad xi.}\\

%$$W = \frac{1}{\eta_0} \int_{-\infty}^{+\infty}{(n_r(\omega))\ |F(\omega)|^2}\ d\omega$$\\
%
%Where $n(\omega)$ is a complex refractive index per Debye relaxation equation, $n_r()$ is the real part of the same, everything else is a real constant. Set up a functional with a lagrange multiplier\\
%
%$$\xi = -e_x(z,t) + \lambda W$$\\
%
%Take the functional ("variational") gradient with respect to $F(\omega)$.
%
%$$ \nabla \xi = -\frac{1}{\sqrt{2\pi}} \left(e^{- j (\omega/c_0)n(\omega)z}\right)^\star \  e^{-j\omega T} + \lambda...$$
%
%At this point, you could choose to perform a second integral over the time-domain Greens function solution to the harmonic oscillator\cite{Complex2020}, eq. 4 and 15,
%
%$$x(t) = \int_{-\infty}^{+\infty}{G(t,t')\ \frac{q\cdot e_x(z,t'))}{m}\ } dt'$$\\
%
%(eq. 15, for the underdamped case)
%
%$$G(t,t') = UnitStep(t-t') \frac{1}{\sqrt{\gamma^2-\omega_0^2}  }\sinh\left({\sqrt{\gamma^2-\omega_0^2}}\ (t-t')\right)$$
%
%But a much more straightforward
%
%Where * is the complex conjugate.\\

%
%Then set
%
%$$x(t) = \int_{-\infty}^{+\infty}{G(t,t')\ \frac{q\cdot e_x(z,t'))}{m}\ } dt'$$\\
%
%Anyhow, then modify the lagrange multiplier,
%
%$$\xi = -x(t) + \lambda W$$\\
%
%And now,
%
%$$\nabla \xi = 0$$

This lagrange multiplier technique has, however, a fundamental limitation (noted by Tufts \cite{Optimum1964}): for reasons that the author does not yet comprehend, only the pulse energy can be used as a constraint, rather than the value of the peak field. This seems to turn out to be of some importance.

\footnote{Note the ni specifically in the complex conjugate!}

\subsection{Laziness prevails; a return to numerical optimization}

Numerically solving optimal control problems using conjugate-gradient was noted by Lasdon \cite{conjugate1967} and
revisited by Kek \cite{Conjugate}. They reduce the computational workload by first computing the
gradient function by hand.

Using an energy constraint as above appears to tend towards a square step function or a sharp impulse, perhaps as a result of Pontryagin's maximum principle\cite{Optimum1964}.

\ghfile{electronics/propagation/propagation_numerical_optimize.py}

However, a maximum absolute value constraint appears to produce fantastic results.

\begin{figure}[H]
	%	\makebox[\textwidth][c]{
	\includesvg[width=\textwidth]{muscle_pulse_8cm_minimize_test1}
	\caption{}
\end{figure}

The (noisy) output of the optimization for z=0.08 m in muscle. The low-frequency component is believed to be due to the FFT window size. Increasing the window size with the same sample rate caused CG convergence to stall. However, it's interesting that this appears to result in a larger amplitude.

%\begin{figure}[H]
%	%	\makebox[\textwidth][c]{
%	\includesvg[width=\textwidth]{muscle_pulse_8cm_minimize_test2}
%	\caption{}
%\end{figure}

\begin{figure}[H]
	%	\makebox[\textwidth][c]{
	\includesvg[width=\textwidth]{propagated_waveforms_detail}
	\caption{\\
		Some input (left) and output (right) waves (without considering oscillator coupling) transmitted through 6 cm of muscle.\\
		X axis is time; Y axis is amplitude.\\
		(a) Gaussian monopulse with 16 ps FWHM.\\
		(b) Optimized 10 GHz sawtooth wave. Note the slight high-frequency ripple.\\ This has a frequency of approximately 1.5 GHz.\\
		(c) Prototypical precursor 10 GHz sine burst.\\
		(d) Continuous 10 GHz sine tone.
}
\end{figure}

\begin{figure}[H]
	%	\makebox[\textwidth][c]{
	\includesvg[width=\textwidth]{propagated_waveforms}
	\caption{The same four pulses plotted against depth (Y axis) and amplitude (Z axis)}
\end{figure}

Of course, 10x attenuation at 1 MV/m still takes us beyond safe levels at the skin. However, the loss that makes phased-array near-field focusing systems impractical at baseband is no longer as significant of a concern. A dispersive phased array with more than 10 elements may improve penetration further.

\end{document}


\documentclass[10pt,showpacs,preprintnumbers,footinbib,amsmath,amssymb,aps,prl,twocolumn,groupedaddress,superscriptaddress,showkeys]{revtex4-1}
\usepackage{graphicx}
\usepackage{dcolumn}
\usepackage{bm}
\usepackage[colorlinks=true,urlcolor=blue,citecolor=blue]{hyperref}
\usepackage{color}
\usepackage{listings}

\begin{document}

\title{Life  on Devaron, a forest planet with an ancient Jedi Temple.}

\author{S.~O.~Mebody}
\affiliation{Department of Procrastination, University of Akiva}
\author{A.~N.~Ybody}
\affiliation{Department of Odd Travels, University of Anoat}
\author{N.~O.~Body}
\affiliation{Department of Even Travels, University of Ambria}

\begin{abstract}
We present the first calculations for rodlike microswimmers from outer space.
\end{abstract}

\maketitle

\section{Introduction}
The aim of this project is to get familiar with various vector and matrix operations,
from dynamic memory allocation to the usage of programs in the library
package of the course.
For Fortran users memory handling and most matrix and vector operations
are included in the ANSI standard of Fortran 90/95. Array handling in Python is also rather trivial. For C++ user however,
there are several possible options. Two are listed here.

\begin{itemize}
  \item For this exercise we recommend that you make your own functions for dynamic memory allocation of a  vector and a matrix. You don't need to write a class for this operations.  Use then the  library package lib.cpp with its header file  lib.hpp for obtaining LU-decomposed matrices, solve linear equations etc.

  \item A very good and often recommended library for C++ handling of arrays is the library Armadillo, to be found at \url{arma.sourceforge.net}.  We will discuss the usage of this library during the lab sessions and lectures. Armadillo has also an interface to Lapack functions for solving systems of linear equations.
\end{itemize}

\noindent
Your program, whether it is written in C++, Python
or Fortran2008, should include
dynamic memory handling of matrices and vectors.

\section{Methods and algortihms}

Many important differential equations in  Science can be written as
linear second-order differential equations

\begin{equation*}
\frac{d^2y}{dx^2}+k^2(x)y = f(x),
\end{equation*}
where $f$ is normally called the inhomogeneous term and $k^2$ is a real function.

A classical equation from electromagnetism is Poisson's equation.
The electrostatic potential $\Phi$ is generated by a localized charge
distribution $\rho (\mathbf{r})$.   In three dimensions
it reads

\begin{equation*}
\nabla^2 \Phi = -4\pi \rho (\mathbf{r}).
\end{equation*}
With a spherically symmetric $\Phi$ and $\rho (\mathbf{r})$  the equations
simplifies to a one-dimensional equation in $r$, namely

\begin{equation*}
\frac{1}{r^2}\frac{d}{dr}\left(r^2\frac{d\Phi}{dr}\right) = -4\pi \rho(r),
\end{equation*}
which can be rewritten via a substitution $\Phi(r)= \phi(r)/r$ as

\begin{equation*}
\frac{d^2\phi}{dr^2}= -4\pi r\rho(r).
\end{equation*}
The inhomogeneous term $f$ or source term is given by the charge distribution
$\rho$  multiplied by $r$ and the constant $-4\pi$.

We will rewrite this equation by letting $\phi\rightarrow u$ and
$r\rightarrow x$.
The general one-dimensional Poisson equation reads then

\begin{equation*}
-u''(x) = f(x).
\end{equation*}

In this project we will solve the one-dimensional Poisson equation
with Dirichlet boundary conditions by rewriting it as a set of linear equations.

To be more explicit we will solve the equation

\begin{equation*}
-u''(x) = f(x), \hspace{0.5cm} x\in(0,1), \hspace{0.5cm} u(0) = u(1) = 0.
\end{equation*}
and we define the discretized approximation  to $u$ as $v_i$  with
grid points $x_i=ih$   in the interval from $x_0=0$ to $x_{n+1}=1$.
The step length or spacing is defined as $h=1/(n+1)$.
We have then the boundary conditions $v_0 = v_{n+1} = 0$.
We  approximate the second
derivative of $u$ with

\begin{equation*}
   -\frac{v_{i+1}+v_{i-1}-2v_i}{h^2} = f_i  \hspace{0.5cm} \mathrm{for} \hspace{0.1cm} i=1,\dots, n,
\end{equation*}
where $f_i=f(x_i)$.
We  can rewrite this equation as a linear set of equations of the form

\begin{equation*}
   \mathbf{A}\mathbf{v} = \tilde{\mathbf{b}},
\end{equation*}
where $\mathbf{A}$ is an $n\times n$  tridiagonal matrix which we rewrite as

\[
    \mathbf{A} = \begin{bmatrix}
                           2& -1& 0 &\dots   & \dots &0 \\
                           -1 & 2 & -1 &0 &\dots &\dots \\
                           0&-1 &2 & -1 & 0 & \dots \\
                           & \dots   & \dots &\dots   &\dots & \dots \\
                           0&\dots   &  &-1 &2& -1 \\
                           0&\dots    &  & 0  &-1 & 2 \\
                      \end{bmatrix},
\]
and $\tilde{b}_i=h^2f_i$.

In our case we will assume  that the source term is
$f(x) = 100e^{-10x}$, and keep the same interval and boundary
conditions. Then the above differential equation
has a closed-form  solution given by $u(x) = 1-(1-e^{-10})x-e^{-10x}$ (convince yourself that this is correct by inserting the
solution in the Poisson equation).  We will compare
our numerical solution with this result in the next exercise.

We can rewrite our matrix $\mathbf{A}$ in terms of one-dimensional vectors $a,b,c$
of length $1:n$.
Our linear equation reads

\[
    \mathbf{A} = \begin{bmatrix}
                           b_1& c_1 & 0 &\dots   & \dots &\dots \\
                           a_1 & b_2 & c_2 &\dots &\dots &\dots \\
                           & a_2 & b_3 & c_3 & \dots & \dots \\
                           & \dots   & \dots &\dots   &\dots & \dots \\
                           &   &  &a_{n-2}  &b_{n-1}& c_{n-1} \\
                           &    &  &   &a_{n-1} & b_n \\
                      \end{bmatrix}\begin{bmatrix}
                           v_1\\
                           v_2\\
                           \dots \\
                          \dots  \\
                          \dots \\
                           v_n\\
                      \end{bmatrix}
  =\begin{bmatrix}
                           \tilde{b}_1\\
                           \tilde{b}_2\\
                           \dots \\
                           \dots \\
                          \dots \\
                           \tilde{b}_n\\
                      \end{bmatrix}.
\]
We can compute the relative error  in the data set $i=1,\dots, n$,by setting up

\[
   \epsilon_i=log_{10}\left(\left|\frac{v_i-u_i}
                 {u_i}\right|\right),
\]
as function of $log_{10}(h)$ for the function values $u_i$ and $v_i$.
For each step length extract the max value of the relative error.
Try to increase $n$ to $n=10^7$.  Make a table of the results and
comment your results. You can use either the algorithm from b) or c).

To compute the elapsed time in c++ you can use the following statements
\begin{lstlisting}
...
#include "time.h"   //  you have to include the time.h header
int main()
{
    // declarations of variables
    ...
    clock_t start, finish;  //  declare start and final time
    start = clock();
    // your code is here, do something and then get final time
    finish = clock();
    ( (finish - start)/CLOCKS_PER_SEC );
...
\end{lstlisting}

\section{Our results}

We present our results in Fig.~\ref{fig:figure1}.

\begin{figure} \label{fig:figure1}
%\includegraphics[scale=0.4]{figure1.pdf}
\caption{Our results could not be better}
\end{figure}

\section{Conclusions and perspectives}
What a wonderful world!

\begin{thebibliography}{99}
\bibitem{heisenberg} W. Heisenberg, Zeits. f. Physik {\bf 77}, 1 (1932).
\bibitem{miller2006} G.~A.~Miller, A.~K.~Opper, and E.~J.~Stephenson, Annu.~Rev.~Nucl.~Sci.~{\bf 56}, 253 (2006).
\bibitem{ekstrom2015} A.~Ekstr\"om, G.~R.~Jansen, K.~A.~Wendt, G.~Hagen, T.~Papenbrock, B.~D.~Carlsson, C.~Forssen, M.~Hjorth-Jensen, P.~Navratil, and W.~Nazarewicz, Phys.~Rev.~C {\bf 91}, 051301(R) (2015).
\bibitem{brown1977} B. A. Brown, A. Arima and J. B. McGrory, Nucl. Phys. {\bf A277}, 77 (1977) and references therein.
\end{thebibliography}

\end{document}


\documentclass[11pt]{article}

\usepackage{myreport}
\usepackage[american]{babel}
\usepackage[backend=biber, sorting=none]{biblatex}
\addbibresource{report.bib}

\begin{document}
\title{\vspace{-2.5em} Excitation and Detection Efficiency Under Light-Sheet
  Illumination \vspace{-1.0em}} \author{Talon Chandler}
\date{\vspace{-1em}June 21, 2017\\ (Updated: June 26, 2017)\vspace{-1em}}
\maketitle
\section{Introduction}
In these notes I will calculate the excitation and detection efficiency of a
single fluorophore under polarized scanned light-sheet illumination. I will
start by finding the transverse and longitudinal fields at all positions in a
Gaussian beam using reasonable approximations. Next I will calculate the
excitation efficiency of a single fluorophore as the beam is scanned across the
fluorophore. I will combine these results with the results from previous notes
to write the complete forward model. Finally I will discuss the approximations
we may need to simplify reconstruction.

\section{Transverse and Longitudinal Fields In A Scanned Gaussian Beam}
The complex spatial electric field of a paraxial Gaussian beam propagating along the
$\mh{z}$ axis is \cite{nov}
\begin{align}
  \mb{E}(x,y,z) &= \mb{A}\frac{w_0}{w(z)}\text{exp}\left\{{-\frac{(x^2+y^2)}{w^2(z)}}+i\left[kz - \eta(z) + \frac{k(x^2+y^2)}{2R(z)}\right]\right\}\label{eq:gauss}
\end{align}
where
\begin{alignat}{2}
  \mb{A} &= \cos\phi_{\text{pol}}\mh{x} + \sin\phi_{\text{pol}}\mh{y}\qquad &&\text{is the input Jones vector in 3D},\\
  w_0 &\approx \frac{2n}{k(\text{NA})}\qquad &&\text{is the beam waist radius,}\\
  z_0 &= \frac{kw_0^2}{2} &&\text{is the Rayleigh range,}\\
  k &= \frac{2\pi n}{\lambda}\qquad &&\text{is the wave number,}\\
  w(z) &= w_0\sqrt{1+\frac{z^2}{z_0^2}}\qquad &&\text{is the beam radius,}\\
  R(z) &= z\left(1+\frac{z_0^2}{z^2}\right)\qquad &&\text{is the wavefront radius,}\\
  \eta(z) &= \text{arctan}\left(\frac{z}{z_0}\right)\qquad &&\text{is the phase correction.}
\end{alignat}
Equation \ref{eq:gauss} uses the paraxial approximation, so it can only be used
for beams with a waist that is significantly larger than the reduced wavelength
($w_0 \gg \lambda/n$). Notice that under the paraxial approximation the beam is uniformly polarized in the transverse plane.

We would like to calculate the longitudinal component of a Gaussian beam when
the beam waist approaches the reduced wavelength ($w_0 > \lambda/n$). One
approach is to numerically evaluate the Richards-Wolf diffraction integral
\cite{richards, biobeam}. This approach is time consuming and too
accurate for our needs---we only want to model weak longitudinal
fields. Instead, I will follow Novotny et. al. \cite{nov} and use a longitudinal
correction to equation \ref{eq:gauss}.

As written, equation \ref{eq:gauss} doesn't satisfy Gauss' law
($\nabla \cdot \mb{E} = 0$), so we will add a longitudinal field to correct
it. If the input beam is polarized along the $\mh{x}$ axis
($\phi_{\text{pol}}=0$), then we can rearrange Gauss' law to relate the
longitudinal and transverse fields with
\begin{align}
  E_z(x, y, z) = - \int \left[\frac{\partial}{\partial x} E_x(x,y,z)\right]dz.
\end{align}
Carnicer et al. \cite{carnicer} worked through this integral using the angular
spectrum representation and found that
\begin{align}
  E_z(x,y,z) = -i\frac{2x}{kw_0^2}E_x(x,y,z) = -i\frac{x}{z_0}E_x(x,y,z)\label{eq:longit}.
\end{align}

Equation \ref{eq:longit} means that:
\begin{itemize}
\item There is no longitudinal polarization in the $\mh{y}-\mh{z}$ plane
  because $E_z(0,y,z) = 0$.
\item There are longitudinal field lobes on both sides of the optical axis
  along the transverse polarization direction.
\item The factor of $i$ means that the longitudinal fields are $90^{\circ}$ out
  of phase with the transverse fields which means that the total field is
  elliptically polarized off axis.
\item The longitudinal field strength is proportional to
  $\lambda/w_0^2$---highly focused beams have the strongest longitudinal fields.
\end{itemize}

If the input is polarized along the $\mh{x}$ axis, the corrected 3D Jones vector is
\begin{align}
\mb{A}(x,y,z) = \mh{x}- i\frac{x}{z_0}\mh{z}.
\end{align}

If the input polarization is arbitrary then the corrected 3D Jones vector is
\begin{align}
  \mb{A}(x,y,z) = \cos\phi_{\text{pol}}\mh{x} + \sin\phi_{\text{pol}}\mh{y} - i\frac{x\cos\phi_{\text{pol}} + y\sin\phi_{\text{pol}}}{z_0}\mh{z}.
\end{align}

If the beam is scanned along the $\mh{y}$ axis with velocity $v$ then the time
dependent 3D Jones vector is
\begin{align}
  \mb{A}(x,y,z,t) = \cos\phi_{\text{pol}}\mh{x} + \sin\phi_{\text{pol}}\mh{y} - i\frac{x\cos\phi_{\text{pol}} + (y - vt)\sin\phi_{\text{pol}}}{z_0}\mh{z}\label{eq:scanned_j}
\end{align}
and the time-dependent electric field is
\begin{align}
  \mb{E}(x,y,z,t) &= \mb{A}(x,y,z,t)\frac{w_0}{w(z)}\text{exp}\left\{{-\frac{(x^2+(y-vt)^2)}{w^2(z)}}+i\left[kz - \eta(z) + \frac{k(x^2+(y-vt)^2)}{2R(z)}\right]\right\}\label{eq:scanned_e}.
\end{align}
We will use equations \ref{eq:scanned_j} and \ref{eq:scanned_e} to calculate
the excitation efficiency of a single fluorophore. Notice that as the Rayleigh
range $z_0$ increases the longitudinal electric field decreases, so we can ignore the
longitudinal component when the beam is weakly focused.

\section{Scanned Beam Excitation Efficiency}
We define the excitation efficiency of a fluorophore as the fraction of
incident power that excites the fluorophore. If a fluorophore with absorption
dipole moment $\bs{\mu}_{\text{abs}}$ is placed in a time-independent complex
electric field $\mb{E}$, then the excitation efficiency is given by
\begin{align}
  \eta_{\text{exc}} = \frac{|\bs{\mu}_{\text{abs}} \cdot \mb{E}(x,y,z)|^2}{|\mb{E}(x,y,z) |^2}.
\end{align}
If the fluorophore is placed in the path of a scanned laser then the electric
field becomes time dependent. If the laser is scanned quickly we would need to
consider the coherence of the electric field, but we will only consider slow
scanning here to simplify the calculation. Specifically, we require that
$v \ll w_0/\tau_c$---the scan velocity must be much less than the beam width
divided by the coherence time. In this case the excitation efficiency is
\begin{align}
  \eta_{\text{exc}} = \frac{\intinf|\bs{\mu}_{\text{abs}} \cdot \mb{E}(x,y,z,t)|^2dt}{\intinf|\mb{E}(x,y,z,t)|^2dt}\label{eq:excitationx}
\end{align}
We plug equation \ref{eq:scanned_e} into equation \ref{eq:excitationx}, express
$\bs{\mu}_{\text{abs}}$ in spherical coordinates
\begin{align}
  \bs{\mu}_{\text{abs}} = \cos\Phi\sin\Theta\mh{x} + \sin\Phi\sin\Theta\mh{y} + \cos\Theta\mh{z},
\end{align}
and evaluate the integrals (see Appendix for details) to write the
excitation efficiency as
\begin{align}
  \eta_{\text{exc}} = \frac{\sin^2\Theta\cos^2(\Phi-\phi_{\text{pol}}) + \cos^2\Theta\frac{x^2\cos^2\phi_{\text{pol}} + \frac{1}{4}w^2(z)\sin^2\phi_{\text{pol}}}{z_0^2}}{1+\frac{x^2\cos^2\phi_{\text{pol}} + \frac{1}{4}w^2(z)\sin^2\phi_{\text{pol}}}{z_0^2}}.\label{eq:strong}
\end{align}
If the beam is weakly focused then we can ignore the longitudinal excitation and
the excitation efficiency simplifies to
\begin{align}
  \eta_{\text{exc}} \approx \sin^2\Theta\cos^2(\Phi-\phi_{\text{pol}}).\label{eq:weak_approx}
\end{align}

\textbf{How good is the approximation in equation \ref{eq:weak_approx}?}

For longitudinal fluorophores equation \ref{eq:weak_approx} is a very bad
approximation---it predicts that a longitudinal fluorophore will not be excited
at all. We can't use a percentage error because the approximation completely
ignores the excitation of longitudinal dipoles.

Instead, we can compare the size of signals from longitudinal and transverse
fluorophores. If the signal from longitudinal fluorophores is less than the
signal from noise and background, then we can ignore the signal from
longitudinal fluorophores.
\begin{align}
  \text{Excitation Ratio} &= \frac{\text{Max Longitudinal Excitation}}{\text{Max Transverse Excitation}}\\
                          &= \frac{\eta_{\text{exc}}(\Theta = 0)}{\eta_{\text{exc}}(\Theta = \pi/2, \Phi = \phi_{\text{pol}})}\\
                          &= \frac{x^2\cos^2\phi_{\text{pol}} + \frac{1}{4}w^2(z)\sin^2\phi_{\text{pol}}}{z_0^2}\label{eq:ratio}
\end{align}

At first glance equation \ref{eq:ratio} looks bleak---the excitation ratio grows
without bound in the $x$ direction which means that the longitudinal excitation
becomes a larger fraction of the total excitation as we move away from the plane
of the light-sheet. Fortunately, we only care about regions of the beam with a
high intensity, so we look at the intensity-weighted excitation ratio instead.
\begin{align*}
    \text{Intensity-Weighted Excitation Ratio} &= \frac{w_0}{w(z)}e^{-\frac{2x^2}{w^2(z)}}\frac{x^2\cos^2\phi_{\text{pol}} + \frac{1}{4}w^2(z)\sin^2\phi_{\text{pol}}}{z_0^2}\label{eq:intratio} \\
\end{align*}
We can interpret the intensity-weighted excitation ratio as the fraction of the
maximum signal (created by a transverse fluorophore at the origin) that we
ignore by ignoring longitudinal excitation. Figure \ref{fig:error} shows that
the intensity weighted excitation ratio is \textless 2\% for the imaging parameters used
in Wu et. al. \cite{wu2013}.

\fig{../figures/error.pdf}{1.0}{Intensity-weighted excitation ratio as a
  function of position using the parameters in Wu et. al. \cite{wu2013}:
  $w_0 = 1.2\ \mu$m, $z_0 = 9\ \mu$m, $\lambda = 488$ nm, FOV$\approx$ 80$\times$80
  $\mu$m${}^2$. The maximum values are at the edge of the FOV and are \textless 2\%.}{error}

As a rough heuristic, if the fraction of the signal from noise and background is
greater than the intensity-weighted excitation ratio we can justifiably ignore
the longitudinal component.

Figure 2 shows the maximum intensity-weighted excitation ratio for an
80$\times$80 $\mu$m${}^2$ FOV as a function of $w_0$. The maximum
intensity-weighted excitation ratio decreases as $w_0$ increases because wider
beams have smaller longitudinal components.

\fig{../figures/max-error.pdf}{0.5}{Maximum intensity-weighted excitation ration (see equation \ref{eq:intratio}) for an 80$\times$80 $\mu$m${}^2$ FOV with $\lambda = 488$ nm.}{max-error}

\section{Detection Efficiency}
If we detect fluorescence in wide-field mode with an orthogonal arm and no
polarizer then the detection efficiency is
\begin{align}
  \eta_{\text{det}} = 2A + 2B\sin^2\Theta'
\end{align}
where
\begin{align}
  A &= \frac{1}{4} - \frac{3}{8}\cos\alpha + \frac{1}{8}\cos^3\alpha,\\
  B &= \frac{3}{16}\cos\alpha - \frac{3}{16}\cos^3\alpha,
\end{align}
$\alpha = \text{arcsin(NA}/n)$ is the detection cone half angle, and $\Theta'$
is the angle between the dipole axis and the detection optical axis. See the
2017-06-09 notes for the relationship between $\Theta'$ and $\Theta,\Phi$. See
\cite{fourkas} and the 2017-04-25 notes for the derivation of the detection
efficiencies and additional expression for detection arms that use a polarizer.

\section{Orientation Forward Model}
The detected intensity is proportional to the the product of the excitation and
detection efficiencies. Using a weakly focused excitation beam and an
unpolarized detection arm gives us the following model
\begin{align}
  I_{\phi_{\text{pol}}} &= I_{\text{tot}}\sin^2\Theta\cos^2(\Phi - \phi_{\text{pol}})(2A+2B\sin^2\Theta')\label{eq:forward}
\end{align}
where $I_{\text{tot}}$ is the intensity we would collect if we had an excitation and detection efficiency of 1.

\section{Discussion}
Equation \ref{eq:strong} shows that for strongly focused beams the excitation
efficiency is a function of position. This couples the orientation and location
of the fluorophore and complicates our reconstruction. For now we'll use only
weakly focused beams so that we can ignore the longitudinal component.

To ignore the longitudinal component, we require that the fraction of the signal
from noise and background is greater than the intensity weighted excitation
ratio (\textless 2\% with current imaging parameters). We'll need to be careful about
longitudinal excitation if we want to use beams that are more strongly focused.

Under the weak-focusing approximation the orientation and position of
fluorophores are decoupled. This will allow us to split the reconstruction into
two steps (1) estimate the position of the fluorophores using unpolarized frames
(or the sum of orthogonally polarized frames) with established reconstruction
techniques then (2) estimate the orientation or the fluorophores using polarized
frames and equation \ref{eq:forward}.

Note that we are working in a different regime than Agrawal et. al. \cite{agrawal}. They
are considering imaging systems with better resolution than ours, so the
position and orientation are coupled and must be estimated together. At our
resolution, the position and orientation are decoupled so we can estimate them
separately.

\section{References}
\setlength\biblabelsep{0.025\textwidth}
\printbibliography[heading=none]
\pagebreak

\section{Appendix}
We will evaluate the following integrals to find the excitation efficiency
\begin{align}
  \eta_{\text{exc}}(x,y,z) = \frac{\intinf|\bs{\mu}_{\text{abs}} \cdot \mb{E}(x,y,z,t)|^2dt}{\intinf|\mb{E}(x,y,z,t)|^2dt}\label{eq:excitation}
\end{align}
where
\begin{align}
  \bs{\mu}_{\text{abs}} &= \cos\Phi\sin\Theta\mh{x} + \sin\Phi\sin\Theta\mh{y} + \cos\Theta\mh{z}\\
  \mb{E}(x,y,z,t) &= \mb{A}(x,y,z,t)\frac{w_0}{w(z)}\text{exp}\left\{{-\frac{(x^2+(y-vt)^2)}{w^2(z)}}+i\left[kz - \eta(z) + \frac{k(x^2+(y-vt)^2)}{2R(z)}\right]\right\}\\
  \mb{A}(x,y,z,t) &= \cos\phi_{\text{pol}}\mh{x} + \sin\phi_{\text{pol}}\mh{y} - i\frac{x\cos\phi_{\text{pol}} + (y - vt)\sin\phi_{\text{pol}}}{z_0}\mh{z}.\label{eq:scanned_jones}
\end{align}

We'll need the following facts
\begin{align}
  \intinf e^{-ax^2}dx &= \sqrt{\frac{\pi}{a}}\\
  \intinf xe^{-ax^2}dx &= 0 \label{eq:odd}\\
  \intinf x^2e^{-ax^2}dx &= \frac{1}{2a}\sqrt{\frac{\pi}{a}}.
\end{align}

The numerator is
\begin{align}
  = &\intinf|\bs{\mu}_{\text{abs}} \cdot \mb{E}(x,y,z,t)|^2dt\\
  \begin{split}
  = &\intinf\Bigg |\left[\cos\Phi\sin\Theta\cos\phi_{\text{pol}} + \sin\Phi\sin\Theta\sin\phi_{\text{pol}} - i\cos\Theta\frac{x\cos\phi_{\text{pol}} + (y - vt)\sin\phi_{\text{pol}}}{z_0}\right]\\
    &\ \ \ \ \ \ \ \ \frac{w_0}{w(z)}\text{exp}\left\{{-\frac{(x^2+(y-vt)^2)}{w^2(z)}}+i\left[kz - \eta(z) + \frac{k(x^2+(y-vt)^2)}{2R(z)}\right]\right\}\Bigg |^2dt.
  \end{split}\\
  \intertext{After changing variables $y' = y - vt$ and moving constants outside the integral we get}
  = &\frac{w_0^2}{w^2(z)}e^{-\frac{2x^2}{w^2(z)}}\intinf\left|\left[\cos\Phi\sin\Theta\cos\phi_{\text{pol}} + \sin\Phi\sin\Theta\sin\phi_{\text{pol}} - i\cos\Theta\frac{x\cos\phi_{\text{pol}} + y'\sin\phi_{\text{pol}}}{z_0}\right]\right|^2e^{-\frac{2y'^2}{w^2(z)}}dy'.
 \intertext{After expanding the square brackets we get}
   = &\frac{w_0^2}{w^2(z)}e^{-\frac{2x^2}{w^2(z)}}\intinf \Bigg [(\cos\Phi\sin\Theta\cos\phi_{\text{pol}} + \sin\Phi\sin\Theta\sin\phi_{\text{pol}})^2 +\cos^2\Theta\frac{(x\cos\phi_{\text{pol}} +y'\sin\phi_{\text{pol}})^2}{z_0^2} \Bigg ]e^{-\frac{2y'^2}{w^2(z)}}dy'\\
   = &\frac{w_0^2}{w(z)}e^{-\frac{2x^2}{w^2(z)}}\sqrt{\frac{\pi}{2}}\Bigg [\sin^2\Theta\cos^2(\Phi - \phi_{\text{pol}})  + \cos^2\Theta\frac{x^2\cos^2\phi_{\text{pol}} + \frac{1}{4}w^2(z)\sin^2\phi_{\text{pol}}}{z_0^2}  \Bigg ].
\end{align}
The denominator is
\begin{align}
  = &\intinf|\mb{E}(x,y,z,t)|^2dt\\
  = &\frac{w_0^2}{w^2(z)}e^{-\frac{2x^2}{w^2(z)}}\intinf\left|\left[\cos\phi_{\text{pol}}\mh{x} + \sin\phi_{\text{pol}}\mh{y} - i\frac{x\cos\phi_{\text{pol}} + y'\sin\phi_{\text{pol}}}{z_0}\mh{z}\right]\right|^2e^{-\frac{2y'^2}{w^2(z)}}dy'\\
  = &\frac{w_0^2}{w^2(z)}e^{-\frac{2x^2}{w^2(z)}}\intinf\left[1 + \frac{(x\cos\phi_{\text{pol}} + y'\sin\phi_{\text{pol}})^2}{z^2_0}\right]e^{-\frac{2y'^2}{w^2(z)}}dy'\\
  = &\frac{w_0^2}{w(z)}e^{-\frac{2x^2}{w^2(z)}}\sqrt{\frac{\pi}{2}}\left[1 + \frac{x^2\cos^2\phi_{\text{pol}} + \frac{1}{4}w^2(z)\sin^2\phi_{\text{pol}}}{z^2_0}\right].
\end{align}
The final excitation efficiency is
\begin{align*}
\eta_{\text{exc}}(x,y,z) = \frac{\sin^2\Theta\cos^2(\Phi - \phi_{\text{\text{pol}}}) + \cos^2\Theta\frac{x^2\cos^2\phi_{\text{pol}} + \frac{1}{4}w^2(z)\sin^2\phi_{\text{pol}}}{z_0^2}}{1 + \frac{x^2\cos^2\phi_{\text{pol}} + \frac{1}{4}w^2(z)\sin^2\phi_{\text{pol}}}{z^2_0}}.
\end{align*}

\end{document}


\section{Conclusion and further work}
Within this paper we have presented and justified the rationale behind using on-line learning algorithms for large-scale problems, we have pointed out advantages and disadvantages of various parallelization approaches and provided some experimental results to supplement our arguments. Even though the reader was guided to conclude that a specific parallelization idea dominates the realm, all of the presented schemes have their drawbacks. Supplying improvement of the latter always comes with a cost and any of the parallelization methods might turn to be an optimal choice for a specific problem setting.

However, in the ultimate scenario where amount of data is assumed to be infinite, as in processing of real-time streaming data, we conclude that the latter approach, namely parallelized asynchronous stochastic gradient descent with adaptive learning rates, should show the best results. This topic presents itself as an intimidating research prospect and is encouraged to be studied separately.