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
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 asrho = 1e-6
will avoid the singuarlity with a negligible loss in accuracy for analytic quantities. - Adds new optimizers
fmin-auglag
andlsq-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
andSLSQP
methods ofscipy.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 methodscompute_theta_coordinates
andcompute_flux_coordinates
, but allows mapping between arbitrary coordinates. - Adds calculation of
tensor and corresponding 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
anddesc.grid.find_most_rational_surfaces
for finding the least/most rational surfaces for a given rotational transform profile.
Objective
andObjectiveFunction
compute methods have now been separated intocompute_unscaled
which returns the raw physics value of the objective,compute_scaled
, which returns the normalized value, andcompute_scaled_error
which returns the normalized difference between the physics value and the target/bounds. Similarly,jac_scaled
andjac_unscaled
are the relevant derivatives (note thatjac_scaled
is equivalent tojac_scaled_error
as the constant target drops out).grad
andhess
methods still correspond tocompute_scalar
which returns the sum of squares ofcompute_scaled_error
- renames
zeta
->phi
in many places indesc.plotting
to be consistent with when we mean the computational coordinate vs the physical coordinate - Replaces
nfev
withmaxiter
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 updates to work with newer versions of JAX. Minimum
jax
version is now0.3.2
, as some functions used in the constrained optimizers aren't present in previous versions. Maximumjax
version is now0.4.11
, the latest as of 6/13/23. - Adds new
ObjectiveFunction
attributestarget_scaled
andbounds_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.
- Fixes orientation of theta in VMEC output. (Previously we flipped theta for the base
quantities such as
, , and , but not derived quantities such as and ). - 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)
- \@pkim1818 made their first contribution in https://github.com/PlasmaControl/DESC/pull/503
Full Changelog: https://github.com/PlasmaControl/DESC/compare/v0.8.2...v0.9.0
Notes
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
- Is supplement to
- https://github.com/PlasmaControl/DESC/tree/v0.9.0 (URL)