desc.equilibrium.Equilibrium.perturb

Equilibrium.perturb(deltas, objective=None, constraints=None, order=2, tr_ratio=0.1, weight='auto', include_f=True, verbose=1, copy=False)[source]

Perturb an equilibrium.

Parameters:
  • objective (ObjectiveFunction) – Objective function to satisfy. Default = force balance.

  • constraints (Objective or tuple of Objective) – Constraint function to satisfy. Default = fixed-boundary.

  • deltas (dict of ndarray) – Deltas for perturbations. Keys should names of Equilibrium attributes (“p_l”, “Rb_lmn”, “L_lmn” etc.) and values of arrays of desired change in the attribute.

  • order ({0,1,2,3}) – Order of perturbation (0=none, 1=linear, 2=quadratic, etc.)

  • tr_ratio (float or array of float) – Radius of the trust region, as a fraction of ||x||. Enforces ||dx1|| <= tr_ratio*||x|| and ||dx2|| <= tr_ratio*||dx1||. If a scalar, uses the same ratio for all steps. If an array, uses the first element for the first step and so on.

  • weight (ndarray, "auto", or None, optional) – 1d or 2d array for weighted least squares. 1d arrays are turned into diagonal matrices. Default is to weight by (mode number)**2. None applies no weighting.

  • include_f (bool, optional) – Whether to include the 0th order objective residual in the perturbation equation. Including this term can improve force balance if the perturbation step is large, but can result in too large a step if the perturbation is small.

  • verbose (int) – Level of output.

  • copy (bool, optional) – Whether to update the existing equilibrium or make a copy (Default).

Returns:

eq_new (Equilibrium) – Perturbed equilibrium.