Skip to content
Snippets Groups Projects
Commit 08c4285e authored by Michael Alfons Schlüter's avatar Michael Alfons Schlüter
Browse files

clean up

parent f684ecc7
No related branches found
No related tags found
No related merge requests found
File deleted
File deleted
File deleted
File deleted
File deleted
...@@ -221,94 +221,94 @@ fig.tight_layout() ...@@ -221,94 +221,94 @@ fig.tight_layout()
# datan in MJ/kg, MJ/L -> 1/3.6 to kW/(L / kg) # # datan in MJ/kg, MJ/L -> 1/3.6 to kW/(L / kg)
data = ( # data = (
('Butanol', 36.6, 29.2, {'halign': 'right', 'valign': 'top', 'x': 0, 'y': 0}), # ('Butanol', 36.6, 29.2, {'halign': 'right', 'valign': 'top', 'x': 0, 'y': 0}),
('Diesel', 46.2, 37.3, {'halign': 'right', 'valign': 'bottom', 'x': 0, 'y': 0}), # ('Diesel', 46.2, 37.3, {'halign': 'right', 'valign': 'bottom', 'x': 0, 'y': 0}),
('Ethanol', 30, 24, {'halign': 'right', 'valign': 'top', 'x': 0, 'y': 0}), # ('Ethanol', 30, 24, {'halign': 'right', 'valign': 'top', 'x': 0, 'y': 0}),
('Gasoline', 46.4, 34.2, {'halign': 'left', 'valign': 'center', 'x': 0, 'y': 0}), # ('Gasoline', 46.4, 34.2, {'halign': 'left', 'valign': 'center', 'x': 0, 'y': 0}),
('Hydrogen gas', 143, 0.01079), # ('Hydrogen gas', 143, 0.01079),
('Hydrogen gas (700 bar)', 143, 5.6, {'valign': 'top', 'x': 0}), # ('Hydrogen gas (700 bar)', 143, 5.6, {'valign': 'top', 'x': 0}),
('Kerosene', 42.8, 33, {'halign': 'right', 'valign': 'center', 'x': 0, 'y': 0}), # ('Kerosene', 42.8, 33, {'halign': 'right', 'valign': 'center', 'x': 0, 'y': 0}),
('Liquid hydrogen', 143, 10.1), # ('Liquid hydrogen', 143, 10.1),
('Liquid natural gas', 53.6, 22.2, {'halign': 'left', 'valign': 'top', 'x': 0, 'y': 0}), # ('Liquid natural gas', 53.6, 22.2, {'halign': 'left', 'valign': 'top', 'x': 0, 'y': 0}),
('LPG propane', 49.6, 25.3, {'halign': 'left', 'valign': 'center', 'x': 0}), # ('LPG propane', 49.6, 25.3, {'halign': 'left', 'valign': 'center', 'x': 0}),
('Lead-acid battery', 0.14, 0.27, {'halign': 'left', 'valign': 'top', 'x': 0, 'y': 0}), # ('Lead-acid battery', 0.14, 0.27, {'halign': 'left', 'valign': 'top', 'x': 0, 'y': 0}),
('Methanol', 19.7, 15.6, {'halign': 'right', 'valign': 'top', 'x': 0, 'y': 0}), # ('Methanol', 19.7, 15.6, {'halign': 'right', 'valign': 'top', 'x': 0, 'y': 0}),
('Natural gas', 53.6, 0.0364), # ('Natural gas', 53.6, 0.0364),
('Natural gas (250 bar)', 53.6, 9, {'valign': 'top', 'x': 0}), # ('Natural gas (250 bar)', 53.6, 9, {'valign': 'top', 'x': 0}),
('Zinc–air battery', 1.59, 6.02), # ('Zinc–air battery', 1.59, 6.02),
# 0.54-0.72, 0.9-1.9 (values used are from the Li-Ion battery article) # # 0.54-0.72, 0.9-1.9 (values used are from the Li-Ion battery article)
# ('LiFePO4 battery', 0.58, 1.2), # # ('LiFePO4 battery', 0.58, 1.2),
('LiFePO4 battery', 0.4716, 0.8892), # ('LiFePO4 battery', 0.4716, 0.8892),
# ('NMC battery', 0.74, 2.1), # # ('NMC battery', 0.74, 2.1),
('NMC battery', 0.26*3.6, 0.683*3.6), # ('NMC battery', 0.26*3.6, 0.683*3.6),
# ('NMC battery 2030', 0.26*3.6, 0.950*3.6), #https://www.isi.fraunhofer.de/content/dam/isi/dokumente/cct/2022/Development_perspectives_for_lithium-ion_battery_cell_formats_Fraunhofer_2022.pdf # # ('NMC battery 2030', 0.26*3.6, 0.950*3.6), #https://www.isi.fraunhofer.de/content/dam/isi/dokumente/cct/2022/Development_perspectives_for_lithium-ion_battery_cell_formats_Fraunhofer_2022.pdf
) # )
#https://en.wikipedia.org/wiki/Comparison_of_commercial_battery_types # #https://en.wikipedia.org/wiki/Comparison_of_commercial_battery_types
#https://en.wikipedia.org/wiki/Energy_density # #https://en.wikipedia.org/wiki/Energy_density
# font12 = FontProperties(family=['serif'], size=12) # # font12 = FontProperties(family=['serif'], size=12)
# font10 = FontProperties(family=['serif'], size=10) # # font10 = FontProperties(family=['serif'], size=10)
# font8 = FontProperties(family=['serif'], size=8) # # font8 = FontProperties(family=['serif'], size=8)
# plt.rcParams.update({'figure.figsize': [12, 7.5]}) # # plt.rcParams.update({'figure.figsize': [12, 7.5]})
fig, ax = plt.subplots(figsize=(2*7.8*cm,7.8*cm)) # fig, ax = plt.subplots(figsize=(2*7.8*cm,7.8*cm))
#fig, ax = plt.subplots(figsize=(6,5)) # #fig, ax = plt.subplots(figsize=(6,5))
# fig=plt.figure(1) # # fig=plt.figure(1)
# ax=plt.axes([0.05, 0.07, 0.97 - 0.05, 0.95 - 0.07]) # # ax=plt.axes([0.05, 0.07, 0.97 - 0.05, 0.95 - 0.07])
for v in data: # for v in data:
# (name, MJ/kg, MJ/L, label-adjustments) # # (name, MJ/kg, MJ/L, label-adjustments)
label = v[0] # label = v[0]
x = v[1]/3.6 # x = v[1]/3.6
y = v[2]/3.6 # y = v[2]/3.6
if len(v) < 4: # if len(v) < 4:
halign = 'center' # halign = 'center'
valign = 'bottom' # valign = 'bottom'
x_text = x # x_text = x
y_text = y # y_text = y
else: # else:
halign = v[3].get('halign', 'center') # halign = v[3].get('halign', 'center')
valign = v[3].get('valign', 'bottom') # valign = v[3].get('valign', 'bottom')
x_text = x + v[3].get('x', 0) # x_text = x + v[3].get('x', 0)
y_text = y + v[3].get('y', 0) # y_text = y + v[3].get('y', 0)
if valign == 'bottom': # if valign == 'bottom':
y_text += 0 # y_text += 0
elif valign == 'top': # elif valign == 'top':
y_text -= 0 # y_text -= 0
plt.scatter(x=[x], y=[y], c='r', s=5 , marker = 'o', alpha=(.8)) # plt.scatter(x=[x], y=[y], c='r', s=5 , marker = 'o', alpha=(.8))
plt.text(x=x_text, y=y_text, s=label, # plt.text(x=x_text, y=y_text, s=label,
horizontalalignment=halign, # horizontalalignment=halign,
verticalalignment=valign,fontsize=7.5) # verticalalignment=valign,fontsize=7.5)
# fontproperties=font10) # # fontproperties=font10)
#plt.title('Selected energy densities')#, # #plt.title('Selected energy densities')#,
#fontproperties=font12) # #fontproperties=font12)
plt.ylabel(r'kWh/L $\longrightarrow$ smaller size')#, fontproperties=font10) # plt.ylabel(r'kWh/L $\longrightarrow$ smaller size')#, fontproperties=font10)
plt.xlabel(r'kWh/kg $\longrightarrow$ lighter weight')#, fontproperties=font10) # plt.xlabel(r'kWh/kg $\longrightarrow$ lighter weight')#, fontproperties=font10)
# plt.xticks(fontproperties=font8) # # plt.xticks(fontproperties=font8)
# plt.yticks(fontproperties=font8) # # plt.yticks(fontproperties=font8)
# fmt = matplotlib.ticker.StrMethodFormatter("{x}") # # fmt = matplotlib.ticker.StrMethodFormatter("{x}")
# ax.xaxis.set_major_formatter(fmt) # # ax.xaxis.set_major_formatter(fmt)
# ax.yaxis.set_major_formatter(fmt) # # ax.yaxis.set_major_formatter(fmt)
# ax.xaxis.grid(True) # # ax.xaxis.grid(True)
# ax.yaxis.grid(True) # # ax.yaxis.grid(True)
ax.grid(True, axis='both', ls="-", color='0.9', which="both") # ax.grid(True, axis='both', ls="-", color='0.9', which="both")
ax.set_axisbelow(True) # ax.set_axisbelow(True)
ax.set_yscale('log') # ax.set_yscale('log')
ax.set_xscale('log') # ax.set_xscale('log')
plt.xlim(3e-2, 2e2) # plt.xlim(3e-2, 2e2)
# #plt.ylim(1e-2, 1e2) # # #plt.ylim(1e-2, 1e2)
fig.tight_layout() # fig.tight_layout()
plt.savefig('energy_density.pdf') # plt.savefig('energy_density.pdf')
# # surf/countour plot # # surf/countour plot
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment