diff --git a/tracking/particles.py b/tracking/particles.py index 0833e8e052dbe7ad122db4f3f7c848d019c2c3af..80b1e5dd760a35fbe89618669aab1287bd2c84dc 100644 --- a/tracking/particles.py +++ b/tracking/particles.py @@ -86,11 +86,6 @@ class Bunch: coordinates. emit : array of shape (3,) Bunch emittance for each plane [1]. !!! -> Correct for long ? - energy_change : series of shape (alive,) - Store the particle relative energy change in the last turn. Only the - values for alive particles are returned. Used by the - SynchrotronRadiation class to compute radiation damping. To be changed - by Element objects which change the energy, for example RF cavities. Methods ------- @@ -128,8 +123,6 @@ class Bunch: self.current = current if not alive: self.alive = np.zeros((self.mp_number,),dtype=bool) - - self._energy_change = np.zeros((self.mp_number,),dtype=float) def __len__(self): """Return the number of alive particles""" @@ -243,24 +236,6 @@ class Bunch: (self.ring.optics.local_beta * np.mean(self['yp']**2)) return np.array((Jx,Jy)) - @property - def energy_change(self): - """Store the particle relative energy change in the last turn. Used by - the SynchrotronRadiation class to compute radiation damping. To be - changed by Element objects which change the energy, for example RF - cavities.""" - if self.track_alive is True: - return self._energy_change[self.alive] - else: - return self._energy_change - - @energy_change.setter - def energy_change(self, value): - if self.track_alive is True: - self._energy_change[self.alive] = value - else: - self._energy_change = value - def init_gaussian(self, cov=None, mean=None, **kwargs): """ Initialize bunch particles with 6D gaussian phase space. diff --git a/tracking/rf.py b/tracking/rf.py index b956380f84a1f3e5ed6babfc6cde769fd40c9c7b..b1fc6056920b7451c743c087d57fc5db73cb4063 100644 --- a/tracking/rf.py +++ b/tracking/rf.py @@ -44,12 +44,8 @@ class RFCavity(Element): ---------- bunch : Bunch or Beam object """ - energy_change = self.Vc / self.ring.E0 * np.cos( + bunch["delta"] += 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(