Skip to content

Commit

Permalink
bug fix in steady state
Browse files Browse the repository at this point in the history
  • Loading branch information
kaarthiksundar committed Oct 17, 2024
1 parent c39f4ff commit 32b5d03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/objective.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function objective_min_economic_costs(gm::AbstractGasModel, nws = [nw_id_default
)
transfer_prices = Dict(
n => Dict(
i => get(ref(gm, n, :transfer, i), "bid_price", 1.0) for i in transfer_set[n]
i => ref(gm, n, :transfer, i)["withdrawal_min"] >= 0.0 ? get(ref(gm, n, :transfer, i), "bid_price", 1.0) : (-1) * get(ref(gm, n, :transfer, i), "offer_price", 1.0) for i in transfer_set[n]
) for n in nws
)

Expand Down
12 changes: 9 additions & 3 deletions src/core/variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ function variable_load_mass_flow(gm::AbstractGasModel, nw::Int=nw_id_default; bo
fl = var(gm, nw)[:fl] = JuMP.@variable(gm.model,
[i in ids(gm,nw,:dispatchable_delivery)],
base_name="$(nw)_fl",
start=comp_start_value(ref(gm, nw, :delivery), i, "fl_start", 0.0)
start=comp_start_value(ref(gm, nw, :delivery), i, "fl_start",
ref(gm,nw,:delivery,i)["withdrawal_max"])
)

if bounded
Expand All @@ -325,7 +326,10 @@ function variable_transfer_mass_flow(gm::AbstractGasModel, nw::Int=nw_id_default
ft = var(gm, nw)[:ft] = JuMP.@variable(gm.model,
[i in ids(gm,nw,:dispatchable_transfer)],
base_name="$(nw)_ft",
start=comp_start_value(ref(gm, nw, :transfer), i, "ft_start", 0.0)
start= ref(gm, nw, :transfer, i)["withdrawal_min"] < 0.0 ?
ref(gm, nw, :transfer, i)["withdrawal_min"] :
ref(gm, nw, :transfer, i)["withdrawal_max"]
# comp_start_value(ref(gm, nw, :transfer), i, "ft_start", rand())
)

if bounded
Expand All @@ -352,7 +356,9 @@ function variable_production_mass_flow(gm::AbstractGasModel, nw::Int=nw_id_defau
fg = var(gm, nw)[:fg] = JuMP.@variable(gm.model,
[i in ids(gm,nw,:dispatchable_receipt)],
base_name="$(nw)_fg",
start=comp_start_value(ref(gm, nw, :receipt), i, "fg_start", 0.0)
start=comp_start_value(ref(gm, nw, :receipt), i, "fg_start",
ref(gm,nw,:receipt,i)["injection_max"]
)
)

if bounded
Expand Down

0 comments on commit 32b5d03

Please sign in to comment.