Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove EnergyOutput Aux Vars #1029

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/PowerSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ export LowerBoundFeedForwardSlack
export TimeDurationOn
export TimeDurationOff
export PowerOutput
export EnergyOutput

# Constraints
export AbsoluteValueConstraint
Expand Down
4 changes: 0 additions & 4 deletions src/core/auxiliary_variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ struct TimeDurationOff <: AuxVariableType end
Auxiliary Variable for Thermal Generation Models that solve for power above min
"""
struct PowerOutput <: AuxVariableType end
"""
Auxiliary Variable for Hydro and Storage Models that solve for total energy output
"""
struct EnergyOutput <: AuxVariableType end

should_write_resulting_value(::Type{<:AuxVariableType}) = true

Expand Down
42 changes: 0 additions & 42 deletions src/simulation/simulation_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,48 +239,6 @@ function update_decision_state!(
return
end

function update_decision_state!(
state::SimulationState,
key::AuxVarKey{EnergyOutput, T},
store_data::DenseAxisArray{Float64, 2},
simulation_time::Dates.DateTime,
model_params::ModelStoreParams,
) where {T <: PSY.Component}
state_data = get_decision_state_data(state, key)
model_resolution = get_resolution(model_params)
state_resolution = get_data_resolution(state_data)
resolution_ratio = model_resolution ÷ state_resolution
state_timestamps = state_data.timestamps
@assert_op resolution_ratio >= 1

if simulation_time > get_end_of_step_timestamp(state_data)
state_data_index = 1
state_data.timestamps[:] .=
range(
simulation_time;
step = state_resolution,
length = get_num_rows(state_data),
)
else
state_data_index = find_timestamp_index(state_timestamps, simulation_time)
end

offset = resolution_ratio - 1
result_time_index = axes(store_data)[2]
set_update_timestamp!(state_data, simulation_time)
column_names = axes(state_data.values)[1]
for t in result_time_index
state_range = state_data_index:(state_data_index + offset)
for name in column_names, i in state_range
state_data.values[name, i] = store_data[name, t] / resolution_ratio
end
set_last_recorded_row!(state_data, state_range[end])
state_data_index += resolution_ratio
end

return
end

function update_decision_state!(
state::SimulationState,
key::AuxVarKey{S, T},
Expand Down
Loading