Examples are provided for tracking FFAs in a number of circumstances:
- Tracking through an analytical horizontal FFA field model
- Tracking through a 3D field map.
- Tracking through an analytical horizontal FFA field model with RF acceleration
- Tracking through an analytical vertical FFA field model
The following workflows have been checked with OPAL-2021.1.0. Note that examples checked against older versions of OPAL are given at the bottom of the page.
Tracking through an analytical field model
OPAL can use a fully scaling field model including scaling fringe fields to model FFAs analytically. A sample lattice file is available in this example:
example_1-OPAL-2021.1.0.tar.gz (Tested on OPAL-2021.1.0)
To run the example, download the file example.tar.gz and do
tar -xzf example_1-OPAL-2021.1.0.tar.gz
Then change into the working directory and run the code:
cd example_1/example_sector_ffa
/path/to/bin/opal SectorFFAMagnet
cd ..
If it worked - congratulations, you have run OPAL. You should see a lot of output. There is a sample log file here:
OPAL parses the input file, then writes out the position of each field element, then tracks the particle with some debugging output. You can then make some plots:
python example_scripts/plot_orbit.py example_sector_ffa/
The plotting routines require matplotlib and python3. Here is an example of the sort of plots you might see:
Three sectors are shown, together with the dipole (bz) field in Tesla and a low energy proton trajectory at injection (3 MeV).
Tracking through an 3D field map
OPAL can be used to track through a 3D field map. By default interpolation is trilinear. A sample lattice file is available in this example:
example_2-OPAL-2021.1.0.7z (Tested on OPAL2021.1.0.7z)
Due to the size of the field map this example was compressed using 7za. Uncompress using 7za from p7zip package. Then run in the usual way.
7za x example_2-OPAL-2021.1.0.7z
cd example_2/example_main_ring
/path/to/bin/opal KURNS_ADS_Ring
cd ..
Here is an example log file:
To make plots, again do
python example_scripts/plot_orbit.py example_main_ring/
Here is an example of the sort of plots you might see:
Three sectors are shown, together with the dipole (bz) field in Tesla and a low energy proton at injection (11 MeV).
Tracking through an analytical field map with acceleration
OPAL can also model the full acceleration cycle for an FFA. There is an example FFA with RF active here:
example_3-OPAL-2021.1.0.tar.gz (Tested on OPAL-2021.1.0)
Unpack it and run it like:
tar -xzf example_3-OPAL-2021.1.0.tar.gz
cd example_3/example_sector_ffa
/path/to/bin/opal SectorFFAMagnet
cd ..
Here is an example log file:
To make plots of the RF field do
python example_scripts/plot_dump_fields.py example_sector_ffa/
and to plot the particle energy with time, do
python example_scripts/plot_output_planes.py example_sector_ffa/
Here are a couple of examples of the sort of plots you might see:
These two plots show the RF cavity oscillations at injection and after 500 microseconds. Note how the frequency of the RF cavity has increased - this is to match the increased particle revolution frequency (as the particles have accelerated so much).
The particle energy increases with time to match the RF frequency, like:
It looks like the acceleration worked! There are actually two particle trajectories shown: the black points show a particle tuned to match the RF reference trajectory, while the blue points show a particle that is offset longitudinally and oscillating around the reference trajectory.
Tracking through an analytical vertical FFA field map
OPAL can track through a vertical FFA field, where the orbit moves vertically as the energy increases. This is unlike a conventional hFFA where the orbit moves radially. There is an example of OPAL with a vertical FFA field here:
example_4-OPAL-2021.1.0.tar.gz (Tested on OPAL-2021.1.0)
Run it like
tar -xzf example_4-OPAL-2021.1.0.tar.gz
cd example_3/example_sector_ffa
/path/to/bin/opal VerticalSectorFFA
cd ..
Here is an example log file:
To make plots of the field and orbits
python example_scripts/plot_orbit.py example_vertical_ffa/
Here is the sort of plot you might see:
This shows the field in the vertical direction with the trajectory of the closed orbit superimposed. The lattice is a 10 cell triplet lattice, as described in https://arxiv.org/abs/2011.10783. Note that at present (Nov 2020), RF acceleration is not supported in VFFAs.
Old version of the examples
OPAL 2.4.0
(Between 2021-1.0 and 2.4.0: Output files took slightly different paths and some minor cosmetic improvements have been made to the plots)
example_1-OPAL2.4.0.tar.gz (Tested on OPAL2.4.0_2)
example_2-OPAL2.4.0.7z (Tested on OPAL2.4.0_2)
example_3-OPAL2.4.0.tar.gz (Tested on OPAL2.4.0_2)
example_4-OPAL2.4.0.tar.gz (Tested on OPAL2.4.0_2)
OPAL 2.0.0
(Between 2.4.0 and 2.0.0: Plotting scripts were updated to use matplotlib. Various changes to the lattices.) example_1-OPAL2.0.0rc2.tar.gz (Tested on OPAL2.0.0rc2)
example_2-OPAL2.0.0rc2.7z (Tested on OPAL2.0.0rc2)
example_3-OPAL2.0.0rc2.tar.gz (Tested on OPAL2.0.0rc2)