- We first establish the layout of the accelerator and base parameters
ring = Ring(circumference, alpha_0, momentum, particle,
n_turns=n_turns)
rf_station = RFStation(ring, harmonic, voltage, phase)
beam = Beam(ring, n_macroparticles, intensity)
An initial particle distribution is needed (defined from pre-injectors; starting from matched conditions...)
parabolic(ring, rf_station, beam, bunch_length)
The longitudinal profile is generated to monitor bunch parameters, which can be compared with measurements
cut_opt = CutOptions(
cut_left=0,
cut_right=rf_station.t_rf[0, 0],
n_slices=60)
fit_opt = FitOptions(fit_option='gaussian')
profile = Profile(beam, CutOptions=cut_opt, FitOptions=fit_opt)
---
## Tracking using BLonD
#### Solution to Introduction exercise (2/3)
- A monitoring object is made to record the simulated bunch parameters on disk
h5file = './data/saved_data'
bunchmonitor = BunchMonitor(
ring, rf_station, beam,
h5file,
Profile=profile)
bunchmonitor.track()
And some plotting parameters specified for visualization
dt_plt = 200
plots = Plot(ring, rf_station, beam,
dt_plt, ring.n_turns,
0, rf_station.t_rf[0, 0],
-100e6, 100e6,
Profile=profile,
h5file=h5file,
separatrix_plot=True)
---
## Tracking using BLonD
#### Solution to Introduction exercise (3/3)
- The effective tracking objects are generated
rf_tracker = RingAndRFTracker(rf_station, beam)
full_tracker = FullRingAndRF([rf_tracker])
Now is time to track!!
for turn in range(ring.n_turns):
full_tracker.track()
profile.track()
plots.track()
bunchmonitor.track()
The track routines in BLonD represents the main action of objects but do not always actuate on the particles (e.g. plots and bunch monitoring)
---
## Example of applications