Skip to content

Equilibrium edge reconstruction using an asymptotically robust analytic/numerical method#241

Draft
StuartBenjamin wants to merge 101 commits intodevelopfrom
equilibrium_edge_princeton_repo
Draft

Equilibrium edge reconstruction using an asymptotically robust analytic/numerical method#241
StuartBenjamin wants to merge 101 commits intodevelopfrom
equilibrium_edge_princeton_repo

Conversation

@StuartBenjamin
Copy link
Collaborator

@StuartBenjamin StuartBenjamin commented Feb 10, 2026

Scripts that implement the field-line integral replacement formulas from this paper: https://doi.org/10.1088/1361-6587/add9ca

These scripts switch the equilibrium field-line numerical integrator in direct.f (needed to convert an equilibrium into magnetic coordinates) to a mixed numerical/analytic method, that converges to the exact solution as we get asymptotically close to the separatrix (see paper for more details). The pull request has NOT been submitted, because there is a discontinuity in the output splines when we switch from the numerical-only solution to to the mixed analytic formulas. For the treatment to robustly work, we need to blend from the numerical-only solution into the mixed analytic solution... I leave this to future interested parties.
In the meantime, for far-edge equilibrium reconstruction, one can just bump up the numerical integrator fidelity. Attached is Fig 10 from the paper, showing where the numerical integrator starts breaking (around psi = 0.9999999). This is NOT the limiting factor preventing far edge evaluation of dW (in DCON), or RDCON...; in DCON it's the numerical ODE integration that breaks first, due to a singularity in the F matrix. For RDCON, I haven't probed the far edge limit...
Screenshot 2026-02-10 at 2 01 35 PM

For interested parties, here's the particular machine poloidal angle-dependent formulation of the field line integrals in equil, in terms of splines y_out, ff and rzphi:
GPEC_Field_Line_Maths.pdf

…not. Also loop now goes from axis to edge instead of edge to axis
… still needs to be fixed). relies on new function find_fl_surface
…a_brackets,maxima_count are local versions of xpt_etas, xpt_brackets, num_xpts respectively, that necessary whenever running direct_initialise_xpoints on some eta interval that isn't [0,2pi]
… numerical integral and check for a second x-point
StuartBenjamin and others added 28 commits February 8, 2026 17:45
…ine integrator (via direct_fl_int), and also calls the analytic field line integral function (analytic_y_out), and splices the outputs together using functions patch_two_a, patch_two_b, patch_two_c
… by Eq. 12 in https://doi.org/10.1088/1361-6587/add9ca . Also updates to the description of direct_analytic_ints
…uted in outmat2 may be used as inputs for a future implementation of the general formula for yi4 where power_bp =/=0
…ich adds a knot at eta = 2pi for field line integral outputs
…lice two y_outs together (see their descriptions for more information)
…lytic + numerical y_out integrals for a range of xpt_tol & BpBt_tol values, before printing outputs. This function was used to generate the data that is plotted in https://doi.org/10.1088/1361-6587/add9ca Figs. 7 & 9.
@StuartBenjamin StuartBenjamin changed the title Equilibrium edge princeton repo Equilibrium edge reconstruction using an asymptotically robust analytic/numerical method Feb 11, 2026
@StuartBenjamin
Copy link
Collaborator Author

StuartBenjamin commented Feb 11, 2026

For interested parties, here's the particular machine poloidal angle-dependent formulation of the field line integrals in equil, in terms of splines y_out, ff and rzphi:

GPEC_Field_Line_Maths.pdf

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.

2 participants