Skip to content

Commit

Permalink
Get fractional demand for the representative t in node_injection constr.
Browse files Browse the repository at this point in the history
Otherwise we get infeasibilities, because we will be asking
the injections over one representative period to be equal to the
fractional demand of all the represented ones. That doesn't make any
sense.
  • Loading branch information
manuelma committed Oct 24, 2023
1 parent b071345 commit 2305802
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/constraints/constraint_node_injection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function add_constraint_node_injection!(m::Model)
(node=n, stochastic_path=s, t_before=t_before, t_after=t_after) => @constraint(
m,
+ expr_sum(
+ node_injection[n, s, t] + demand[
+ node_injection[n, s, t]
+ demand[
(node=n, stochastic_scenario=s, analysis_time=t0, t=representative_time_slice(m, t))
]
# node slack
Expand All @@ -41,8 +42,8 @@ function add_constraint_node_injection!(m::Model)
init=0,
)
+ expr_sum(
fractional_demand[(node=n, stochastic_scenario=s, analysis_time=t0, t=t)]
* demand[(node=ng, stochastic_scenario=s, analysis_time=t0, t=t)]
fractional_demand[(node=n, stochastic_scenario=s, analysis_time=t0, t=representative_time_slice(m, t))]
* demand[(node=ng, stochastic_scenario=s, analysis_time=t0, t=representative_time_slice(m, t))]
for (n, s, t) in node_injection_indices(
m; node=n, stochastic_scenario=s, t=t_after, temporal_block=anything
)
Expand Down

0 comments on commit 2305802

Please sign in to comment.