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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Collective Effects
mbtrack2
Commits
e5a746f5
Commit
e5a746f5
authored
9 months ago
by
Keon Hee KIM
Browse files
Options
Downloads
Patches
Plain Diff
Add spacing to improve readability
parent
ed09e1a1
No related branches found
No related tags found
1 merge request
!14
Faster CircularResistiveWall
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mbtrack2/impedance/resistive_wall.py
+27
-17
27 additions, 17 deletions
mbtrack2/impedance/resistive_wall.py
with
27 additions
and
17 deletions
mbtrack2/impedance/resistive_wall.py
+
27
−
17
View file @
e5a746f5
...
...
@@ -79,7 +79,6 @@ class CircularResistiveWall(WakeField):
[4] : Zotter, Bruno W., and Semyon A. Kheifets (1998). Impedances and wakes
in high-energy particle accelerators. World Scientific.
"""
def
__init__
(
self
,
...
...
@@ -168,7 +167,8 @@ class CircularResistiveWall(WakeField):
if
exact
==
True
:
idx2
=
time
==
0
idx3
=
np
.
logical_not
(
np
.
logical_or
(
idx1
,
idx2
))
factor
=
self
.
Z0
*
c
/
(
3
*
np
.
pi
*
self
.
radius
**
2
)
*
self
.
length
factor
=
(
self
.
Z0
*
c
/
(
3
*
np
.
pi
*
self
.
radius
**
2
)
*
self
.
length
)
if
np
.
any
(
idx2
):
# fundamental theorem of beam loading
wl
[
idx2
]
=
3
*
factor
/
2
...
...
@@ -217,8 +217,9 @@ class CircularResistiveWall(WakeField):
if
exact
==
True
:
idx2
=
time
==
0
idx3
=
np
.
logical_not
(
np
.
logical_or
(
idx1
,
idx2
))
factor
=
(
(
self
.
Z0
*
c
**
2
*
self
.
t0
)
/
(
3
*
np
.
pi
*
self
.
radius
**
4
)
*
self
.
length
)
factor
=
(
(
self
.
Z0
*
c
**
2
*
self
.
t0
)
/
(
3
*
np
.
pi
*
self
.
radius
**
4
)
*
self
.
length
)
wt
[
idx3
]
=
self
.
__TransWakeExact
(
time
[
idx3
],
factor
)
else
:
idx2
=
np
.
logical_not
(
idx1
)
...
...
@@ -226,22 +227,31 @@ class CircularResistiveWall(WakeField):
return
wt
def
__LongWakeExact
(
self
,
t
,
factor
):
wl
=
np
.
real
(
factor
*
(
4
*
np
.
exp
(
-
1
*
t
/
self
.
t0
)
*
np
.
cos
(
np
.
sqrt
(
3
)
*
t
/
self
.
t0
)
+
wofz
(
1j
*
np
.
sqrt
(
2
*
t
/
self
.
t0
))
-
wofz
(
np
.
exp
(
1j
*
np
.
pi
/
6
)
*
np
.
sqrt
(
2
*
t
/
self
.
t0
))
-
wofz
(
-
1
*
np
.
exp
(
-
1j
*
np
.
pi
/
6
)
*
np
.
sqrt
(
2
*
t
/
self
.
t0
))
)
)
wl
=
np
.
real
(
factor
*
(
4
*
np
.
exp
(
-
1
*
t
/
self
.
t0
)
*
np
.
cos
(
np
.
sqrt
(
3
)
*
t
/
self
.
t0
)
+
wofz
(
1j
*
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
-
wofz
(
np
.
exp
(
1j
*
np
.
pi
/
6
)
*
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
-
wofz
(
-
1
*
np
.
exp
(
-
1j
*
np
.
pi
/
6
)
*
np
.
sqrt
(
2
*
t
/
self
.
t0
))
)
)
return
wl
def
__TransWakeExact
(
self
,
t
,
factor
):
wt
=
np
.
real
(
factor
*
(
2
*
np
.
exp
(
-
1
*
t
/
self
.
t0
)
*
(
np
.
sqrt
(
3
)
*
np
.
sin
(
np
.
sqrt
(
3
)
*
t
/
self
.
t0
)
-
np
.
cos
(
np
.
sqrt
(
3
)
*
t
/
self
.
t0
)
)
+
wofz
(
1j
*
np
.
sqrt
(
2
*
t
/
self
.
t0
))
+
np
.
exp
(
-
1j
*
np
.
pi
/
3
)
*
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
)
)
)
)
wt
=
np
.
real
(
factor
*
(
2
*
np
.
exp
(
-
1
*
t
/
self
.
t0
)
*
(
np
.
sqrt
(
3
)
*
np
.
sin
(
np
.
sqrt
(
3
)
*
t
/
self
.
t0
)
-
np
.
cos
(
np
.
sqrt
(
3
)
*
t
/
self
.
t0
)
)
+
wofz
(
1j
*
np
.
sqrt
(
2
*
t
/
self
.
t0
)
)
+
np
.
exp
(
-
1j
*
np
.
pi
/
3
)
*
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
def
__LongWakeApprox
(
self
,
t
):
...
...
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