Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mbtrack2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Collective Effects
mbtrack2
Commits
7df41cfe
Commit
7df41cfe
authored
11 months ago
by
Keon Hee KIM
Browse files
Options
Downloads
Patches
Plain Diff
Import _wofz from particles_electromagnetic_fields
parent
2bf4ef51
No related branches found
No related tags found
1 merge request
!14
Faster CircularResistiveWall
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mbtrack2/impedance/resistive_wall.py
+11
-19
11 additions, 19 deletions
mbtrack2/impedance/resistive_wall.py
with
11 additions
and
19 deletions
mbtrack2/impedance/resistive_wall.py
+
11
−
19
View file @
7df41cfe
...
@@ -5,9 +5,9 @@ Define resistive wall elements based on the WakeField class.
...
@@ -5,9 +5,9 @@ Define resistive wall elements based on the WakeField class.
import
numpy
as
np
import
numpy
as
np
from
scipy.constants
import
c
,
epsilon_0
,
mu_0
from
scipy.constants
import
c
,
epsilon_0
,
mu_0
from
scipy.special
import
wofz
as
_scipy_wofz
from
mbtrack2.impedance.wakefield
import
Impedance
,
WakeField
,
WakeFunction
from
mbtrack2.impedance.wakefield
import
Impedance
,
WakeField
,
WakeFunction
from
mbtrack2.tracking.particles_electromagnetic_fields
import
_wofz
def
skin_depth
(
frequency
,
rho
,
mu_r
=
1
,
epsilon_r
=
1
):
def
skin_depth
(
frequency
,
rho
,
mu_r
=
1
,
epsilon_r
=
1
):
...
@@ -239,21 +239,11 @@ class CircularResistiveWall(WakeField):
...
@@ -239,21 +239,11 @@ class CircularResistiveWall(WakeField):
wt
[
idx2
]
=
self
.
__TransWakeApprox
(
time
[
idx2
])
wt
[
idx2
]
=
self
.
__TransWakeApprox
(
time
[
idx2
])
return
wt
return
wt
def
__wofz
(
self
,
z
):
"""
Compute the Faddeeva function w(z) = exp(-z**2) * erfc(-i*z).
Returns
-------
tuple
Real and imaginary parts of the Faddeeva function.
"""
res
=
_scipy_wofz
(
z
)
return
res
.
real
,
res
.
imag
def
__LongWakeExact
(
self
,
t
,
factor
):
def
__LongWakeExact
(
self
,
t
,
factor
):
w1re
,
_
=
self
.
__wofz
(
1j
*
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
w1re
,
_
=
_wofz
(
0
,
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
w2re
,
_
=
self
.
__wofz
(
np
.
exp
(
1j
*
np
.
pi
/
6
)
*
w2re
,
_
=
_wofz
(
np
.
cos
(
np
.
pi
/
6
)
*
np
.
sqrt
(
2
*
t
/
self
.
t0
),
np
.
sin
(
np
.
pi
/
6
)
*
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
wl
=
factor
*
(
4
*
np
.
exp
(
-
1
*
t
/
self
.
t0
)
*
wl
=
factor
*
(
4
*
np
.
exp
(
-
1
*
t
/
self
.
t0
)
*
...
@@ -262,8 +252,10 @@ class CircularResistiveWall(WakeField):
...
@@ -262,8 +252,10 @@ class CircularResistiveWall(WakeField):
return
wl
return
wl
def
__TransWakeExact
(
self
,
t
,
factor
):
def
__TransWakeExact
(
self
,
t
,
factor
):
w1re
,
_
=
self
.
__wofz
(
1j
*
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
w1re
,
_
=
_wofz
(
0
,
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
w2re
,
w2im
=
self
.
__wofz
(
np
.
exp
(
1j
*
np
.
pi
/
6
)
*
w2re
,
w2im
=
_wofz
(
np
.
cos
(
np
.
pi
/
6
)
*
np
.
sqrt
(
2
*
t
/
self
.
t0
),
np
.
sin
(
np
.
pi
/
6
)
*
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
wt
=
factor
*
(
2
*
np
.
exp
(
-
1
*
t
/
self
.
t0
)
*
wt
=
factor
*
(
2
*
np
.
exp
(
-
1
*
t
/
self
.
t0
)
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment