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
dcb29270
Commit
dcb29270
authored
1 year ago
by
Alexis GAMELIN
Browse files
Options
Downloads
Patches
Plain Diff
Fix Resonator
Fix resonator wake function for negative time and update docstrings.
parent
71de9837
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mbtrack2/impedance/resonator.py
+11
-3
11 additions, 3 deletions
mbtrack2/impedance/resonator.py
with
11 additions
and
3 deletions
mbtrack2/impedance/resonator.py
+
11
−
3
View file @
dcb29270
...
...
@@ -14,6 +14,9 @@ class Resonator(WakeField):
"""
Resonator model WakeField element which computes the impedance and the
wake function in both longitudinal and transverse case.
! For transverse case, if Q < 2, there is a kick factor mismatch
between time and frequency domain.
Parameters
----------
...
...
@@ -22,7 +25,7 @@ class Resonator(WakeField):
frequency : array of float
Frequency points where the impedance will be evaluated in [Hz].
Rs : float
Shunt impedance in [ohm].
Shunt impedance in [ohm]
in longitudinal or [ohm/m] in transverse
.
fr : float
Resonance frequency in [Hz].
Q : float
...
...
@@ -94,6 +97,8 @@ class Resonator(WakeField):
(
2
*
self
.
Q_p
)))
if
np
.
any
(
np
.
abs
(
t
)
<
atol
):
wl
[
np
.
abs
(
t
)
<
atol
]
=
wl
[
np
.
abs
(
t
)
<
atol
]
/
2
elif
np
.
any
(
t
<
-
atol
):
wl
[
t
<
-
atol
]
=
0
return
wl
def
long_impedance
(
self
,
f
):
...
...
@@ -105,13 +110,16 @@ class Resonator(WakeField):
def
transverse_wake_function
(
self
,
t
):
if
self
.
Q
>=
0.5
:
return
(
self
.
wr
*
self
.
Rs
/
self
.
Q_p
*
wt
=
(
self
.
wr
*
self
.
Rs
/
self
.
Q_p
*
np
.
exp
(
-
1
*
t
*
self
.
wr
/
2
/
self
.
Q_p
)
*
np
.
sin
(
self
.
wr_p
*
t
))
else
:
return
(
self
.
wr
*
self
.
Rs
/
self
.
Q_p
*
wt
=
(
self
.
wr
*
self
.
Rs
/
self
.
Q_p
*
np
.
exp
(
-
1
*
t
*
self
.
wr
/
2
/
self
.
Q_p
)
*
np
.
sinh
(
self
.
wr_p
*
t
))
if
np
.
any
(
t
<
0
):
wt
[
t
<
0
]
=
0
return
wt
class
PureInductive
(
WakeField
):
...
...
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