mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
stochastic extension w/ scenarios
This commit is contained in:
@@ -8,6 +8,7 @@ function _add_production_piecewise_linear_eqs!(
|
||||
formulation_prod_vars::Gar1962.ProdVars,
|
||||
formulation_pwl_costs::Gar1962.PwlCosts,
|
||||
formulation_status_vars::Gar1962.StatusVars,
|
||||
sc::UnitCommitmentScenario
|
||||
)::Nothing
|
||||
eq_prod_above_def = _init(model, :eq_prod_above_def)
|
||||
eq_segprod_limit = _init(model, :eq_segprod_limit)
|
||||
@@ -24,9 +25,9 @@ function _add_production_piecewise_linear_eqs!(
|
||||
for t in 1:model[:instance].time
|
||||
# Definition of production
|
||||
# Equation (43) in Kneuven et al. (2020)
|
||||
eq_prod_above_def[gn, t] = @constraint(
|
||||
eq_prod_above_def[sc.name, gn, t] = @constraint(
|
||||
model,
|
||||
prod_above[gn, t] == sum(segprod[gn, t, k] for k in 1:K)
|
||||
prod_above[sc.name, gn, t] == sum(segprod[sc.name, gn, t, k] for k in 1:K)
|
||||
)
|
||||
|
||||
for k in 1:K
|
||||
@@ -37,21 +38,21 @@ function _add_production_piecewise_linear_eqs!(
|
||||
# difference between max power for segments k and k-1 so the
|
||||
# value of cost_segments[k].mw[t] is the max production *for
|
||||
# that segment*
|
||||
eq_segprod_limit[gn, t, k] = @constraint(
|
||||
eq_segprod_limit[sc.name, gn, t, k] = @constraint(
|
||||
model,
|
||||
segprod[gn, t, k] <= g.cost_segments[k].mw[t] * is_on[gn, t]
|
||||
segprod[sc.name, gn, t, k] <= g.cost_segments[k].mw[t] * is_on[gn, t]
|
||||
)
|
||||
|
||||
# Also add this as an explicit upper bound on segprod to make the
|
||||
# solver's work a bit easier
|
||||
set_upper_bound(segprod[gn, t, k], g.cost_segments[k].mw[t])
|
||||
set_upper_bound(segprod[sc.name, gn, t, k], g.cost_segments[k].mw[t])
|
||||
|
||||
# Objective function
|
||||
# Equation (44) in Kneuven et al. (2020)
|
||||
add_to_expression!(
|
||||
model[:obj],
|
||||
segprod[gn, t, k],
|
||||
g.cost_segments[k].cost[t],
|
||||
segprod[sc.name, gn, t, k],
|
||||
sc.probability * g.cost_segments[k].cost[t],
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user