Something went wrong on our end
Select Git revision
-
Gamelin Alexis authored
Update machines/__init__.py, machines/soleil.py, tracking/__init__.py, tracking/aperture.py, tracking/element.py, tracking/optics.py, tracking/parallel.py, tracking/particles.py, tracking/rf.py, tracking/synchrotron.py files
Gamelin Alexis authoredUpdate machines/__init__.py, machines/soleil.py, tracking/__init__.py, tracking/aperture.py, tracking/element.py, tracking/optics.py, tracking/parallel.py, tracking/particles.py, tracking/rf.py, tracking/synchrotron.py files
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
rf.py 1.44 KiB
# -*- coding: utf-8 -*-
"""
This module handles radio-frequency (RF) cavitiy elements.
@author: gamelina
@date: 11/03/2020
"""
import numpy as np
from tracking.element import Element
class RFCavity(Element):
"""
Perfect RF cavity class for main and harmonic RF cavities.
Use cosine definition.
Parameters
----------
ring : Synchrotron object
m : int
Harmonic number of the cavity
Vc : float
Amplitude of cavity voltage [V]
theta : float
Phase of Cavity voltage
"""
def __init__(self, ring, m, Vc, theta):
self.ring = ring
self.m = m
self.Vc = Vc
self.theta = theta
@Element.parallel
def track(self,bunch):
"""
Tracking method for the element.
No bunch to bunch interaction, so written for Bunch objects and
@Element.parallel is used to handle Beam objects.
Parameters
----------
bunch : Bunch or Beam object
"""
energy_change = self.Vc / self.ring.E0 * np.cos(
self.m * self.ring.omega1 * bunch["tau"] + self.theta )
bunch["delta"] += energy_change
# energy_change is used by SynchrotronRadiation to compute radiation
# damping
bunch.energy_change += energy_change
def value(self, val):
return self.Vc / self.ring.E0 * np.cos(
self.m * self.ring.omega1 * val + self.theta )