<jupyter_start><jupyter_text>Adsorption isotherms<jupyter_code>%%time
potential = ExternalPotential.HardWall(sigma/ANGSTROM)
pore_size = 5*sigma

pores = {'slit_pore': (Pore1D(Geometry.Cartesian, 2*pore_size, potential), pore_size-sigma/2),
         'cylindrical_pore': (Pore1D(Geometry.Cylindrical, pore_size, potential), np.pi*(pore_size-sigma/2)**2),
         'spherical_pore': (Pore1D(Geometry.Spherical, pore_size, potential), 4/3*np.pi*(pore_size-sigma/2)**3)}

f, ax = plt.subplots(1,2,figsize=(15,5))

for label, (pore, volume) in pores.items():
    pmax = State(func, KELVIN, density=0.75/(sigma**3*NAV)).pressure()
    isotherm = Adsorption1D.adsorption_isotherm(func, KELVIN, (1e-10*pmax, pmax, 50), pore)
    ax[0].plot(isotherm.pressure/(KB*KELVIN)*sigma**3, isotherm.total_adsorption/volume*sigma**3*NAV, label=label)
    
    profile = isotherm.profiles[-1]
    ax[1].plot(profile.r/sigma, (profile.density*sigma**3*NAV).T, label=label)

ax[0].axis([0,5,0,0.75])
ax[0].set_xlabel('$\\beta p\sigma^3$')
ax[0].set_ylabel('$\\bar\\rho\sigma^3$')
ax[0].legend()

ax[1].axis([0,5,0,6])
ax[1].set_xlabel('$r~~/~~\sigma$')
ax[1].set_ylabel('$\\rho\sigma^3$')
ax[1].legend();<jupyter_output>CPU times: user 6.41 s, sys: 17.5 ms, total: 6.42 s
Wall time: 6.42 s<jupyter_text>Pair correlation function<jupyter_code>for density in [0.1,0.5,0.95]:
    bulk = State(func, KELVIN, density=density/(sigma**3*NAV))
    pair_correlation = PairCorrelation(bulk, 0, 2048, 30*sigma).solve()

    plt.plot(pair_correlation.r/ANGSTROM, pair_correlation.pair_correlation_function.T, label=f'$\\rho\sigma^3={density}$')

plt.axis([0,4,0,6])
plt.xlabel('$r~~/~~\sigma$')
plt.ylabel('$g(r)$')
plt.legend();<jupyter_output><empty_output><jupyter_text>Density profiles of mixtures<jupyter_code>mix = FMTFunctional(np.array([1.0, 2.0, 0.5]), FMTVersion.WhiteBear)
bulk = State(mix, KELVIN, density=0.42/(ANGSTROM**3*NAV), molefracs=np.array([0.3,0.2,0.5]))
profile = Pore1D(Geometry.Cartesian, 10*ANGSTROM, ExternalPotential.HardWall(1.0)).initialize(bulk).solve()
plt.plot(profile.z/ANGSTROM, (profile.density*ANGSTROM**3*NAV).T)

plt.axis([0,5,0,1])
plt.xlabel('$z~~/~~\mathrm{\AA}$')
plt.ylabel('$\\rho~~/~~\mathrm{\AA^{-3}}$');<jupyter_output><empty_output><jupyter_text>Pair correlation functions of mixtures<jupyter_code>mix = FMTFunctional(np.array([1.0, 3.0]), FMTVersion.WhiteBear)
bulk = State(mix, KELVIN, density=0.04/(ANGSTROM**3*NAV), molefracs=np.array([0.3,0.7]))
pair_correlation = PairCorrelation(bulk, 0, 2048, 30*sigma).solve()
plt.plot(pair_correlation.r/ANGSTROM, pair_correlation.pair_correlation_function[0,:], label='$g_{11}$')
plt.plot(pair_correlation.r/ANGSTROM, pair_correlation.pair_correlation_function[1,:], label='$g_{12}$')
print(f'Comp. 1: SFE = {pair_correlation.self_solvation_free_energy/KB/KELVIN:6.3f}, µ = {bulk.chemical_potential(Contributions.ResidualNvt)[0]/RGAS/KELVIN:6.3f}')
pair_correlation = PairCorrelation(bulk, 1, 2048, 30*sigma).solve()
plt.plot(pair_correlation.r/ANGSTROM, pair_correlation.pair_correlation_function[0,:], label='$g_{21}$')
plt.plot(pair_correlation.r/ANGSTROM, pair_correlation.pair_correlation_function[1,:], label='$g_{22}$')
print(f'Comp. 2: SFE = {pair_correlation.self_solvation_free_energy/KB/KELVIN:6.3f}, µ = {bulk.chemical_potential(Contributions.ResidualNvt)[1]/RGAS/KELVIN:6.3f}')

plt.axis([0,10,0,4])
plt.xlabel('$r~~/~~\sigma$')
plt.ylabel('$g(r)$')
plt.legend();<jupyter_output>Comp. 1: SFE =  1.825, µ =  1.800
Comp. 2: SFE = 10.172, µ = 10.150
{'fraction_non_alphanumeric': 0.2069357589539511, 'fraction_numerical': 0.053439454235361, 'mean_word_length': 7.071100917431193, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '112954', 'license': 'Apache-2.0', 'n_tokens_mistral': 1632, 'n_tokens_neox': 1491, 'n_words': 176, 'path': 'examples/FundamentalMeasureTheory.ipynb', 'repo_name': 'feos-org/feos-dft', 'size': '3518'}