Skip to content

Conversation

@chandrarn
Copy link
Collaborator

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.

Copy link
Contributor

Copilot AI left a 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 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.

Copy link
Contributor

Copilot AI commented Jan 26, 2026

@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.

chandrarn and others added 10 commits January 26, 2026 16:28
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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chandrarn
Copy link
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Jan 26, 2026

@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.

@chandrarn
Copy link
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Jan 26, 2026

@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
@chandrarn chandrarn requested a review from ZanderKeith January 26, 2026 21:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
chandrarn and others added 4 commits January 26, 2026 16:45
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>
@chandrarn
Copy link
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Jan 26, 2026

@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.

Copy link
Collaborator

@ZanderKeith ZanderKeith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix linting and I'll approve.

Copy link
Collaborator Author

@chandrarn chandrarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-commit lint checks

@ZanderKeith ZanderKeith merged commit f362d80 into main Jan 27, 2026
@chandrarn chandrarn deleted the RNC_Filament_Edits branch January 27, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants