vmec_jax.optimization_workflow¶
Reusable teaching workflow helpers for fixed-boundary optimizations.
The functions in this module are intentionally small building blocks for the
standalone examples. Users should still construct objective lists explicitly in
the scripts, as in SIMSOPT’s LeastSquaresProblem.from_tuples workflow, but
the mechanical VMEC/JAX stage setup, mode continuation, saving, and plotting
live here instead of being repeated in every example.
Functions
|
Smooth upper-bound penalty enforcing |
|
Smooth lower-bound penalty enforcing |
|
Attach final optimization metadata without writing artifacts. |
|
Aspect-ratio least-squares objective. |
|
Return Boozer |
|
Build one VMEC/JAX optimization stage from an objective list. |
|
Build one QI stage while sharing one Boozer transform across QI terms. |
|
Merge per-stage histories into one optimization history. |
|
Return a compact label for a boundary-mode stage descriptor. |
|
Interpolate selected VMEC boundary Fourier coefficients. |
|
Solve a SIMSOPT-style fixed-boundary least-squares problem. |
|
Differentiable minimum- |
|
Mean rotational transform on full-mesh surfaces, excluding the axis. |
|
Mean full-mesh rotational-transform objective. |
|
Normalize an int/tuple/dict stage descriptor into mode limits. |
|
Return true when optimization history should record mean iota. |
|
Return the canonical final-artifact paths for an optimization run. |
|
Write and return a simple omnigenity seed input path when enabled. |
|
Print the final scalar diagnostics from an optimization result. |
|
Print the problem summary used by the standalone examples. |
|
Boozer |
|
QI field-quality term penalizing small local |
|
Signed LCFS elongation constraint |
|
Boundary elongation upper-bound objective. |
|
Signed mirror-ratio constraint |
|
Mirror-ratio upper-bound objective evaluated from Boozer |
|
Soft-wall objective that penalizes QI residuals above |
|
Outer residual/Jacobian budget for one fixed-boundary stage. |
|
Repeated mode-continuation sequence used by the example scripts. |
|
Smooth QI residual term from |
|
Quasisymmetry residual objective for QA, QH, or QP. |
|
Set VMEC spectral resolution to at least |
|
Same-mode repeated continuation used by the QI example. |
|
Create the state residual callback consumed by |
|
Run a fixed-boundary objective list through one or more mode stages. |
|
Run a QI objective list through repeated or direct mode stages. |
|
Save initial/final inputs, wouts, and history from a solve result. |
|
Save initial/final inputs, wouts, and history. |
|
Save stage input files and optionally wout files. |
|
Return an input deck with a simple deterministic omnigenity seed boundary. |
|
Write a resumable checkpoint after one QI continuation stage. |
Classes
|
Smooth upper-bound objective for |
|
Smooth lower-bound objective for |
|
Aspect-ratio objective object. |
|
Wrap a non-negative violation objective as an augmented-Lagrangian term. |
|
VMEC |
|
VMEC |
|
Cartesian magnetic-field vector objective on one radial surface. |
|
Total-beta objective for finite-beta studies. |
|
Boozer |
|
Boundary-parameter mode limits for one optimization stage. |
|
Smooth lower-bound objective for VMEC Mercier stability. |
|
Prepared optimizer and metadata for one active boundary-mode stage. |
|
Result returned by |
|
Small fixed-boundary optimization object used by the examples. |
|
Smooth upper-bound objective for the Glasser resistive criterion. |
|
VMEC |
|
Flux-coordinate current-density vector objective from JXBFORCE channels. |
|
Least-squares objective assembled from |
|
Minimum- |
|
Smooth lower-bound objective for the vacuum magnetic-well proxy. |
|
Maximum LCFS elongation penalty object for solved VMEC states. |
|
Mean rotational-transform objective object. |
|
Maximum mirror-ratio penalty object for solved VMEC states. |
|
One weighted least-squares objective block. |
|
Canonical files written by fixed-boundary optimization examples. |
|
One field-quality objective that shares a Boozer/QI field evaluation. |
|
Boozer/QI sampling options shared by QI objective terms. |
|
Smooth QI residual object using a shared Boozer field evaluation. |
|
Soft upper-bound objective for preserving a low-QI basin during cleanup. |
|
QS residual object for QA/QH/QP objectives. |
|
Redl bootstrap-current mismatch objective for finite-beta studies. |
|
Objects needed by objective callbacks for one mode-continuation stage. |
|
Integrated toroidal-current profile from VMEC's Mercier path. |
|
Radial derivative of |
|
Fast mirror-ratio penalty evaluated directly from VMEC |
|
Volume-averaged magnetic-field objective for finite-beta studies. |