desc.objectives.MercierStability

class desc.objectives.MercierStability(eq=None, target=None, bounds=(0, inf), weight=1, normalize=True, normalize_target=True, grid=None, name='Mercier Stability')[source]

The Mercier criterion is a fast proxy for MHD stability.

This makes it a useful figure of merit for stellarator operation. Systems with D_Mercier > 0 are favorable for stability.

See equation 4.16 in Landreman, M., & Jorge, R. (2020). Magnetic well and Mercier stability of stellarators near the magnetic axis. Journal of Plasma Physics, 86(5), 905860510. doi:10.1017/S002237782000121X.

Parameters:
  • eq (Equilibrium, optional) – Equilibrium that will be optimized to satisfy the Objective.

  • target (float, ndarray, optional) – Target value(s) of the objective. Only used if bounds is None. len(target) must be equal to Objective.dim_f

  • bounds (tuple, optional) – Lower and upper bounds on the objective. Overrides target. len(bounds[0]) and len(bounds[1]) must be equal to Objective.dim_f

  • weight (float, ndarray, optional) – Weighting to apply to the Objective, relative to other Objectives. len(weight) must be equal to Objective.dim_f

  • normalize (bool) – Whether to compute the error in physical units or non-dimensionalize.

  • normalize_target (bool) – Whether target and bounds should be normalized before comparing to computed values. If normalize is True and the target is in physical units, this should also be set to True.

  • grid (Grid, ndarray, optional) – Collocation grid containing the nodes to evaluate at.

  • name (str) – Name of the objective function.

Methods

build(eq[, use_jit, verbose])

Build constant arrays.

compute(*args, **kwargs)

Compute the Mercier stability criterion.

compute_scalar(*args, **kwargs)

Compute the scalar form of the objective.

compute_scaled(*args, **kwargs)

Compute and apply the target/bounds, weighting, and normalization.

copy([deepcopy])

Return a (deep)copy of this object.

eq(other)

Compare equivalence between DESC objects.

jit()

Apply JIT to compute methods, or re-apply after updating self.

load(load_from[, file_format])

Initialize from file.

print_value(*args, **kwargs)

Print the value of the objective.

save(file_name[, file_format, file_mode])

Save the object.

update_target(eq)

Update target values using an Equilibrium.

xs(eq)

Return a tuple of args required by this objective from the Equilibrium eq.

Attributes

args

Names (str) of arguments to the compute functions.

bounds

Lower and upper bounds of the objective.

built

Whether the transforms have been precomputed (or not).

derivatives

Derivatives of the function wrt the argument given by the dict keys.

dim_f

Number of objective equations.

dimensions

Dimensions of the argument given by the dict keys.

fixed

Whether the objective fixes individual parameters (or linear combo).

linear

Whether the objective is a linear function (or nonlinear).

name

Name of objective function (str).

normalization

normalizing scale factor.

scalar

Whether default "compute" method is a scalar or vector.

target

Target value(s) of the objective.

target_arg

Name of argument corresponding to the target.

weight

Weighting to apply to the Objective, relative to other Objectives.