Skip to content

Commit 51e369b

Browse files
authored
Merge branch 'lanl-ansi:master' into master
2 parents 0c937ab + 9f1a851 commit 51e369b

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
## Staged
44
- nothing
55

6+
## v0.10.2
7+
- bug fix in Steady State transfer cost model
8+
- fix for power expression and power variable writing
9+
610
## v0.10.1
711
- use JuMP v1.23.2 to fix a bug in NLExpression's get value.
812

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "GasModels"
22
uuid = "5e113713-6c35-5477-b766-e1109486666f"
33
authors = ["Russell Bent <[email protected]>", "Kaarthik Sundar <[email protected]>", "David Fobes <[email protected]>"]
44
repo = "https://github.com/lanl-ansi/GasModels.jl.git"
5-
version = "0.10.1"
5+
version = "0.10.2"
66

77
[deps]
88
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
@@ -23,7 +23,7 @@ HiGHS = "~0.3, ~1"
2323
InfrastructureModels = "~0.6, ~0.7"
2424
Ipopt = "~0.8, ~0.9, ~1"
2525
JSON = "~0.18, ~0.19, ~0.20, ~0.21"
26-
JuMP = "1.23.2"
26+
JuMP = "~1.0, 1"
2727
Juniper = ">= 0.4"
2828
Memento = "~1.0, ~1.1, ~1.2, ~1.3, ~1.4"
2929
PolyhedralRelaxations = "~0.3"

src/core/objective.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function objective_min_economic_costs(gm::AbstractGasModel, nws = [nw_id_default
111111
)
112112
transfer_prices = Dict(
113113
n => Dict(
114-
i => get(ref(gm, n, :transfer, i), "bid_price", 1.0) for i in transfer_set[n]
114+
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]
115115
) for n in nws
116116
)
117117

src/core/variable.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ function variable_load_mass_flow(gm::AbstractGasModel, nw::Int=nw_id_default; bo
298298
fl = var(gm, nw)[:fl] = JuMP.@variable(gm.model,
299299
[i in ids(gm,nw,:dispatchable_delivery)],
300300
base_name="$(nw)_fl",
301-
start=comp_start_value(ref(gm, nw, :delivery), i, "fl_start", 0.0)
301+
start=comp_start_value(ref(gm, nw, :delivery), i, "fl_start",
302+
ref(gm,nw,:delivery,i)["withdrawal_max"])
302303
)
303304

304305
if bounded
@@ -325,7 +326,10 @@ function variable_transfer_mass_flow(gm::AbstractGasModel, nw::Int=nw_id_default
325326
ft = var(gm, nw)[:ft] = JuMP.@variable(gm.model,
326327
[i in ids(gm,nw,:dispatchable_transfer)],
327328
base_name="$(nw)_ft",
328-
start=comp_start_value(ref(gm, nw, :transfer), i, "ft_start", 0.0)
329+
start= ref(gm, nw, :transfer, i)["withdrawal_min"] < 0.0 ?
330+
ref(gm, nw, :transfer, i)["withdrawal_min"] :
331+
ref(gm, nw, :transfer, i)["withdrawal_max"]
332+
# comp_start_value(ref(gm, nw, :transfer), i, "ft_start", rand())
329333
)
330334

331335
if bounded
@@ -352,7 +356,9 @@ function variable_production_mass_flow(gm::AbstractGasModel, nw::Int=nw_id_defau
352356
fg = var(gm, nw)[:fg] = JuMP.@variable(gm.model,
353357
[i in ids(gm,nw,:dispatchable_receipt)],
354358
base_name="$(nw)_fg",
355-
start=comp_start_value(ref(gm, nw, :receipt), i, "fg_start", 0.0)
359+
start=comp_start_value(ref(gm, nw, :receipt), i, "fg_start",
360+
ref(gm,nw,:receipt,i)["injection_max"]
361+
)
356362
)
357363

358364
if bounded

0 commit comments

Comments
 (0)