Improvements for helicity, q(r) discritization, and d_phi advance#1
Improvements for helicity, q(r) discritization, and d_phi advance#1ZanderKeith merged 20 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements improvements to the magnetic geometry calculations to better match empirical C-Mod data, specifically addressing helicity handling, q(r) discretization, and the d_phi advance calculation.
Changes:
- Switched from interpolation to smoothing splines for q(psi) and F(psi) to avoid discretization jumps
- Added helicity_sign parameter to control the sign of the helicity in filament tracing
- Improved d_phi calculation to use actual segment lengths instead of assuming circular cross-sections
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 19 comments.
| File | Description |
|---|---|
| synthwave/magnetic_geometry/equilibrium_field.py | Replaced interpolating splines with smoothing splines for q(psi) and F(psi); added lam parameter for smoothing control; changed ValueError to SyntaxError in error handling |
| synthwave/magnetic_geometry/filaments.py | Added helicity_sign parameter to _trace method; updated _Z_a and psi_prime_a functions to use helicity_sign; implemented new _d_phi_dl function using actual segment lengths; increased Newton solver iterations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@chandrarn I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: chandrarn <8441592+chandrarn@users.noreply.github.com>
[WIP] Update helicity and q(r) discretization based on feedback
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@chandrarn I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@chandrarn I've opened a new pull request, #4, to work on those changes. Once the pull request is ready, I'll request review from you. |
[WIP] Improve helicity and q(r) discretization for d_phi advance
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@chandrarn I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you. |
ZanderKeith
left a comment
There was a problem hiding this comment.
Fix linting and I'll approve.
chandrarn
left a comment
There was a problem hiding this comment.
pre-commit lint checks
Improvements to ensure agreement with empirical C-Mod data. The improved d_phi step is necessary for accurate filament structures for non-interger m/n modes. The fix corrects an assumption that d_l_theta = r theta, which is only true in the limiting case of circular cross section.