Skip to content
Snippets Groups Projects
Commit 2969fef2 authored by Keon Hee KIM's avatar Keon Hee KIM
Browse files

Reduced each term of the longitudinal and transverse wake functions to speed up the calculation

parent 97dac5da
No related branches found
No related tags found
1 merge request!14Faster CircularResistiveWall
...@@ -133,6 +133,11 @@ class CircularResistiveWall(WakeField): ...@@ -133,6 +133,11 @@ class CircularResistiveWall(WakeField):
to the characteristic time t0. to the characteristic time t0.
Eq. (11) in [1] is completely identical to Eq. (22) in [2]. Eq. (11) in [1] is completely identical to Eq. (22) in [2].
The real parts of the last two terms of Eq. (11) in [1] are the same,
and the imaginary parts have the same magnitude but opposite signs.
Therefore, the former term was doubled, the latter term was eliminated,
and only the real part was taken to speed up the calculation.
The fundamental theorem of beam loading [3] is applied for the exact The fundamental theorem of beam loading [3] is applied for the exact
expression of the longitudinal wake function: Wl(0) = Wl(0+)/2. expression of the longitudinal wake function: Wl(0) = Wl(0+)/2.
...@@ -188,10 +193,15 @@ class CircularResistiveWall(WakeField): ...@@ -188,10 +193,15 @@ class CircularResistiveWall(WakeField):
Eq. (11) in [1] is completely identical to Eq. (25) in [2]. Eq. (11) in [1] is completely identical to Eq. (25) in [2].
There are typos in both Eq. (11) in [1] and Eq. (25) in [2]. There are typos in both Eq. (11) in [1] and Eq. (25) in [2].
Corrected the typos in the last two terms of exact expression Corrected the typos in the last two terms of exact expression for
for transverse wake function in Eq. (11), of [1]. transverse wake function in Eq. (11), of [1].
It is necessary to multiply Eq. (25) in [2] by c*t0. It is necessary to multiply Eq. (25) in [2] by c*t0.
The real parts of the last two terms of Eq. (11) in [1] are the same,
and the imaginary parts have the same magnitude but opposite signs.
Therefore, the former term was doubled, the latter term was eliminated,
and only the real part was taken to speed up the calculation.
Parameters Parameters
---------- ----------
time : array of float time : array of float
...@@ -230,31 +240,23 @@ class CircularResistiveWall(WakeField): ...@@ -230,31 +240,23 @@ class CircularResistiveWall(WakeField):
return wt return wt
def __LongWakeExact(self, t, factor): def __LongWakeExact(self, t, factor):
wl = np.real( factor * wl = factor * ( 4 * np.exp(-1 * t / self.t0) *
( 4 * np.exp(-1 * t / self.t0) * np.cos(np.sqrt(3) * t / self.t0)
np.cos(np.sqrt(3) * t / self.t0) + np.real( wofz( 1j *
+ wofz( 1j * np.sqrt(2 * t / self.t0) ) )
np.sqrt(2 * t / self.t0) ) - 2 * np.real( wofz( np.exp(1j * np.pi / 6) *
- wofz( np.exp(1j * np.pi / 6) * np.sqrt(2 * t / self.t0) ) ) )
np.sqrt(2 * t / self.t0) )
- wofz( -1 * np.exp(-1j * np.pi / 6) *
np.sqrt(2 * t / self.t0)) ) )
return wl return wl
def __TransWakeExact(self, t, factor): def __TransWakeExact(self, t, factor):
wt = np.real( factor * wt = factor * ( 2 * np.exp(-1 * t / self.t0) *
( 2 * np.exp(-1 * t / self.t0) * ( np.sqrt(3) * np.sin(np.sqrt(3) * t / self.t0)
( np.sqrt(3) * - np.cos(np.sqrt(3) * t / self.t0) )
np.sin(np.sqrt(3) * t / self.t0) - + np.real( wofz( 1j *
np.cos(np.sqrt(3) * t / self.t0) ) np.sqrt(2 * t / self.t0) ) )
+ wofz( 1j * + 2 * np.real( np.exp(-1j * np.pi / 3) *
np.sqrt(2 * t / self.t0) ) wofz( np.exp(1j * np.pi / 6) *
+ np.exp(-1j * np.pi / 3) * np.sqrt(2 * t / self.t0) ) ) )
wofz( np.exp(1j * np.pi / 6) *
np.sqrt(2 * t / self.t0) )
+ np.exp(1j * np.pi / 3) *
wofz( -1 * np.exp(-1j * np.pi / 6) *
np.sqrt(2 * t / self.t0) ) ) )
return wt return wt
def __LongWakeApprox(self, t): def __LongWakeApprox(self, t):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment