Skip to content

Commit

Permalink
update aux vars calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Sep 25, 2024
1 parent fa4c2fc commit a4fea25
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/devices_models/devices/thermal_generation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -818,10 +818,13 @@ function calculate_aux_variable_value!(
time_steps = get_time_steps(container)

for ix in eachindex(JuMP.axes(aux_variable_container)[1])
ini_cond_value = get_condition(ini_cond[ix])
# if its nothing it means the thermal unit was on must run
# so there is nothing to do but to add the total number of time steps
# to the count
if isnothing(get_value(ini_cond[ix]))
sum_on_var = time_steps[end]
else
ini_cond_value = get_condition(ini_cond[ix])
on_var = jump_value.(on_variable_results.data[ix, :])
aux_variable_container.data[ix, :] .= ini_cond_value
sum_on_var = sum(on_var)
Expand Down Expand Up @@ -859,10 +862,11 @@ function calculate_aux_variable_value!(

time_steps = get_time_steps(container)
for ix in eachindex(JuMP.axes(aux_variable_container)[1])
IS.@assert_op JuMP.axes(aux_variable_container)[1][ix] ==
JuMP.axes(on_variable_results)[1][ix]
IS.@assert_op JuMP.axes(aux_variable_container)[1][ix] ==
get_component_name(ini_cond[ix])
# if its nothing it means the thermal unit was on must run
# so there is nothing to do but continue
if isnothing(get_value(ini_cond[ix]))
continue
end
on_var = jump_value.(on_variable_results.data[ix, :])
ini_cond_value = get_condition(ini_cond[ix])
aux_variable_container.data[ix, :] .= ini_cond_value
Expand Down

0 comments on commit a4fea25

Please sign in to comment.