New Features
- Adds function
solve_regularized_surface_current
todesc.magnetic_fields
module that implements the REGCOIL algorithm (Landreman, (2017)) for surface current normal field optimization, which can run on both CPUs and GPUs.- Can specify the tuple
current_helicity=(M_coil, N_coil)
to determine if resulting contours correspond to helical topology (both(M_coil, N_coil)
not equal to 0), modular (N_coil
equal to 0 andM_coil
nonzero) or windowpane/saddle (M_coil
andN_coil
both zero) M_coil
is the number of poloidal transits a coil makes before returning to itself, whileN_coil
is the number of toroidal transits a coil makes before returning to itself (this is sort of like the QShelicity
)- if multiple values of the regularization parameter are input, will return a family of surface current fields (as a list) corresponding to the solution at each regularization value
- Can specify the tuple
- Adds method
to_CoilSet
toFourierCurrentPotentialField
which implements a coil cutting algorithm to discretize the surface current into coils- works for both modular and helical coils
- Adds a new objective
SurfaceCurrentRegularization
(which minimizesw*|K|
, the regularization term from surface current in the REGCOIL algorithm, withw
being the objective weight which act as the regularization parameter)- use of both this and the
QuadraticFlux
objective allows for REGCOIL solutions to be obtained through the optimization framework, and combined with other objectives as well.
- use of both this and the
- Adds a new tutorial showing how to use
REGCOIL
features, as well as a new section in the stage two optimization notebook using REGCOIL to obtain an initial guess for filamentary coil optimization. - Adds
from_input_file
method toEquilibrium
class to generate anEquilibrium
object with boundary, profiles, resolution and flux specified in a given DESC or VMEC input file - Adds
SurfaceQuadraticFlux
objective which minimizes the quadratic magnetic flux through aFourierRZToroidalSurface
object, allowing for optimizing for Quadratic flux minimizing (QFM) surfaces. - Allows
ToroidalFlux
objective to acceptFourierRZToroidalSurface
so it can be used to specify the toroidal flux through a QFM surface. - Adds
eq_fixed
flag toToroidalFlux
to allow for the equilibrium/QFM surface to vary during optimization, useful for single-stage optimizations. - Adds tutorial notebook showcasing QFM surface capability.
- Adds
rotate_zeta
function todesc.compat
to rotate anEquilibrium
around Z axis.
Minor Changes
- Changes local area weighting of Bn in
QuadraticFlux
objective to be the square root of the local area element (Note that any existing optimizations using this objective may need different weights to achieve the same result now.) - Adds an
NFP
attribute toScalarPotentialField
,VectorPotentialField
andDommaschkPotentialField
, to allowSplineMagneticField.from_field
andMagneticField.save_mgrid
to efficiently take advantage of the discrete toroidal symmetry of these fields, if present. - Adds support for
numpy
version2.0.0
- Various improvements to optimization algorithms for improving performance of equilibrium solving and optimization, especially on GPUs.
Bug Fixes
- Fixes bug that occurs when taking the gradient of
root
androot_scalar
with newer versions of JAX (>=0.4.34) and unpins the JAX version. - Changes
FixLambdaGauge
constraint to now enforce zero flux surface average for lambda, instead of enforcing lambda(rho,0,0)=0 as it was incorrectly doing before. - Fixes bug in
softmin/softmax
implementation. - Fixes bug that occurred when using
ProximalProjection
with a scalar optimization algorithm. - Fixes bug where
from desc.plotting import *
would not importdesc.plotting.poincare_plot
Full Changelog: v0.12.3...v0.13.0