desc.equilibrium.Equilibrium.optimize

Equilibrium.optimize(objective=None, constraints=None, optimizer='proximal-lsq-exact', ftol=None, xtol=None, gtol=None, maxiter=50, x_scale='auto', options=None, verbose=1, copy=False)[source]

Optimize an equilibrium for an objective.

Parameters:
  • objective (ObjectiveFunction) – Objective function to optimize.

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

  • optimizer (str or Optimizer (optional)) – optimizer to use

  • ftol (float) – stopping tolerances. None will use defaults for given optimizer.

  • xtol (float) – stopping tolerances. None will use defaults for given optimizer.

  • gtol (float) – stopping tolerances. None will use defaults for given optimizer.

  • maxiter (int) – Maximum number of solver steps.

  • x_scale (array_like or 'auto', optional) – Characteristic scale of each variable. Setting x_scale is equivalent to reformulating the problem in scaled variables xs = x / x_scale. An alternative view is that the size of a trust region along jth dimension is proportional to x_scale[j]. Improved convergence may be achieved by setting x_scale such that a step of a given size along any of the scaled variables has a similar effect on the cost function. If set to 'auto', the scale is iteratively updated using the inverse norms of the columns of the Jacobian or Hessian matrix.

  • options (dict) – Dictionary of additional options to pass to optimizer.

  • verbose (int) – Level of output.

  • copy (bool) – Whether to return the current equilibrium or a copy (leaving the original unchanged).

Returns:

  • eq (Equilibrium) – Either this equilibrium or a copy, depending on “copy” argument.

  • result (OptimizeResult) – The optimization result represented as a OptimizeResult object. Important attributes are: x the solution array, success a Boolean flag indicating if the optimizer exited successfully and message which describes the cause of the termination. See OptimizeResult for a description of other attributes.