<jupyter_start><jupyter_text>Ideal mixture<jupyter_code>params = PcSaftParameters.from_json(['hexane', 'octane'], '20191105_pure_parameters.json')
saft = PcSaft(params)
dia_p = PhaseDiagramBinary.new_pxy(saft, 300*KELVIN)
dia_t = PhaseDiagramBinary.new_txy(saft, BAR)

f, ax = plt.subplots(1,3,figsize=(20,5))
ax[0].plot(dia_p.liquid_molefracs, dia_p.pressure/BAR, '-k')
ax[0].plot(dia_p.vapor_molefracs, dia_p.pressure/BAR, '-k')
ax[0].set_xlim(0,1)
ax[0].set_xlabel('$x_1,y_1$')
ax[0].set_ylabel('$p$ / bar')

ax[1].plot(dia_t.liquid_molefracs, dia_t.temperature/KELVIN, '-g')
ax[1].plot(dia_t.vapor_molefracs, dia_t.temperature/KELVIN, '-g')
ax[1].set_xlim(0,1)
ax[1].set_xlabel('$x_1,y_1$')
ax[1].set_ylabel('$T$ / K')

ax[2].plot([0,1], [0,1], '--k')
ax[2].plot(dia_t.liquid_molefracs, dia_t.vapor_molefracs, '-g')
ax[2].plot(dia_p.liquid_molefracs, dia_p.vapor_molefracs, '-k')
ax[2].set_xlim(0,1)
ax[2].set_ylim(0,1)
ax[2].set_xlabel('$x_1$')
ax[2].set_ylabel('$y_1$');<jupyter_output><empty_output><jupyter_text>Azeotropic mixture<jupyter_code>params = PcSaftParameters.from_json(['acetone', 'hexane'], '20191105_pure_parameters.json')
saft = PcSaft(params)
dia_p = PhaseDiagramBinary.new_pxy(saft, 300*KELVIN)
dia_t = PhaseDiagramBinary.new_txy(saft, 5*BAR)

f, ax = plt.subplots(1,3,figsize=(20,5))
ax[0].plot(dia_p.liquid_molefracs, dia_p.pressure/BAR, '-k')
ax[0].plot(dia_p.vapor_molefracs, dia_p.pressure/BAR, '-k')
ax[0].set_xlim(0,1)
ax[0].set_xlabel('$x_1,y_1$')
ax[0].set_ylabel('$p$ / bar')

ax[1].plot(dia_t.liquid_molefracs, dia_t.temperature/KELVIN, '-g')
ax[1].plot(dia_t.vapor_molefracs, dia_t.temperature/KELVIN, '-g')
ax[1].set_xlim(0,1)
ax[1].set_xlabel('$x_1,y_1$')
ax[1].set_ylabel('$T$ / K')

ax[2].plot([0,1], [0,1], '--k')
ax[2].plot(dia_t.liquid_molefracs, dia_t.vapor_molefracs, '-g')
ax[2].plot(dia_p.liquid_molefracs, dia_p.vapor_molefracs, '-k')
ax[2].set_xlim(0,1)
ax[2].set_ylim(0,1)
ax[2].set_xlabel('$x_1$')
ax[2].set_ylabel('$y_1$');<jupyter_output><empty_output><jupyter_text>Supercritical mixture<jupyter_code>params = PcSaftParameters.from_json(['carbon-dioxide', 'hexane'], '20191105_pure_parameters.json')
saft = PcSaft(params)
T_vec = [350*KELVIN, 450*KELVIN, 500*KELVIN]
c_vec = ['k', 'r', 'b']
dia_p = [PhaseDiagramBinary.new_pxy(saft, T) for T in T_vec]
dia_t = PhaseDiagramBinary.new_txy(saft, 50*BAR)

f, ax = plt.subplots(1,3,figsize=(20,5))
for d,c,T in zip(dia_p, c_vec, T_vec):
    ax[0].plot(d.liquid_molefracs, d.pressure/BAR, color=c, label=f'{T}')
    ax[0].plot(d.vapor_molefracs, d.pressure/BAR, color=c)
ax[0].set_xlim(0,1)
ax[0].set_xlabel('$x_1,y_1$')
ax[0].set_ylabel('$p$ / bar')
ax[0].legend()

ax[1].plot(dia_t.liquid_molefracs, dia_t.temperature/KELVIN, '-g')
ax[1].plot(dia_t.vapor_molefracs, dia_t.temperature/KELVIN, '-g')
ax[1].set_xlim(0,1)
ax[1].set_xlabel('$x_1,y_1$')
ax[1].set_ylabel('$T$ / K')

ax[2].plot([0,1], [0,1], '--k')
for d,c,T in zip(dia_p, c_vec, T_vec):
    ax[2].plot(d.liquid_molefracs, d.vapor_molefracs, color=c, label=f'{T}')
ax[2].plot(dia_t.liquid_molefracs, dia_t.vapor_molefracs, '-g', label=f'{50*BAR}')
ax[2].set_xlim(0,1)
ax[2].set_ylim(0,1)
ax[2].set_xlabel('$x_1$')
ax[2].set_ylabel('$y_1$')
ax[2].legend();<jupyter_output><empty_output><jupyter_text>Liquid-liquid equilibrium<jupyter_code>params = PcSaftParameters.from_json(['water_np', 'octane'], '20191105_pure_parameters.json')
saft = PcSaft(params)
dia_p = PhaseDiagramBinary.new_pxy_lle(saft, 500*KELVIN, 0.5, BAR, 5000*BAR)
dia_t = PhaseDiagramBinary.new_txy_lle(saft, BAR, 0.5, 300*KELVIN, 364*KELVIN)

f, ax = plt.subplots(1,3,figsize=(20,5))
ax[0].plot(dia_p.liquid_molefracs, dia_p.pressure/BAR, '-k')
ax[0].plot(dia_p.vapor_molefracs, dia_p.pressure/BAR, '-k')
ax[0].set_xlim(0,1)
ax[0].set_xlabel('$x_1,y_1$')
ax[0].set_ylabel('$p$ / bar')

ax[1].plot(dia_t.liquid_molefracs, dia_t.temperature/KELVIN, '-g')
ax[1].plot(dia_t.vapor_molefracs, dia_t.temperature/KELVIN, '-g')
ax[1].set_xlim(0,1)
ax[1].set_xlabel('$x_1,y_1$')
ax[1].set_ylabel('$T$ / K')

ax[2].plot([0,1], [0,1], '--k')
ax[2].plot(dia_t.liquid_molefracs, dia_t.vapor_molefracs, '-g')
ax[2].plot(dia_p.liquid_molefracs, dia_p.vapor_molefracs, '-k')
ax[2].set_xlim(0,1)
ax[2].set_ylim(0,1)
ax[2].set_xlabel('$x_1$')
ax[2].set_ylabel('$y_1$');<jupyter_output><empty_output><jupyter_text>Heteroazeotropic mixture<jupyter_code>params = PcSaftParameters.from_json(['acetone', 'water_np'], '20191105_pure_parameters.json')
saft = PcSaft(params)
dia_p = PhaseDiagramHetero.new_pxy(saft, 450*KELVIN, (0.005, 0.9), 50*BAR, 101)
dia_t = PhaseDiagramHetero.new_txy(saft, BAR, (0.001, 0.99), 273.15*KELVIN, 101)

f, ax = plt.subplots(1,3,figsize=(20,5))
ax[0].plot(dia_p.vle.liquid_molefracs, dia_p.vle.pressure/BAR, '-k')
ax[0].plot(dia_p.vle.vapor_molefracs, dia_p.vle.pressure/BAR, '-k')
ax[0].plot(dia_p.lle.vapor_molefracs, dia_p.lle.pressure/BAR, '-k')
ax[0].plot(dia_p.lle.liquid_molefracs, dia_p.lle.pressure/BAR, '-k')
ax[0].set_xlim(0,1)
ax[0].set_xlabel('$x_1,y_1$')
ax[0].set_ylabel('$p$ / bar')

ax[1].plot(dia_t.vle.liquid_molefracs, dia_t.vle.temperature/KELVIN, '-g')
ax[1].plot(dia_t.vle.vapor_molefracs, dia_t.vle.temperature/KELVIN, '-g')
ax[1].plot(dia_t.lle.liquid_molefracs, dia_t.lle.temperature/KELVIN, '-g')
ax[1].plot(dia_t.lle.vapor_molefracs, dia_t.lle.temperature/KELVIN, '-g')
ax[1].set_xlim(0,1)
ax[1].set_xlabel('$x_1,y_1$')
ax[1].set_ylabel('$T$ / K')

ax[2].plot([0,1], [0,1], '--k')
ax[2].plot(dia_t.vle.liquid_molefracs, dia_t.vle.vapor_molefracs, '-g')
ax[2].plot(dia_p.vle.liquid_molefracs, dia_p.vle.vapor_molefracs, '-k')
ax[2].set_xlim(0,1)
ax[2].set_ylim(0,1)
ax[2].set_xlabel('$x_1$')
ax[2].set_ylabel('$y_1$');<jupyter_output><empty_output><jupyter_text>Two associating components<jupyter_code>params = PcSaftParameters.from_json(['water_np', '1-butanol_n'], '20191105_pure_parameters.json')
saft = PcSaft(params)
dia_p = PhaseDiagramHetero.new_pxy(saft, 350*KELVIN, (0.55, 0.98), BAR, 101)
dia_t = PhaseDiagramHetero.new_txy(saft, BAR, (0.5,0.995), 343.15*KELVIN, 101)

f, ax = plt.subplots(1,3,figsize=(20,5))
ax[0].plot(dia_p.vle.liquid_molefracs, dia_p.vle.pressure/BAR, '-k')
ax[0].plot(dia_p.vle.vapor_molefracs, dia_p.vle.pressure/BAR, '-k')
ax[0].plot(dia_p.lle.vapor_molefracs, dia_p.lle.pressure/BAR, '-k')
ax[0].plot(dia_p.lle.liquid_molefracs, dia_p.lle.pressure/BAR, '-k')
ax[0].set_xlim(0,1)
ax[0].set_xlabel('$x_1,y_1$')
ax[0].set_ylabel('$p$ / bar')

ax[1].plot(dia_t.vle.liquid_molefracs, dia_t.vle.temperature/KELVIN, '-g')
ax[1].plot(dia_t.vle.vapor_molefracs, dia_t.vle.temperature/KELVIN, '-g')
ax[1].plot(dia_t.lle.liquid_molefracs, dia_t.lle.temperature/KELVIN, '-g')
ax[1].plot(dia_t.lle.vapor_molefracs, dia_t.lle.temperature/KELVIN, '-g')
ax[1].set_xlim(0,1)
ax[1].set_xlabel('$x_1,y_1$')
ax[1].set_ylabel('$T$ / K')

ax[2].plot([0,1], [0,1], '--k')
ax[2].plot(dia_t.vle.liquid_molefracs, dia_t.vle.vapor_molefracs, '-g')
ax[2].plot(dia_p.vle.liquid_molefracs, dia_p.vle.vapor_molefracs, '-k')
ax[2].set_xlim(0,1)
ax[2].set_ylim(0,1)
ax[2].set_xlabel('$x_1$')
ax[2].set_ylabel('$y_1$');<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22506681671121115, 'fraction_numerical': 0.05500070333380222, 'mean_word_length': 7.670731707317073, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '191835', 'license': 'Apache-2.0', 'n_tokens_mistral': 3977, 'n_tokens_neox': 3678, 'n_words': 364, 'path': 'examples/PhaseDiagramBinary.ipynb', 'repo_name': 'JohannesEller/feos-pcsaft', 'size': '7109'}