desc.objectives.FixOmniMap
- class desc.objectives.FixOmniMap(field, target=None, bounds=None, weight=1, normalize=False, normalize_target=False, indices=True, name='fixed omnigenity map')Source
Fixes OmnigenousField.x_lmn coefficients.
- Parameters:
field (OmnigenousField) – Field that will be optimized to satisfy the Objective.
target (float, optional) – Target value(s) of the objective. If None, uses field value.
bounds (tuple, optional) – Lower and upper bounds on the objective. Overrides target.
weight (float, optional) – Weighting to apply to the Objective, relative to other Objectives.
normalize (bool) – Whether to compute the error in physical units or non-dimensionalize.
normalize_target (bool) – Whether target 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.
indices (ndarray or bool, optional) – indices of the feld.x_lmn array to fix. Must have len(target) = len(weight) = len(indices). If True/False uses all/none of the field.x_lmn indices.
name (str) – Name of the objective function.
Methods
build
([use_jit, verbose])Build constant arrays.
compute
(params[, constants])Compute fixed omnigenity map error.
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.
jit
()Apply JIT to compute methods, or re-apply after updating self.
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, **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
(*things)Return a tuple of args required by this objective from optimizable things.
Attributes
Lower and upper bounds of the objective.
Whether the transforms have been precomputed (or not).
Constant parameters such as transforms and profiles.
Number of objective equations.
Whether the objective fixes individual parameters (or linear combo).
Whether the objective is a linear function (or nonlinear).
Name of objective (str).
normalizing scale factor.
Whether default "compute" method is a scalar or vector.
Target value(s) of the objective.
Optimizable things that this objective is tied to.
Weighting to apply to the Objective, relative to other Objectives.