Alphabetical Listing

Basis

desc.basis.PowerSeries(L[, sym])

1D basis set for flux surface quantities.

desc.basis.FourierSeries(N[, NFP, sym])

1D basis set for use with the magnetic axis.

desc.basis.DoubleFourierSeries(M, N[, NFP, sym])

2D basis set for use on a single flux surface.

desc.basis.ZernikePolynomial(L, M[, sym, ...])

2D basis set for analytic functions in a unit disc.

desc.basis.ChebyshevDoubleFourierBasis(L, M, N)

3D basis: tensor product of Chebyshev polynomials and two Fourier series.

desc.basis.FourierZernikeBasis(L, M, N[, ...])

3D basis set for analytic functions in a toroidal volume.

Coils

desc.coils.CoilSet(*coils[, NFP, sym, name])

Set of coils of different geometry but shared parameterization and resolution.

desc.coils.FourierRZCoil([current, R_n, ...])

Coil parameterized by fourier series for R,Z in terms of toroidal angle phi.

desc.coils.FourierXYZCoil([current, X_n, ...])

Coil parameterized by fourier series for X,Y,Z in terms of arbitrary angle s.

desc.coils.FourierPlanarCoil([current, ...])

Coil that lines in a plane.

desc.coils.MixedCoilSet(*coils[, name])

Set of coils or coilsets of different geometry.

desc.coils.SplineXYZCoil(current, X, Y, Z[, ...])

Coil parameterized by spline points in X,Y,Z.

Compatibility

desc.compat.ensure_positive_jacobian(eq)

Convert an Equilibrium to have a positive coordinate Jacobian.

desc.compat.flip_helicity(eq)

Change the sign of the helicity of an Equilibrium.

desc.compat.rescale(eq[, L, B, ...])

Rescale an Equilibrium in size L and magnetic field strength B.

Continuation

desc.continuation.solve_continuation(eqfam)

Solve for an equilibrium by continuation method.

desc.continuation.solve_continuation_automatic(eq)

Solve for an equilibrium using an automatic continuation method.

Derivatives

Note that the derivative module also exposes the Derivative class, which is an alias for AutoDiffDerivative if JAX is installed, or FiniteDiffDerivative if not.

desc.derivatives.AutoDiffDerivative(fun[, ...])

Computes derivatives using automatic differentiation with JAX.

desc.derivatives.FiniteDiffDerivative(fun[, ...])

Computes derivatives using 2nd order centered finite differences.

Equilibrium

desc.equilibrium.Equilibrium([Psi, NFP, L, ...])

Equilibrium is an object that represents a plasma equilibrium.

desc.equilibrium.EquilibriaFamily(*args)

EquilibriaFamily stores a list of Equilibria.

Examples

desc.examples.get(name[, data])

Get example equilibria and data.

desc.examples.listall()

Return a list of examples that DESC has.

Geometry

desc.geometry.FourierRZCurve([R_n, Z_n, ...])

Curve parameterized by Fourier series for R,Z in terms of toroidal angle phi.

desc.geometry.FourierXYZCurve([X_n, Y_n, ...])

Curve parameterized by Fourier series for X,Y,Z in terms of arbitrary angle s.

desc.geometry.FourierPlanarCurve([center, ...])

Curve that lies in a plane.

desc.geometry.FourierRZToroidalSurface([...])

Toroidal surface represented by Fourier series in poloidal and toroidal angles.

desc.geometry.SplineXYZCurve(X, Y, Z[, ...])

Curve parameterized by spline knots in X,Y,Z.

desc.geometry.ZernikeRZToroidalSection([...])

A toroidal cross section represented by a Zernike polynomial in R,Z.

Grid

desc.grid.Grid(nodes[, sort, jitable])

Collocation grid with custom node placement.

desc.grid.LinearGrid([L, M, N, NFP, sym, ...])

Grid in which the nodes are linearly spaced in each coordinate.

desc.grid.QuadratureGrid(L, M, N[, NFP])

Grid used for numerical quadrature.

desc.grid.ConcentricGrid(L, M, N[, NFP, ...])

Grid in which the nodes are arranged in concentric circles.

desc.grid.find_least_rational_surfaces(iota, n)

Find "least rational" surfaces for given iota profile.

desc.grid.find_most_rational_surfaces(iota, n)

Find "most rational" surfaces for a give iota profile.

IO

desc.io.load(load_from[, file_format])

Load any DESC object from previously saved file.

Magnetic Fields

desc.magnetic_fields.CurrentPotentialField(...)

Magnetic field due to a surface current potential on a toroidal surface.

desc.magnetic_fields.FourierCurrentPotentialField([...])

Magnetic field due to a surface current potential on a toroidal surface.

desc.magnetic_fields.DommaschkPotentialField([...])

Magnetic field due to a Dommaschk scalar magnetic potential in rpz coordinates.

desc.magnetic_fields.OmnigenousField([L_B, ...])

A magnetic field with perfect omnigenity (but is not necessarily analytic).

desc.magnetic_fields.PoloidalMagneticField(B0, ...)

Pure poloidal magnetic field (ie in theta direction).

desc.magnetic_fields.ScalarPotentialField(...)

Magnetic field due to a scalar magnetic potential in cylindrical coordinates.

desc.magnetic_fields.ScaledMagneticField(...)

Magnetic field scaled by a scalar value.

desc.magnetic_fields.SplineMagneticField(R, ...)

Magnetic field from precomputed values on a grid.

desc.magnetic_fields.SumMagneticField(*fields)

Sum of two or more magnetic field sources.

desc.magnetic_fields.ToroidalMagneticField(B0, R0)

Magnetic field purely in the toroidal (phi) direction.

desc.magnetic_fields.VerticalMagneticField(B0)

Uniform magnetic field purely in the vertical (Z) direction.

desc.magnetic_fields.field_line_integrate(r0, ...)

Trace field lines by integration.

desc.magnetic_fields.read_BNORM_file(fname, ...)

Read BNORM-style .txt file containing Bnormal Fourier coefficients.

Objective Functions

desc.objectives.AspectRatio(eq[, target, ...])

Aspect ratio = major radius / minor radius.

desc.objectives.BootstrapRedlConsistency(eq)

Promote consistency of the bootstrap current for axisymmetry or quasi-symmetry.

desc.objectives.BoundaryError(eq, field[, ...])

Target for free boundary conditions on LCFS for finite beta equilibrium.

desc.objectives.BScaleLength(eq[, target, ...])

Target a particular value for the magnetic field scale length.

desc.objectives.CurrentDensity(eq[, target, ...])

Radial, poloidal, and toroidal current density.

desc.objectives.Elongation(eq[, target, ...])

Elongation = semi-major radius / semi-minor radius.

desc.objectives.Energy(eq[, target, bounds, ...])

MHD energy.

desc.objectives.FixAtomicNumber(eq[, ...])

Fixes effective atomic number profile coefficients.

desc.objectives.FixAxisR(eq[, target, ...])

Fixes magnetic axis R coefficients.

desc.objectives.FixAxisZ(eq[, target, ...])

Fixes magnetic axis Z coefficients.

desc.objectives.FixBoundaryR(eq[, target, ...])

Boundary condition on the R boundary parameters.

desc.objectives.FixBoundaryZ(eq[, target, ...])

Boundary condition on the Z boundary parameters.

desc.objectives.FixCurrent(eq[, target, ...])

Fixes toroidal current profile coefficients.

desc.objectives.FixElectronDensity(eq[, ...])

Fixes electron density profile coefficients.

desc.objectives.FixElectronTemperature(eq[, ...])

Fixes electron temperature profile coefficients.

desc.objectives.FixIonTemperature(eq[, ...])

Fixes ion temperature profile coefficients.

desc.objectives.FixIota(eq[, target, ...])

Fixes rotational transform coefficients.

desc.objectives.FixModeR(eq[, target, ...])

Fixes Fourier-Zernike R coefficients.

desc.objectives.FixModeZ(eq[, target, ...])

Fixes Fourier-Zernike Z coefficients.

desc.objectives.FixOmniBmax(field[, target, ...])

Ensures the B_max contour is straight in Boozer coordinates.

desc.objectives.FixOmniMap(field[, target, ...])

Fixes OmnigenousField.x_lmn coefficients.

desc.objectives.FixOmniWell(field[, target, ...])

Fixes OmnigenousField.B_lm coefficients.

desc.objectives.FixParameter(thing[, ...])

Fix specific degrees of freedom associated with a given Optimizable object.

desc.objectives.FixPressure(eq[, target, ...])

Fixes pressure coefficients.

desc.objectives.FixPsi(eq[, target, bounds, ...])

Fixes total toroidal magnetic flux within the last closed flux surface.

desc.objectives.FixSumModesR(eq[, target, ...])

Fixes a linear sum of Fourier-Zernike R coefficients.

desc.objectives.FixSumModesZ(eq[, target, ...])

Fixes a linear sum of Fourier-Zernike Z coefficients.

desc.objectives.FixThetaSFL(eq[, name])

Fixes lambda=0 so that poloidal angle is the SFL poloidal angle.

desc.objectives.ForceBalance(eq[, target, ...])

Radial and helical MHD force balance.

desc.objectives.ForceBalanceAnisotropic(eq)

Force balance for anisotropic pressure equilibria.

desc.objectives.GenericObjective(f, eq[, ...])

A generic objective that can compute any quantity from the data_index.

desc.objectives.get_equilibrium_objective(eq)

Get the objective function for a typical force balance equilibrium problem.

desc.objectives.get_fixed_axis_constraints(eq)

Get the constraints necessary for a fixed-axis equilibrium problem.

desc.objectives.get_fixed_boundary_constraints(eq)

Get the constraints necessary for a typical fixed-boundary equilibrium problem.

desc.objectives.get_NAE_constraints(desc_eq, ...)

Get the constraints necessary for fixing NAE behavior in an equilibrium problem.

desc.objectives.GoodCoordinates(eq[, sigma, ...])

Target "good" coordinates, meaning non self-intersecting curves.

desc.objectives.HelicalForceBalance(eq[, ...])

Helical MHD force balance.

desc.objectives.Isodynamicity(eq[, target, ...])

Isodynamicity metric for cross field transport.

desc.objectives.LinearObjectiveFromUser(fun, ...)

Wrap a user defined linear objective function.

desc.objectives.MagneticWell(eq[, target, ...])

The magnetic well is a fast proxy for MHD stability.

desc.objectives.MeanCurvature(eq[, target, ...])

Target a particular value for the mean curvature.

desc.objectives.MercierStability(eq[, ...])

The Mercier criterion is a fast proxy for MHD stability.

desc.objectives.ObjectiveFromUser(fun, eq[, ...])

Wrap a user defined objective function.

desc.objectives.ObjectiveFunction(objectives)

Objective function comprised of one or more Objectives.

desc.objectives.Omnigenity(eq, field[, ...])

Omnigenity error.

desc.objectives.PlasmaVesselDistance(eq, surface)

Target the distance between the plasma and a surrounding surface.

desc.objectives.Pressure(eq[, target, ...])

Target pressure profile.

desc.objectives.PrincipalCurvature(eq[, ...])

Target a particular value for the (unsigned) principal curvature.

desc.objectives.QuasisymmetryBoozer(eq[, ...])

Quasi-symmetry Boozer harmonics error.

desc.objectives.QuasisymmetryTwoTerm(eq[, ...])

Quasi-symmetry two-term error.

desc.objectives.QuasisymmetryTripleProduct(eq)

Quasi-symmetry triple product error.

desc.objectives.RadialForceBalance(eq[, ...])

Radial MHD force balance.

desc.objectives.RotationalTransform(eq[, ...])

Targets a rotational transform profile.

desc.objectives.Shear(eq[, target, bounds, ...])

Targets a shear profile (normalized derivative of rotational transform).

desc.objectives.ToroidalCurrent(eq[, ...])

Target toroidal current profile.

desc.objectives.VacuumBoundaryError(eq, field)

Target for free boundary conditions on LCFS for vacuum equilibrium.

desc.objectives.Volume(eq[, target, bounds, ...])

Plasma volume.

Optimize

desc.optimize.Optimizer(method)

A helper class to wrap several optimization routines.

desc.optimize.fmin_auglag(fun, x0, grad[, ...])

Minimize a function with constraints using an augmented Lagrangian method.

desc.optimize.fmintr(fun, x0, grad[, hess, ...])

Minimize a scalar function using a (quasi)-Newton trust region method.

desc.optimize.lsq_auglag(fun, x0, jac[, ...])

Minimize a function with constraints using an augmented Lagrangian method.

desc.optimize.lsqtr(fun, x0, jac[, bounds, ...])

Solve a least squares problem using a (quasi)-Newton trust region method.

desc.optimize.register_optimizer(name, ...)

Decorator to wrap a function for optimization.

desc.optimize.sgd(fun, x0, grad[, args, ...])

Minimize a scalar function using stochastic gradient descent with momentum.

Perturbations

desc.perturbations.get_deltas(things1, things2)

Compute differences between parameters for perturbations.

desc.perturbations.perturb(eq, objective, ...)

Perturb an Equilibrium with respect to input parameters.

desc.perturbations.optimal_perturb(eq, ...)

Perturb an Equilibrium with respect to input parameters to optimize an objective.

Plotting

desc.plotting.plot_1d(eq, name[, grid, log, ...])

Plot 1D profiles.

desc.plotting.plot_2d(eq, name[, grid, log, ...])

Plot 2D cross-sections.

desc.plotting.plot_3d(eq, name[, grid, log, ...])

Plot 3D surfaces.

desc.plotting.plot_basis(basis[, return_data])

Plot basis functions.

desc.plotting.plot_boozer_modes(eq[, log, ...])

Plot Fourier harmonics of \(|B|\) in Boozer coordinates.

desc.plotting.plot_boozer_surface(thing[, ...])

Plot \(|B|\) on a surface vs the Boozer poloidal and toroidal angles.

desc.plotting.plot_boundaries(eqs[, labels, ...])

Plot stellarator boundaries at multiple toroidal coordinates.

desc.plotting.plot_boundary(eq[, phi, ...])

Plot stellarator boundary at multiple toroidal coordinates.

desc.plotting.plot_coefficients(eq[, L, M, ...])

Plot spectral coefficient magnitudes vs spectral mode number.

desc.plotting.plot_coils(coils[, grid, fig, ...])

Create 3D plot of coil geometry.

desc.plotting.plot_comparison(eqs[, rho, ...])

Plot comparison between flux surfaces of multiple equilibria.

desc.plotting.plot_fsa(eq, name[, ...])

Plot flux surface averages of quantities.

desc.plotting.plot_grid(grid[, return_data])

Plot the location of collocation nodes on the zeta=0 plane.

desc.plotting.plot_logo([save_path])

Plot the DESC logo.

desc.plotting.plot_qs_error(eq[, log, fB, ...])

Plot quasi-symmetry errors f_B, f_C, and f_T as normalized flux functions.

desc.plotting.plot_section(eq, name[, grid, ...])

Plot Poincare sections.

desc.plotting.plot_surfaces(eq[, rho, ...])

Plot flux surfaces.

Profiles

desc.profiles.PowerSeriesProfile([params, ...])

Profile represented by a monic power series.

desc.profiles.TwoPowerProfile([params, name])

Profile represented by two powers.

desc.profiles.SplineProfile([values, knots, ...])

Profile represented by a piecewise cubic spline.

desc.profiles.MTanhProfile([params, name])

Profile represented by a modified hyperbolic tangent + polynomial.

desc.profiles.ScaledProfile(scale, profile, ...)

Profile times a constant value.

desc.profiles.SumProfile(*profiles, **kwargs)

Sum of two or more Profiles.

desc.profiles.ProductProfile(*profiles, **kwargs)

Product of two or more Profiles.

Transform

desc.transform.Transform(grid, basis[, ...])

Transforms from spectral coefficients to real space values.

VMEC

desc.vmec.VMECIO()

Performs input from VMEC netCDF files to DESC Equilibrium and vice-versa.