Skip to content

Commit

Permalink
change time variant check
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Nov 29, 2024
1 parent d68c408 commit 43f6048
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ function _add_variable_cost_to_objective!(
end
pwl_fuel_consumption_expressions =
_add_pwl_term!(container, component, cost_function, T(), U())
is_time_variant = PSY.has_time_series(component)

is_time_variant = is_time_variant(cost_function)
for t in get_time_steps(container)
fuel_cost_value = _get_fuel_cost_value(
container,
Expand Down
4 changes: 4 additions & 0 deletions src/utils/powersystems_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ function _get_piecewise_incrementalcurve_per_system_unit(
return PSY.PiecewiseStepData(x_coords_normalized, y_coords_normalized)
end

function is_time_variant(cost_function::PSY.FuelCurve{PSY.PiecewisePointCurve})
return isa(PSY.get_fuel_cost(cost_function), IS.TimeSeriesKey)
end

function get_deterministic_time_series_type(sys::PSY.System)
time_series_types = IS.get_time_series_counts_by_type(sys.data)
existing_types = Set(d["type"] for d in time_series_types)
Expand Down

0 comments on commit 43f6048

Please sign in to comment.