pockit.optimizer.ipopt

def solve( system: pockit.base.systembase.SystemBase, guess: pockit.base.variablebase.VariableBase | list[typing.Union[pockit.base.variablebase.VariableBase, typing.Iterable[float]]], optimizer_options: Optional[dict] = None) -> tuple[pockit.base.variablebase.VariableBase | list[typing.Union[pockit.base.variablebase.VariableBase, typing.Iterable[float]]], typing.Any]:

Solve the system using Ipopt.

If the system has only one phase and no static variables, guess can be a single Variable object. Otherwise, guess should be a list of Variable objects, one for each Phase, followed by an array of static-parameter values.

Optimizer options should be a dictionary of options to pass to Ipopt. See Ipopt documentation for available options. Options are passed through unchanged.

Arguments:
  • system: System to solve.
  • guess: Initial guess for the solution.
  • optimizer_options: Options to pass to Ipopt.
Returns:

The Ipopt solution converted to the same structure as guess (a single Variable object or a list containing Variable objects and an array of static-parameter values), and the raw output returned by Ipopt.