SciPy Backend¶
The recommended conda-forge package includes both solver backends. Install it once, then select SciPy in your code when it is the better fit:
If you specifically want a smaller environment without the native Ipopt libraries, install the base PyPI distribution instead:
Select the backend explicitly:
from pockit.optimizer import scipy
solution, result = scipy.solve(
system,
guess,
optimizer_options={"maxiter": 1000, "verbose": 1},
)
if not result.success:
raise RuntimeError(result.message)
The SciPy backend is well suited to installation verification, teaching examples, and moderately sized nonlinear programs. Ipopt generally scales better for large, sparse constrained problems produced by fine optimal-control meshes. Actual performance still depends on the model, scaling, derivatives, and initial guess. See Quick Installation when Ipopt is needed.
The backend accepts the options and returns the result object defined by
scipy.optimize.minimize
with method="trust-constr". These differ from Ipopt's options and status
dictionary.