desc.objectives.FixAtomicNumber

class desc.objectives.FixAtomicNumber(eq=None, target=None, bounds=None, weight=1, normalize=False, normalize_target=False, profile=None, indices=True, name='fixed-atomic-number')Source

Fixes effective atomic number profile coefficients.

Parameters:
  • eq (Equilibrium) – 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. Must be broadcastable to Objective.dim_f.

  • bounds (tuple of {float, ndarray}, optional) – Lower and upper bounds on the objective. Overrides target. Both bounds must be broadcastable to to Objective.dim_f

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

  • normalize (bool, optional) – Whether to compute the error in physical units or non-dimensionalize. Has no effect for 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. Has no effect for this objective.

  • profile (Profile, optional) – Profile containing the radial modes to evaluate at.

  • indices (ndarray or bool, optional) – indices of the Profile.params array to fix. (e.g. indices corresponding to modes for a PowerSeriesProfile or indices corresponding to knots for a SplineProfile). Must have len(target) = len(weight) = len(modes). If True/False uses all/none of the Profile.params indices.

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

Methods

build([eq, use_jit, verbose])

Build constant arrays.

compute(Zeff_l, **kwargs)

Compute fixed atomic number 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.

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).

constants

Constant parameters such as transforms and profiles.

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.

weight

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