odys.optimization.model.model_builder¶
Internal implementation detail. Most users do not need this page directly.
Builds the linopy model of an optimization problem: variables, constraints and objective.
build_model(problem)
¶
Build the optimization model of an energy system.
Variables come first (entity formulations, then objective terms), then
constraints (entity formulations, the power balance, objective terms), then
the objective: the sum of the weighted terms, maximized. A problem is built
into one model only; its formulations refuse a second add_variables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
problem
|
OptimizationProblem
|
The formulations of the energy system and of its objective terms. |
required |
Returns:
| Type | Description |
|---|---|
Model
|
The linopy model, ready for solving. |
Source code in src/odys/optimization/model/model_builder.py
12 13 14 15 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 | |