Acceleration
The acceleration can be simulated by adding to the line the element
xtrack.ReferenceEnergyIncrease as illustrated by the following example.
import json
import numpy as np
import xobjects as xo
import xpart as xp
import xtrack as xt
Delta_p0c = 450e9/10*23e-6 # ramp rate 450GeV/10s
fname_line = ('../../test_data/sps_w_spacecharge/'
'line_no_spacecharge_and_particle.json')
with open(fname_line, 'r') as fid:
input_data = json.load(fid)
line = xt.Line.from_dict(input_data['line'])
energy_increase = xt.ReferenceEnergyIncrease(Delta_p0c=Delta_p0c)
line.append_element(energy_increase, 'energy_increase')
line.build_tracker()
particles = xp.Particles(p0c=26e9, zeta=np.linspace(-1, 1, 40))
line.track(particles, num_turns=500, turn_by_turn_monitor=True)
Particles motion in the longitudinal phase space as obtained from the simulation above. See the full code generating the image.