# Guide to Non-linear Dynamics in Accelerator Physics/Tracking

This chapter provides tools to describe tools for finding map that track particles in em fields.

## Introduction

There are several way of tracking a particle in accelerator physics. Each one has different goal and needs its own approximation. Here there is a possible classification.

### physics involved

In their evolution particles experience the following physical process:

#### decay or inelastic scattering

    spontaneous or triggered by very small scale interaction with other particles. The particles are propagated using probabilistic models using QFT.

#### elastic scattering

    small scale interaction of high energy particles with other particles that does not involve decays. As inelastic scattering particles are propagated using probabilistic models using QFT. A special case of elastic scattering is synchrotron radiation that may or may not use probabilistic models or approximated statistics law. The approximation used are typically neglect not probable terms, simplify the motion.

#### electromagnetic field

    propagation due the interaction of particle with electromagnetic field which can be either external or generated by two or more particles.

### simulation goals
#### event generation

    for describing which kind of particle may be produced after a collision
    between an high energy particle and either another high energy particle
    in particle colliders or a low energy particles in fixed target experiment.
    The approximation used is too neglect the extension of the space time.
    Codes are dmjet, pythia.

#### particle matter interaction

    for calculating the efficiency of a detector,
    the energy deposited, the radiation damage of some equipment.
    Codes are geant, mars, fluka.

#### short term analysis (one turn)

    for calculating or approximating beam envelops,
    invariants of the motion and perturbation terms for periodic structures. The object
    of the study are the explicit form of the equation of motion more than the trajectory
    of the particle even though the trajectories may be use to compute or approximate the equation of motion. Matter interaction and collective effects are usually not included.
    Codes are mad, ptc, tracy.

#### short term simulation for beam loss

    for calculating the trajectory of the particles in the tail of the particle distribution in the beam. These particles are usually source of losses or background noise in the experiments. Usually hundreds of turn are needed in these simulations. The motion is accurate but the interaction with matter is very simplified.
    Codes are sixtrack.

#### short term simulation for collective instabilities

    for calculating the short term stability of a bunch of particle due the interaction of the particles with themselves (direct space charge) or the interaction with metallic surfaces close by (impedances, indirect space charge). The motion is accurate but not the simplecticity of the equation. This is an unavoidable approximation due the high dimensionality of the problem.
    Codes are orbit, elegant,headtail, warp.

#### long term simulation

    for evaluating the long term stability of motion in circular ring due to small non-linear perturbation. Usually thousands (electron) or millions (hadron) of turns are needed to find results. Long term simulation are used either as a direct evaluation tool for the impact of machine imperfection or as a benchmark for perturbation methods (analysis of the 1-turn map, frequency map, tune footprint, tune or action diffusion). The approximation used are share by the short term analysis.
    Codes are sixtrack,teapot.
In the following, we concentrate on tracking for short term analysis and long term simulation that shares the need of keeping the mathematical structure of the equations exact.

## Discrete Tracking

The aim of this section is to study how to solve the motion of a single particle in a general em field without affecting the structure of the equation of motions.
If the em fields are easily approximated by discontinuous vector field occupying a well defined not overlapping region, the tracking problem can be approached by a composition of discrete steps. Each step is the exact solution of the equation of motion between the boundary of the region. The region type may be
* a region of zero volume defined by one surface
* a region enclosed by two parallel plane surfaces
* a region enclosed by two not parallel plane surfaces
* a region enclosed by general surfaces.
The program is to find out which kind of field and region allows the motion to be solved exactly and how to find those fields and regions that approximate the real field.

## Equation of motion

A particle in the vacuum has four degree of freedom and the rest mass therefore can identified by the quantities:
${\vec {x}}=(x,y,z,t)\qquad {\vec {p}}=(p_{x},p_{y},p_{z},p_{t})\quad m$
which are the location and mechanical momentum. The conservation of rest mass implies:
$m^{2}c^{2}=p_{t}^{2}-p_{x}^{2}-p_{y}^{2}-p_{z}^{2}$.
The least action principle and the isotropy the space and homogeneity of time implies:
$\partial _{t}{\vec {x}}=\partial _{\vec {p}}H$
$\partial _{t}{\vec {p}}=-\partial _{\vec {x}}H$
for any $t$, where $H=p_{t}$.
Instead of $t,x,y,z$ could have be used as well. The solution of motion is a straight line.
In case of the em ${\vec {A}}({\vec {x}})=(-\phi ({\vec {x}}),A_{x}({\vec {x}}),A_{y}({\vec {x}}),A_{z}({\vec {x}}))$, if one wants to keep the same structure for the equation of motion, one has to substitute ${\vec {p}}$ with ${\vec {P}}={\vec {p}}-q{\vec {A}}$ where $q$ is the charge of the particle.
The equation of motion are not exactly solvable in a bounded region in the general case. Solvable cases are:

### drift type

The hamiltonian depends only on ${\vec {p}}$. The map is
${\vec {x}}\to {\vec {x}}+\partial _{\vec {p}}H\qquad {\vec {p}}\to {\vec {p}}$.
A particular case is for no field in a parallel plane boundary region. The map is
${\vec {x}}\to {\vec {x}}+{\frac {t_{f}}{m}}{\vec {p}}\qquad {\vec {p}}\to {\vec {p}}$
$t_{f}$ is the time of flight which does not depend on ${\vec {x}}$ because of the parallel boundaries. Assuming that the particle is sitting on one face, if the opposite face is at a distance $d$ then $t_{f}={\frac {md}{p_{z}}}$

### kick type

Zero volume surface with infinite field. The motion is a change of momentum but not a change of coordinate:
${\vec {x}}\to {\vec {x}}\qquad {\vec {p}}_{x}\to {\vec {p}}_{x}+{\vec {f}}({\vec {x}})$

### free field region (CONJECTURE TO BE CHECKED)

If there is no field and the region is defined by
$f({\vec {x}})=0$
and if $f({\vec {x}}+t_{f}{\frac {\vec {p}}{m}})=0$
can be solved for $t_{f}$. The map is:
${\vec {x}}\to {\vec {x}}+{\frac {t_{f}}{m}}{\vec {p}}\qquad {\vec {p}}\to {\vec {p}}$
Being exact, the resulting map (maybe containing infinite terms) should be symplectic by construction.

### uniform type (CONJECTURE TO BE CHECKED)

Uniform em field with parallel boundaries. Examples are ideal dipoles or solenoid magnet.
Since the motion can be exactly determined, the resulting map (maybe containing infinite terms) should be symplectic by construction.

### derived type

If it exists a canonical transformation $T$that brings the field and the region in the above forms, the map $TST^{-1}$
where $S$ is a map of one the type above solve exactly the motion. Example are sector bend magnets, where the canonical transformation brings to cylindrical coordinate (and may or may not cancel the bending field) and back.

### symplectic integrator

In case the Hamiltonian is the sum of solvable pieces $H=H_{1}+H_{2}+\ldots$, approximate models could be built in the form of a sequence of region such that $\prod \exp(c_{i}:H_{j}:)=\exp(:H:+O(n))$. A particular case is the kick drift approximation or the generalized Yoshida symplectic integrator.

### Inclusion of Radiation

When tracking a single single charged particle through a magnetic field, if it accelerates, it will emit radiation. This is particularly important when tracking electrons. Actually, the effect of radiation is typically split into two distinct pieces, a deterministic energy loss, and a stochastic part resulting from the quantization of the outgoing electromagnetic field (photons).
First we describe the deterministic part. We use a high energy approximation in which the energy and momentum are related by E=P/c. The power radiated by a charged particle in a magnetic field is given by $P_{\gamma }={\frac {e^{2}c^{3}}{2\pi }}C_{\gamma }E^{2}B^{2}\$ with $C_{\gamma }={\frac {4\pi }{3}}{\frac {r_{e}}{(mc^{2})^{3}}}=8.85\times 10^{-5}{\frac {m}{GeV^{3}}}$. Now, suppose that in the symplectic integrator, we go track through a region of magnetic field of length L. In fact, the length of this section will depend on the initial coordinates of the particle. The length of the region is given by $L^{*}=L(1+{\frac {x}{\rho }}+{\frac {1}{2}}(x'^{2}+y'^{2}))$. Now, in many codes, the magnetic field is normalized by $B\rho$ so that the integrated constant term is unitless. Define ${\bar {B}}={\frac {B}{B\rho }}$. Using the relation $B\rho ={\frac {E}{ec}}$, one finds that the change in the energy deviation is given by $\delta =\delta _{0}-C_{r}(1+\delta _{0})^{2}{\bar {B}}_{\perp }^{2}L^{*}$, with $C_{r}=C_{\gamma }{\frac {E^{3}}{2\pi }}$. This is the formula used in e.g. Accelerator Toolbox and Tracy. Now that the change in energy (momentum) has been computed, the changes in the transverse momenta x', y' may be correspondingly computed. This is done by noting that $p_{x,y}$ don't change in the radiation process.