Added fix vars to unit.jl

feature/fix-vars
Aleksandr Kazachkov 4 years ago
parent 4ed13d6e95
commit 7302fabe37

@ -95,8 +95,15 @@ function _add_startup_shutdown_limit_eqs!(model::JuMP.Model, g::Unit)::Nothing
) )
# Shutdown limit # Shutdown limit
if g.initial_power > g.shutdown_limit if g.initial_power > g.shutdown_limit
eq_shutdown_limit[g.name, 0] = # TODO check what happens with these variables when exporting the model
@constraint(model, switch_off[g.name, 1] <= 0) # 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 end
if t < T if t < T
eq_shutdown_limit[g.name, t] = @constraint( eq_shutdown_limit[g.name, t] = @constraint(

Loading…
Cancel
Save