From b965100e36d296124880492d902251f6988a3e9e Mon Sep 17 00:00:00 2001 From: Gamelin Alexis <alexis.gamelin@synchrotron-soleil.fr> Date: Thu, 3 Mar 2022 10:13:32 +0100 Subject: [PATCH] Add non-linear model to FBII rise time calculation Correct typo in ion_frequency --- collective_effects/ions.py | 43 ++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/collective_effects/ions.py b/collective_effects/ions.py index 66be6a0..bac8d8e 100644 --- a/collective_effects/ions.py +++ b/collective_effects/ions.py @@ -56,7 +56,7 @@ def ion_cross_section(ring, ion): return sigma -def ion_frequency(N, Lesp, sigmax, sigmay, ion="CO", dim="y", express="coupling"): +def ion_frequency(N, Lsep, sigmax, sigmay, ion="CO", dim="y", express="coupling"): """ Compute the ion oscillation frequnecy. @@ -64,7 +64,7 @@ def ion_frequency(N, Lesp, sigmax, sigmay, ion="CO", dim="y", express="coupling" ---------- N : float Number of electrons per bunch. - Lesp : float + Lsep : float Bunch spacing in [m]. sigmax : float or array Horizontal beam size in [m]. @@ -118,22 +118,32 @@ def ion_frequency(N, Lesp, sigmax, sigmay, ion="CO", dim="y", express="coupling" elif express == "no_coupling": k = 1 - f = c * np.sqrt( 2 * rp * N / ( A * k * Lesp * sigmay * (sigmax + sigmay) ) ) / (2*pi) + f = c * np.sqrt( 2 * rp * N / ( A * k * Lsep * sigmay * (sigmax + sigmay) ) ) / (2*pi) return f def fast_beam_ion(ring, Nb, nb, Lsep, sigmax, sigmay, P, T, beta, - decoherence=True, delta_omega = 0, ion="CO", dim="y"): + model="linear", delta_omega = 0, ion="CO", dim="y"): """ Compute fast beam ion instability rise time [1]. - Warning ! If decoherence=False, the rise time is not an e-folding time - (i.e. y ~ exp(t/tau)) but an assymptotic grow time - (i.e. y ~ exp(sqrt(t/tau))) see [1][2]. + Warning ! + If model="linear", the rise time is an assymptotic grow time + (i.e. y ~ exp(sqrt(t/tau))) [1]. + If model="decoherence", the rise time is an e-folding time + (i.e. y ~ exp(t/tau)) [2]. + If model="non-linear", the rise time is a linear growth time + (i.e. y ~ t/tau) [3]. + + The linear model assumes that [1]: + x,y << sigmax,sigmay The decoherence model assumes that [2]: Lsep << c / (2 * pi * ion_frequency) - Lsep << c / (2 * pi * betatron_frequency) + Lsep << c / (2 * pi * betatron_frequency) + + The non-linear model assumes that [3]: + x,y >> sigmax,sigmay Parameters ---------- @@ -154,8 +164,10 @@ def fast_beam_ion(ring, Nb, nb, Lsep, sigmax, sigmay, P, T, beta, Tempertature in [K]. beta : float Average betatron function around the ring in [m]. - decoherence : bool, optional - If True, decoherence is taken into account using [2]. + model : str, optional + If "linear", use [1]. + If "decoherence", use [2]. + If "non-linear", use [3]. delta_omega : float, optional RMS variation of the ion oscillation angular frequnecy around the ring in [Hz]. @@ -175,6 +187,8 @@ def fast_beam_ion(ring, Nb, nb, Lsep, sigmax, sigmay, P, T, beta, linear theory and simulations", Physical Review E 52 (1995). [2] : G. V. Stupakov, T. O. Raubenheimer, and F. Zimmermann, "Fast beam-ion instability. II. effect of ion decoherence", Physical Review E 52 (1995). + [3] : Chao, A. W., & Mess, K. H. (Eds.). (2013). Handbook of accelerator + physics and engineering. World scientific. 3rd Printing. p417. """ if dim == "y": @@ -198,8 +212,15 @@ def fast_beam_ion(ring, Nb, nb, Lsep, sigmax, sigmay, P, T, beta, tau = den/num - if decoherence is True: + if model == "decoherence": tau = tau * 2 * np.sqrt(2) * nb * Lsep * delta_omega / c + elif model == "non-linear": + fi = ion_frequency(Nb, Lsep, sigmax, sigmay, ion, dim) + tau = tau * 2 * pi * fi * ring.T1 * nb**(3/2) + elif model == "linear": + pass + else: + raise ValueError("model unknown") return tau -- GitLab