feat(vmec): add find_theta inverse method to VMECGeometry#253
feat(vmec): add find_theta inverse method to VMECGeometry#253krystophny merged 1 commit intomainfrom
Conversation
Add Newton-Raphson inversion to find VMEC poloidal angle from (R, Z, zeta) at a given flux surface. Uses analytic Jacobian from Fourier derivatives for efficiency. Supports: - Single guess with fast Newton iteration - Multi-start fallback for robust global convergence - Vectorized batch processing
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||
User description
Summary
Use Case
Computing VMEC theta coordinates for particle loss footprints from BEAMS3D simulations where only (R, Z, phi) are available at the wall crossing.
Test plan
PR Type
Enhancement
Description
Add
find_thetamethod to invert VMEC poloidal angle from (R, Z) coordinatesImplements Newton-Raphson iteration with analytic Jacobian from Fourier derivatives
Supports single initial guess for fast convergence or multi-start fallback
Handles vectorized batch processing for arrays of points
Diagram Walkthrough
File Walkthrough
vmec.py
Implement VMEC theta inversion with Newton-Raphsonpython/libneo/vmec.py
find_thetamethod toVMECGeometryclass for inverting poloidalangle from (R, Z) coordinates
from Fourier derivatives
robust global convergence
linear interpolation of Fourier coefficients at arbitrary flux
surfaces