There is a newer version of the record available.

Published June 16, 2023 | Version v0.9.0
Software Open

DESC

  • 1. Princeton University
  • 2. University of Maryland, College Park

Description

New Features
  • Implements a new limit API to correctly evaluate a number of quantities at the coordinate singularity at ρ=0 rather than returning NaN. Currently only quantities related to rotational transform and magnetic field strength are implemented, though in the future all quantities should evaluate correctly at the magnetic axis. Note that evaluating quantities at the axis generally requires higher order derivatives and so can be much more expensive than evaluating at nonsingular points, so during optimization it is not recommended to include a grid point at the axis. Generally a small finite value such as rho = 1e-6 will avoid the singuarlity with a negligible loss in accuracy for analytic quantities.
  • Adds new optimizers fmin-auglag and lsq-auglag for performing constrained optimization using the augmented Lagrangian method. These generally perform much better than constrained algorithms from scipy.
  • Adds interfaces to trust-constr and SLSQP methods of scipy.optimize.minimize. These methods can handle general nonlinear constraints, though their performance on badly scaled problems like those encountered in stellarator optimization isn't great.
  • Adds calculation of the PEST straight field line coordinate jacobian, which is now used to check for nestedness in Equilibrium.is_nested. Previously the non-straight field line jacobian was used, which would not detect if SFL theta contours overlapped.
  • Introduces a new function/method Equilibrium.map_coordinates which generalizes the existing methods compute_theta_coordinates and compute_flux_coordinates, but allows mapping between arbitrary coordinates.
  • Adds calculation of B tensor and corresponding LB metric
  • Adds objective BScaleLength for penalizing strong magnetic field curvature.
  • Adds objective ObjectiveFromUser for wrapping an arbitary user defined function.
  • Adds utilities desc.grid.find_least_rational_surfaces and desc.grid.find_most_rational_surfaces for finding the least/most rational surfaces for a given rotational transform profile.
Breaking changes
  • Objective and ObjectiveFunction compute methods have now been separated into compute_unscaled which returns the raw physics value of the objective, compute_scaled, which returns the normalized value, and compute_scaled_error which returns the normalized difference between the physics value and the target/bounds. Similarly, jac_scaled and jac_unscaled are the relevant derivatives (note that jac_scaled is equivalent to jac_scaled_error as the constant target drops out). grad and hess methods still correspond to compute_scalar which returns the sum of squares of compute_scaled_error
  • renames zeta -> phi in many places in desc.plotting to be consistent with when we mean the computational coordinate ζ vs the physical coordinate ϕ
  • Replaces nfev with maxiter in many places in the code. For most optimizers in scipy and all DESC optimizers, one iteration means one accepted step, which may require more than 1 function evaluation due to line searches or trust region subproblems. However, derivatives are generally only evaluated once per iteration, and are usually the most significant cost, so the iteration count is generally a better proxy for wall time than number of function evaluations.
Minor changes
  • Minor updates to work with newer versions of JAX. Minimum jax version is now 0.3.2, as some functions used in the constrained optimizers aren't present in previous versions. Maximum jax version is now 0.4.11, the latest as of 6/13/23.
  • Adds new ObjectiveFunction attributes target_scaled and bounds_scaled which return vectors of the scaled values from each sub-objective.
  • Adds automatic scaling of variables for scipy.optimize.minimize methods, using the hessian at the initial point.
  • Ensures objectives don't have both bounds and target set at the same time. This occasionally caused issues if one of them had a default value without the user realizing.
  • Adds documentation on how to interface with new optimizers.
  • Adds a documentation notebook with a simple example of using constrained optimizers
  • Adds a table of optimizer info to docs
  • Adds capability of InputReader to read VMEC files that have inputs spanning multiple lines
  • Reduces default initial trust region radius for most optimizers to be more conservative.
  • Adds a "softmin" option to PlasmaVesselDistance objective which is smoother and usually provides a better optimization landscape compared to the standard hard min.
Bug Fixes
  • Fixes orientation of theta in VMEC output. (Previously we flipped theta for the base quantities such as R, Z, and λ, but not derived quantities such as B and J).
  • Fixes VMEC utility bug that would cause xn, xm to be empty if the Fourier modes given had only sine symmetry.
  • Fixes bug when VMEC input file has duplicated lines, DESC now will just use the last duplicated line (which is what VMEC does)
New Contributors

Full Changelog: https://github.com/PlasmaControl/DESC/compare/v0.8.2...v0.9.0

Notes

If you use this software, please cite it using the metadata from this file. To cite a specific version of DESC, please cite the correct version from Zenodo at https://zenodo.org/search?page=1&size=20&q=conceptrecid:%224876504%22&sort=-version&all_versions=True

Files

PlasmaControl/DESC-v0.9.0.zip

Files (98.0 MB)

Name Size Download all
md5:10a5fb6fc8ad8fb3ce5ce7a73334cce8
98.0 MB Preview Download

Additional details

Related works