Skip to content

Commit

Permalink
Remove unused multi_bunch_mode parameter
Browse files Browse the repository at this point in the history
When summing over frequencies the multi-bunch mode changes the
frequencies that are sampled, but when integrating over omega' all
values of omega' are used and the coupled-bunch mode isn't significant.

From Chao's equation 6.236
omega' = (M*p + mu)w_0 + Omega
where mu is the coupled-bunch mode.
When converting the summation to an integral it is assumed that the
summation index p is continuous and the derivative d(omega')/dp used,
which is equal to M*w_0. This adds an extra factor of 1/(M*w_0) to the
coefficient of the interaction matrix. Notably, the multi-bunch mode
is not included.

This factor of 1/M for the broadband case cancels with the extra factor
of M is added to the summation for multiple bunches as per Chao's
Equation 6.237; which is added in generateInteractionMatrix.

The conclusion is that there can be no multi-bunch coupling in the
broadband approximation; all wakes are assumed to die out before the
next bunch arrives. Each bunch only interacts with itself.

Benchmarks all look OK.
  • Loading branch information
DavidPost-1 committed Sep 5, 2023
1 parent 3d97af7 commit d8d9633
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion PyVlasovSolver/airbag_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ def generateBroadbandBaseMatrix(max_l: int, zhat,
upper_limit: np.ndarray,
zperp,
f0: float, num_bunches: int,
multi_bunch_mode: int,
beta: float, w_xi: float) -> np.ndarray:
'''
Prior to Chao's Equation 6.184, the value of Ω in the definition of
Expand Down
1 change: 0 additions & 1 deletion PyVlasovSolver/nht_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ def generateBroadbandBaseMatrix(max_l: int, ring_radii,
upper_limit: np.ndarray,
zperp,
f0: float, num_bunches: int,
multi_bunch_mode: int,
beta: float, w_xi: float) -> np.ndarray:
num_rings = len(ring_radii)

Expand Down
21 changes: 11 additions & 10 deletions PyVlasovSolver/vlasov.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def generateBaseMatrix(self, method, zperp, max_harmonics, multi_bunch_mode):
This method is likely to be relatively slow, as the sample frequencies
are decided by the integration routine meaning that less terms can be
computed in advance and there's less room for compilation.
multi_bunch_mode is not a required parameter for this method.
'''
if method == "perturbed-simple":
return self._generateBaseMatrix_perturbedSimple(zperp,
Expand All @@ -136,7 +137,7 @@ def generateBaseMatrix(self, method, zperp, max_harmonics, multi_bunch_mode):
max_harmonics,
multi_bunch_mode)
elif method == "broadband":
return self._generateBaseMatrix_broadband(zperp, max_harmonics, multi_bunch_mode)
return self._generateBaseMatrix_broadband(zperp, max_harmonics)
else:
raise ValueError("Invalid method.")

Expand All @@ -146,7 +147,7 @@ def _generateBaseMatrix_perturbedSimple(self, zperp, max_harmonics, multi_bunch_
def _generateBaseMatrix_perturbedFull(self, zperp, max_harmonics, multi_bunch_mode):
raise Exception("Not implemented yet.")

def _generateBaseMatrix_broadband(self, zperp, max_harmonics, multi_bunch_mode):
def _generateBaseMatrix_broadband(self, zperp, max_harmonics):
raise Exception("Not implemented yet.")

def generateLMatrix(self):
Expand Down Expand Up @@ -237,14 +238,14 @@ def _generateBaseMatrix_perturbedFull(self, zperp, max_harmonics, multi_bunch_mo

return self.base_matrix

def _generateBaseMatrix_broadband(self, zperp, max_harmonics, multi_bunch_mode):
sample_frequencies = self._impedanceSampleFrequencies(max_harmonics, multi_bunch_mode)
def _generateBaseMatrix_broadband(self, zperp, max_harmonics):
sample_frequencies = self._impedanceSampleFrequencies(max_harmonics, 0)
upper_limit = np.max(sample_frequencies)

self.base_matrix = am.generateBroadbandBaseMatrix(self.max_l, self.zhat,
upper_limit, zperp,
self.accelerator.f0, self.accelerator.num_bunches,
multi_bunch_mode, self.accelerator.beta,
self.accelerator.beta,
self.accelerator.w_xi)
return self.base_matrix

Expand Down Expand Up @@ -291,14 +292,14 @@ def _generateBaseMatrix_perturbedFull(self, zperp, max_harmonics, multi_bunch_mo

return self.base_matrix

def _generateBaseMatrix_broadband(self, zperp, max_harmonics, multi_bunch_mode):
sample_frequencies = self._impedanceSampleFrequencies(max_harmonics, multi_bunch_mode)
def _generateBaseMatrix_broadband(self, zperp, max_harmonics):
sample_frequencies = self._impedanceSampleFrequencies(max_harmonics, 0)
upper_limit = np.max(sample_frequencies)

self.base_matrix = nht.generateBroadbandBaseMatrix(self.max_l, self.ring_radii,
upper_limit, zperp,
self.accelerator.f0, self.accelerator.num_bunches,
multi_bunch_mode, self.accelerator.beta,
self.accelerator.beta,
self.accelerator.w_xi)
return self.base_matrix

Expand Down Expand Up @@ -369,8 +370,8 @@ def _generateBaseMatrix_perturbedFull(self, zperp, max_harmonics, multi_bunch_mo

return self.base_matrix

def _generateBaseMatrix_broadband(self, zperp, max_harmonics, multi_bunch_mode):
sample_frequencies = self._impedanceSampleFrequencies(max_harmonics, multi_bunch_mode)
def _generateBaseMatrix_broadband(self, zperp, max_harmonics):
sample_frequencies = self._impedanceSampleFrequencies(max_harmonics, 0)
upper_limit = np.max(sample_frequencies)

self.base_matrix = lm.generateBroadbandBaseMatrix(self.max_l, self.max_n, self.a, self.Gk,
Expand Down

0 comments on commit d8d9633

Please sign in to comment.