:mod:`ocelot.cpbd.wake3D` ========================= .. py:module:: ocelot.cpbd.wake3D .. autoapi-nested-parse:: Created on 17.05.2016 @author: Igor Zagorodnov Added wake table WakeTableDechirperOffAxis on 11.2019 @authors: S. Tomin and I. Zagorodnov Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ocelot.cpbd.wake3D.WakeTable ocelot.cpbd.wake3D.WakeTableDechirperOffAxis ocelot.cpbd.wake3D.Wake ocelot.cpbd.wake3D.WakeKick Functions ~~~~~~~~~ .. autoapisummary:: ocelot.cpbd.wake3D.triang_filter ocelot.cpbd.wake3D.Der ocelot.cpbd.wake3D.Int1 ocelot.cpbd.wake3D.Int1h ocelot.cpbd.wake3D.project_on_grid_py ocelot.cpbd.wake3D.s2current .. data:: _logger .. data:: nb_flag :annotation: = True .. function:: triang_filter(x, filter_order) .. function:: Der(x, y) .. function:: Int1(x, y) .. function:: Int1h(h, y) .. function:: project_on_grid_py(Ro, I0, dI0, q_array) Simple function to project particles charge on grid :param Ro: grid :param I0: grid index for each particle :param dI0: coefficient how particle close to Ro[i+1]. Example: particle i, dI0=0.7 -> Ro[i]---------dI0[i]--Ro[i+1] :param q_array: charge array in [C] :return: Ro .. data:: project_on_grid .. function:: s2current(s_array, q_array, n_points, filter_order, mean_vel) I = s2current(P0,q,Ns,NF) :param s_array: s-vector, coordinates in longitudinal direction :param q_array: charge-vector :param n_points: number of sampling points :param filter_order: filter order :param mean_vel: mean velocity :return: .. py:class:: WakeTable(wake_file=None) WakeTable(wake_file) - load and prepare wake table wake_file - path to the wake table .. method:: load_table(self, wake_file) .. method:: read_file(self, wake_file) .. method:: process_wake_table(self, wake_table) :param wake_file: file name :return: (T, H): T- table of wakes coefs, H - matrix of the coefs place in T .. py:class:: WakeTableDechirperOffAxis(b=500 * 1e-06, a=0.01, width=0.02, t=0.25 * 0.001, p=0.5 * 0.001, length=1, sigma=3e-05, orient='horz') Bases: :class:`ocelot.cpbd.wake3D.WakeTable` WakeTableDechirperOffAxis() - creates two wake tables for horizontal and vertical corrugated plates. Based on https://doi.org/10.1016/j.nima.2016.09.001 and SLAC-PUB-16881 :param b: distance from the plate in [m] :param a: half gap between plates in [m] :param width: width of the corrugated structure in [m] :param t: longitudinal gap in [m] :param p: period of corrugation in [m] :param length: length of the corrugated structure in [m] :param sigma: characteristic (rms) longitudinal beam size in [m] :param orient: "horz" or "vert" plate orientation :return: hor_wake_table, vert_wake_table .. method:: calculate_wake_tables(self, b, a, width, t, p, length, sigma) Function creates two wake tables for horizontal and vertical corrugated plates :param b: distance from the plate in [m] :param a: half gap between plates in [m] :param width: width of the corrugated structure in [m] :param t: longitudinal gap in [m] :param p: period of corrugation in [m] :param length: length of the corrugated structure in [m] :param sigma: characteristic longitudinal beam size in [m]] :param filename: save to files if filename is not None :return: hor_wake_table, vert_wake_table .. py:class:: Wake(step=1) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` The wake field impact on the beam is included as 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 = 500 - defines the number of the equidistant sampling points for the one-dimensional wake coefficients in the Taylor expansion of the 3D wake function. filter_order = 20 - smoothing filter order wake_table = None - wake table [WakeTable()] factor = 1. - scaling coefficient TH - list from WakeTable, (T, H): T- table of wakes coefs, H - matrix of the coefs place in T .. method:: convolution(self, xu, u, xw, w) .. method:: wake_convolution(self, xb, bunch, xw, wake) .. method:: add_wake(self, I, T) [x, W] = AddWake(I, T) :param I: wake table in V/C, W in V (R, L, Cinv, nm, W0, N0, W1, N1) :param T: wake table in V/C, W in V :return: .. method:: add_total_wake(self, X, Y, Z, q, TH, Ns, NF) .. method:: prepare(self, lat) method is called at the moment of Physics Process addition to Navigator class. :param lat: :return: .. method:: get_long_wake(self, current_profile) method to extract a longitudinal wake from the Table for specific current profile :param current_profile: 2D array with shape (n, 2) where first column is position and second is a beam current :return: wake .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. py:class:: WakeKick(factor=1) Bases: :class:`ocelot.cpbd.wake3D.Wake` The wake field impact on the beam is included as 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 = 500 - defines the number of the equidistant sampling points for the one-dimensional wake coefficients in the Taylor expansion of the 3D wake function. filter_order = 20 - smoothing filter order wake_table = None - wake table [WakeTable()] factor = 1. - scaling coefficient TH - list from WakeTable, (T, H): T- table of wakes coefs, H - matrix of the coefs place in T .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: