Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ITCPG.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Stuermer
ITCPG.jl
Commits
ce9b2a7e
Commit
ce9b2a7e
authored
4 years ago
by
Julian Stürmer
Browse files
Options
Downloads
Patches
Plain Diff
Add power flow model to build_network_data
parent
904e7196
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Data.jl
+11
-9
11 additions, 9 deletions
src/Data.jl
with
11 additions
and
9 deletions
src/Data.jl
+
11
−
9
View file @
ce9b2a7e
...
@@ -3,19 +3,25 @@
...
@@ -3,19 +3,25 @@
#=
#=
Builds a network data dictionary conform with PowerModels.jl from several files containing certain input data:
Builds a network data dictionary conform with PowerModels.jl from several files containing certain input data:
model - whether to calculate AC- or DC-PF (:ac or :dc)
pgfile - .RAW or .m file that contains the detailed grid data (e.g. generator and load information etc.)
pgfile - .RAW or .m file that contains the detailed grid data (e.g. generator and load information etc.)
busfile - .csv file that contains geographic locations of all buses
busfile - .csv file that contains geographic locations of all buses
branchfile - .csv file that contains transmission line lengths
branchfile -
optional
.csv file that contains transmission line lengths
nddfile - .jld2 file in which the final network data dictionary will be saved
nddfile - .jld2 file in which the final network data dictionary will be saved
=#
=#
function
build_network_data
(;
function
build_network_data
(
pgfile
::
String
,
busfile
::
String
,
branchfile
::
String
,
nddfile
::
String
model
=
:
ac
;
pgfile
::
String
,
busfile
::
String
,
nddfile
::
String
,
branchfile
=
""
)
)
### Read grid data and calculate initial operation point
### Read grid data and calculate initial operation point
network_data
=
calc_init_op
(
pgfile
,
model
=:
ac
)
network_data
=
calc_init_op
(
pgfile
,
model
=
model
)
### Add additional data to dictionary
add_locs!
(
network_data
,
busfile
)
# add geographic bus locations
add_locs!
(
network_data
,
busfile
)
# add geographic bus locations
add_tl_lengths!
(
network_data
,
branchfile
)
# add transmission line lengths
if
isempty
(
branchfile
)
==
false
# check whether to add line lengths
add_tl_lengths!
(
network_data
,
branchfile
)
end
add_tl_voltages!
(
network_data
)
# add transmission line voltages
add_tl_voltages!
(
network_data
)
# add transmission line voltages
save
(
nddfile
,
"network_data"
,
network_data
)
# save network data
save
(
nddfile
,
"network_data"
,
network_data
)
# save network data
...
@@ -191,19 +197,15 @@ function get_underground_tl(
...
@@ -191,19 +197,15 @@ function get_underground_tl(
if
mode
==
:
single
# one end alone has to exceed min_MW_load
if
mode
==
:
single
# one end alone has to exceed min_MW_load
filter!
(
load
->
last
(
load
)
>=
min_MW_load
,
MW_loads
)
filter!
(
load
->
last
(
load
)
>=
min_MW_load
,
MW_loads
)
large_MW_loads
=
collect
(
keys
(
MW_loads
))
large_MW_loads
=
collect
(
keys
(
MW_loads
))
println
(
large_MW_loads
)
counter
=
0
### Go through branches and identify underground transmission lines
### Go through branches and identify underground transmission lines
for
(
i
,
branch
)
in
network_data
[
"branch"
]
for
(
i
,
branch
)
in
network_data
[
"branch"
]
if
branch
[
"transformer"
]
==
false
&&
branch
[
"length"
]
<
max_length
if
branch
[
"transformer"
]
==
false
&&
branch
[
"length"
]
<
max_length
from
,
to
=
branch
[
"f_bus"
],
branch
[
"t_bus"
]
from
,
to
=
branch
[
"f_bus"
],
branch
[
"t_bus"
]
if
from
in
large_MW_loads
||
to
in
large_MW_loads
if
from
in
large_MW_loads
||
to
in
large_MW_loads
push!
(
underground_tl
,
i
)
push!
(
underground_tl
,
i
)
counter
+=
1
end
end
end
end
end
end
println
(
counter
)
elseif
mode
==
:
sum
# both ends together have to exceed min_MW_load
elseif
mode
==
:
sum
# both ends together have to exceed min_MW_load
### Go through branches and identify underground transmission lines
### Go through branches and identify underground transmission lines
for
(
i
,
branch
)
in
network_data
[
"branch"
]
for
(
i
,
branch
)
in
network_data
[
"branch"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment