rho_lo_p = mof_isotherms[mof]['rho_empty'] #*crystal_density[mof] else: rho_lo_p = mof_isotherms[mof]['rho_empty'] * crystal_density[mof] delta_G_lo_p = np.interp(rho_lo_p, n, mu) - mu_empty if basename == 'methane': rho_hi_p = mof_isotherms[mof]['rho_full'] #*crystal_density[mof] else: rho_hi_p = mof_isotherms[mof]['rho_full'] * crystal_density[mof] delta_G_hi_p = np.interp(rho_hi_p, n, mu) - mu_full if mof in mof_isotherms: plt.plot([delta_G_lo_p / (kJ / mol), delta_G_hi_p / (kJ / mol)], [(rho_hi_p - rho_lo_p) / density_units, (rho_hi_p - rho_lo_p) / density_units], colors.symbol(basename) + '-', label=colors.latex_mof(mof), color=colors.color(mof)) stepby = None if 20 < ymax < 200: stepby = 10 elif 200 < ymax < 1000: stepby = 100 elif 1000 < ymax < 3000: stepby = 500 if stepby is not None: plt.yticks( list(range(0, int(ymax), stepby)) + [round(ymax)] + list(range((int(ymax / stepby) + 1) * stepby, int(y_max_lim), stepby)))
if basename == 'methane': rho_lo_p = mof_isotherms[mof]['rho_empty'] #*crystal_density[mof] else: rho_lo_p = mof_isotherms[mof]['rho_empty'] * crystal_density[mof] delta_G_lo_p = np.interp(rho_lo_p, n, mu) - mu_empty if basename == 'methane': rho_hi_p = mof_isotherms[mof]['rho_full'] #*crystal_density[mof] else: rho_hi_p = mof_isotherms[mof]['rho_full'] * crystal_density[mof] delta_G_hi_p = np.interp(rho_hi_p, n, mu) - mu_full plt.plot([delta_G_lo_p / (kJ / mol), delta_G_hi_p / (kJ / mol)], [(rho_hi_p - rho_lo_p) / density_units, (rho_hi_p - rho_lo_p) / density_units], colors.symbol(basename) + '-', label=colors.latex_mof(mof), color=colors.color(mof)) stepby = None if 20 < ymax < 200: stepby = 10 elif 200 < ymax < 1000: stepby = 100 elif 1000 < ymax < 3000: stepby = 500 if stepby is not None: plt.yticks( list(range(0, int(ymax), stepby)) + [round(ymax)] + list(range((int(ymax / stepby) + 1) * stepby, int(y_max_lim), stepby))) plt.legend(loc='lower right', framealpha=1.0, prop=small_font)
for mof in colors.order(CH4_298_E_Data): # For each MOF fname = 'data/%s/%s-%g.txt' % ('methane', mof, 298) MofData = np.loadtxt(fname, skiprows=1, unpack=True) T_MOF = MofData[0][0] * Kelvin p_MOF = MofData[1] * bar rho_MOF = MofData[2] * density_units rho_lo_p = my_interp(p_empty, p_MOF, rho_MOF) delta_G_lo_p = mu_from_n(rho_lo_p) - mu_empty rho_hi_p = my_interp(p_full, p_MOF, rho_MOF) delta_G_hi_p = mu_from_n(rho_hi_p) - mu_full qst = CH4_298_E_Data[mof] plt.plot([delta_G_lo_p / (kJ / mol), delta_G_hi_p / (kJ / mol)], [qst / (kJ / mol), qst / (kJ / mol)], colors.symbol('methane') + '-', label=colors.latex_mof(mof), color=colors.color(mof)) mofs_shown.add(colors.latex_mof(mof)) # --- Read in the data from NIST --- # NistData = None mu = None p = None NistDataCold = np.loadtxt('data/' + 'hydrogen-77.csv', skiprows=1) NistDataHot = np.loadtxt('data/' + 'hydrogen-77.csv', skiprows=1) molecular_weight = 2.016 * gram / mol density_units = kg / L / molecular_weight p_empty = 5 * bar p_full = 100 * bar