desc.objectives.FixNearAxisZ

class desc.objectives.FixNearAxisZ(eq, order=1, N=None, target=None, weight=1, normalize=True, normalize_target=True, name='Fix Near Axis Z Behavior')Source

Fixes an equilibrium’s near-axis behavior in Z to specified order.

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

  • order ({0,1,2}) – order (in rho) of near-axis behavior to constrain

  • N (int) – max toroidal resolution to constrain. If None, defaults to equilibrium’s toroidal resolution

  • target (Qsc, optional) – pyQSC Qsc object describing the NAE solution to fix the equilibrium’s near-axis behavior to. If None, will fix the equilibrium’s current near axis behavior.

  • weight ({float, ndarray}, optional) – Weighting to apply to the Objective, relative to other Objectives. Must be broadcastable to Objective.dim_f

  • normalize (bool, optional) – Whether to compute the error in physical units or non-dimensionalize. Unused by this objective

  • normalize_target (bool, optional) – 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. Unused by this objective

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

Methods

build([use_jit, verbose])

Build constant arrays.

compute(params[, constants])

Compute fixed near axis Z behavior errors.

compute_scalar(*args, **kwargs)

Compute the scalar form of the objective.

compute_scaled(*args, **kwargs)

Compute and apply weighting and normalization.

compute_scaled_error(*args, **kwargs)

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

compute_unscaled(*args, **kwargs)

Compute the raw value of the objective.

copy([deepcopy])

Return a (deep)copy of this object.

equiv(other)

Compare equivalence between DESC objects.

grad(*args, **kwargs)

Compute gradient vector of self.compute_scalar wrt x.

hess(*args, **kwargs)

Compute Hessian matrix of self.compute_scalar wrt x.

jac_scaled(*args, **kwargs)

Compute Jacobian matrix of self.compute_scaled wrt x.

jac_scaled_error(*args, **kwargs)

Compute Jacobian matrix of self.compute_scaled_error wrt x.

jac_unscaled(*args, **kwargs)

Compute Jacobian matrix of self.compute_unscaled wrt x.

jvp_scaled(v, x[, constants])

Compute Jacobian-vector product of self.compute_scaled.

jvp_scaled_error(v, x[, constants])

Compute Jacobian-vector product of self.compute_scaled_error.

jvp_unscaled(v, x[, constants])

Compute Jacobian-vector product of self.compute_unscaled.

load(load_from[, file_format])

Initialize from file.

print_value(args[, args0])

Print the value of the objective and return a dict of values.

save(file_name[, file_format, file_mode])

Save the object.

update_target(thing)

Update target values using an Optimizable object.

xs(*things)

Return a tuple of args required by this objective from optimizable things.

Attributes

bounds

Lower and upper bounds of the objective.

built

Whether the transforms have been precomputed (or not).

constants

Constant parameters such as transforms and profiles.

dim_f

Number of objective equations.

fixed

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

linear

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

name

Name of objective (str).

normalization

normalizing scale factor.

scalar

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

target

Target value(s) of the objective.

things

Optimizable things that this objective is tied to.

weight

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