PlasmaRamp#

class wake_t.beamline_elements.PlasmaRamp(length, profile='inverse_square', ramp_type='upramp', wakefield_model='focusing_blowout', decay_length=None, plasma_dens_top=None, plasma_dens_down=None, position_down=None, bunch_pusher='boris', dt_bunch='auto', push_bunches_before_diags=True, n_out=1, name='Plasma ramp', **model_params)[source]#

Class defining a plasma density ramp.

This elements is a subclass of PlasmaStage that exposes convenient attributes for defining a plasma density ramp, such as predefined density profiles.

Parameters:
lengthfloat

Length of the plasma ramp in m.

profilestring or callable

Longitudinal density profile of the ramp. Possible string values are 'gaussian', 'inverse square' and 'exponential'. A callable might also be provided as a function of the form 'def func(z, decay_length, density_top, density_down, position_down)' that returns the density value at the given position z.

ramp_typestring

Possible types are 'upramp' and 'downramp'.

wakefield_modelstr

Wakefield model to be used. Possible values are 'blowout', 'custom_blowout', 'focusing_blowout', 'cold_fluid_1d' and 'quasistatic_2d'.

decay_lengthfloat

Optional. Characteristic decay length of the ramp. If not provided, it will be determined from plasma_dens_top, plasma_dens_down and position_down.

plasma_dens_topfloat

Optional. Needed only if decay_length=None. Plasma density at the beginning (end) of the downramp (upramp) in units of \(m^{-3}\).

plasma_dens_downfloat

Optional. Needed only if decay_length=None. Plasma density at the position position_down in units of \(m^{-3}\).

position_downfloat

Optional. Needed only if decay_length=None. Position where the plasma density will be equal to plasma_dens_down measured from the beginning (end) of the downramp (upramp). If not provided, the length value is assigned.

bunch_pusherstr

The pusher used to evolve the particle bunches in time within the specified fields. Possible values are 'rk4' (Runge-Kutta method of 4th order) or 'boris' (Boris method).

dt_bunchfloat

The time step for evolving the particle bunches. If None, it will be automatically set to \(dt = T/(10*2*pi)\), where T is the smallest expected betatron period of the bunch along the plasma stage. A list of values can also be provided. In this case, the list should have the same order as the list of bunches given to the track method.

push_bunches_before_diagsbool, optional

Whether to push the bunches before saving them to the diagnostics. Since the time step of the diagnostics can be different from that of the bunches, it could happen that the bunches appear in the diagnostics as they were at the last push, but not at the actual time of the diagnostics. Setting this parameter to True (default) ensures that an additional push is given to all bunches to evolve them to the diagnostics time before saving. This additional push will always have a time step smaller than the the time step of the bunch, so it has no detrimental impact on the accuracy of the simulation. However, it could make convergence studies more difficult to interpret, since the number of pushes will depend on n_diags. Therefore, it is exposed as an option so that it can be disabled if needed.

n_outint

Number of times along the stage in which the particle distribution should be returned (A list with all output bunches is returned after tracking).

namestr

Name of the plasma ramp. This is only used for displaying the progress bar during tracking. By default, 'Plasma ramp'.

**model_params

Keyword arguments which will be given to the wakefield model. Each model requires a different set of parameters. See PlasmaStage documentation for more details.

See also

PlasmaStage

Methods

ramp_profile(z)

Return the density value at a certain z location.

track([bunches, opmd_diag, diag_dir, ...])

Track bunch through element.