From 7302fabe371d11699d607902eea9c213989d6e5c Mon Sep 17 00:00:00 2001 From: Aleksandr Kazachkov Date: Mon, 26 Jul 2021 18:30:24 -0400 Subject: [PATCH] Added fix vars to unit.jl --- src/model/formulations/base/unit.jl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/model/formulations/base/unit.jl b/src/model/formulations/base/unit.jl index e701977..78c9b20 100644 --- a/src/model/formulations/base/unit.jl +++ b/src/model/formulations/base/unit.jl @@ -95,8 +95,15 @@ function _add_startup_shutdown_limit_eqs!(model::JuMP.Model, g::Unit)::Nothing ) # Shutdown limit if g.initial_power > g.shutdown_limit - eq_shutdown_limit[g.name, 0] = - @constraint(model, switch_off[g.name, 1] <= 0) + # TODO check what happens with these variables when exporting the model + # Generator producing too much to be turned off in the first time period + # (can a binary variable have bounds x = 0?) + if formulation_status_vars.fix_vars_via_constraint + eq_shutdown_limit[g.name, 0] = + @constraint(model, model[:switch_off][g.name, 1] <= 0.0) + else + fix(model[:switch_off][g.name, 1], 0.0; force = true) + end end if t < T eq_shutdown_limit[g.name, t] = @constraint(