:mod:`ocelot.cpbd.sc` ===================== .. py:module:: ocelot.cpbd.sc .. autoapi-nested-parse:: @author: Igor Zagorodnov @ Martin Dohlus Created on 27.03.2015 Revision on 01.06.2017: coordinate transform to the velocity direction 2019: Added LSC: S. Tomin and I. Zagorodnov Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ocelot.cpbd.sc.SpaceCharge ocelot.cpbd.sc.LSC Functions ~~~~~~~~~ .. autoapisummary:: ocelot.cpbd.sc.smooth_z .. data:: logger .. data:: pyfftw_flag :annotation: = True .. data:: ne_flag :annotation: = True .. function:: smooth_z(Zin, mslice) .. py:class:: SpaceCharge(step=1) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Space Charge physics process Attributes: self.step = 1 [in Navigator.unit_step] - step of the Space Charge kick applying self.nmesh_xyz = [63, 63, 63] - 3D mesh Description: The space charge forces are calculated by solving the Poisson equation in the bunch frame. Then the Lorentz transformed electromagnetic field is applied as a kick in the laboratory frame. For the solution of the Poisson equation we use an integral representation of the electrostatic potential by convolution of the free-space Green's function with the charge distribution. The convolution equation is solved with the help of the Fast Fourier Transform (FFT). The same algorithm for solution of the 3D Poisson equation is used, for example, in ASTRA .. method:: prepare(self, lat) method is called at the moment of Physics Process addition to Navigator class. :param lat: :return: .. method:: sym_kernel(self, ijk2, hxyz) .. method:: potential(self, q, steps) .. method:: el_field(self, X, Q, gamma, nxyz) .. method:: apply(self, p_array, zstep) the method is called on every step. :param p_array: :param dz: :return: .. py:class:: LSC(step=1) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Longitudinal Space Charge smooth_param - 0.1 smoothing parameter, resolution = np.std(p_array.tau())*smooth_param .. method:: imp_lsc(self, gamma, sigma, w, dz) gamma - energy sigma - transverse RMS size of the beam w - omega = 2*pi*f .. method:: imp_step_lsc(self, gamma, rb, w, dz) longitudinal space-charge impedance in case of a stepped profile bunch gamma - energy rb - transverse radius of the beam w - omega = 2*pi*f .. method:: wake2impedance(self, s, w) Fourier transform with exp(iwt) s - Meter w - V/C f - Hz y - Om .. method:: impedance2wake(self, f, y) Fourier transform with exp(-iwt) f - Hz y - Om s - Meter w - V/C .. method:: wake_lsc(self, s, bunch, gamma, sigma, dz) .. method:: apply(self, p_array, dz) wakes in V/pC :param p_array: :param dz: :return: