From 92221bcaa4ddf083bb33d37acd0d5d49624d40ae Mon Sep 17 00:00:00 2001 From: Aleksandr Kazachkov Date: Fri, 23 Jul 2021 16:54:51 -0400 Subject: [PATCH] Use shortfall penalty only when val is nonnegative --- src/model/formulations/base/system.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/formulations/base/system.jl b/src/model/formulations/base/system.jl index f88c15e..d62f90f 100644 --- a/src/model/formulations/base/system.jl +++ b/src/model/formulations/base/system.jl @@ -39,12 +39,12 @@ function _add_reserve_eqs!(model::JuMP.Model)::Nothing eq_min_reserve[t] = @constraint( model, sum(model[:reserve][g.name, t] for g in instance.units) + ( - shortfall_penalty > -1e-7 ? model[:reserve_shortfall][t] : 0.0 + shortfall_penalty >= 0 ? model[:reserve_shortfall][t] : 0.0 ) >= instance.reserves.spinning[t] ) # Account for shortfall contribution to objective - if shortfall_penalty > -1e-7 + if shortfall_penalty >= 0 add_to_expression!( model.obj, shortfall_penalty,