diff --git a/mbtrack2/impedance/wakefield.py b/mbtrack2/impedance/wakefield.py index 5de4a8fffb9ecf70a7feb9f14a1a1347ba8d1e5a..31712518626ca947d6faedfee0219d01d1a90876 100644 --- a/mbtrack2/impedance/wakefield.py +++ b/mbtrack2/impedance/wakefield.py @@ -277,6 +277,8 @@ class WakeFunction(ComplexData): Compute a wake function from wake potential data. plot() Plot the wake function data. + loss_factor(sigma) + Compute the loss factor or the kick factor for a Gaussian bunch. """ def __init__(self, @@ -454,6 +456,34 @@ class WakeFunction(ComplexData): label = r"$W_{" + self.component_type + r"}$" + unit ax.set_ylabel(label) return ax + + def loss_factor(self, sigma): + """ + Compute the loss factor or the kick factor for a Gaussian bunch. + Formulas from Eq. (5.6), Eq. (5.12) and Eq. (5.17) of [1]. + + Parameters + ---------- + sigma : float + RMS bunch length in [s] + + Returns + ------- + kloss: float + Loss factor in [V/C] or kick factor in [V/C/m] depanding on the + impedance type. + + References + ---------- + [1] : Zotter, Bruno W., and Semyon A. Kheifets. Impedances and wakes + in high-energy particle accelerators. World Scientific, 1998. + + """ + time = self.data.index + S = 1/(2*np.sqrt(np.pi)*sigma)*np.exp(-1*time**2/(4*sigma**2)) + kloss = trapz(x = time, y = self.data["real"]*S) + + return kloss class Impedance(ComplexData): """ diff --git a/mbtrack2/tracking/wakepotential.py b/mbtrack2/tracking/wakepotential.py index 14ac15167630cda3e042d5b623fe3e9b80a3532a..43a16927e20fa96553d9b503522ceced5fe74200 100644 --- a/mbtrack2/tracking/wakepotential.py +++ b/mbtrack2/tracking/wakepotential.py @@ -70,7 +70,7 @@ class WakePotential(Element): """ - def __init__(self, ring, wakefield, n_bin=65): + def __init__(self, ring, wakefield, n_bin=80): self.wakefield = wakefield self.types = self.wakefield.wake_components self.n_types = len(self.wakefield.wake_components)