Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
esm-course
esm-tutorials
Commits
993a32ee
Commit
993a32ee
authored
Jul 09, 2018
by
vs2788
Browse files
modify lines width and buses sizes while plotting
parent
6d959c39
Changes
1
Hide whitespace changes
Inline
Side-by-side
tutorial-6/tutorial.py
View file @
993a32ee
...
...
@@ -143,6 +143,7 @@ def plot_bus_status(network):
'pmax'
:
network
.
loads_t
.
p_set
.
values
[
0
]
*
0
,
'p'
:
network
.
loads_t
.
p_set
.
values
[
0
]
*
0
,
'ponpmax'
:
network
.
loads_t
.
p_set
.
values
[
0
]
*
0
})
bus_status
.
index
=
network
.
buses
.
index
for
i
in
bus_status
.
index
:
#print(bus_status.loc[i].values[0],p_nc.generators.loc[p_nc.generators["bus"]==i].index)
#print(i)
...
...
@@ -157,7 +158,7 @@ def plot_bus_status(network):
except
:
print
(
i
)
bus_color
=
(
bus_status
.
status
/
p_nc_25
.
loads_t
.
p_set
.
values
[
0
]).
values
bus_color
=
(
bus_status
.
status
/
network
.
loads_t
.
p_set
.
values
[
0
]).
values
#print(loading_dc)
#print(pd.concat(dict(Line=abs(loading),Link=abs(loading_dc))))
...
...
@@ -187,6 +188,7 @@ def plot_line_loading_bus_status(network):
'pmax'
:
network
.
loads_t
.
p_set
.
values
[
0
]
*
0
,
'p'
:
network
.
loads_t
.
p_set
.
values
[
0
]
*
0
,
'ponpmax'
:
network
.
loads_t
.
p_set
.
values
[
0
]
*
0
})
bus_status
.
index
=
network
.
buses
.
index
for
i
in
bus_status
.
index
:
#print(bus_status.loc[i].values[0],p_nc.generators.loc[p_nc.generators["bus"]==i].index)
#print(i)
...
...
@@ -211,11 +213,11 @@ def plot_line_loading_bus_status(network):
# line_widths=pd.concat(dict(Line=network.lines['s_nom']/1500,Link=network.links['p_nom']/1500)))
network
.
plot
(
bus_colors
=
bus_color
,
#bus_sizes=400,
bus_sizes
=
network
.
loads_t
.
p_set
.
values
[
0
]
/
500
**
(
0.5
)
,
bus_sizes
=
((
abs
(
bus_status
.
status
)
/
1000
)
**
(
2
)
*
3.14
).
values
,
#(bus_status.max_gen_load/1000)**(2)*3.14
,
bus_cmap
=
plt
.
cm
.
jet
,
line_colors
=
pd
.
concat
(
dict
(
Line
=
abs
(
loading
),
Link
=
abs
(
loading_dc
))),
line_cmap
=
dict
(
Line
=
plt
.
cm
.
jet
,
Link
=
plt
.
cm
.
jet
),
line_widths
=
pd
.
concat
(
dict
(
Line
=
network
.
lines
[
's_nom'
]
/
500
,
Link
=
network
.
links
[
'p_nom'
]
/
500
)))
line_widths
=
pd
.
concat
(
dict
(
Line
=
network
.
lines
[
's_nom'
]
*
abs
(
loading
)
/
1000
*
2
,
Link
=
network
.
links
[
'p_nom'
]
*
abs
(
loading_dc
)
/
1000
*
2
)))
Z
=
[[
0
,
0
],[
max
(
abs
(
loading
)),
0
]]
CS3
=
plt
.
contourf
(
Z
,
cmap
=
plt
.
cm
.
jet
)
plt
.
colorbar
(
fraction
=
0.01
,
pad
=
0.06
,
label
=
'Residual Generation divided by Load at Bus'
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment