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 with SciPy's trust-constr method via
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 of
static-parameter values.
Optimizer options should be a dictionary of options to pass to scipy.optimize.minimize().
See the SciPy documentation
for available options. Options are passed through unchanged.
Arguments:
- system:
Systemto solve. - guess: Initial guess for the solution.
- optimizer_options: Options to pass to
scipy.optimize.minimize().
Returns:
The SciPy solution converted to the same structure as
guess(a singleVariableobject or a list containingVariableobjects and an array of static-parameter values), and the raw output returned byscipy.optimize.minimize().