fluxopt.model
¶
Classes:
| Name | Description |
|---|---|
FlowSystem |
|
FlowSystem
¶
Initialize the flow system optimization model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ModelData
|
Pre-built model data. |
required |
Methods:
| Name | Description |
|---|---|
build |
Build all variables, constraints, and the objective. |
optimize |
Build, optionally customize, and solve the model. |
solve |
Solve the built model and return results. |
Source code in src/fluxopt/model.py
build
¶
Build all variables, constraints, and the objective.
Source code in src/fluxopt/model.py
optimize
¶
optimize(
objective_effects: str | list[str],
customize: Callable[[FlowSystem], None] | None = None,
*,
solver: str = 'highs',
**kwargs: Any,
) -> Result
Build, optionally customize, and solve the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | list[str]
|
Effect name(s) to minimize. Sum of named effect totals. |
required |
|
Callable[[FlowSystem], None] | None
|
Optional callback to modify the linopy model between build and solve.
Receives |
None
|
|
str
|
Solver backend name. |
'highs'
|
|
Any
|
Passed through to |
{}
|