-
-
Notifications
You must be signed in to change notification settings - Fork 18
Add resistive wall Wakefields #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a comprehensive resistive wall impedance module (ResistiveWallImpedance) that computes longitudinal impedance Z(k) and wakefield W(z) through direct numerical integration. This complements the existing fast pseudomode approximation (ResistiveWallWakefield) by providing high-accuracy calculations suitable for validation and research applications.
Key changes:
- New
ResistiveWallImpedanceclass supporting flat and round geometries with direct impedance/wakefield calculations - Enhanced
ResistiveWallWakefieldwith lazy matplotlib imports, improved__repr__, and standardized validation - Added
wakefield_plot()visualization function to ParticleGroup and plot module - Updated documentation with two example notebooks and navigation entries
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pmd_beamphysics/wakefields/resistive_wall_impedance.py | New module implementing numerical impedance/wakefield calculations with AC conductivity support |
| pmd_beamphysics/wakefields/resistive_wall.py | Existing pseudomode wakefield implementation with improved documentation and lazy imports |
| pmd_beamphysics/wakefields/init.py | Module initialization exporting both wakefield classes and utility functions |
| pmd_beamphysics/plot.py | Added wakefield_plot() function and enhanced density_plot() with flexible axis support |
| pmd_beamphysics/particles.py | Added wakefield_plot() method to ParticleGroup class |
| mkdocs.yml | Added wakefields section to documentation navigation |
| docs/examples/wakefields/resistive_wall_wakefield.ipynb | Tutorial notebook for pseudomode wakefield usage |
| docs/examples/wakefields/resistive_wall_impedance.ipynb | Tutorial notebook comparing numerical and pseudomode approaches |
| docs/examples/data/SLAC-PUB-10707-digitized-Fig8-AC-Cu.csv | Reference data for flat geometry validation |
| docs/examples/data/SLAC-PUB-10707-digitized-Fig4-AC-Cu.csv | Reference data for round geometry validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Based on my work on this branch, here's a summary for the PR:
PR: Add Resistive Wall Impedance Module
Summary
This PR adds a new
ResistiveWallImpedanceclass for computing longitudinal resistive wall impedance Z(k) and wakefield W(z) via direct numerical integration. This complements the existingResistiveWallWakefieldpseudomode approach by providing high-accuracy calculations suitable for validation and research.New Features
ResistiveWallImpedanceclassgeometryparameterplot_impedance()andplot_wakefield()convenience methodsFlatResistiveWallImpedance()andRoundResistiveWallImpedance()Physics formulas implemented
Flat geometry (SLAC-PUB-10707 Eq. 52):
$$Z_\parallel(k) = \frac{Z_0}{2\pi a} \int_0^\infty \frac{dx}{\cosh(x)[\cosh(x)/\zeta - ika \cdot \text{sinhc}(x)]}$$
Round geometry (SLAC-PUB-10707 Eq. 2, PhysRevSTAB.18.034402 Eq. 7):
$$Z_\parallel(k) = \frac{Z_0}{2\pi a}\left(\frac{1}{\zeta(k)} - \frac{ika}{2}\right)^{-1}$$
Wakefield (Chao Eq. 2.24):
$$W(z) = \frac{2c}{\pi} \int_0^{k_{\max}} \text{Re}[Z(k)] \cos(kz) , dk$$
Low-level functions exposed
ac_conductivity()— Drude model AC conductivitysurface_impedance()— Surface impedance for conducting walllongitudinal_impedance_flat()/longitudinal_impedance_round()— Direct impedance calculationwakefield_from_impedance()— Wakefield via Fourier transformcharacteristic_length()— Characteristic length scale s₀Improvements to existing
ResistiveWallWakefield__repr__— Shows all parameters plus derived values (s₀, Γ, k_r, Q_r)relaxation_time >= 0now consistent across modulesDocumentation
References