pypsa.optimization.optimize.OptimizationAccessor.solve_model#
- OptimizationAccessor.solve_model(extra_functionality: Callable | None = None, solver_name: str = 'highs', solver_options: dict = {}, assign_all_duals: bool = False, **kwargs: Any) tuple[str, str] #
Solve an already created model and assign its solution to the network.
- Parameters:
solver_name (str) – Name of the solver to use.
solver_options (dict) – Keyword arguments used by the solver. Can also be passed via **kwargs.
assign_all_duals (bool, default False) – Whether to assign all dual values or only those that already have a designated place in the network.
**kwargs – Keyword argument used by linopy.Model.solve, such as solver_name, problem_fn or solver options directly passed to the solver.
- Returns:
status (str) – The status of the optimization, either “ok” or one of the codes listed in https://linopy.readthedocs.io/en/latest/generated/linopy.constants.SolverStatus.html
condition (str) – The termination condition of the optimization, either “optimal” or one of the codes listed in https://linopy.readthedocs.io/en/latest/generated/linopy.constants.TerminationCondition.html