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

Set fixed storage size in yml #33

Merged
merged 1 commit into from
Oct 8, 2019
Merged
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
11 changes: 9 additions & 2 deletions src/optim_problems/opt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,15 @@ function setup_opt_intertech_cap!(cep::OptModelCEP,
#Check for specific constraint that bounds the installed capacity of one technology to another
for tech in set["tech"]["all"]
if haskey(techs[tech].constraints,"cap_eq")
push!(cep.info,"CAP[$tech, 'new', node] = CAP[$(techs[tech].constraints["cap_eq"]), 'new', node] ∀ node, tech_{EUR-Cap-Cost out/in==0}")
@constraint(cep.model, [node=set["nodes"]["all"]], cep.model[:CAP][tech,"new",node] == cep.model[:CAP][techs[tech].constraints["cap_eq"],"new",node])
# With 'cap_eq_multiply', one can define the relationship between two technologies. This is useful for setting fixed storage hours: For a system
# with 4 hours of storage, set this value for 'bat_e' to '4.0' (assuming hourly delta t).
if haskey(techs[tech].constraints,"cap_eq_multiply")
cap_eq_multiply = techs[tech].constraints["cap_eq_multiply"] #parse(Float64,techs[tech].constraints["cap_eq_multiply"])
else
cap_eq_multiply = 1.0
end
push!(cep.info,"CAP[$tech, 'new', node] = CAP[$(techs[tech].constraints["cap_eq"]), 'new', node] *$cap_eq_multiply ∀ node, tech_{EUR-Cap-Cost out/in==0}")
@constraint(cep.model, [node=set["nodes"]["all"]], cep.model[:CAP][tech,"new",node] == cap_eq_multiply * cep.model[:CAP][techs[tech].constraints["cap_eq"],"new",node])
end
end
return cep
Expand Down