Skip to content

Commit

Permalink
update slack expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Jan 3, 2024
1 parent 21b0ae4 commit 8154c9a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/devices_models/devices/common/add_to_expression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,10 @@ function add_to_expression!(
}
variable = get_variable(container, U(), PSY.ACBus)
expression = get_expression(container, T(), PSY.ACBus)
@assert_op length(axes(variable, 1)) == length(axes(expression, 1))
#TODO: Update Slacks to consider reduced buses
#@assert_op length(axes(variable, 1)) == length(axes(expression, 1))
# We uses axis here to avoid double addition of the slacks to the aggregated buses
for t in get_time_steps(container), n in axes(variable, 1)
for t in get_time_steps(container), n in axes(expression, 1)
_add_to_jump_expression!(
expression[n, t],
variable[n, t],
Expand All @@ -1137,7 +1138,7 @@ function add_to_expression!(
variable = get_variable(container, U(), PSY.ACBus, "P")
expression = get_expression(container, T(), PSY.ACBus)
# We uses axis here to avoid double addition of the slacks to the aggregated buses
for t in get_time_steps(container), n in axes(variable, 1)
for t in get_time_steps(container), n in axes(expression, 1)
_add_to_jump_expression!(
expression[n, t],
variable[n, t],
Expand All @@ -1161,7 +1162,7 @@ function add_to_expression!(
variable = get_variable(container, U(), PSY.ACBus, "Q")
expression = get_expression(container, T(), PSY.ACBus)
# We uses axis here to avoid double addition of the slacks to the aggregated buses
for t in get_time_steps(container), n in axes(variable, 1)
for t in get_time_steps(container), n in axes(expression, 1)
_add_to_jump_expression!(
expression[n, t],
variable[n, t],
Expand Down

0 comments on commit 8154c9a

Please sign in to comment.