odys.solvers.solver¶
Internal implementation detail. Most users do not need this page directly.
See Solvers in the User Guide for the public API.
Solver dispatch for energy system optimization.
This module provides the solve function that dispatches to any linopy-supported solver based on the SolverConfig.
solve(model, solver_config)
¶
Solve the model with the configured solver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The linopy model to solve. |
required |
solver_config
|
SolverConfig
|
Solver configuration. |
required |
Returns:
| Type | Description |
|---|---|
SolveOutcome
|
The solver status, termination condition, objective value and solution. Without a solution |
SolveOutcome
|
(a status other than |
SolveOutcome
|
feasible solution) the objective value is |
Raises:
| Type | Description |
|---|---|
OdysSolverError
|
If the configured solver is not available. |
Source code in src/odys/solvers/solver.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
validate_solver_available(solver_name)
¶
Validate that the solver is installed and available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
solver_name
|
SolverName
|
The solver name to check. |
required |
Raises:
| Type | Description |
|---|---|
OdysSolverError
|
If the solver is not in linopy.available_solvers. |
Source code in src/odys/solvers/solver.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |