Commit 993a32ee authored by vs2788's avatar vs2788

modify lines width and buses sizes while plotting

parent 6d959c39
......@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment