Skip to content

Commit

Permalink
Merge branch 'feature/avoid_multitracker' of github.com:xsuite/xwakes…
Browse files Browse the repository at this point in the history
… into feature/avoid_multitracker
  • Loading branch information
lgiacome committed Nov 18, 2024
2 parents 5fb943c + 11f3328 commit dcd1877
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions xwakes/wit/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,20 +582,19 @@ def wake(self, t):
plane = self.plane
omega_r = 2 * np.pi * f_r
root_term = np.sqrt(1 - 1 / (4 * q ** 2) + 0J)
omega_bar = omega_r * root_term
alpha = omega_r / (2 * q)
if plane == 'z':
omega_bar = omega_r * root_term
alpha = omega_r / (2 * q)
out = np.zeros_like(t)
mask = t >= 0
out[mask] = factor * (omega_r * r * np.exp(-alpha * t[mask]) * (
np.cos(omega_bar * t[mask]) -
alpha * np.sin(omega_bar * t[mask]) / omega_bar) / q).real
else:
omega_bar = omega_r * root_term
out = np.zeros_like(t)
mask = t >= 0
out[mask] = factor * (omega_r * r * np.exp(-omega_r * t[mask] / (2 * q)) *
np.sin(omega_r * root_term * t[mask]) /
out[mask] = factor * (omega_r * r * np.exp(-alpha * t[mask]) *
np.sin(omega_bar * t[mask]) /
(q * root_term)).real
return out

Expand Down

0 comments on commit dcd1877

Please sign in to comment.