diff --git a/tracking/synchrotron.py b/tracking/synchrotron.py index a622c0458f5ba5efc77ac2492c3f0dc4f245223b..a12122c14e15d86c8d77a07fac0c8ff3f72ef779 100644 --- a/tracking/synchrotron.py +++ b/tracking/synchrotron.py @@ -69,6 +69,11 @@ class Synchrotron: Momentum compaction. sigma : array of shape (4,) RMS beam size at equilibrium in [m]. + + Methods + ------- + synchrotron_tune(Vrf) + Compute synchrotron tune from RF voltage. """ def __init__(self, h, optics, particle, **kwargs): self._h = h @@ -230,4 +235,23 @@ class Synchrotron: self.optics.local_dispersion[2]**2*self.sigma_delta)**0.5 sigma[3] = (self.emit[1]*self.optics.local_alpha[1] + self.optics.local_dispersion[3]**2*self.sigma_delta)**0.5 - return sigma \ No newline at end of file + return sigma + + def synchrotron_tune(Vrf): + """ + Compute synchrotron tune from RF voltage + + Parameters + ---------- + Vrf : float + Main RF voltage in [V]. + + Returns + ------- + tuneS : float + Synchrotron tune. + """ + phase = np.pi - np.arcsin(ring.U0 / Vrf) + tuneS = np.sqrt( - (Vrf / ring.E0) * (ring.h * ring.ac) / (2*np.pi) + * np.cos(phase) ) + return tuneS \ No newline at end of file