Skip to content

Commit

Permalink
fix incorrect no load cost
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Sep 28, 2024
1 parent 88dfd7f commit a3a3f25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ function add_proportional_cost!(
cost_term = proportional_cost(op_cost_data, U(), d, V())
iszero(cost_term) && continue
for t in get_time_steps(container)
_add_proportional_term!(container, U(), d, cost_term * multiplier, t)
exp = _add_proportional_term!(container, U(), d, cost_term * multiplier, t)
add_to_expression!(container, ProductionCostExpression, exp, d, t)
end
end
return
Expand Down
6 changes: 4 additions & 2 deletions src/devices_models/devices/thermal_generation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ initial_condition_variable(::InitialTimeDurationOff, d::PSY.ThermalGen, ::Abstra

########################Objective Function##################################################
# TODO: Decide what is the cost for OnVariable, if fixed or constant term in variable
#proportional_cost(cost::PSY.ThermalGenerationCost, S::OnVariable, T::PSY.ThermalGen, U::AbstractThermalFormulation) = no_load_cost(cost, S, T, U)
proportional_cost(cost::PSY.ThermalGenerationCost, S::OnVariable, T::PSY.ThermalGen, U::AbstractThermalFormulation) = PSY.get_fixed(cost)
function proportional_cost(cost::PSY.ThermalGenerationCost, S::OnVariable, T::PSY.ThermalGen, U::AbstractThermalFormulation)
return no_load_cost(cost, S, T, U) + PSY.get_constant_term(PSY.get_vom_cost(PSY.get_variable(cost)))
end

proportional_cost(cost::PSY.MarketBidCost, ::OnVariable, ::PSY.ThermalGen, ::AbstractThermalFormulation) = PSY.get_no_load_cost(cost)

has_multistart_variables(::PSY.ThermalGen, ::AbstractThermalFormulation)=false
Expand Down

0 comments on commit a3a3f25

Please sign in to comment.