Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Models running with, non-default, solvers Cbc and Clp will fail unless
`"EnableJuMPDirectMode"` is set to false (#835).
- Improve `@expressions` performance by pre-processing sets (#815).

### Fixed
- Fix call to `get_retirement_stage` by casting `lifetime` to integer (#840).

## [0.4.4] - 2025-02-04

### Added
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GenX"
uuid = "5d317b1e-30ec-4ed6-a8ce-8d2d88d7cfac"
authors = ["Bonaldo, Luca", "Chakrabarti, Sambuddha", "Cheng, Fangwei", "Ding, Yifu", "Jenkins, Jesse D.", "Luo, Qian", "Macdonald, Ruaridh", "Mallapragada, Dharik", "Manocha, Aneesha", "Mantegna, Gabe ", "Morris, Jack", "Patankar, Neha", "Pecci, Filippo", "Schwartz, Aaron", "Schwartz, Jacob", "Schivley, Greg", "Sepulveda, Nestor", "Xu, Qingyu", "Zhou, Justin"]
version = "0.4.4-dev.5"
version = "0.4.4-dev.6"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
24 changes: 12 additions & 12 deletions src/multi_stage/endogenous_retirement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function endogenous_retirement_discharge!(EP::Model,
@expression(EP,
eNewCapTrack[y in RET_CAP],
sum(EP[:vCAPTRACK][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP, eMinRetCapTrack[y in RET_CAP],
if y in COMMIT
cum_min_retired_cap_mw(gen[y]) / cap_size(gen[y])
Expand Down Expand Up @@ -302,7 +302,7 @@ function endogenous_retirement_charge!(EP::Model,
@expression(EP,
eNewCapTrackCharge[y in RET_CAP_CHARGE],
sum(EP[:vCAPTRACKCHARGE][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackCharge[y in RET_CAP_CHARGE],
cum_min_retired_charge_cap_mw(gen[y]))
Expand Down Expand Up @@ -368,7 +368,7 @@ function endogenous_retirement_energy!(EP::Model,
@expression(EP,
eNewCapTrackEnergy[y in RET_CAP_ENERGY],
sum(EP[:vCAPTRACKENERGY][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackEnergy[y in RET_CAP_ENERGY],
cum_min_retired_energy_cap_mw(gen[y]))
Expand Down Expand Up @@ -434,7 +434,7 @@ function endogenous_retirement_vre_stor_dc!(EP::Model,
@expression(EP,
eNewCapTrackDC[y in RET_CAP_DC],
sum(EP[:vCAPTRACKDC][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackDC[y in RET_CAP_DC],
cum_min_retired_cap_inverter_mw(gen[y]))
Expand Down Expand Up @@ -500,7 +500,7 @@ function endogenous_retirement_vre_stor_solar!(EP::Model,
@expression(EP,
eNewCapTrackSolar[y in RET_CAP_SOLAR],
sum(EP[:vCAPTRACKSOLAR][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackSolar[y in RET_CAP_SOLAR],
cum_min_retired_cap_solar_mw(gen[y]))
Expand Down Expand Up @@ -566,7 +566,7 @@ function endogenous_retirement_vre_stor_wind!(EP::Model,
@expression(EP,
eNewCapTrackWind[y in RET_CAP_WIND],
sum(EP[:vCAPTRACKWIND][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackWind[y in RET_CAP_WIND],
cum_min_retired_cap_wind_mw(gen[y]))
Expand Down Expand Up @@ -630,7 +630,7 @@ function endogenous_retirement_vre_stor_elec!(EP::Model,
sum(EP[:vRETCAPTRACKELEC][y, p] for p in 1:cur_stage))
@expression(EP, eNewCapTrackElec[y in RET_CAP_ELEC],
sum(EP[:vCAPTRACKELEC][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP, eMinRetCapTrackElec[y in RET_CAP_ELEC],
cum_min_retired_cap_elec_mw(gen[y]))

Expand Down Expand Up @@ -687,7 +687,7 @@ function endogenous_retirement_vre_stor_stor!(
@expression(EP,
eNewCapTrackEnergy_VS[y in RET_CAP_STOR],
sum(EP[:vCAPTRACKENERGY_VS][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackEnergy_VS[y in RET_CAP_STOR],
cum_min_retired_energy_cap_mw(gen[y]))
Expand Down Expand Up @@ -755,7 +755,7 @@ function endogenous_retirement_vre_stor_discharge_dc!(EP::Model,
@expression(EP,
eNewCapTrackDischargeDC[y in RET_CAP_DISCHARGE_DC],
sum(EP[:vCAPTRACKDISCHARGEDC][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackDischargeDC[y in RET_CAP_DISCHARGE_DC],
cum_min_retired_cap_discharge_dc_mw(gen[y]))
Expand Down Expand Up @@ -821,7 +821,7 @@ function endogenous_retirement_vre_stor_charge_dc!(EP::Model,
@expression(EP,
eNewCapTrackChargeDC[y in RET_CAP_CHARGE_DC],
sum(EP[:vCAPTRACKCHARGEDC][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackChargeDC[y in RET_CAP_CHARGE_DC],
cum_min_retired_cap_charge_dc_mw(gen[y]))
Expand Down Expand Up @@ -888,7 +888,7 @@ function endogenous_retirement_vre_stor_discharge_ac!(EP::Model,
@expression(EP,
eNewCapTrackDischargeAC[y in RET_CAP_DISCHARGE_AC],
sum(EP[:vCAPTRACKDISCHARGEAC][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackDischargeAC[y in RET_CAP_DISCHARGE_AC],
cum_min_retired_cap_discharge_ac_mw(gen[y]))
Expand Down Expand Up @@ -954,7 +954,7 @@ function endogenous_retirement_vre_stor_charge_ac!(EP::Model,
@expression(EP,
eNewCapTrackChargeAC[y in RET_CAP_CHARGE_AC],
sum(EP[:vCAPTRACKCHARGEAC][y, p]
for p in 1:get_retirement_stage(cur_stage, lifetime(gen[y]), stage_lens)))
for p in 1:get_retirement_stage(cur_stage, Int(floor(lifetime(gen[y]))), stage_lens)))
@expression(EP,
eMinRetCapTrackChargeAC[y in RET_CAP_CHARGE_AC],
cum_min_retired_cap_charge_ac_mw(gen[y]))
Expand Down
2 changes: 1 addition & 1 deletion test/test_electrolyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Test

include(joinpath(@__DIR__, "utilities.jl"))

obj_true = 34275.8599
obj_true = 34277.0607
test_path = "electrolyzer"

# Define test inputs
Expand Down
Loading