Skip to content

v0.13.0

Latest
Compare
Choose a tag to compare
@dpanici dpanici released this 04 Dec 05:43
· 914 commits to master since this release
4e723e4

New Features

  • Adds function solve_regularized_surface_current to desc.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 and M_coil nonzero) or windowpane/saddle (M_coil and N_coil both zero)
    • M_coil is the number of poloidal transits a coil makes before returning to itself, while N_coil is the number of toroidal transits a coil makes before returning to itself (this is sort of like the QS helicity)
    • 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
  • Adds method to_CoilSet to FourierCurrentPotentialField 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 minimizes w*|K|, the regularization term from surface current in the REGCOIL algorithm, with w 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.
  • Adds a new tutorial showing how to useREGCOIL 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 to Equilibrium class to generate an Equilibrium 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 a FourierRZToroidalSurface object, allowing for optimizing for Quadratic flux minimizing (QFM) surfaces.
  • Allows ToroidalFlux objective to accept FourierRZToroidalSurface so it can be used to specify the toroidal flux through a QFM surface.
  • Adds eq_fixed flag to ToroidalFlux 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 to desc.compat to rotate an Equilibrium 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 to ScalarPotentialField, VectorPotentialField and DommaschkPotentialField, to allow SplineMagneticField.from_field and MagneticField.save_mgrid to efficiently take advantage of the discrete toroidal symmetry of these fields, if present.
  • Adds support for numpy version 2.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 and root_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 import desc.plotting.poincare_plot

Full Changelog: v0.12.3...v0.13.0