pockit.optimizer.scipy
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 trust-constr method of
scipy.optimize.minimize().
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
as values of static variables.
Optimizer options should be a dictionary of options to pass to scipy.optimize.minimize().
See Scipy documentation
for available options. Options will be passed verbatimly.
Arguments:
- system:
Systemto solve. - guess: Guess to the solution.
- optimizer_options: Options to pass to
scipy.optimize.minimize().
Returns:
The value returned by
scipy.optimize.minimize()parsed as the same format asguess(a singleVariableobject or a list ofVariableobjects and a array for static values), and the raw output returned byscipy.optimize.minimize().