There are two methods to model FFAs in OPAL, using the OPAL-Cycl routines.
- Tracking through an analytical field model (OPAL >= 2.0).
- Tracking through a 3D field map.
The following workflows have been checked with OPAL 2.0.0rc2.
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:
To run the example, download the file example.tar.gz and do
tar -xzf example.tar.gz
Then change into the working directory and run the code:
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/
This relies on a correct installation of PyRoot, the python API for ROOT plotting library - it doesn't always work. 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:
Due to file size issues this example was compressed using 7za. Uncompress using 7za from p7zip package. Then run in the usual way.
7za x example_2.7z
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:
Unpack it and run it like:
tar -xzf example_3.tar.gz
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.