\documentclass[11pt,a4paper,titlepage]{article}

\usepackage{a4}                        % A4 papistoerrelse
\usepackage[english]{babel}            % Orddeling osv.
\usepackage[latin1]{inputenc}          % 
\usepackage{amsmath}                   % Matematiske kommandoer
\usepackage{amssymb}                   % Matematiske symboler
\usepackage[dvips]{graphicx}           % Import af pakke til .eps haandtering
\usepackage{epsfig}                    %Import af pakke til blandet .ps og .tex
\usepackage{color}
%\usepackage{ulem}
\newcommand{\eq}[1]{\begin{eqnarray}#1\end{eqnarray}}
\newcommand{\eqar}[1]{\begin{eqnarray}#1\end{eqnarray}}
\newcommand{\bra}[1]{\ensuremath{\left< #1\right\vert}}
\newcommand{\ket}[1]{\ensuremath{\left\vert #1\right>}}
\newcommand{\innerp}[2]{\bra{#1} \left. #2\right>}
\newcommand{\cel}{$^{\circ}$C }
\newcommand{\fed}[1]{\ensuremath{\mathbf{#1}}}

\usepackage[font=small,labelfont=bf]{caption}
\usepackage{mathtools}
 \newtagform{lilleskrift}[]{\footnotesize(}{)}
 \usetagform{lilleskrift}
 \renewcommand{\eqref}[1]{(\ref{#1})}

\begin{document}

%\begin{center}
%\huge{Problems for NIDS June 2011}
%\end{center}

%\section{ESS Thermal Powder Diffractometer}
\noindent{\LARGE\bfseries{}ESS Thermal Powder Diffractometer}
\vspace{0.1cm}

\noindent{\footnotesize Exercise for INSIS school 2012, Frascati, Italy\\
\slshape Linda Udby, Pia Jensen, Peter Willendrup, Kim Lefmann}
\vspace{0.5cm}

\noindent We will here build a simple time-of-flight powder diffractometer. 
The basic philosophy is that a polychromatic beam is sent on to 
the sample and the diffracted neutrons are counted in time-of-flight 
detectors covering a large 
part of the solid angle. To interpret the data, one applies the basic 
time-of-flight equation 
\begin{equation}
t = \alpha \lambda L ,
\end{equation}
where $t$ is the flight time, $\lambda$ is the wavelength of the neutron, 
$L$ is the travel length, and $\alpha = m_{\rm n}/h \approx 252.7\, \mu$s/m/\AA .
One then assumes that all detected neutrons are scattered elastically,
whence $\lambda$ can be calculated. In turn, the scattering vector $q$
can be found from $2\theta$, the scattering angle found from the detector position:
\begin{equation}
q = 2 k_{\rm i} \sin\theta = \frac{4 \pi}{\lambda} \sin\theta .
\end{equation}
Here, $k_{\rm i}$ is the incoming wave vector, as seen on figure \ref{fig:skitse}, where the scattering angle is also indicated.

\begin{figure}[htbp]
 \centering
  \includegraphics[scale=1]{skitse.pdf}
 \caption{The incoming neutron beam follows $k_{\rm i}$, and is scattered elastically along $k_{\rm f}$ 
          (meaning that $|k_{\rm i}| = |k_{\rm f}|$) at an angle $2\theta$.}
 \label{fig:skitse}
\end{figure} 

\section{The ESS moderator}
ESS is a long-pulsed source, with the most important parameter being the pulse length, 
here called $d$, and the repetition frequency, $f = 1/T$. 
Make a simple instrument using the ESS thermal moderator
\verb+ESS_moderator_long.comp+, which emit neutrons directly into a time-of-flight
detector, simulating a typical thermal wavelength range.

Use the standard parameters for a thermal source (ambient H$_2$O), listed in the component; otherwise
default parameters. Simulate only one pulse (set parameter \verb+twopulses+ to 0), 
and use \verb+d+~$=2.0$~ms, \verb+freq+~$=20$~Hz, and \verb+size+~$=0.02$. The lower and upper boundaries of the wavelength should
be set to reasonable values corresponding to thermal neutrons -- try 0.01~\AA{} to 2.5~\AA{}. The three parameters \verb+dist+, 
\verb+xw+ and \verb+yh+ will be set below.
\begin{enumerate}
\item Place one time-of-flight monitor \verb+TOF_monitor.comp+ directly at the moderator,
one at 6~m distance, and one at 149.9~m distance (these monitors are physically
realistic). The monitors should have the same size as the moderator, and the moderator
should focus on the 149.9~m monitor (now is the time to set the \verb+dist+, 
\verb+xw+ and \verb+yh+ parameters correctly). Perform the simulation. Adjust the timelimits to see the full pulse.
\item Next, place wavelength sensitive (but unphysical) TOF monitors, using the 
\verb+TOFLambda_monitor+ component, at these three positions and repeat the simulations.
Notice how a given time channel (in the physical TOF monitors) contains a sharper
wavelength information at the long distance.
\item Third, it has been decided at ESS to change the source parameters to $d=2.86$~ms, $f=14$~Hz. 
This should have the same time-integrated flux as the previous setting, given constant peak flux. 
Confirm that by simulation. (In fact, the ESS moderator is normalized to constant time-integrated flux.)
%\textcolor{green}{Er det meningen man skal se p\aa{} den integrerede intensitet af den f\o rste monitor? I s\aa fald skal man have $\lambda_{min}=0.1$~\AA{} for at den er ens i de to konfigurationer.}
\end{enumerate}

\section{Frame overlap}
%Go back to the first settings of $d$ and $f$ and
Several pulses are produced by the source pr. second according to the pulse frequency $f$.
\begin{enumerate}
\item Turn on a second pulse of the moderator and perform a simulation.
Notice that some time channels at the 149.9~m
monitor has ambigious wavelength information. This is known as frame overlap.

To avoid frame overlap, the wavelength band, $\Delta\lambda$, of the neutrons must be limited by the
frame overlap conditions, \emph{i.e.} neutrons from two following pulses
(time $\Delta T$ apart) must not mix. This gives rise to
$T \geq \Delta t = \alpha \,\Delta\lambda \,L$, or
\begin{equation}
\Delta\lambda \leq \frac{\Delta T}{\alpha L} .
\end{equation}
In reality, this is performed by frame overlap choppers at distances of 10-50~m from
the moderator. In the simulations, you will merely limit the simulated band to the calculated value.
% \textcolor{green}{N\aa{}r jeg regner det ud f\aa{}r jeg
% $\Delta\lambda=1.4$\AA{}, men ser jeg p\aa{} monitoren er det
% n\ae{}rmere $\Delta\lambda=1.3$\AA{} for at undg\aa{}
% frameoverlap}. \textcolor{red}{Set}\sout{Keep} 
\item Set the lower wavelength to 0.5~\AA{} and perform a simulation. Note the integrated intensity found on the last monitor.
\end{enumerate}

\section{A quick and dirty guide system}
We will now investigate how more neutrons can be transported far away from the source by use of guides. An important concept in construction of guides is the divergence of the neutron beam.

\begin{enumerate}
\item Insert a 'sample sized' (2~cm$\,\times\,$2~cm) \verb+DivLambda_monitor+ after the last monitor at 149.9~m. Use 100 bins and a maximum divergence of $\pm$ 0.2$^\circ$. Perform a simulation and investigate the divergence of the beam.
\end{enumerate}

\begin{figure}[htbp]
 \centering
  \includegraphics[scale=1]{guides.pdf}\vspace{2mm}
 \caption{Illustrations showing the concepts of four different guide types.}
 \label{fig:guides}
\end{figure} 

\noindent There are several different types of guide geometries (see figure \ref{fig:guides}), and each of these give different results on the sample position. In the following, use the Trace possibility of McStas (this can be chosen instead of the Simulate option in a drop-down list in the GUI) to see how the guides look.

\begin{enumerate}
%\item[2.] Now, insert a straight \verb+Guide+ at 6.01~m from the source (in
%between the last and middle monitors), with a
%length of 141.9~m. The guide cross-section should be 5~cm$\,\times\,$5~cm. Use the
%default coating parameters which correspond to a so-called ``$m=2$''
%supermirror guide. Change the source focusing parameters to illuminate
%the guide opening.
%Perform a simulation and comment on the results; statistics and
%intensity recorded on the last monitor. Comment on the divergence distribution too.
\item[2.] Choose one of the four guide types below to continue. For all, the total length should be 141.9~m, and the guide should start at 6.01~m from the source (in between the last and middle monitors). 

\begin{enumerate}
\item[a.] A straight guide using the component \verb+Guide+: 

Insert it with a cross-section of 5~cm$\,\times\,$5~cm. 
Use the default coating parameters which correspond to a so-called ``$m=2$'' supermirror guide. 

\item[b.] An elliptical guide using the component \verb+Guide_tapering+: 

Insert it with a cross-section of 5~cm$\,\times\,$5~cm in both ends.
Calculate at what distance to the guide end the focus point should be in order for the full sample to be illuminated. Set
the distance of the focus point at the entrance of the guide to a large enough value to open up for the full source. 
Use the default coating parameters, setting both \verb+m+-parameters to 2, getting a so-called ``$m=2$'' supermirror guide. 

\item[c.] A parabolic guide using the component \verb+Guide_tapering+: 

Insert it with a cross-section of 5~cm$\,\times\,$5~cm in the source-end. 
Set \verb+louth+ and \verb+loutw+ to a value you feel is right (try looking at the guide using Trace). 
Use the default coating parameters, setting both \verb+m+-parameters to 2, getting a so-called ``$m=2$'' supermirror guide. 

\item[d.] A ballistic guide using the component \verb+Guide+ three times: 

Insert it with a cross-section of 5~cm$\,\times\,$5~cm in the ends, with the two end-pieces getting linearlly larger towards the center piece. The center piece  should have a cross-section you deem good by looking at the instrument using Trace. You should also choose a length of the end-pieces using Trace. 
Use the default coating parameters which correspond to a so-called ``$m=2$'' supermirror guide. 

\end{enumerate}

\item[3.] For either of the guides, change the source focusing parameters to illuminate
the guide opening. Perform a simulation and comment on the results; statistics and
intensity recorded on the last monitor. Comment on the divergence distribution too.
\end{enumerate}


\section{Optional: Powder sample}
Let us go back to simulating just one pulse.
We place a 6~mm diameter sample at 150.0~m distance from the source.
Use \verb+Powder1.comp+ with a reflection of $q=5$~\AA$^{-1}$, corresponding to a particular reflection of a powder sample.
For time-of-flight detector, we use a cylinder of 
2~m radius and 20~cm height. Use the component \verb+TOF_cylPSD_monitor.comp+ and focus on simulating the sample scattering on the detector.
\begin{enumerate}
\item Perform the simulation and see how the scattered neutrons display a band in the $(t,\theta)$
plot. 
%You may like to place a beamstop, {\em e.g.} 1~m after the sample to avoid the direct beam, or alternatively use an 
%\begin{verbatim}
%EXTEND %{
% if(!SCATTERED) ABSORB; 
%%}
%\end{verbatim}
\item To perform quantitative analysis, place a 10~mm wide TOF detector at 130 degrees scattering angle 
simulating a vertical stripe of pixels in the TOF detector (use \verb+Arm+ and place it after the perimeter of the cylidrical TOF monitor).
Notice that the picture you reach resembles the moderator time structure (you may need to simulate
up to $10^8$ rays to see this). This information can be transferred into 
information on $q$. 

Calculate the percieved value of $q$ and the peak width, $dq$. %\textcolor{green}{Jeg f\aa{}r $q=4.88$$\frac{dq}{q}\approx 10\%$ ved bare at vurdere centrum of peakbredde}\\

Hints: Think about the zero point in time and the total neutron flight path through the instrument.
\end{enumerate}


\end{document}
