From b2eaa0e48bee7ab2b6b98635c82b3564465746c8 Mon Sep 17 00:00:00 2001 From: mtanneau Date: Sat, 17 Jul 2021 15:57:03 -0400 Subject: [PATCH] Fix duplicated startup constraint --- src/model/formulations/MorLatRam2013/scosts.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/model/formulations/MorLatRam2013/scosts.jl b/src/model/formulations/MorLatRam2013/scosts.jl index f1cba19..2d68747 100644 --- a/src/model/formulations/MorLatRam2013/scosts.jl +++ b/src/model/formulations/MorLatRam2013/scosts.jl @@ -12,14 +12,14 @@ function _add_startup_cost_eqs!( S = length(g.startup_categories) startup = model[:startup] for t in 1:model[:instance].time - for s in 1:S - # If unit is switching on, we must choose a startup category - eq_startup_choose[g.name, t, s] = @constraint( - model, - model[:switch_on][g.name, t] == - sum(startup[g.name, t, s] for s in 1:S) - ) + # If unit is switching on, we must choose a startup category + eq_startup_choose[g.name, t] = @constraint( + model, + model[:switch_on][g.name, t] == + sum(startup[g.name, t, s] for s in 1:S) + ) + for s in 1:S # If unit has not switched off in the last `delay` time periods, startup category is forbidden. # The last startup category is always allowed. if s < S