Analysis.solve

Analysis.solve(solver=None, post_process=True)

Solve the optimization problem and optionally post-process results.

Parameters:
solverstr, optional

Solver to use (“IPOPT” or “SLSQP”). If None, uses the solver specified in optimiser settings. Default is None.

post_processbool, optional

Whether to apply the solution to the form diagram after solving. Default is True.

Returns:
SolverResult

The optimization result containing xopt, fopt, success status, etc.

Notes

This is the fourth and final step in the new workflow. It requires that: - setup_optimization() has been called (for nonlinear) - OR create_base_problem() has been called (for convex) - Problem is fully configured in optimiser.problem

The result is stored in self.result.

Examples

>>> analysis.create_base_problem()
>>> analysis.compute_starting_point()
>>> analysis.setup_optimization()
>>> result = analysis.solve(solver="IPOPT")
>>> print(f"Optimal objective: {result.fopt}")