From 708359a7206c95861eb49005d0c9c2feb3a7798d Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Tue, 13 Feb 2024 16:05:08 +0100 Subject: [PATCH] equality constraints --- core/src/allocation.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/allocation.jl b/core/src/allocation.jl index 6ae3fca01..1c775c074 100644 --- a/core/src/allocation.jl +++ b/core/src/allocation.jl @@ -494,14 +494,14 @@ Add the flow conservation constraints to the allocation problem. The constraint indices are user node IDs. Constraint: -sum(flows out of node node) <= flows into node + flow from storage and vertical fluxes +sum(flows out of node node) == flows into node + flow from storage and vertical fluxes """ function add_constraints_flow_conservation!( problem::JuMP.Model, p::Parameters, allocation_network_id::Int, )::Nothing - (; graph, allocation) = p + (; graph) = p F = problem[:F] node_ids = graph[].node_ids[allocation_network_id] node_ids_conservation = @@ -517,7 +517,7 @@ function add_constraints_flow_conservation!( sum([ F[(node_id, outneighbor_id)] for outneighbor_id in outflow_ids_allocation(graph, node_id) - ]) <= sum([ + ]) == sum([ F[(inneighbor_id, node_id)] for inneighbor_id in inflow_ids_allocation(graph, node_id) ]),