In this notebook we'll calculate the characteristic Henry's constant at zero loading. Unlike fitting the entire isotherm with a Henry model, these methods will attempt to fit a straight line only on the initial part of the isotherm. First, make sure the data is imported.
In [1]:
%run import.ipynb
The slope method of calculating Henry's fits a linear henry model to the isotherm points. If the model does not fit, it goes to progresivelly lower pressures until it finds a good fit. For data that is very non-linear, this fit might be between p=0 and the first isotherm point.
In [2]:
# Slope method
isotherm = next(i for i in isotherms_n2_77k if i.material=='MCM-41')
h1 = pygaps.initial_henry_slope(isotherm, max_adjrms=0.01, logx=True, verbose=True)
isotherm = next(i for i in isotherms_n2_77k if i.material=='UiO-66(Zr)')
h2 = pygaps.initial_henry_slope(isotherm, max_adjrms=0.01, logx=True, verbose=True)
print(h1,h2)
The virial method uses a virial model to fit the data and then obtain the Henry constant from the value of the virial function at n=0. If the data can be fit well by a virial model, the resulting Henry constant will be very accurate.
In [3]:
# Virial method
isotherm = next(i for i in isotherms_n2_77k if i.material=='MCM-41')
h1 = pygaps.initial_henry_virial(isotherm, verbose=True)
isotherm = next(i for i in isotherms_n2_77k if i.material=='UiO-66(Zr)')
h2 = pygaps.initial_henry_virial(isotherm, verbose=True)
print(h1,h2)
More information about the functions and their use can be found in the manual.