4. Unary Isotherms

4.1. Langmuir

The temperature-dependent unary Langmuir isotherm is expressed as

(1)\[q_i = \frac{q_{\text{m},i}k_if_i}{1 + k_i f_i}\]

where \(f_i\), is the fugacity of component i, can be calculated assuming ideal gas

\[f_i^\text{IG} = y_i P\]

or, using the RealGas package to calculate \(\phi_i\) from \(y_i,P,T\) data,

\[f_i = \phi_i y_i P\]

An Arrhenius relationship for \(k_i\) is assumed as

\[k_i = k_{i,\infty}\exp\left(\frac{-\Delta H_i}{RT}\right)\]

Introducing the dimensionless parameters

(2)\[\theta_i = \frac{q_i}{q_\text{ref}}\]
(3)\[f_i^\star = \frac{f_i}{f_\text{ref}}\]
(4)\[T^\star = \frac{T}{T_\text{ref}}\]

The variables to be fit in dimensionless form are

(5)\[H_i^\star = \frac{\Delta H_i}{R T_\text{ref}}\]
(6)\[q_{\text{m},i}^\star = \frac{q_{\text{m},i}}{q_\text{ref}}\]
(7)\[A_i = \ln\left(k_{i,\infty} f_\text{ref}\right)\]

So that Equation (1) becomes

(8)\[\theta_i = \frac{q_{\text{m},i}^\star\exp\left(A_i - \frac{H_i^\star}{T^\star}\right)f_i^\star}{1 + \exp\left(A_i - \frac{H_i^\star}{T^\star}\right)f_i^\star}\]

4.2. Modules

class isotherm_models.unaryisotherm.UnaryIsotherm(f_i, q_i, T, q_ref=None, f_ref=None, T_ref=None, **kwargs)[source]

Base class for Unary Isotherms

Parameters
  • f_i (list) – fugacities of component i (can be calculated assuming ideal gas or real gas)

  • q_i (list) – loadings of component i

  • T (list, optional) – temperatures in [K], defaults to None

  • q_ref (float, optional) – reference loading, defaults to maximum loading in q_i

  • f_ref (float, optional) – reference fugacity, defaults to maximum fugacity in f_j

  • T_ref (float, optional) – reference temperature, defaults to maximum temperature in T

  • points (list, derived from input) – state points at which a pressure and temperature are provided

  • f_i_star (list, derived) – dimensionless fugacitities, calculated by Equation (3)

  • theta (list, derived) – dimensionless loadings, calculated by Equation (2)

  • T_star (list, derived) – dimensionless temperatures, calculated by Equation (4)

  • theta_calc (pyo.Var, derived from input) – calculated dimensionless at each state point

  • objective (pyo.Objective, derived from input) – objective function to be minimized for isotherm fitting, calculated from isotherm_models.unaryisotherm.UnaryIsotherm.objective_rule_pyomo()

  • R2 (pyo.Expression, derived) – coefficient of determination, see isotherm_models.unaryisotherm.UnaryIsotherm.R2_rule()

  • q_calc (pyo.Expression, derived) – calculated loading in units

R2_rule()[source]

Calculate coefficient of determination squared, \(R^2\)

isotherm_eq_rule(point)[source]

Constraint for dimensionless expression

objective_rule_pyomo()[source]

Sum of squared errors between calculated loading and predicted loading

\[\sum_i \left(\theta_i^{\text{raw}}-\theta_i^{\text{calc}}\right)^2\]

where raw denotes the raw data obtained by experiment or molecular simulation and calc denotes the data calculated from the isotherm function

solve(solver=<pyomo.solvers.plugins.solvers.IPOPT.IPOPT object>, **kwargs)[source]

Solve constraints subject to objective function

Parameters
  • solver (pyo.SolverFactory, optional) – solver for solving model equations, defaults to pyo.SolverFactory(‘ipopt’)

  • kwargs – for solve argument

class isotherm_models.unaryisotherm.LangmuirUnary(*args, **kwargs)[source]

Langmuir isotherm for unary mixture

Isotherm is Equation (1). Dimensionless isotherm is Equation (8). Dimensionless variables to be fit are \(H_i^\star\), \(A_i\), and \(q_{\text{m},i}^\star\), as defined in Equations (5), (6), and (7), respectively.

Parameters
  • H_i_star (pyo.Var) – \(H_i^\star\), dimensionless heat of adsorption of component i

  • A_i (pyo.Var) – \(A_i\), dimensionless langmuir constant in logarithmic space

  • q_mi_star (pyo.Var) – \(q_{\text{m}i}^\star\), dimensionless saturation loading

  • q_mi (pyo.Expression) – langmuir saturaiton loading

  • k_i_inf (pyo.Expression) – langmuir adsorption constant independent of temperature

  • dH_i (pyo.Expression) – heat of adsorption of component i

dimensionless_isotherm_expression(point)[source]

Dimensionless isotherm expression, see Equation (8)

eval(f_i, T, q_mi, k_i_inf, dH_i)[source]

evaluate using generic types (any type)

eval_pyomo(f_i, T)[source]

evaluate using pyomo types (any type)

initial_guess_A_i()[source]

Initial guess for \(A_i\) variable

Todo

Come up with logical initial guess

initial_guess_H_i_star()[source]

Initial guess for \(H_i^\star\) variable

This value of 10 corresponds to an absolute value for heat of adsorption of \(10RT\) which is approximately 25 kJ/mol

initial_guess_q_mi_star()[source]

Initial guess for \(q_mi^\star\) variable

If \(q_\text{ref}\) is chosen to be the saturation loading, \(q_mi^\star\) will be 1. Thus, we return 1 as initial guess

initial_guess_vector()[source]

p0 in scipy curve fit; initial guess for dimensionless parameters

Note

order here must be the same as last args in LangmuirUnary.eval_dimensionless()

isotherm_expression(point)[source]

Isotherm expression in unit quantities, see Equation (1)

5. Binary Isotherms

5.1. Binary Langmuir

(9)\[q_i = \frac{q_{\text{m},i}k_i\hat{f}_i}{1 + k_i \hat{f}_i + k_j \hat{f}_j}\]

Arrhenius relationships are used for \(k_i\) and \(k_j\), and dimensionless variables are used as illustrated in isotherm_models.unaryisotherm.LangmuirUnary

Note

This isotherm is not equivalent to the conventional extended langmuir isotherm, because both \(k_i\) and \(k_j\) are fit simultaneously to binary data.

For completeness, the relationships are repeated for the binary case below

\[\begin{split}\begin{align} k_i &= k_{i,\infty}\exp\left(\frac{-\Delta H_i}{RT}\right)\\ k_j &= k_{j,\infty}\exp\left(\frac{-\Delta H_j}{RT}\right)\\ \end{align}\end{split}\]

The dimensionless parameters \(\theta_i\) and \(T^\star\) are calculated as the unary case, as shown in Equations (2) and (4), respectively. The other dimensionless parameters are

(10)\[\hat{f}_i^\star = \frac{\hat{f}_i}{f_\text{ref}}\]
(11)\[\hat{f}_j^\star = \frac{\hat{f}_j}{f_\text{ref}}\]

The dimensionless variables to be fit include \(H_i^\star\), \(q_{\text{m},i}^\star\), \(A_i\), \(H_j^\star\), \(q_{\text{m},j}^\star\), and \(A_j\). The former three (\(H_i^\star\), \(q_{\text{m},i}^\star\), and \(A_i\)) have the same expression as the unary case, as shown in Equations (5), (6), and (7), respectively. The latter two are expressed as

(12)\[H_j^\star = \frac{\Delta H_j}{R T_\text{ref}}\]
(13)\[A_j = \ln\left(k_{j,\infty} f_\text{ref}\right)\]

So that Equation (9) becomes

(14)\[\theta_i = \frac{ q_{\text{m},i}^\star\exp\left(A_i - \frac{H_i^\star}{T^\star}\right)\hat{f}_i^\star }{ 1 + \exp\left(A_i - \frac{H_i^\star}{T^\star}\right)\hat{f}_i^\star + \exp\left(A_j - \frac{H_j^\star}{T^\star}\right)\hat{f}_j^\star }\]

5.2. Modules

class isotherm_models.binaryisotherm.BinaryIsotherm(hat_f_i, hat_f_j, q_i, T, f_ref=None, **kwargs)[source]

Base class for Binary Isotherms, inherits from UnaryIsotherm

The following additional dimensionless variables are used in computations

Parameters
  • hat_f_j (list) – mixture fugacities of component i

  • hat_f_j – mixture fugacities of component j

  • q_i (list) – loadings of component i

  • T (list, optional) – temperatures in [K], defaults to None

  • points (list, derived from input) – state points at which a pressure and temperature are provided

  • hat_f_i_star (list, derived) – dimensionless fugacitities of component i, calculated by Equation (10)

  • hat_f_j_star (list, derived) – dimensionless fugacitities of component j, calculated by Equation (11)

  • theta (list, derived) – dimensionless loadings, calculated by Equation (2)

  • T_star (list, derived) – dimensionless temperatures, calculated by Equation (4)

  • theta_calc (pyo.Var, derived from input) – calculated dimensionless at each state point

  • objective (pyo.Objective, derived from input) – objective function to be minimized for isotherm fitting, calculated from isotherm_models.unaryisotherm.UnaryIsotherm.objective_rule_pyomo()

  • R2 (pyo.Expression, derived) – coefficient of determination, see isotherm_models.unaryisotherm.UnaryIsotherm.R2_rule()

  • q_calc (pyo.Expression, derived) – calculated loading in units

  • unary_points (list, derived) – points where only i is present, derived from where \(\hat{f}_j < 1\times10^{-12}\)

plot_adsorption_surface()[source]

plot surface of adsorption data

Todo

implement this helpful for debugging

class isotherm_models.binaryisotherm.BinaryLangmuir(*args, **kwargs)[source]

Temperature-dependent extended unary Langmuir isotherm, expressed as

Isotherm is Equation (9). Dimensionless isotherm is Equation (14). Dimensionless variables to be fit are \(H_i^\star\), \(A_i\), \(q_{\text{m},i}^\star\), \(H_j_star\), and \(A_j\), as defined in Equations (5), (6), (7), (12), and (13), respectively.

Parameters
  • H_i_star (pyo.Var) – \(H_i^\star\), dimensionless heat of adsorption of component i

  • A_i (pyo.Var) – \(A_i\), dimensionless langmuir constant in logarithmic space

  • H_j_star (pyo.Var) – \(H_j^\star\), dimensionless heat of adsorption of component j

  • A_j (pyo.Var) – \(A_j\), dimensionless langmuir constant in logarithmic space

  • q_mi_star (pyo.Var) – \(q_{\text{m},i}^\star\), dimensionless saturation loading

  • q_mi (pyo.Expression) – langmuir saturation loading

  • k_i_inf (pyo.Expression) – langmuir adsorption constant independent of temperature

  • dH_i (pyo.Expression) – heat of adsorption of component i

  • k_j_inf (pyo.Expression) – langmuir adsorption constant independent of temperature

  • dH_j (pyo.Expression) – heat of adsorption of component j

dimensionless_isotherm_expression(point)[source]

Dimensionless isotherm expression, see Equation (14)

eval(x, q_mi, dH_i, dH_j, k_i_inf, k_j_inf)[source]

evaluate using generic types (any type)

eval_pyomo(hat_f_i, hat_f_j, T)[source]

Evaluate isotherm in dimensional form

initial_guess_vector()[source]

p0 in scipy curve fit; initial guess for dimensionless parameters

Note

order here must be the same as last args in LangmuirUnary.eval_dimensionless()

isotherm_expression(point)[source]

Isotherm expression in unit quantities, see Equation (9)