Small fixes to ArrCon00

bugfix/formulations
Alinson S. Xavier 4 years ago
parent 67cef8b5cd
commit 92bfc01e8f

@ -59,9 +59,8 @@ function main()
"tejada19/UC_168h_199g", "tejada19/UC_168h_199g",
] ]
formulations = Dict( formulations = Dict(
# "ArrCon00" => UnitCommitment.Formulation( "ArrCon00" =>
# ramping=UnitCommitment._ArrCon00(), UnitCommitment.Formulation(ramping = UnitCommitment.ArrCon00()),
# ),
"DamKucRajAta16" => UnitCommitment.Formulation( "DamKucRajAta16" => UnitCommitment.Formulation(
ramping = UnitCommitment.DamKucRajAta16(), ramping = UnitCommitment.DamKucRajAta16(),
), ),
@ -142,7 +141,10 @@ end
BLAS.set_num_threads(1) BLAS.set_num_threads(1)
UnitCommitment.optimize!( UnitCommitment.optimize!(
model, model,
UnitCommitment.XavQiuWanThi19(time_limit = 3600.0, gap_limit=1e-4), UnitCommitment.XavQiuWanThi19(
time_limit = 3600.0,
gap_limit = 1e-4,
),
) )
end end
@info @sprintf("Total time was %.2f seconds", total_time) @info @sprintf("Total time was %.2f seconds", total_time)

@ -32,7 +32,7 @@ function _add_ramp_eqs!(
if is_initially_on if is_initially_on
# min power is _not_ multiplied by is_on because if !is_on, then ramp up is irrelevant # min power is _not_ multiplied by is_on because if !is_on, then ramp up is irrelevant
eq_ramp_up[gn, t] = @constraint( eq_ramp_up[gn, t] = @constraint(
mip, model,
g.min_power[t] + g.min_power[t] +
prod_above[gn, t] + prod_above[gn, t] +
(RESERVES_WHEN_RAMP_UP ? reserve[gn, t] : 0.0) <= (RESERVES_WHEN_RAMP_UP ? reserve[gn, t] : 0.0) <=
@ -52,7 +52,7 @@ function _add_ramp_eqs!(
# Equation (24) in Kneuven et al. (2020) # Equation (24) in Kneuven et al. (2020)
eq_ramp_up[gn, t] = @constraint( eq_ramp_up[gn, t] = @constraint(
mip, model,
max_prod_this_period - min_prod_last_period <= max_prod_this_period - min_prod_last_period <=
RU * is_on[gn, t-1] + SU * switch_on[gn, t] RU * is_on[gn, t-1] + SU * switch_on[gn, t]
) )
@ -66,7 +66,7 @@ function _add_ramp_eqs!(
# then the generator should be able to shut down at time t = 1, # then the generator should be able to shut down at time t = 1,
# but the constraint below will force the unit to produce power # but the constraint below will force the unit to produce power
eq_ramp_down[gn, t] = @constraint( eq_ramp_down[gn, t] = @constraint(
mip, model,
g.initial_power - (g.min_power[t] + prod_above[gn, t]) <= RD g.initial_power - (g.min_power[t] + prod_above[gn, t]) <= RD
) )
end end
@ -83,7 +83,7 @@ function _add_ramp_eqs!(
# Equation (25) in Kneuven et al. (2020) # Equation (25) in Kneuven et al. (2020)
eq_ramp_down[gn, t] = @constraint( eq_ramp_down[gn, t] = @constraint(
mip, model,
max_prod_last_period - min_prod_this_period <= max_prod_last_period - min_prod_this_period <=
RD * is_on[gn, t] + SD * switch_off[gn, t] RD * is_on[gn, t] + SD * switch_off[gn, t]
) )

Loading…
Cancel
Save