Skip to content

Fix winding-surface optimization example - #66

Open
rogeriojorge wants to merge 6 commits into
feat/winding_surface_optimizationfrom
rj/winding-surface-proxy-fixes
Open

Fix winding-surface optimization example#66
rogeriojorge wants to merge 6 commits into
feat/winding_surface_optimizationfrom
rj/winding-surface-proxy-fixes

Conversation

@rogeriojorge

@rogeriojorge rogeriojorge commented Sep 1, 2026

Copy link
Copy Markdown
Member

This updates the winding-surface optimization example and adds a resolved comparison with REGCOIL and QUADCOIL.

Corrections

  • include winding-surface Jacobians and quadrature weights in the induction matrix
  • use close=False so periodic endpoints are not duplicated
  • include the missing 4*pi^2 normalization
  • prevent the entropy objective from improving by weakening the full operator
  • add a nonlocal self-separation check alongside the area-element check
  • use 64-bit JAX calculations

ESSOS peak-current Pareto objective

For every trial winding surface, ESSOS solves the regularized current-potential problem at three nearby peak-current limits:

$$ \Phi_i=\underset{\Phi}{\operatorname{argmin}}\left[f_B(\Phi)+\lambda_i f_K(\Phi)\right], \qquad K_{\max}(\Phi_i)=K_i, $$

where

$$ f_B=\int_{S_p}(\mathbf B\cdot\mathbf n)^2,dA, \qquad f_K=\int_{S_c}|\mathbf K|^2,dA =\int_{S_c}|\nabla_s\Phi|^2,dA, $$

and $K_i=(0.95,1.00,1.05)K_{\mathrm{target}}$. The winding surface minimizes

$$ J_{\mathrm{Pareto}}(S_c)=\frac{1}{3}\sum_{i=1}^{3} \frac{f_B(S_c;K_i)}{f_B(S_{c,0};K_i)}+J_{\mathrm{geometry}}. $$

The three samples cover a short section of the $f_B$--$K_{\max}$ trade-off curve, so the surface is not tuned to one regularization value. The geometry term preserves volume, controls the Fourier spectrum, retains at least 90% of the initial plasma clearance, and penalizes small Jacobian or nonlocal self-approach. This is a local three-point Pareto objective, not a construction of the complete Pareto front.

The optimization uses 32 points per angle per field period. Surface motion is capped at 2% of the plasma minor radius per active Fourier coefficient.

Results

For the included QA example at 7 MA/m, a separate 96x96 REGCOIL evaluation gives:

  • sheet fB: 19.873 -> 2.712
  • max |Bn|/B: 0.0569 -> 0.0267
  • 40-filament fB: 20.331 -> 3.010
  • dense Kmax: 6.989 MA/m

At 10 MA/m, the Pareto surface reduces resolved sheet fB by 27.6% relative to the normal offset for QA and by 88.2% for W7-X. W7-X filament fB is reduced by 88.1%. The QA filament result is worse despite its improved sheet result, so no universal coil-improvement claim is made.

The current-complexity comparison uses the same $f_K$ as the inner regularization. Relative to the normal offset, ESSOS Pareto changes $f_K$ by +0.24% for QA and +22.2% for W7-X. W7-X RMS current increases from 2.208 to 2.432 MA/m while both surfaces satisfy the same 10 MA/m peak limit. The field-error improvement therefore has a visible current-complexity cost.

Resolved metrics

Current complexity

The driver, numerical tables, all figures, and detailed notes are under examples/winding_surface_comparison/. QUADCOIL's W7-X solves did not converge and are marked failed rather than treated as valid results.

Eight-coil study

An additive study under examples/winding_surface_comparison_8_coils/ repeats the comparison with eight coils per half field period and adds Landreman-Paul QH. At 96x96, the QH Pareto iterate reduces sheet fB by 75.1% and filament fB by 73.6% relative to the normal offset. The QA case shows the limitation clearly: its sheet result improves, but filament fB is 15.7% worse with the reduced coil count. The QH Pareto outer solve stopped on a line-search failure, so it is reported as a valid non-converged iterate.

@rogeriojorge
rogeriojorge force-pushed the rj/winding-surface-proxy-fixes branch from c846c00 to 659ae6b Compare September 1, 2026 01:39
@rogeriojorge rogeriojorge changed the title Correct and safeguard winding-surface surrogate Fix winding-surface optimization example Sep 1, 2026
@rogeriojorge

Copy link
Copy Markdown
Member Author

@dseidita1919 Doing my own tests, to see if a couple things might help:

  • Adding winding and plasma Jacobian/quadrature weights as Landreman & Boozer mention
  • Explicit close=False, since ESSOS’s close=True includes duplicate periodic endpoint (perhaps we should change this, as SIMSOPT does)
  • Missing 4 pi^2 full-torus integration factor for minor radius and volume
  • flot64 instead of float32
  • some random way of checking self intersection that literature search found at https://arxiv.org/abs/1102.3642 and https://arxiv.org/abs/2107.01664
  • there seems to be a loophole that all svd values can decrease while flattening, giving a worse solution but better entropy

@rogeriojorge rogeriojorge changed the title Fix winding-surface optimization example Use a physical objective for winding-surface optimization Sep 1, 2026
@rogeriojorge
rogeriojorge force-pushed the rj/winding-surface-proxy-fixes branch from 88a1dc1 to 659ae6b Compare September 1, 2026 11:45
@rogeriojorge rogeriojorge changed the title Use a physical objective for winding-surface optimization Fix winding-surface optimization example Sep 1, 2026
@rogeriojorge

Copy link
Copy Markdown
Member Author

The resolved comparison is now included in the PR under examples/winding_surface_comparison.

Main findings:

  • At 10 MA/m, the ESSOS Pareto surface reduces the 96x96 sheet fB by 27.6% for Landreman-Paul QA and 88.2% for W7-X relative to a normal-offset surface.
  • The W7-X filament result improves by 88.1% (5.909 to 0.703), with max |Bn|/B reduced from 0.260 to 0.109.
  • The QA sheet improves, but its filament fB becomes worse. This is an important limitation and is reported explicitly.
  • The entropy proxy is worse than the normal-offset baseline in both resolved sheet comparisons.
  • ESSOS and REGCOIL current solves agree when evaluated at the same resolution. QUADCOIL agrees for QA after refinement; its W7-X solves did not converge and are marked failed.
  • The standalone 7 MA/m example reduces validated sheet fB from 19.873 to 2.712. Its saved coefficients have dense Kmax = 6.989 MA/m.

Resolved sheet and filament metrics:

Resolved surface comparison

Resolved current potentials and coil contours:

Validated current potentials

Resolved winding surfaces and coils:

Validated surfaces and coils

The remaining figures and CSV tables are in the same folder.

@rogeriojorge

Copy link
Copy Markdown
Member Author

Added the requested Pareto definition and current-complexity comparison.

For each trial surface, the inner problems are

$$ \Phi_i=\arg\min_{\Phi}\left[f_B(\Phi)+\lambda_i f_K(\Phi)\right], \qquad K_{\max}(\Phi_i)=K_i, $$

with $K_i=(0.95,1.00,1.05)K_{\mathrm{target}}$ and

$$ f_K=\int_{S_c}|\mathbf K|^2,dA =\int_{S_c}|\nabla_s\Phi|^2,dA. $$

The outer objective minimizes the mean normalized $f_B$ at those three current limits, plus the explicit geometry controls. Sampling three nearby points makes the surface improve a local part of the $f_B$--$K_{\max}$ trade-off instead of one selected regularization value.

The new figure compares $f_K/f_{K,\mathrm{offset}}$ and $K_{\mathrm{rms}}=\sqrt{f_K/A_c}$ for all four winding-surface methods:

Current-potential complexity

For QA, the Pareto surface has essentially the same complexity as the normal offset: $f_K$ changes by +0.24% and RMS current changes from 4.956 to 4.953 MA/m. For W7-X, $f_K$ increases by 22.2% and RMS current increases from 2.208 to 2.432 MA/m. Both still satisfy the same 10 MA/m peak-current limit. This makes the cost of the W7-X field-error improvement explicit.

The dimensional $f_K$ and RMS-current values are included in data/surface_validation_96.csv.

@rogeriojorge

Copy link
Copy Markdown
Member Author

Added a second, additive study with eight coils per half field period. The original ten-coil results are unchanged. The new study also adds Landreman-Paul QH.

Main results from the independent 96x96 validation:

  • QH: ESSOS Pareto reduces sheet fB by 75.1% and filament fB by 73.6% relative to the normal offset. Relative to the tested REGCOIL adjoint surface, the reductions are 65.1% and 63.1%.
  • W7-X: filament fB remains 88.1% below the normal-offset result.
  • QA: sheet fB improves by 27.6%, but filament fB is 15.7% worse. Going from ten to eight coils per half period raises QA filament error by about a factor of eight, so the present sheet objective is not enough for sparse coil sets.
  • The QH Pareto run stopped after seven outer iterations on a line-search failure. Its saved surface is valid and feasible at 10 MA/m on the 96x96 grid, but it is labeled as a non-converged iterate. QUADCOIL exceeded six minutes and about 2.8 GB on QH without completing, so those entries are marked failed.

Resolved metrics:

Eight-coil resolved metrics

Current potential and coil contours:

Eight-coil current potential

Winding surfaces and coils:

Eight-coil surfaces and coils

The reproducible driver, CSV tables, complexity plot, convergence plot, and remaining figures are in examples/winding_surface_comparison_8_coils/.

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.

1 participant