Wake Class
The Wake
class simulates the impact of the wake field on a particle beam as a series of kicks.
In order to take into account the impact of the wake field on the beam the longitudinal wake function
of point charge through the second order Taylor expansion is used.
In general case it uses 13 one-dimensional functions to represent the longitudinal component of the wake
function for arbitrary sets of the source and the wittness particles near to the reference axis.
Parameters:
- w_sampling (
int
): Defines the number of equidistant sampling points for the one-dimensional wake coefficients in the Taylor expansion of the 3D wake function. Default is500
. - filter_order (
int
): Smoothing filter order. Default is20
. - wake_table (
WakeTable
orNone
): A table containing the wake function coefficients. Default isNone
. - factor (
float
): Scaling coefficient for the wake. Default is1.0
. - TH (
list
): List containing the wake table and matrix of coefficients.
Methods:
__init__(self, step=1, **kwargs)
Constructor to initialize the Wake
class with specified parameters, including wake sampling points, filter order, scaling factor, and wake table.
add_wake(self, I, T)
This method calculates the wake function W
given the beam current (I
) and the wake table (T
). It performs the wake convolution and applies the wake function to the particles' trajectories.
add_total_wake(self, X, Y, Z, q, TH, Ns, NF)
Adds the total wake to the particle array. It uses the wake function coefficients and the current profile to compute the wake effect in all directions (longitudinal, vertical, and horizontal).
prepare(self, lat)
Prepares the wake function by checking the wake table and ensuring the necessary data is available for the calculations.
get_long_wake(self, current_profile)
Extracts a longitudinal wake from the wake table for a specific current profile. The current_profile
is a 2D array with positions and beam currents.
get_dipole_wake(self, current_profile)
Extracts a dipole wake from the wake table for a specific current profile. This function computes the wake effect due to the dipole interaction between the particles.
apply(self, p_array, dz)
Applies the wake field to the particle array (p_array
) over a given path length (dz
). This method updates the particles' positions and momenta based on the wake effect.
__repr__(self) -> str
Returns a string representation of the Wake
class, including key parameters like wake sampling, filter order, scaling factor, and wake table file.
Summary
The Wake
class models the effect of the wake field on a particle beam by applying a series of kicks calculated from a Taylor expansion of the longitudinal wake function. The class provides methods to compute the wake based on various current profiles and wake coefficients. It also supports the application of the wake field to the particle array, updating the particles' momenta and positions.
Class Documentation
This section provides documentation for the WakeTableDechirperOffAxis
class, which creates wake tables for horizontal and vertical corrugated plates based on a set of physical parameters. It models the wake field effects on a particle beam passing through these structures.
WakeTableDechirperOffAxis Class
The WakeTableDechirperOffAxis
class calculates and generates wake tables for both horizontal and vertical corrugated plates. These wake tables represent the longitudinal wake field generated by the plates and are used to simulate the impact of the wake field on the particle beam. The class implements formulas from Z. Huang's work and SLAC-PUB-16881 to model these wake fields.
Parameters:
- b (
float
): Distance from the plate in meters. Default is500e-6
(500 µm). - a (
float
): Half gap between the plates in meters. Default is0.01
(10 mm). - width (
float
): Width of the corrugated structure in meters. Default is0.02
(20 mm). - t (
float
): Longitudinal gap in meters. Default is0.25e-3
(250 µm). - p (
float
): Period of corrugation in meters. Default is0.5e-3
(500 µm). - length (
float
): Length of the corrugated structure in meters. Default is1
(1 meter). - sigma (
float
): Characteristic (rms) longitudinal beam size in meters. Default is30e-6
(30 µm). - orient (
str
): Plate orientation, either"horz"
for horizontal or"vert"
for vertical. Default is"horz"
.
Methods:
__init__(self, b=500e-6, a=0.01, width=0.02, t=0.25e-3, p=0.5e-3, length=1, sigma=30e-6, orient="horz")
Constructor to initialize the WakeTableDechirperOffAxis
class with the specified physical parameters. It calculates the wake tables for the horizontal and vertical plates using the calculate_wake_tables
method and processes the appropriate wake table based on the plate orientation (orient
).
calculate_wake_tables(self, b, a, width, t, p, length, sigma)
Calculates the wake tables for both horizontal and vertical corrugated plates based on the given parameters. The method performs complex calculations involving the corrugation period, beam size, and other physical properties to generate the wake table.
prepare(self, lat)
Prepares the wake table and checks if the wake table (wake_table
) is defined. If it is None
, it logs a message requesting a WakeTable()
to be provided.
get_long_wake(self, current_profile)
Extracts the longitudinal wake from the wake table for a specific current profile. The current_profile
is a 2D array where the first column is position and the second is beam current.
get_dipole_wake(self, current_profile)
Extracts the dipole wake from the wake table for a specific current profile. This method computes the wake due to dipole interactions and returns the resulting wake field.
apply(self, p_array, dz)
Applies the wake field to the particle array (p_array
) over a given path length (dz
). This method updates the particles' momenta based on the wake field, including the longitudinal and transverse wake components.
__repr__(self) -> str
Returns a string representation of the WakeTableDechirperOffAxis
class, including key parameters like wake sampling, filter order, scaling factor, and wake table file.
Summary
The WakeTableDechirperOffAxis
class creates and processes wake tables for both horizontal and vertical corrugated plates, representing the wake field interactions with a particle beam. It calculates the wake field using a set of physical parameters and applies this wake to the beam using methods like get_long_wake
, get_dipole_wake
, and apply
. This class is essential for modeling the wake field effects in particle accelerators with off-axis dechirpers.