Skip to content

Commit

Permalink
update linear and quadratic methods to use new function
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Oct 16, 2024
1 parent 50f7ed4 commit 3d74a48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,10 @@ function _add_fuel_linear_variable_cost!(
container::OptimizationContainer,
::T,
component::V,
heat_rate::Float64, # already normalized in MMBTU/p.u.
::Float64, # already normalized in MMBTU/p.u.
fuel_cost::IS.TimeSeriesKey,
) where {T <: VariableType, V <: PSY.Component}
parameter = get_parameter_array(container, FuelCostParameter(), V)
multiplier = get_parameter_multiplier_array(container, FuelCostParameter(), V)
expression = get_expression(container, FuelConsumptionExpression(), V)
name = PSY.get_name(component)
for t in get_time_steps(container)
cost_expr = expression[name, t] * parameter[name, t] * multiplier[name, t]
add_to_expression!(
container,
ProductionCostExpression,
cost_expr,
component,
t,
)
add_to_objective_variant_expression!(container, cost_expr)
end
_add_time_varying_fuel_variable_cost!(container, T(), component, fuel_cost)
return
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,7 @@ function _add_fuel_quadratic_variable_cost!(
quadratic_fuel_curve::Float64,
fuel_cost::IS.TimeSeriesKey,
) where {T <: VariableType}
error("Not implemented yet")
_add_quadraticcurve_variable_cost!(
container,
T(),
component,
proportional_fuel_curve,
quadratic_fuel_curve,
)
_add_time_varying_fuel_variable_cost!(container, T(), component, fuel_cost)
end

@doc raw"""
Expand Down

0 comments on commit 3d74a48

Please sign in to comment.