-
Notifications
You must be signed in to change notification settings - Fork 122
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
[Question]: Basic modifications to have additional/new zones and new/additional fuels. #713
Comments
...and also, to be clear, I have looked through the documentation on adding resources, but from what I can tell this doesn't apply, because I am not trying to add a new abstract type of energy resource ("thermal," "hydro," etc) but I am trying to create one ("fuel_oil") which inherits the "Thermal" properties. I assumed that I could do this by adding it to the Thermal.csv file, but what else am I missing? |
Hi @abooda1981. Yes, you're correct. The column names in |
Hello @lbonaldo and many thanks for your reply! As a heads up: I am going to add a second question about how to add a zone/region but maybe it was my mistake to try to solve two questions at once. I want to confirm that I did indeed change the appropriate column headings as explained. I have also ensured that TimeDomainReduction is set to "1" in the file genxsettings. Unfortunately, I have the same error as before. I should add: I tried this with TDR set to 0, as well, and that did not help. Below I list the steps I took and also show a screen shot of the error message. I am running Julia version 1.8.1 and I downloaded this project in the last 5 days or so. Many thanks again! In /resources/Thermal.csv:
Additionally, in the file "Fuels_data.csv" in the folder "TDR_results":
None of the above steps helped. Here is a screenshot: |
Okay, thanks. Not sure what I did differently but I got it to work--it's possible that I missed a space or maybe I had another typo. Many thanks! I now have a new fuel. |
Great news! |
Question
Hello. I am hoping to modify GenX by doing two things:
I did not attempt the first of these, yet, but I would like to. For the second, I modified two files: "Thermal.csv" in the resources folder, and the "Fuels_data.csv". I came up with the name "NB_FO". I do notice that the prefix isn't matched to one of the other three "ME," "CT" and "MA". (Although I don't know if that's the reason).
I'd be grateful for any advice about how to do this. I have been trawling through the online help notes found here, with no luck: https://genxproject.github.io/GenX.jl/stable/
Additional context
The error message I receive when trying to implement a new fuel type, "NB_FO," this is the error message I get:
ERROR: LoadError: KeyError: key InlineStrings.String7("NB_FO") not found
Stacktrace:
[1] getindex(h::Dict{AbstractString, Array{Float64}}, key::InlineStrings.String7)
@ Base ./dict.jl:498
[2] macro expansion
@ ~/.julia/packages/GenX/QT3Ub/src/model/core/fuel.jl:182 [inlined]
[3] macro expansion
@ ~/.julia/packages/MutableArithmetics/xVyia/src/rewrite.jl:327 [inlined]
[4] macro expansion
@ ~/.julia/packages/JuMP/glJ0u/src/macros.jl:257 [inlined]
[5] macro expansion
@ ~/.julia/packages/JuMP/glJ0u/src/macros/@expression.jl:86 [inlined]
[6] (::GenX.var"#129#176"{Dict{AbstractString, Array{Float64}}, Vector{Int64}, Vector{GenX.AbstractResource}, JuMP.Model})(y::Int64, t::Int64)
@ GenX ~/.julia/packages/JuMP/glJ0u/src/Containers/macro.jl:539
[7] #84
@ ~/.julia/packages/JuMP/glJ0u/src/Containers/container.jl:85 [inlined]
[8] iterate
@ ./generator.jl:47 [inlined]
[9] collect_to!(dest::Matrix{JuMP.AffExpr}, itr::Base.Generator{JuMP.Containers.VectorizedProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, JuMP.Containers.var"#84#85"{GenX.var"#129#176"{Dict{AbstractString, Array{Float64}}, Vector{Int64}, Vector{GenX.AbstractResource}, JuMP.Model}}}, offs::Int64, st::Tuple{Tuple{Int64, Int64}, Tuple{Int64, Int64}})
@ Base ./array.jl:845
[10] collect_to_with_first!(dest::Matrix{JuMP.AffExpr}, v1::JuMP.AffExpr, itr::Base.Generator{JuMP.Containers.VectorizedProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, JuMP.Containers.var"#84#85"{GenX.var"#129#176"{Dict{AbstractString, Array{Float64}}, Vector{Int64}, Vector{GenX.AbstractResource}, JuMP.Model}}}, st::Tuple{Tuple{Int64, Int64}, Tuple{Int64, Int64}})
@ Base ./array.jl:823
[11] collect(itr::Base.Generator{JuMP.Containers.VectorizedProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, JuMP.Containers.var"#84#85"{GenX.var"#129#176"{Dict{AbstractString, Array{Float64}}, Vector{Int64}, Vector{GenX.AbstractResource}, JuMP.Model}}})
@ Base ./array.jl:797
[12] map(f::Function, A::JuMP.Containers.VectorizedProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}})
@ Base ./abstractarray.jl:2961
[13] container
@ ~/.julia/packages/JuMP/glJ0u/src/Containers/container.jl:85 [inlined]
[14] container
@ ~/.julia/packages/JuMP/glJ0u/src/Containers/container.jl:71 [inlined]
[15] container(f::Function, indices::JuMP.Containers.VectorizedProductIterator{Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, #unused#::Type{JuMP.Containers.AutoContainerType}, names::Vector{Any})
@ JuMP.Containers ~/.julia/packages/JuMP/glJ0u/src/Containers/container.jl:75
[16] macro expansion
@ ~/.julia/packages/JuMP/glJ0u/src/macros.jl:393 [inlined]
[17] fuel!(EP::JuMP.Model, inputs::Dict{Any, Any}, setup::Dict{Any, Any})
@ GenX ~/.julia/packages/GenX/QT3Ub/src/model/core/fuel.jl:180
[18] generate_model(setup::Dict{Any, Any}, inputs::Dict{Any, Any}, OPTIMIZER::MathOptInterface.OptimizerWithAttributes)
@ GenX ~/.julia/packages/GenX/QT3Ub/src/model/generate_model.jl:127
[19] macro expansion
@ ./timing.jl:382 [inlined]
[20] run_genx_case_simple!(case::String, mysetup::Dict{Any, Any}, optimizer::Type)
@ GenX ~/.julia/packages/GenX/QT3Ub/src/case_runners/case_runner.jl:77
[21] run_genx_case!(case::String, optimizer::Type)
@ GenX ~/.julia/packages/GenX/QT3Ub/src/case_runners/case_runner.jl:37
[22] run_genx_case!(case::String)
@ GenX ~/.julia/packages/GenX/QT3Ub/src/case_runners/case_runner.jl:32
[23] top-level scope
@ ~/GenX.jl-main/example_systems/1_three_zones/Run.jl:3
[24] include(fname::String)
@ Base.MainInclude ./client.jl:476
[25] top-level scope
@ REPL[2]:1
in expression starting at /home/abed/GenX.jl-main/example_systems/1_three_zones/Run.jl:3
The text was updated successfully, but these errors were encountered: