Skip to content
Snippets Groups Projects
Commit c5a79d24 authored by Alexis GAMELIN's avatar Alexis GAMELIN
Browse files

Refactor beamloading module

Remove untested code
Rename BeamLoadingVlasov to BeamLoadingEquilibrium
parent c485ec4c
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,6 @@ General calculations about instabilities
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.constants import c, m_e, e, pi, epsilon_0
import math
......@@ -204,57 +203,6 @@ def lcbi_growth_rate(ring, I, Vrf, M, fr=None, Rs=None, QL=None, Z=None):
mu = np.argmax(growth_rates)
return growth_rate, mu, growth_rates
def plot_critical_mass(ring, bunch_charge, bunch_spacing, n_points=1e4):
"""
Plot ion critical mass, using Eq. (7.70) p147 of [1]
Parameters
----------
ring : Synchrotron object
bunch_charge : float
Bunch charge in [C].
bunch_spacing : float
Time in between two adjacent bunches in [s].
n_points : float or int, optional
Number of point used in the plot. The default is 1e4.
Returns
-------
fig : figure
References
----------
[1] : Gamelin, A. (2018). Collective effects in a transient microbunching
regime and ion cloud mitigation in ThomX (Doctoral dissertation,
Université Paris-Saclay).
"""
n_points = int(n_points)
s = np.linspace(0, ring.L, n_points)
sigma = ring.sigma(s)
rp = 1.534698250004804e-18 # Proton classical radius, m
N = np.abs(bunch_charge/e)
Ay = N*rp*bunch_spacing*c/(2*sigma[2,:]*(sigma[2,:] + sigma[0,:]))
Ax = N*rp*bunch_spacing*c/(2*sigma[0,:]*(sigma[2,:] + sigma[0,:]))
fig = plt.figure()
ax = plt.gca()
ax.plot(s, Ax, label=r"$A_x^c$")
ax.plot(s, Ay, label=r"$A_y^c$")
ax.set_yscale("log")
ax.plot(s, np.ones_like(s)*2, label=r"$H_2^+$")
ax.plot(s, np.ones_like(s)*16, label=r"$H_2O^+$")
ax.plot(s, np.ones_like(s)*18, label=r"$CH_4^+$")
ax.plot(s, np.ones_like(s)*28, label=r"$CO^+$")
ax.plot(s, np.ones_like(s)*44, label=r"$CO_2^+$")
ax.legend()
ax.set_ylabel("Critical mass")
ax.set_xlabel("Longitudinal position [m]")
return fig
def rwmbi_growth_rate(ring, current, beff, rho_material, plane='x'):
"""
......@@ -327,33 +275,4 @@ def rwmbi_threshold(ring, beff, rho_material, plane='x'):
Ith = (4*np.pi*E0*beff**3) / (c*beta0*tau_rad) * (((1-frac_tune)*omega0) / (2*c*Z0*rho_material))**0.5
return Ith
\ No newline at end of file
\ No newline at end of file
......@@ -5,4 +5,4 @@ Created on Tue Jan 14 18:11:33 2020
@author: gamelina
"""
from mbtrack2.vlasov.beamloading import BeamLoadingVlasov
\ No newline at end of file
from mbtrack2.vlasov.beamloading import BeamLoadingEquilibrium
\ No newline at end of file
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment