Sector
nimopt.models.sector has mixed density. The region-technology map is
sparse: a technology exists in some regions and not in others. Every sited
pair runs in every hour. The generation variable takes its members from a
parameter over the sited pairs crossed with the whole horizon. It is
therefore sparse in one axis and dense in the other.
minimize Σ_{(r,k) sited, t} cost[r,k] · gen[r,k,t]
subject to Σ_k gen[r,k,t] == demand[r,t] for each region r and hour t
0 ≤ gen[r,k,t] ≤ capacity[r,k] for each sited (r,k) and hour t
from nimopt.models import sector
print(sector.definition().explain())
Output
sector min not built
sets R · K · T
parameters sited (R,K,T) · capacity (R,K) · cost (R,K) · demand (R,T)
variables gen (R×K×T) over sited [0.0, capacity]
constraint balance (R,T) Sum(K, gen[R, K, T]) == demand[R, T]
objective min Sum(R, K, T, cost[R, K] * gen[R, K, T])
Each region meets its own demand from the technologies sited in it. The optimum is a merit order per region and hour.
from nimopt.models import sector
inputs = sector.data()
model = sector.definition().build(inputs)
solution = model.solve()
print(
model.n_columns,
"columns of a possible",
len(inputs["R"]) * len(inputs["K"]) * len(inputs["T"]),
)
print(solution.objective, sector.reference(inputs))
Output
16 columns of a possible 24
18350.0 18350.0
Every region-hour has a balance row. The capacity bound applies to the sited pairs alone, and no balance row is dropped.
from nimopt.models import sector
model = sector.definition().build(sector.data())
print(model.absent("balance"))
Output
balance 8 of 8 rows stated by terms