Skip to content

Commit

Permalink
limit
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungFaithful committed May 30, 2019
1 parent e41aeb9 commit 8fa15e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/CA_1/nodes.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node,region,infrastruct,lat,lon,|,pv,wind,coal,oil,gas,bat_e,bat_in,bat_out,h2_e,h2_in,h2_out,trans
california,CA,ex,36.782142,-119.415653,|,9857,5741,101,539,45321,115,98,98,0,0,0,0
california,CA,lim,36.782142,-119.415653,|,1000000,1000000,100000,100000,100000,1000000,1000000,100000,100000000,1000000,1000000,0
california,CA,lim,36.782142,-119.415653,|,1000000,1000000,100000,100000,100000,1000000,1000000,100000,10000000000,1000000,1000000,0
2 changes: 1 addition & 1 deletion data/GER_1/nodes.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node,infrastruct,region,lat,lon,|,pv,wind,coal,gas,oil,bat_e,bat_in,bat_out,h2_e,h2_in,h2_out,trans
germany,ex,GER,51.167261,10.450738,|,32312,31827,45027,22370,7004,0,0,0,0,0,0,0
germany,lim,GER,51.167261,10.450738,|,1000000,1000000,100000,100000,100000,1000000,1000000,1000000,100000000,1000000,1000000,0
germany,lim,GER,51.167261,10.450738,|,1000000,1000000,100000,100000,100000,1000000,1000000,1000000,10000000000,1000000,1000000,0
10 changes: 10 additions & 0 deletions src/utils/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ function get_met_cap_limit(cep::OptModelCEP, opt_data::OptDataCEP, variables::Di
set=cep.set
# nodes with limits
nodes=opt_data.nodes
lines=opt_data.lines

met_cap_limit=Array{String,1}()
for tech in set["tech_cap"]
Expand All @@ -323,6 +324,15 @@ function get_met_cap_limit(cep::OptModelCEP, opt_data::OptDataCEP, variables::Di
end
end
end
for tech in set["tech_trans"]
for line in set["lines"]
#Check if the limit is reached in any capacity at any node
if sum(variables["TRANS"][tech,:,line]) == lines[tech,node].power_lim
#Add this technology and node to the met_cap_limit Array
push!(met_cap_limit,tech*"-"*line)
end
end
end
# If the array isn't empty throw an error (as limits are only for numerical speedup)
if !isempty(met_cap_limit)
#TODO change to warning
Expand Down

0 comments on commit 8fa15e5

Please sign in to comment.