Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompatHelper: bump compat for RecursiveArrayTools to 3, (keep existing compat) #603

Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated README with new instructions for running GenX through Julia REPL terminal (#492)
- Fix factor of 0.5 when writing out transmission losses. (#480)
- Fix summation error when a set of hours is empty (in thermal_commit.jl).
- Fix access to eELOSSByZone expr before initialization (#541)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Distances = "0.10.7"
HiGHS = "1.1.4"
JuMP = "1.1.1"
MathOptInterface = "1.6.1"
RecursiveArrayTools = "2.31.2"
RecursiveArrayTools = "2.31.2, 3"
Statistics = "1.4.0"
StatsBase = "0.33.21, 0.34"
YAML = "0.4.7"
Expand Down
5 changes: 4 additions & 1 deletion src/model/generate_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ function generate_model(setup::Dict,inputs::Dict,OPTIMIZER::MOI.OptimizerWithAtt
# Initialize Objective Function Expression
@expression(EP, eObj, 0)


#@expression(EP, :eCO2Cap[cap=1:inputs["NCO2Cap"]], 0)
@expression(EP, eGenerationByZone[z=1:Z, t=1:T], 0)

# Initialize energy losses related to technologies
@expression(EP, eELOSSByZone[z=1:Z], 0)

# Initialize Capacity Reserve Margin Expression
if setup["CapacityReserveMargin"] > 0
@expression(EP, eCapResMarBalance[res=1:inputs["NCapacityReserveMargin"], t=1:T], 0)
Expand Down
7 changes: 3 additions & 4 deletions src/model/resources/storage/storage_all.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ function storage_all!(EP::Model, inputs::Dict, setup::Dict)
[y in STOR_ALL, t=1:T], EP[:vP][y,t] <= EP[:vS][y, hoursbefore(hours_per_subperiod,t,1)]*dfGen[y,:Eff_Down]
end)
end
#From co2 Policy module
@expression(EP, eELOSSByZone[z=1:Z],
sum(EP[:eELOSS][y] for y in intersect(STOR_ALL, dfGen[dfGen[!,:Zone].==z,:R_ID]))
)
# From co2 Policy module
expr = @expression(EP, [z=1:Z], sum(EP[:eELOSS][y] for y in intersect(STOR_ALL, dfGen[dfGen[!,:Zone].==z,:R_ID])))
EP[:eELOSSByZone] += expr
end

function storage_all_reserves!(EP::Model, inputs::Dict)
Expand Down