In [1]:
%run import.ipynb
import matplotlib.pyplot as plt
import numpy
In [2]:
isotherms_iast_models = []
isotherm = next(i for i in isotherms_iast if i.material=='MOF-5(Zn)')
print('Isotherm sample:', isotherm.material)
for isotherm in isotherms_iast:
model = pygaps.ModelIsotherm.from_pointisotherm(isotherm, model='Langmuir', verbose=True)
isotherms_iast_models.append(model)
Now we can perform the IAST calculation with the resulting models. We specify the partial pressures of each component in the gaseous phase to obtain the composition of the adsorbed phase.
In [3]:
gas_fraction = [0.5, 0.5]
total_pressure = 10
pygaps.iast(isotherms_iast_models, gas_fraction, total_pressure, verbose=True)
Out[3]:
Alternatively, if we are interested in a binary system, we can use the extension functions iast_binary_svp
and iast_binary_vle
to obtain how the selectivity changes based on pressure in a constant composition or, respectively, how the gas phase-adsorbed phase changes with gas composition, at constant pressure.
These functions perform the IAST calculation at every point in the range passed and can plot the results. If interested in the selectivity for one component in an equimolar mixture over a pressure range:
In [4]:
mole_fractions = [0.5, 0.5]
pressure_range = numpy.linspace(0.01, 20, 30)
result_dict = pygaps.iast_binary_svp(
isotherms_iast_models,
mole_fractions,
pressure_range,
verbose=True,
)
plt.show()
Or if interested on a adsorbed - gas phase equilibrium line:
In [5]:
total_pressure = 2
result_dict = pygaps.iast_binary_vle(isotherms_iast_models, total_pressure, verbose=True)
plt.show()
The isotherms themselves can be used directly. However, instead of spreading pressure being calculated from the model, it will be approximated through interpolation and numerical quadrature integration.
In [6]:
gas_fraction = [0.5, 0.5]
total_pressure = 10
pygaps.iast(isotherms_iast_models, gas_fraction, total_pressure, verbose=True)
Out[6]:
The binary mixture functions can also accept PointIsotherm objects.
In [7]:
mole_fraction = [0.5, 0.5]
pressure_range = numpy.linspace(0.01, 20, 30)
result_dict = pygaps.iast_binary_svp(isotherms_iast,
mole_fraction,
pressure_range,
verbose=True,
)
plt.show()
In [8]:
total_pressure = 2
result_dict = pygaps.iast_binary_vle(isotherms_iast, total_pressure, verbose=True)
plt.show()
More info about the method can be found in the manual.